If $a,n \in \mathbb{Z}$ such that $\gcd(a,n)=1$ , then $a^{\varphi (n)} \equiv 1 \operatorname{mod} n$ , where $\varphi$ is the Euler totient function.