$n$ or $2n$ is a sum of three squares

846 Views Asked by At

For a given positive integer $n$, show that $n$ or $2n$ is a sum of three squares.

My attempt: If $n$ is a sum of three squares, there is nothing to prove. So assume $n$ is not a sum of three squares. Then $$n\equiv7\pmod8\implies 2n\equiv6\pmod8.$$ I'm completely stuck here. I know that no positive integer of the form $4^a(8b+7)$ can be written as a sum of three squares. My textbook (Elementary Number Theory- David Burton) doesn't give proof of the converse of the statement but mentions that the converse is true. The question is from the same book. So are we supposed to use the full theorem? (Alex has already given a proof using the converse.) Is there any way to proceed without using the converse of the theorem? Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

So $x$ is the sum of three squares iff $x$ is not of the form $4^a(8b+7)$ via Legendre's theorem. Suppose $n$ is not the sum of three squares, so that $x=4^a(8b+7)$ for some integers $a,b$. Then $2x=2\cdot 4^a(8b+7)$. Notice that $8b+7$ is always odd. So it's not possible that $2x=4^c(8d+7)$, as $c=a$ necessarily, e.g. $2\cdot 4^a=4^c$ is impossible.