Any positive integer can be written as sum / difference of consecutive squares

808 Views Asked by At

How should one go about proving that $x \in \mathbb{N}$ can be written (with the right combination of signs) as $\pm 1^2 \pm 2^2 \pm \ldots \pm n^2$ for any $x : x, n \in \mathbb N$? I have tried for hours but can't figure out an appropriate approach. So what I ask of you specifically is, how should one be able to determine a reasonable approach for such a conjecture? Thanks.

1

There are 1 best solutions below

5
On BEST ANSWER

Let $P(m)$ be the statement that $m \in \Bbb{N}$ can be represented as the sum of squares with appropriate signs. We induct on $m$. For the base cases, we have \begin{align*} P(1):\quad 1 & = 1^2,\\ P(2):\quad 2 & = −1^2 − 2^2 − 3^2 + 4^2,\\ P(3):\quad 3 & = −1^2 + 2^2,\\ P(4):\quad 4 & = −1^2 − 2^2 + 3^2. \end{align*} Note the following is true. $$m^2 − (m + 1)^2 − (m + 2)^2 + (m + 3)^2 = 4.$$

Using this, for the inductive step we can now show that $P(m) \implies P(\color{red}{m+4})$. Because if $P(m)$ is true, then $m$ has a representation and in that representation we just need to add a few terms using the above identity to get the representation for $m+4$.

So we have, $P(1) \implies P(5), P(2) \implies P(6), P(3) \implies P(7), P(4) \implies P(8), \ldots$