For any prime $p > 3$, why is $p^2-1$ always divisible by 24? Let $p&gt;3$ be a prime. Prove that $24 \mid p^2-1$.


I know this is very basic and old hat to many, but I love this question and I am interested in seeing whether there are any proofs beyond the two I already know.
The most elementary proof I can think of, without explicitly mentioning any number theory: out of the three consecutive numbers $p - 1$, $p$, $p + 1$, one of them must be divisible by $3$; also, since the neighbours of p are consecutive even numbers, one of them must be divisible by $2$ and the other by $4$, so their product is divisible by $3 · 2 · 4 = 24$ — and of course, we can throw $p$ out since it's prime, and those factors cannot come from it.
As Unnikrihnan stated, every prime > 3 is of the form 6n + 1, or 6n − 1.

So, we could write the problem as ((6n ± 1)^2 - 1) /24.
Solving, we have: ((36n^2 ± 12n +1) – 1)/24;

Which, is equal to (36n^2 ± 12n)/24, and also equal to (3n^2 ± n) / 2, and to
n (3n  ± 1) / 2.

Since we are not interested on the numerical value of this equation, but that the result of the equation to be an integer, not a fraction, the n outside of the parenthesis is irrelevant.

So the equation could be written as, (3n ± 1)/2, and the result of this equation is always an integer for any odd or even value of n.