# Gaussian Integer a+2bi as sum of 3 squares [closed]

Let $$a, b \in \mathbb{Z}$$. Then is it true that the Gaussian integer $$a+2bi$$ can be expressed as a sum of three squares?

• What is a question? – Mark Sapir Jun 15 at 1:08
• The intended question is surely something like "Is it true that every Gaussian integer $a+2bi$ is the sum of three [Gaussian] squares?". Presumably it is "well-known" that the ternary quadratic form $Q(x,y,z)=x^2+y^2+z^2$ over ${\bf Z}[i]$ is unique in its genus and that ${\rm Im}(Q) \equiv 0 \bmod 2$ is the only local obstruction. Still, quadratic forms over $O_K$ for number fields $K$ other than ${\bf Q}$ are probably too advanced for Math Stack Exchange. – Noam D. Elkies Jun 15 at 1:13
• @NoamD.Elkies So, why not leave an answer with a reference to the details? This is the sort of thing that is routine for number theorists but not for general mathematicians. (I know enough number theory to follow the vocabulary in your comment, but not enough to easily check whether it is true that $x^2+y^2+z^2$ is still unique in its genus over $Z[i]$, which is why I'm not doing it.) – David E Speyer Jun 15 at 3:06
• @DavidESpeyer because I'm in transit and can't easily locate references, and I'm not the only MO regular who could do this. (In fact I have a vague recollection of an equivalent question here that was answered along these lines.) – Noam D. Elkies Jun 15 at 3:32
• Does this answer your question? Is it true that $\{x^4+y^2+z^2:\ x,y,z\in\mathbb Z[i]\}=\{a+2bi:\ a,b\in\mathbb Z\}$? – Sam Hopkins Jun 17 at 4:53

One doesn't need to look at the genus here. We have $$x^2+y^2+z^2= (x+iy) (x-iy) + z^2.$$

Plugging in $$z=0$$, $$x=1+iy$$, we obtain $$1 (1+2iy) + 0^2= 1+ 2iy$$ which gets every number with real part odd and imaginary part even.

Doing the same with $$z=1$$ gets every number with real and imaginary parts even.

So we can represent every number with imaginary part even.

• That's great! It's slicker than Niven's proof. – Henry Cohn Jun 15 at 3:48
• I'm sorry. but how do you get from real part $1$ as you've shown to every number with real part odd? I can see ways to accomplish this using $z$, but then it makes the rest of the argument more complicated. – Paul Sinclair Jun 15 at 17:29
• @PaulSinclair $y$ need not be an integer. Adjust the imaginary part of $y$ as needed. – Will Sawin Jun 15 at 18:28
• Doh! Thank you. – Paul Sinclair Jun 15 at 20:28
• OK - I had some problems understanding @WillSawin's response, but finally I get it... $y$ can be taken to be any Gaussian integer; not just an element of $\mathbb Z$. – Anthony Quas Jun 18 at 4:55

Yes, every Gaussian integer with even imaginary part is the sum of three squares of Gaussian integers. This was proved by Ivan Niven in his paper Integers of quadratic fields as sums of squares (Transactions of the AMS 48 (1940), 405-417). For comparison, those with odd imaginary part are not sums of any number of squares, because $$(a+bi)^2 = a^2-b^2+2abi$$ always has even imaginary part.

The question is not new. See my old question and its answer available from Is it true that $\{x^4+y^2+z^2:\ x,y,z\in\mathbb Z[i]\}=\{a+2bi:\ a,b\in\mathbb Z\}$?