Euler's theorem 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, statesHere 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 producesThus 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.
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]
Orders of Units in Modular Arithmetic by Keith Conrad. p. 2, explanation following Example 1.8: a positive-exponent return to one forces coprimality
Euler totient function Created 2026-09-24 Updated 2026-10-20
Euler's totient function is the arithmetic functionIt counts the congruence classes modulo represented by integers coprime to . In particular, , since . For , the coprime integers among are , so ; they form a reduced residue system. [ref]
https://darijgrinberg.gitlab.io/floor.pdf. Darij Grinberg, MIT 18.781 lecture notes, Definition 2.1.2
Counting these congruence classes is useful because they are exactly the classes with modular multiplicative inverses. Their number supplies the exponent in Euler theorem. Möbius inversion gives the product formulawhere runs over distinct prime factors of . Thus for prime powers with , and . The product for is an empty product, so it gives the same convention .
Choose a reduced residue system . For a unit modulo n , the bijection on the unit group has inverse . Comparing products before and after this permutation givesThe product is a unit; its modular inverse cancels it, proving Euler's theorem. Merely being nonzero would not justify cancellation.[ref]
Euler’s Theorem by Keith Conrad. pp. 2–3, Section 2: permutation of the units, comparison of products, cancellation
In the modulo-twelve example, . The permuted representatives have the same product, while the unreduced products equal . Equating these products modulo twelve exposes the fourth power without calculating it directly. Using all nonzero congruence classes instead would include nonunits, whose product need not permit cancellation.
Past exam of the mathematics course of the University of Cambridge 2007 ia Paper 4 8E ii Solution Created 2026-09-24 Updated 2026-10-14
The Fermat-Euler theorem states that, for a positive integer and an integer coprime to , , where the Euler totient function counts residue classes coprime to . The case is trivial. For , let be a reduced residue system. Multiplication by permutes it: equality of two resulting residues can be cancelled using the modular inverse of , and the products remain coprime to . Multiplying the residues before and after the permutation givesEvery factor on the right is a unit, so its product can be cancelled. This provesThe integer is prime: none of the primes up to divides it. Therefore . Apply the theorem to and use the supplied congruence:To connect this to individual digits rather than merely assert periodicity, use long-division remainders andInduction gives . Since is coprime to , no remainder is zero. The congruence above therefore implies for every , using the unique representative in . In particularHenceThis is the mechanism of decimal period from multiplicative order: the period divides .
Past exam of the mathematics course of the University of Cambridge 2017 ia Paper 4 5D a Solution Created 2026-09-24 Updated 2026-10-05
The Fermat-Euler theorem states that for an integer and a positive integer with ,where the Euler totient function counts the residue classes coprime to . For , choose a reduced residue system . Multiplication by the unit modulo n preserves coprimality and is injective on these residue classes: implies , because has a multiplicative inverse modulo . It therefore permutes the reduced residue system, givingThe product is also a unit modulo n, so it can be cancelled. This proves the Fermat-Euler theorem. For every modular congruence is automatic; one may use .
For a prime number , the Euler totient function has value . Thus whenever . Multiplying by , and treating separately, gives the all-integer version of Fermat's little theorem:Finally, Wilson theorem states that for every prime number , . Its converse is also true: an integer is prime exactly when . For the converse, any proper divisor would divide both and , contradicting that congruence.
