Proving $4 \nmid n^2+2$ for all $n \in \mathbb{Z}$ I was asked to prove $4 \nmid n^2+2$ for all $n \in \mathbb{Z}$ and I was wondering whether my procedure was correct.
$I$. Assume $n$ is even, or rather $n = 2Q, Q\in\mathbb{Z}$. Assume as well $4|n^2+2$. Then
$$n^2+2=4q \tag{$q\in\mathbb{Z}$}$$
$$\implies (2Q)^2+2 =4q$$
$$\implies 2=4(q-Q^2)$$
Our result implies $4|2$, which is absurd. Then if $n$ is even it can not happen $4|n^2+2$.
$II.$ Assume $n=2Q+1, Q\in\mathbb{Z}$. Assume $4|n^2+2$. Then
$$n^2+2=4$$
$$\implies (2Q+1)^2+2=4q$$
$$\implies 4Q^2+4Q+3=4q$$
$$\implies 3=4(q-Q^2-Q)$$
which implies $4|3$, which is absurd. Then if $n$ is odd, $4\nmid n^2+2$.
$III.$ We've shown $4|n^2+2$ is absurd if $n$ is odd and if $n$ is even. Thus we have shown $4\nmid n^2+2$ for all $n\in\mathbb{Z}$.
I have the two general questions one has when finishing a proof. $A)$ Is the proof correct? $B)$ Was there a simpler proof? In this case, perhaps a proof that could be directly applied to all integers instead of having to show the property for even and odd numbers separately?
 A: Your proof is correct. Here is another perhaps simpler one. Suppose you can have $4\mid (n^2+2)$ for some $n$. Then you can express $n^2+2 = 4m$ for some $m$. So $n^2 = 2(2m-1)$. This shows $2 \mid n^2 \implies 2 \mid n$ and this allows you to write $n = 2p$ for some $p$. Hence $n^2 = (2p)^2 = 4p^2=4m-2\implies 2p^2=2m-1$. This can't happen since the LSH is even and the RHS is odd. Therefore $4 \nmid (n^2+2)$.
A: Same ideas but shorter: If $n$ is even then $n=2Q$, $Q\in\mathbb{Z}$, thus
$$
(n^2+2)÷4=(4Q^2+2)÷4=Q^2+\frac12\not\in\mathbb{Z}.
$$
If $n$ is odd then $n^2+2$ is odd, so $4\not\mid n^2+2$.
A: The easiest way I can think of to prove this is to consider even and odd numbers separatedly.
$(2k)^2+2=4k^2+2$ which is not divisible by $4$
$(2k+1)^2+2=4k^2+4k+1+2=4(k^2+k)+3$ which is not divisible by $4$
A: Do you know Euler's theorem? We have $n^2\equiv 1\pmod4$, when $n$ and $4$ are relatively prime.
That takes care of $1$ and $3$.
$0$ is clear.
All that's left is $n=2$.  But $2^2\equiv 0\not\equiv-2\pmod 4$.
