Integer as plus/minus combination of three squares

79 Views Asked by At

Some time ago I came across the following statement in a paper: "Every integer $k$ has a representation of the form $k=\pm a^2 \pm b^2 \pm c^2$" Unfortunately I can't remember where I read it, just wrote it down in my nodes. Moreover, I was not able to find this problem somewhere on the web. Now, I would be interested in a proof, and I suspect it might be rather easy, although I couldn't solve it.

1

There are 1 best solutions below

1
On BEST ANSWER

Using $a^2-b^2 = (a-b)(a+b)$, we can write : $pq = (\frac{p+q}{2})^2-(\frac{p-q}{2})^2$

With $p=1$ and $q=k$ or $q=k+1$

$$k=2n+1 \implies k=(n+1)^2−n^2$$ $$k=2n \implies k=(n+1)^2−n^2-1$$