Euler's Theorem

If gcd(a,n)=1 then a^{φ(n)} ≡ 1 (mod n).
Euler's Theorem

Euler’s Theorem: Let n1n\ge 1 and let aZa\in\mathbb{Z}. If the of aa and nn is 11 (written gcd(a,n)=1\gcd(a,n)=1), then

aφ(n)1(modn),a^{\varphi(n)} \equiv 1 \pmod n,

where φ(n)\varphi(n) is Euler’s totient function, defined by

φ(n)={k{1,2,,n}:gcd(k,n)=1}.\varphi(n)=\bigl|\{\,k\in\{1,2,\dots,n\}: \gcd(k,n)=1\,\}\bigr|.

As usual, xy(modn)x \equiv y \pmod n means nn divides xyx-y.

This follows immediately from applied to the (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times, a finite with (Z/nZ)×=φ(n)|(\mathbb{Z}/n\mathbb{Z})^\times|=\varphi(n). The special case n=pn=p prime is .

Proof sketch (group-theoretic): If gcd(a,n)=1\gcd(a,n)=1, then the residue class of aa is an element of (Z/nZ)×(\mathbb{Z}/n\mathbb{Z})^\times. In any finite group, xG=ex^{|G|}=e for all xGx\in G (by Lagrange), so aφ(n)1(modn)a^{\varphi(n)}\equiv 1 \pmod n.

Examples:

  • n=10n=10, a=3a=3: φ(10)=4\varphi(10)=4, and 34=811(mod10)3^4=81\equiv 1 \pmod{10}.
  • n=12n=12, a=5a=5: φ(12)=4\varphi(12)=4, and 54=6251(mod12)5^4=625\equiv 1 \pmod{12}.
  • The hypothesis gcd(a,n)=1\gcd(a,n)=1 matters: for n=8n=8, a=2a=2 we have gcd(2,8)1\gcd(2,8)\ne 1, and indeed 2φ(8)=24=160(mod8)12^{\varphi(8)}=2^4=16\equiv 0 \pmod 8\neq 1.