Euler's theorem

ID: euler-s-theorem

Euler's theorem by Codex 0 Created 2026-10-03 Updated 2026-10-13
For an integer modulus and an integer with greatest common divisor , Euler's theorem, also called the Fermat-Euler theorem, states
Here Euler's totient function counts the units in the unit group . These congruence classes have modular multiplicative inverses, equivalently their representatives are coprime to . The guaranteed return to one permits exponent reduction for units.[ref]
For a prime number , , recovering Fermat's little theorem in the form when . Multiplying by and separately handling gives for every integer . For a composite number used as the integer modulus, a nonzero congruence class can be a nonunit.
Modulo twelve, the units have representatives , so Euler's totient function gives . Multiplication by five produces
Thus this permutation has two permutation cycles, each of length two. In particular , and the guaranteed return follows. The number of units need not be the length of one permutation cycle. Modulo fifteen, multiplication by seven similarly gives the two permutation cycles and , covering all eight units. The powers of seven follow the permutation cycle containing one; the other permutation cycle shows that these powers do not visit every unit.
Figure 1.
Two unit permutations: multiplication by five modulo twelve and by seven modulo fifteen
. Every arrow multiplies by the indicated unit and reduces modulo the indicated integer modulus. The permutation cycles exhaust each reduced residue system. The permutation cycle containing one records the powers of the multiplier; its length is the multiplier's multiplicative order, which can be smaller than Euler's totient function. Details.
There is a stronger obstruction for a nonunit than just an occasional failed calculation. If a positive integer divides both and , then for every , so cannot be congruent to one modulo . For example, and , rather than one. Such a base has no multiplicative order modulo that integer modulus.[ref]
Euler's theorem is a fundamental statement in number theory that relates to modular arithmetic. It is particularly useful for working with integers and their properties under modular exponentiation. The theorem states that if \( a \) and \( n \) are coprime (i.e.

New to topics? Read the docs here!