# Numbers whose Cube equals Sum of Sequence of that many Squares

## Theorem

The integers $m$ in the following sequence all have the property that $m^3$ is equal to the sum of $m$ consecutive squares:

$m^3 = \displaystyle \sum_{k \mathop = 1}^m \left({n + k}\right)^2$

for some $n \in \Z_{\ge 0}$:

$0, 1, 47, 2161, 99 \, 359, 4 \, 568 \, 353, \ldots$

## Proof

We have:

 $(1):\quad$ $\displaystyle m^3$ $=$ $\displaystyle \sum_{k \mathop = 1}^m \left({n + k}\right)^2$ $\displaystyle$ $=$ $\displaystyle \sum_{k \mathop = 1}^m \left({n^2 + 2 n k + k^2}\right)$ $\displaystyle$ $=$ $\displaystyle n^2 \sum_{k \mathop = 1}^m 1 + 2 n \sum_{k \mathop = 1}^m k + \sum_{k \mathop = 1}^m k^2$ $\displaystyle$ $=$ $\displaystyle m n^2 + 2 n \frac {m \left({m + 1}\right)} 2 + \frac {m \left({m + 1}\right) \left({2 m + 1}\right)} 6$ Closed Form for Triangular Numbers, Sum of Sequence of Squares $\displaystyle \leadsto \ \$ $\displaystyle m^2$ $=$ $\displaystyle n^2 + n \left({m + 1}\right) + \frac {\left({m + 1}\right) \left({2 m + 1}\right)} 6$

Thus we have the quadratic equation:

$n^2 + \left({m + 1}\right) n + \dfrac {\left({m + 1}\right) \left({2 m + 1}\right)} 6 - m^2 = 0$
 $\displaystyle n$ $=$ $\displaystyle \dfrac {-\left({m + 1}\right) \pm \sqrt{\left({m + 1}\right)^2 - 4 \left({\dfrac {\left({m + 1}\right) \left({2 m + 1}\right)} 6 - m^2}\right)} } 2$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 2 \sqrt {m^2 + 2 m + 1 - 2 \left({\dfrac {2 m^2 + 3 m + 1} 3}\right) - 4 m^2}$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 2 \sqrt {5 m^2 + 2 m + 1 - \dfrac {4 m^2 + 6 m + 2} 3}$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 2 \sqrt {\frac {15 m^2 + 6 m + 3 - 4 m^2 - 6 m - 2 + 6 m^2} 3}$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 2 \sqrt {\frac {11 m^2 + 1} 3}$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 2 \sqrt {\frac {33 m^2 + 3} 9}$ $\displaystyle$ $=$ $\displaystyle - \dfrac {m + 1} 2 \pm \frac 1 6 \sqrt {33 m^2 + 3}$

Let $t := +\sqrt {33 m^2 + 3}$.

We are given that $m$ is an integer.

Let $n$ be an integer.

Then $t$ is a rational number which is the square root of an integer.

Therefore $t$ is an integer.

Now let $t$ be an integer.

Then $3$ is a divisor of $t^2$.

Thus $3$ is a divisor of $t$.

It follows that $\dfrac t 3$ and $m + 1$ have the same parity.

Thus either $\dfrac {m + 1} 2$ and $\dfrac t 6$ are both integers or both half-integers.

Hence $n$ is an integer

Thus it has been demonstrated that $n$ is an integer if and only if $t$ is an integer.

Thus, finding the solutions of $(1)$ is equivalent to finding the solutions to the Diophantine equation:

$(3): \quad t^2 - 33m^2 = 3$

We first note the degenerate solution:

$t = 6, m = 1$

Consider Pell's Equation:

$(4): \quad x^2 - 33 y^2 = 1$

By working it out (or looking it up), the first positive solution to $(4)$ is:

$x = 23, y = 4$

Thus all the solutions to $(4)$ are:

$x = 1, y = 0$

and:

$x = \pm x_n, y = \pm y_n$

where:

