# Not the sum of the squares of two rational numbers

It is easy to see that $7$ isn't the sum of the squares of two integers. However, I want to show why it isn't. Can someone show me a proof as to why $7$ is not the sum of the squares of two rational numbers.

If you want an elementary proof, we can convert $r^2 + s^2 = 7$ for $r,s$ rational to the equation $a^2 + b^2 = 7c^2$ with $a,b,c$ integers by multiplying by the least common multiple of the denominators. Since the denominators shared no common factors with their numerators, there is no nontrivial common factor shared by all three of $a,b,c$.
However, if you consider $a^2+b^2 = 7c^2$ modulo $7$, then you see that $a^2 + b^2 = 0$. Since the possible values of $a^2$ and $b^2$ are $0,1,2,4$, the only way they add to $0$ modulo $7$ is if $a^2 = b^2 = 0 \pmod{7}$. This implies that $7$ divides both $a$ and $b$. But then $7^2$ divides $7c$, so that $7$ divides $c$ as well. This contradicts our assumption that $a,b,c$ do not share a common factor, so we are done.
Alternative answer: the equation $a^2+b^2=7c^2$ implies $$a^2+b^2+c^2\equiv0\pmod4\ .$$ Since squares modulo $4$ are $0$ and $1$ only, this has no solution unless $a,b,c$ are all even. But then they have a common factor (namely, $2$), which without loss of generality is not so.