Tuesday, July 9, 2019

The Sum of Cubes and the Triangle Numbers

Update: I created an animated version of this same proof. Check it out on my YouTube channel!

Earlier today I came across the summation:

$\sqrt{1^3 + 2^3 + ... + n^3}$

After calculating the sum for some low values of $n$, it seemed as though this summation was exactly equivalent to the following:

$1 + 2 + ... + n$

The latter summation is the definition of the $n$th triangle number. In other words, the triangle number of the positive integer $n$ is the sum of all positive integers less than or equal to $n$.

I was very perplexed to see this, and needed some proof and reasoning of why this should be true.


And this is where it gets fun!

Let us first see how this is true geometrically for small values of $n$, then we can generalize from there.

Consider the following image:

We start off with one cube (right). Now let us see if we can arrange it into a square (left). Imagine the square view is just viewing the cube from the top down.

Alright, that was easy. Since $1$ is a perfect square, we can take its square root and get an integer value, showing that

$\sqrt{1^3} = 1$

which so far is consistent with the triangle numbers, since the first triangle number is also $1$. Don't worry if this doesn't make sense yet, because we haven't really done anything.

Let's make things a little more interesting by looking at the summation for $n=2$


The left view represents the sum so far. We started with $1^3$ which is simply $1$ so we've drawn one box to left. Now we must add $2^3$ which is picture to the right. To visualize this I will start by moving only one layer of the cube over to the left.


And now it's pretty apparent that we can move the remaining $4$ cubes over to the left side to make another perfect square.


Great! Our assumption that the square root of the sum of cubes is equivalent to the triangle numbers still holds, because

$\sqrt{1^3 + 2^3} = 1 + 2 = 3$

Now we're ready to generalize this, so we can know that this is true for any positive integer $n$.

Once again, the left view represents the sum so far (which we know is a perfect square), and the right view represents the $n$th cube that we're adding.


We always start by adding only one layer of the cube to our sum. Notice that every layer of $n^3$ is composed of exactly $n^2$ unit cubes. This means that there are $n^3 - n^2$ remaining unit cubes on the right that we somehow need to fit into the square on the left. We've done it for $n=1$ and $n=2$ but now we must find a way to prove we can make a perfect square for any positive integer $n$.



I notice that there are two rectangles missing from the square. One side length is simply $n$ since that's the side length of the square we've just added. The other side length is the sum of the side lengths of all the previous cubes we've added. In other words, it's the triangle number of $n-1$. We can be sure of this, since we always construct the next perfect square by placing one layer of the cube diagonally, insuring that each side length of the square increases by the side length of the cube.

And in fact, there's a cool trick for deriving an equation for the $n$th triangle number. Consider:


This schematic demonstrates adding up the numbers from $1$ to $n$ to calculate the $n$th triangle number. Nothing too special. But, if we double that triangle we made and rotate it...


Amazing! We've made a rectangle that we know has the area of twice the $n$th triangle number. So we can just divide the area by $2$ and we get the equation:

$\frac{n(n+1)}{2}$

And what we actually need is the triangle number for $n-1$, which comes out to be:

$\frac{n(n-1)}{2}$

And with that, we've found the area of the missing rectangles!


Notice that the area of both missing rectangles combined is $n^3 - n^2$ which is exactly the remaining number of unit cubes on the right! This means we know we can make a perfect square for any value of $n$. And what's more, we know the side length of the perfect square is the $n$th triangle number, thanks to our sneaky method of constructing the perfect square starting with one layer of the cube.

This shows that the square root of the sum of the first $n$ cubes is in fact equivalent to the $n$th triangle number! Wow, I love math.

I would not be surprised if this proof has been shown elsewhere, but I did discover this proof independently and had fun doing it! Now time to sleep.


1 comment:

  1. this is so cool! it's amazing that you were able to visualize it like that!

    ReplyDelete