Sum of Integers

It is said (perhaps apocryphally) that while Gauss was in elementary school, he and his classmates were assigned the task of summing the integers from 1 to 100, as a way to keep them busy for a while. To the teacher's surprise, Gauss finished unusually quickly, with the correct answer: 5050. He explained that it was not actually necessary to add all those numbers individually, but that (I'm paraphrasing) you can think of the sum of the first n integers as the area of a "triangular staircase" of width n:


and that two of these "staircases" can be arranged into a rectangle:


So, it must follow that the area of one of them is half the area of the rectangle. This is a geometric interpretation of the algebraic formula for the sum of the first n integers:

i=1niarea of triangular staircase=12n(n+1)half the area of the rectangle

It's a beautiful explanation, regardless of whether or not the story is true!

Sum of Squares

In calculus, while learning about the formulas for sums of the first n squares, cubes, etc:


I wondered: is there a similar geometric understanding of these formulas too? It turns out that, for the sum of squares, the answer is yes. Just like before, we can interpret the sum of the squares of the first n integers as the volume of a "pyramid staircase"


And then observe that 6 of these staircases can be assembled into a cuboid:



i=1ni2volume of a pyramid staircase=16n(n+1)(2n+1)one sixth the area of the cuboid

I'm still curious about whether or not a similar construction exists for sums of ik for k3, but it's much harder to visualize higher dimensions (which defeats the whole point of a "visual" proof).