Euler’s Theorem: Let n≥1 and let a∈Z. If the greatest common divisor
of a and n is 1 (written gcd(a,n)=1), then
aφ(n)≡1(modn),where φ(n) is Euler’s totient function, defined by
φ(n)={k∈{1,2,…,n}:gcd(k,n)=1}.As usual, x≡y(modn) means n divides x−y.
This follows immediately from Lagrange's theorem
applied to the group of units
(Z/nZ)×, a finite group
with ∣(Z/nZ)×∣=φ(n). The special case n=p prime is Fermat's little theorem
.
Examples:
- n=10, a=3: φ(10)=4, and 34=81≡1(mod10).
- n=12, a=5: φ(12)=4, and 54=625≡1(mod12).
- The hypothesis gcd(a,n)=1 matters: for n=8, a=2 we have gcd(2,8)=1, and indeed 2φ(8)=24=16≡0(mod8)=1.