The completed, and expanded, chart is below.
Click the image to build a Pyramid
In filling out the chart you might have noticed that it would be useful to know how many balls are in each layer of the pyramid. Of course, the number of the balls in the pyramid is the sum of the number of balls in all the layers.
But, the number of balls in layer N is Triangle(N)
,
the number of balls in a triangle with a side of N balls.
(Recall that triangle numbers were discussed in chapter 91.)
N | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
Triangle(N) | 1 | 3 | 6 | 10 | 15 | 21 | 28 |
Pyramid(N) | 1 | 4 | 10 | 20 | 35 | 56 | 84 |
Say that you know that there are Pyramid(N-1)
balls in the first
N-1 layers (counting from the top of the pyramid).
Then the following scheme looks tempting:
Pyramid(N) = Pyramid(N-1) + Triangle(N)
This looks suspiciously like a recursive definition. But what is missing?