<s>[INST] Let $p$ be prime not equal to 2 or 5. Show $p^2+1$ or $p^2-1$ is divisible by 10. I can do half the proof but can not think of a way to finish. If $p$ is prime then both $p-1$ and $p+1$ are even. In cases where either $p-1$ or $p+1$ is divisible by 5 that implies $(p-1)(p+1)=p^2-1=10n$ for some positive integer $n$. I am not sure if I am on the right track with this. 
 [/INST] If $p \equiv 3$ or $7 \pmod{10}$, then $p^2 \equiv 9 \pmod{10}$, so $p^2 + 1 \equiv 0 \pmod{10}$ as desired. But if $p \equiv 1$ or $9 \pmod{10}$, then $p^2 \equiv 1 \pmod{10}$, so $p^2 - 1 \equiv 0 \pmod{10}$ as desired.
Examples: $3^2 + 1 = 10$, $7^2 + 1 = 50$, $11^2 - 1 = 120$, $19^2 - 1 = 360$.
</s>