[Math] Is this an accurate proof that no perfect square is of the form $4k+3$? ($k$ an integer)

elementary-number-theoryproof-verificationsquare-numbers

A positive integer $n$ is a perfect square. Prove that it cannot be of the form $4k+3$, where $k$ is an integer.

I tried to prove this by proof by contradiction: if $n$ is a perfect square, then its square root, say $x$, is an integer. Suppose $n$ is of the form $4k+3$. Then $$x^2= 4k+3$$ which we can also write as $$x^2\equiv3 \mod 4$$ However, this congruence has no solutions. Therefore our initial assumption that $n$ is of the form $4k+3$ was false and $n$ cannot be of the form $4k+3$.

I know there's something missing or wrong in this proof but I don't know what. Any help would be appreciated.

Best Answer

For even $\sqrt n=2m$, $n=(2m)^2=4m^2\equiv\color{blue}0\mod 4$.

For odd $\sqrt n=2m+1$, $n=(2m+1)^2=4m^2+4m+1\equiv\color{blue}1\mod 4$.

So you never achieve congruency to $\color{blue}3$, as there are no other cases.

As a byproduct, this also establishes that $4k+2$ is never a perfect square.

Related Question