Monday, 5 January 2026

Exercise (4.2).12

Let $p$ be prime and $\gcd (n, p) = 1$.

Prove that

$$ (p− 1)! + n^{p−1} \equiv 0  \pmod p $$


We're given $p$ is prime. By Wilson's Theorem this means

$$ (p-1)! \equiv -1 \pmod p $$

Also, $\gcd(n,p)=1$ means $p$ does not divide $n$, and so Fermat's Little Theorem tell us

$$ n^{p-1} \equiv 1 \pmod p$$

Adding these gives us the desired result.

$$ (p− 1)! + n^{p−1} \equiv -1 + 1 \equiv 0  \pmod p $$