📐 Fermat
If $p$ is prime and $p \\nmid a$, then $a^{p-1} \\equiv 1 \\pmod{p}$.
Proof: Let $G_p = \\{[1], \\ldots, [p-1]\\}$. Multiplying all elements by $[a]$ permutes $G_p$. Product of $aG_p$ equals $[a]^{p-1}$ times product of $G_p$. Cancel to get $[a]^{p-1} = [1]$.
From: intro-discrete
Learn more: https://mathacademy-cyan.vercel.app/#/section/5
Explore all courses: https://mathacademy-cyan.vercel.app