Proof that $n^2 - 5$ is not divisible by 8 The question is from one of the past exams in a course I am doing. I have gotten halfway through it but cannot figure out how to finish it off.
So the first part was to prove that $4 \mid n^2 - 5 $ if $n$ is an odd integer. 
Here is a brief proof (without intricate details):
Consider $n = 2k+1$
$n^2 - 5 = 4(k^2 + k -1)$
$\therefore 4 \mid n^2 - 5$
Now I think I can prove the second part by showing $k^2 + k - 1 \neq 2 $ if $k$ is an integer.
Hence rearranging I have $k^2 + k - 3 = 0$, which gives two non-integer roots. 
However this course has not used the quadratic formula explicitly so I am wondering if there is a simpler way.
 A: For any integer $n$, one of these has to be true.
$$n \equiv 0, \pm1, \pm2, \pm3, \pm4 \ (\rm mod 8)$$
Square both sides, to get
$$n^2 \equiv 0,1, 4, 9, 16 \ (\rm mod 8)$$
Then,
$$n^2 \equiv 0,1, 4 \ (\rm mod 8)$$
(9 is congruent to 1, 16 is congruent to 0)
Therefore, $n^2-5$ can never be divided by 8.
A: Alternatively, you can simply consider the following cases:


*

*$n\equiv0\pmod8 \implies n^2-5\equiv0^2-5\equiv- 5\equiv3\not\equiv0\pmod8$

*$n\equiv1\pmod8 \implies n^2-5\equiv1^2-5\equiv- 4\equiv4\not\equiv0\pmod8$

*$n\equiv2\pmod8 \implies n^2-5\equiv2^2-5\equiv- 1\equiv7\not\equiv0\pmod8$

*$n\equiv3\pmod8 \implies n^2-5\equiv3^2-5\equiv+ 4\equiv4\not\equiv0\pmod8$

*$n\equiv4\pmod8 \implies n^2-5\equiv4^2-5\equiv+11\equiv3\not\equiv0\pmod8$

*$n\equiv5\pmod8 \implies n^2-5\equiv5^2-5\equiv+20\equiv4\not\equiv0\pmod8$

*$n\equiv6\pmod8 \implies n^2-5\equiv6^2-5\equiv+31\equiv7\not\equiv0\pmod8$

*$n\equiv7\pmod8 \implies n^2-5\equiv7^2-5\equiv+44\equiv4\not\equiv0\pmod8$

A: $$n^2\equiv5\pmod8\implies n^2\equiv5\pmod2\equiv1\implies n\text{ must be odd}$$
Now $(2a+1)^2=8\cdot\dfrac{a(a+1)}2+1\equiv1\pmod8\not\equiv5$
A: If $n=2k+1$ then you have shown that $n^2-5=4(k^2+k-1)$. If $k$ is even then $k^2+k-1$ is an even plus an even minus an odd, therefore odd, and if $k$ is odd then $k^2+k-1$ is an odd plus an odd minus an odd, therefore odd. So $2\nmid k^2+k-1$ therefore $8\nmid n^2-5=4(k^2+k-1)$.
If $n$ is even then obviously $n^2-5$ is odd.
A: $$n^2 - 5 \equiv_8 0 \Leftrightarrow n^2 \equiv_8 5$$
So, $n$ is such number, that square has remainder $5$, when divided by $8$.
Could you show that such number doesn't exist?
Hint: If you have no better idea, you can check just numbers from set $\lbrace 0, 1, \dots, m-1\rbrace$, when $m$ is divisor (here $8$).
Def:
$$ a \equiv_m b \Longleftrightarrow m \mid (a - b)$$
A: If $n=2k$ then $n^2-5=8q-5$ or $n=8q-1$
If $n=2k+1 \,$ then $n^2-5=8q-4$ 
