<s>[INST] 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}$.
 [/INST] Product of 5 consecutive integer numbers is of course divisible by $5$, so $5|(n-2)(n-1)n(n+1)(n+2)$. If $5\not|n,$ then from primality of $5$ we have
\begin{align*}
5|(n-2)(n-1)(n+1)(n+2) & = (n^2-1)(n^2-4)\\
                       & = n^4 - 5n^2 +4\\
                       & = n^4 - 1 - 5(n^2 - 1)
\end{align*}
so $5|n^4-1$.
</s>