How to (quickly) prove that $24p+17$ is not a square number Computer says $24p+17$ is not square number for $p<10^7$ so I guess it's not. I know that squares of odd numbers are all $8p+1$ but $24p+17$ passes the test
And how to solve problems like this in general? Thx in advance

Reduce the equation modulo three. Since 3 divides 24 and since $17 = 5\times 3 + 2$ we see that $24p+17 \equiv 2\bmod 3$ for all $p$. Now notice that $0^2 = 0 \equiv 0 \bmod 3$, $1^2 =1 \equiv \bmod 3$ and $2^2 = 4 \equiv 1 \bmod 3$. So no square number is congruent to 2 modulo 3, meaning $24p+17$ is not square.
In general, I looked at the factors of 24. They are 1, 2, 3, 4, 6, 8, 12 and 24. The aim now is to reduce $24p+17$ modulo one of these factors. You then need to find a factor that when you reduce 17 modulo that factor, you get a number which is not given by squaring any of the members of $\mathbb{Z}_n$.
For example, let's try $n=6$. $24p+17 \equiv 5 \bmod 6$. Next $0^2 \equiv 0 \bmod 6$, $1^2 \equiv 1 \bmod 6$, $2^2 \equiv 4 \bmod 6$, $3^2 \equiv 3 \bmod 6$, $4^2 \equiv 4 \bmod 6$ and $5^2 \equiv 1 \bmod 6$. Again, no square is congruent to 5 modulo 6, while $24p+17$ is congruent to 5 modulo 6. Again, this proves that $24p+17$ is not a square.