$(5): \quad x_n + y_n \sqrt {33} = \left({23 + 4 \sqrt {33} }\right)^n$

for all positive integers $n$.

Using the solution of $(3)$:

$t = 6, m = 1$

we can obtain another solution of $(3)$ by using:

$\left({6 + \sqrt {33} }\right) \left({x + y \sqrt {33} }\right) = t + m \sqrt {33}$

where:

$(6): \quad t = 6 x + 33 y, m = x + 6 y$

Thus:

$t - m \sqrt {33} = \left({6 - \sqrt {33} }\right) \left({x - y \sqrt {33} }\right)$

from which:

 $\displaystyle t^2 - 33 m^2$ $=$ $\displaystyle \left({t - m \sqrt {33} }\right) \left({t + m \sqrt {33} }\right)$ $\displaystyle$ $=$ $\displaystyle \left({6 - \sqrt {33} }\right) \left({6 + \sqrt {33} }\right) \left({x - y \sqrt {33} }\right) \left({x + y \sqrt {33} }\right)$ $\displaystyle$ $=$ $\displaystyle \left({6^2 - 1 \times 33}\right) \left({x^2 - 33 y^2}\right)$ $\displaystyle$ $=$ $\displaystyle 3 \times 1$ $\displaystyle$ $=$ $\displaystyle 4$

Thus it is demonstrated that $\left({t, m}\right)$ is a solution of $(3)$.

Now let $\left({t, m}\right)$ be any solution of $(3)$.

Let:

$x = 2 t - 11 m$
$y = \dfrac {6 m - t} 3$

We have that:

$t^2 - 33 m^2 = 3$

and so:

$3$ is a divisor of $t^2$

and so:

$3$ is a divisor of $t$

and so $x$ and $y$ are both integers.

$x$ and $y$ are seen to be solutions to $(4)$, and:

$t = 6 x + 33 y$
$m = x + 6 y$

Thus from $(5)$ and $(6)$ it follows that the solutions of $(3)$ with $m > 1$ are obtained from $x = \pm x_n, y = \pm y_n$ in $(5)$.

It follows further that all values of $m$ in such solutions are odd.

The trivial solution $x = 1, y - 0$ of $(4)$ corresponds to $m = 1, t = 6$ of $(3)$.

Thus we have that all the values of $m$ are given by:

$m_n = x_n + 6 y_n$

where:

$x_n + y_n \sqrt {33} = \left({23 + 4 \sqrt {33} }\right)^n$

We can set up a recursive process to calculate $\left({x_n, y_n}\right)$ of $(4)$ and the corresponding $\left({t_n, m_n}\right)$ of $(3)$ as follows:

$(7): \quad \left({x_n, y_n}\right) = \begin{cases} \left({23, 4}\right) & : n = 1 \\ \left({23 x_{n - 1} + 132 y_{n - 1}, 23 y_{n - 1}, 4 x_{n - 1} }\right) & : n > 1 \end{cases}$
$(8): \quad \left({t_n, m_n}\right) = \begin{cases} \left({6, 1}\right) & : n = 0 \\ \left({23 t_{n - 1} + 132 m_{n - 1}, 23 t_{n - 1}, 4 m_{n - 1} }\right) : & n > 0 \end{cases}$

Using $(8)$, the values of $m$ for $n \ge 1$ are found to be:

$m_1 = 47, m_2 = 2161, m_3 = 99 \, 359, \ldots$

$\blacksquare$

## Examples

### $47$ as Sum of Sequence of $47$ Squares

$\displaystyle 47^3 = \sum_{k \mathop = 1}^{47} \left({21 + k}\right)^2$

### $2161$ as Sum of Sequence of $2161$ Squares

$\displaystyle 2161^3 = \sum_{k \mathop = 1}^{2161} \left({988 + k}\right)^2$

### $99 \, 359$ as Sum of Sequence of $99 \, 359$ Squares

$\displaystyle 99 \, 359^3 = \sum_{k \mathop = 1}^{99 \, 359} \paren {45 \, 449 + k}^2$