Prove that $24n+5$ can't be a perfect square with $n \in \Bbb Z^+$
My try
I tried to prove it by contradiction:
Assume that $24n+5=a^2$ with $a\in \Bbb Z^+$
Then $24n+5$ is odd, so $a$ is odd too
Then $$n=\frac {a^2-5}{24}$$
So $a^2-5|24$
I saw that if $a^2-5|24$, then $a$ must have a remainder of 5 when is divided by 24.
Example: Let $a^2-5=24$, then $a^2=29$ and $29/24=1$ with remainder of 5.
Let $a^2-5=48$, then $a^2=53$ and $53/24=2$ with remainder of 5.
So the problem reduces to finding a perfect square that divided by $24$ gives a remainder of $5$. I tried by brute force with all $a\ge 7$ (because $a$ is odd, so i tried $7,9,$... till $25$) and they all give remainder of $1$ or $9$. I know this doesn't suffices that there isn't a perfect square that divided by 24 gives remainder of $5$, but i don't know how to continue. I'm thinking about modular arithmetic and congruency, but i don't see the way.
Any hints?, or atleast is my way is correct?.
Thanks.
Assume for contradiction that $24n+5$ was a perfect square. Then for some $a\in\mathbb{Z}$, we have $24n+5=a^2$. Since $a$ is an integer then $a^2$ is an integer, thus $24n+5$ must be odd, meaning that $a^2$ is odd, therefore meaning that $a$ is also odd. So for some $k\in\mathbb{Z}$, $a=2k+1$ and thus $a^2 = 4k^2+4k+1$. And we have the equation $24n+5=4k^2+4k+1$. This implies that $6n+1=k^2+k$. But notice that $6n+1$ is always odd and $k^2+k$ is always even. A contradiction.