# Sums of Partial Sequences of Squares

## Theorem

Let $n \in \Z_{>0}$.

Consider the odd number $2 n + 1$ and its square $\paren {2 n + 1}^2 = 2 m + 1$.

Then:

$\displaystyle \sum_{j \mathop = 0}^n \paren {m - j}^2 = \sum_{j \mathop = 1}^n \paren {m + j}^2$

That is:

the sum of the squares of the $n + 1$ integers up to $m$

equals:

the sum of the squares of the $n$ integers from $m + 1$ upwards.

## Proof

The proof proceeds by induction.

For all $n \in \Z_{> 0}$, let $\map P n$ be the proposition:

$\displaystyle \sum_{j \mathop = 0}^n \paren {m - j}^2 = \sum_{j \mathop = 1}^n \paren {m + j}^2$

where $\paren {2 n + 1})^2 = 2 m + 1$.

First it is worth rewriting this so as to eliminate $m$.

 $\displaystyle \paren {2 n + 1}^2$ $=$ $\displaystyle 4 n^2 + 4 n + 1$ $\displaystyle$ $=$ $\displaystyle 2 \paren {2 n^2 + 2 n} + 1$

Thus the statement to be proved can be expressed:

$\displaystyle \sum_{j \mathop = 0}^n \paren {2 n^2 + 2 n - j}^2 = \sum_{j \mathop = 1}^n \paren {2 n^2 + 2 n + j}^2$

### Basis for the Induction

$\map P 1$ is the case:

$3^2 + 4^2 = 5^2$

which is the $3-4-5$ triangle.

Thus $\map P 1$ is seen to hold.

This is the basis for the induction.

### Induction Hypothesis

Now it needs to be shown that, if $\map P k$ is true, where $k \ge 2$, then it logically follows that $\map P {k + 1}$ is true.

So this is the induction hypothesis:

$\displaystyle \sum_{j \mathop = 0}^k \paren {2 k^2 + 2 k - j}^2 = \sum_{j \mathop = 1}^k \paren {2 k^2 + 2 k + j}^2$

from which it is to be shown that:

$\displaystyle \sum_{j \mathop = 0}^{k + 1} \paren {2 \paren {k + 1}^2 + 2 \paren {k + 1} - j}^2 = \sum_{j \mathop = 1}^{k + 1} \paren {2 \paren {k + 1}^2 + 2 \paren {k + 1} + j}^2$

### Induction Step

This is the induction step:

 $\displaystyle$  $\displaystyle \sum_{j \mathop = 0}^{k + 1} \paren {2 \paren {k + 1}^2 + 2 \paren {k + 1} - j}^2$ $\displaystyle$ $=$ $\displaystyle \sum_{j \mathop = 0}^{k + 1} \paren {2 k^2 + 6 k + 4 - j}^2$

So $\map P k \implies \map P {k + 1}$ and the result follows by the Principle of Mathematical Induction.

Therefore:

$\displaystyle \forall n \in \Z_{>0}: \sum_{j \mathop = 0}^n \paren {m - j}^2 = \sum_{j \mathop = 1}^n \paren {m + j}^2$

where $\paren {2 n + 1}^2 = 2 m + 1$.

$\blacksquare$

## Examples

### Example: $3^2 = 4 + 5$

 $\displaystyle 3$ $=$ $\displaystyle 1 + 2$ $\displaystyle 3^2$ $=$ $\displaystyle 4 + 5$ $\displaystyle 3^2 + 4^2$ $=$ $\displaystyle 5^2$

### Example: $5^2 = 12 + 13$

 $\displaystyle 5$ $=$ $\displaystyle 2 + 3$ $\displaystyle 5^2$ $=$ $\displaystyle 12 + 13$ $\displaystyle 10^2 + 11^2 + 12^2$ $=$ $\displaystyle 13^2+ 14^2$

### Example: $7^2 = 24 + 25$

 $\displaystyle 7$ $=$ $\displaystyle 3 + 4$ $\displaystyle 7^2$ $=$ $\displaystyle 24 + 25$ $\displaystyle 21^2 + 22^2 + 23^2 + 24^2$ $=$ $\displaystyle 25^2 + 26^2 + 27^2$