1. ## Cube numbers

Show that if the difference of two consecutive cube numbers is a square number ( $(k+1)^3-k^3=n^2$) then there exists two integers $a$ and $b$ for which $n=a^2+b^2$.

2. Originally Posted by james_bond
Show that if the difference of two consecutive cube numbers is a square number ( $(k+1)^3-k^3=n^2$) then there exists two integers $a$ and $b$ for which $n=a^2+b^2$.
This looks like an interesting problem!

If $(k+1)^3-k^3=n^2$ then $3k^2 + 3k -(n^2-1) = 0$. For that quadratic equation in k to have an integer solution, the discriminant $9+12(n^2-1) = 3(4n^2-1)$ must be a square. So let $4n^2 - 1 = 3m^2$, and hence $(2n)^2 - 3m^2 = 1$. The solution to that Pell's equation comes from convergents to the continued fraction expansion of $\sqrt3$. The j'th solution $(k_j,n_j)$ is given by $2n_j+(2k_j+1)\sqrt3 = (2+\sqrt3)^{2j+1}$.

The solutions $n_j$ turn out to be sums of consecutive squares, satisfying the equation $n_j = p_j^2 + (p_j+1)^2$, where $p_j = \tfrac12(\sqrt{2n_j-1}-1)$. That raises two questions. (1) Why should $2n_j-1$ be a square? (2) Why is that formula true? I can't answer either of those questions.

The first few values of k, n and p are given in this table (entries taken from the Sloane sequences A001921, A001570 and A001571).

$\begin{array}{r|r|r}k&n&p\\ \hline 0&1&0\\ 7&13&2\\ 104&181&9\\ 1455&2521&35\\ 20272&35113&132\\ 282359&489061&494\\ 3932760&6811741&1845\end{array}$

3. Originally Posted by Opalg
The j'th solution $(k_j,n_j)$ is given by $2n_j+(2k_j+1)\sqrt3 = (2+\sqrt3)^{2j+1}$.

The solutions $n_j$ turn out to be sums of consecutive squares, satisfying the equation $n_j = p_j^2 + (p_j+1)^2$, where $p_j = \tfrac12(\sqrt{2n_j-1}-1)$. That raises two questions. (1) Why should $2n_j-1$ be a square? (2) Why is that formula true? I can't answer either of those questions.
1.) $2n_j-1$ square implies $n_j = 2t^2+2t+1$ for some $t$ (I leave out my work ).

We also know $n_j = \frac{(2+\sqrt{3})^{2j+1}-(2k_j+1)\sqrt{3}}{2}$.

Maybe it's possible to use the latter formula to derive the desired relation... I save this for another day.

2.) Does $n_j = p_j^2 + (p_j+1)^2$, where $p_j = \tfrac{1}{2}(\sqrt{2n_j-1}-1)$?

This can be shown true by simple algebra.