If n ≡ −1 (mod 24), then 24 divides
I have proven already that if is the prime factorization of n, then
.
Maybe that helps?
Suppose .
Finding an inverse modulo is special because if it exists, .
Therefore .
Last but not least you need to show is not square. I'll let you take a stab at that. (Hint: Consider modulo .)
So we have then that