It was indicated in the comments of this MO question that if $p\ge5$ is a prime then $24|p^2-1$. Indeed $p=6k\pm1$ and $p^2-1=36k^2\pm12k+1-1=12k(3k\pm1)$ and exactly one of $k$ and $3k\pm1$ is even.
Let $Q(p)=\dfrac{p^2-1}{24}$ (where $p\ge5$ is a prime).
Note that $Q(5)=1$, $Q(7)=2$, $Q(11)=5$, $Q(13)=7$ are all primes
(except $1$, which used to be a prime).
On the other hand $Q(17)=12$, $Q(19)=15$, $Q(23)=22$, $Q(29)=35$, $Q(31)=40$, $Q(37)=57$, $Q(41)=70$, $Q(43)=77$, $Q(47)=92$, $Q(53)=117$, are all composite numbers, though they do not have a common factor, and I do not see an obvious pattern.
Question. Is it true that $Q(p)=\dfrac{p^2-1}{24}$ is composite whenever $p\ge17$ is a prime?
If so, how to prove this? Is it known, any references?
(Is it related in any way to quadratic residues, am I supposed to know it? :)
I ran reduce computer algebra and it tells me the answer is yes for at least all primes $p\le21331777$ (when I interrupted it). Thank you!
When $p-1>24$, then $24$ can't cancel any of the factors $p-1$ and $p+1$ properly, so the number $\frac{p^2-1}{24}$ is always composite for $p-1>24$, other cases can be calculate manually...