# Can the sum of the first nn squares be a cube?

In other words, if you have a pile of cannonballs in a square pyramid, can you rearrange them as a cube instead, or do you have to shell someone first? Or, instead, does have any nontrivial integer solutions?

The analogous problem where you want to put the cannonballs in a square instead of a cube is know to have only one nontrivial solution:

It can be seen that $n,n+1,2n+1$ are pairwise coprime by using Euclid’s algorithm. Consider the six cases of the rest $n \pmod 6$:

$n=6y$

$y(6y+1)(12y+1)=x^3$

Since the product of 3 coprime integers is a cube each is a cube too. Let
$y=a^3$, $6y+1=b^3$, $12y+1=c^3$. A solution is the equivalent to a solution to the system

$n=6y+1$

Applying the same argument and substitution:

$n=6y+2$

$n=6y+3$

$n=6y+4$

$n=6y+5$

So if it is proven that none of these systems of “cubic Pell equations” has a nontrivial solution, the theorem is proven. I have a suspicion a quick proof would require an algebraic number theory atom bomb.

All six cases boils down to whether one can find integer solutions for Skolem’s equation

for $d = 2$ and $4$.
According to my reference, there is a theorem:

(Skolem) – If $d \in \mathbb{Z}$ is given with $d \ne 0$, there exists at most one pair $(x,y) \in \mathbb{Z} \times \mathbb{Z}$ with $y \ne 0$ such that $x^3 + dy^3 = 1$

For $d = 2$, the only $v \ne 0$ solution is $(u,v) = (-1,1)$ and
there is no $v \ne 0$ solution for $d = 4$.
As a corollary of this, there is no $n > 1$ solution for the equation:

Please consult reference below for more details.

References

• Henri Cohen, Number Theory Volume I, Tools and Diophantine Equations,
$\S 6.4.7$ Skolem’s Equations $x^3 + dy^3 = 1$.