Counting & Number Theory

Modular Power, Inverse & Bezout Calculator

Reduce an integer, exponentiate modulo m and inspect invertibility plus a Bezout identity.

How the calculation works

Repeated squaring evaluates a^e modulo m without constructing the full power. Extended Euclid finds gcd g and integers x,y with ax+my=g. If g=1, inverse = x modulo m; otherwise no multiplicative inverse exists. Residues use the least nonnegative convention.

Worked example

Example inputs — Signed decimal integer a: 17; Nonnegative decimal exponent: 13; Decimal modulus m, at least two: 43. Expected results — Least nonnegative residue of a: 17; a raised to exponent modulo m: 13; gcd(a,m): 1; Multiplicative inverse of a modulo m: 38; Bezout coefficient x for a: -5; Bezout coefficient y for m: 2.

Assumptions and limits

Exact integer arithmetic is used for counts and integer results. Computation limits keep this browser tool responsive. Specify whether objects/groups are distinguishable and whether order matters; different conventions count different outcomes. Decimal integers up to 200 characters each. Modulus must be positive and at least two; exponent is nonnegative. A non-coprime base has no multiplicative inverse, although its modular power is still defined. This is arithmetic, not a cryptographic key-generation service.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.