Does $b^2 = 4a + 2$ have integer solutions? I got the following question on an exam I had today: $$b^2 = 4a+2$$
I said that it didn't since $b^2 -2$ was not a multiple of $4a$ or in other words, was not divisible by $4$. Is this correct?
 A: If $b$ was odd then $b^2$ would also be odd, but this can't happen because we know:
$$b^2=2(2a+1)$$
Thus we must have that $b$ is even or that:
$$ b=2k$$
$$\implies b^2=4k^2$$
$$\implies 4k^2=4a+2$$
$$\implies 2k^2=2a+1$$
Which can't be true because a natural number can't be both even and odd
A: We assume, on the contrary, that $b^2 = 4a + 2$ does indeed have integer solutions. Then, $b^2 \equiv 2 \mod 4 \implies 2$ is a quadratic residue modulo $4$.
We now aim to obtain a contradiction by proving (as demanded by the rigorous standards of mathematics) that $2$ cannot be a quadratic residue modulo $4$, i.e. $b^2 \not\equiv{2} \mod 4$ for all $b\in\mathbb{Z}$.
Note that the integer $b$ can be written as either one of $4k, 4k + 1, 4k + 2, 4k + 3$ for some $k \in \mathbb{Z}$. Taking the residues of the square of each modulo $4$, we get :
$$\begin{align}b^2 &= (4k)^2, (4k + 1)^2, (4k + 2)^2, (4k + 3)^2\\
&\equiv 0, 1^2,2^2, 3^2 \mod 4\\
&\equiv 0,1 \mod4\end{align}$$
From the above, we see that $b^2 \not\equiv{2} \mod 4$ for all $b\in\mathbb{Z}$, and hence $2$ cannot be a quadratic residue modulo 4, leading to a contradiction. Thus, there cannot be any integer solutions in $a,b$.
A: What you probably did in your exam is showing that $0,1,2,3$ upon squaring become $0,1,0,1$; which are precisely the quadratic residues $\mod 4$: since any number is congruent to one and only one of $0,1,2,3\mod 4$, every square is congruent exactly to one of $0,1\mod 4$, hence none is to $2$; i.e. $2$ is a quadratic non-residue modulo $4$.
