Prove that if $n$ is not divisible by $5$, then $n^4 \equiv 1 \pmod{5}$ Suppose $n$ is an integer which is not divisible by $5$. Prove that $n^4 \equiv 1 \pmod{5}$.

$$n^4-1 = (n-1)(n+1)(n^2+1)$$  The factors $n-1$ and $n+1$ take care of $n \equiv \pm 1 \mod 5$, while if $n \equiv \pm 2 \mod 5$, $n^2 + 1 \equiv 2^2 + 1 \equiv 0 \mod 5$.
