Sum of Squares

There is a lovely formula for the sum latexSn of the first latexn square integers.  Namely

latexSn=12+22+32++n2=n(n+1)(2n+1)6.

Sum of Squares

The sum of the first 6 cubes represented as a solid.

 

Imagine the sum latexSn as the volume of the pyramid of 1 x 1 x 1 cubes with one cube on the top layer, 4 on the next, 9 on the next and so on up to latexn2 cubes on the bottom layer as seen in the figure above. From the above expression, we see that the sum is one sixth the volume of a box with dimensions  latexn, latexn+1, and latex2n+1. So it is at least conceivable that six of these pyramids could be packed into a rectangular volume of that size.  And as the pictures indicate below, there is such an arrangement.