2

The pyramid looks like:

enter image description here

For which I managed to derive the formula for the count of cube sides (ignoring the top). This was easy by simply thinking about it as a triangle:

If we have 4 squares wide pyramid, then the total sides represented graphically looks like:

 1*4    xxxx
+2*4    xxxxxxxx
+3*4    xxxxxxxxxxxx
+4*4    xxxxxxxxxxxxxxxx

= 40 sides total.

Which is obviously a triangular area.

So I calculated half of the rectangle + remaining halves of the squares diagonally:

n*(4*n)   (4*n)
------- + ----- = 2n^2+2n
   2        2

Hurray!


Now to the real problem:

How could I visualize the count of cubes in the same pyramid in a similar way?

My brain just doesn't work in 3d. I had an idea about calculating the volume of pyramid, but I couldn't really get anywhere from there.

The answer is:

2n^3+3n^2+n
-----------
     6 

But I have now forgotten where I found this piece of magic. It works perfectly, but I don't know why.

So I would like to understand how someone came up with that formula? Preferrably in visual representation which would be easy to understand.

It's really easy to visualize as a loop (n = 4):

 1*1    x
+2*2    xxxx
+3*3    xxxxxxxxx
+4*4    xxxxxxxxxxxxxxxx

= 30 cubes total.

But I don't know how to start compressing this loop into one single formula.

Edit: I added one mandatory tag that I could think of somehow relating to this question.

Volkkari
  • 25
  • 1
  • 4

1 Answers1

4

Consider each level separately. On the $k$-th level ($k$ starting at $1$ and counting from the top of the pyramid), there are $k^2$ blocks. Hence we just have to compute $1^2+2^2+\cdots+n^2$.

There is a standard result that

$$\sum\limits_{k=1}^nk^2=\frac{n(n+1)(2n+1)}{6}=\frac{2n^3+3n^2+n}{6},$$

which is provable by induction or various counting methods. Here is the wikipedia article on square pyramidal numbers as they are called.


Visual proof (Taken from https://math.stackexchange.com/a/48152/160289), due to Man-Keung Siu. It appeared in the March 1984 issue of Mathematics Magazine:

enter image description here

(n+½)*(n+1)*n
------------- = Amount of cubes.
      3
Peter Woolfitt
  • 20,914
  • 6
  • 54
  • 85
  • Is it possible to explain this for dummies? "there is a standard result" - which still remains unexplained. – Volkkari Jun 28 '14 at 16:20
  • How would you start solving this problem if you didnt know that standard result? – Volkkari Jun 28 '14 at 16:26
  • @Volkkari [Here](http://math.stackexchange.com/questions/48080/proof-that-sum-limits-k-1nk2-fracnn12n16) is a link to another Math.SE question which goes through quite a few methods of proof of this fact. Additionally, there is an [argument at the bottom of the wikipedia page](http://en.wikipedia.org/wiki/Square_pyramidal_number#Derivation_of_the_summation_formula) on pyramidal numbers. – Peter Woolfitt Jun 28 '14 at 16:47
  • Oh this was nice: http://i.stack.imgur.com/U5sXF.png – Volkkari Jun 29 '14 at 10:22
  • I edited your post with that image, and I'll accept the answer once you have accepted the image (at least) to your post. – Volkkari Jun 29 '14 at 10:30
  • Another thing is that, how did he come up with that visual proof? Its pretty hard to come up with something like that. I was thinking a bit like that, but not so asymmetrical. Maybe there are more visual proofs for this too? – Volkkari Jun 29 '14 at 10:32