Show that for any odd $n$ it follows that $n^2 \equiv 1 \mod 8$ and for uneven primes $p\neq 3$ we have $p^2 \equiv 1\mod 24$.
My workings so far: I proceeded by induction. Obviously $1^2 \equiv 1 \mod 8$. Then assume that for a certain uneven number $k$ we have $k^2 \equiv 1 \mod 8$. Then the the next uneven number is $k+2$ and $(k+2)^2 = k^2 + 4k + 4 \equiv 4k + 5 \mod 8$. by the induction hypothesis. Now since $k$ is uneven we can write it as $k=2j+1$ and thus $4k+5 =8j+9 \equiv 1 \mod 8$ and we have shown what was asked for by induction.
However, in the case of a prime number $n$ I am not so certain how to proceed because I can't use induction. It comes down to proving that $24|(p^2-1)$. This is certainly the case for the first uneven prime $p \neq 3$, namely $p=5$ such that $p^2-1 =24$. How would I proceed from here, or how should I approach the problem differently? Many thanks in advance!