Euler's theorem. Let n≥1n\ge 1 and a∈Za\in\mathbb Z. If the of aa and nn is 11, then

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

where Euler's totient function is

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

Here x≡y(modn)x\equiv y\pmod n means that nn divides x−yx-y.

Remarks

This follows from applied to the (Z/nZ)×(\mathbb Z/n\mathbb Z)^\times, whose order is φ(n)\varphi(n). The case in which n=pn=p is prime is .

Examples
  • For n=10n=10 and a=3a=3, φ(10)=4\varphi(10)=4 and 34=81≡1(mod10)3^4=81\equiv1\pmod {10}.
  • The coprimality hypothesis is essential: 2φ(8)=24≡0(mod8)2^{\varphi(8)}=2^4\equiv0\pmod 8.