0

The biggest challenge to solve the problem is that I can't really picture a pyramid. And it is hard to make a model. The pyramids I am trying to find include those on all tiers.

3 Answers3

2

If a pyramid is defined as stacking squares of $n^2$ squares on top of each other for $n=n_0$ to $n=n_1$, then for a pyramid with base side length $N$ the only question is how many square bases can you find at level $n$ in the original pyramid with base side length $N$. Note for $n = N$ this is one. For $n = N - 1$ this is $2^2 + 1 =5$, because you have two choices for where to start each side of the smaller pyramid if you start at the base, and one choice if you start one level higher. For $n = N- k$ the answer is $\sum_{k=0}^n (k+1)^2$. So you get $\sum_{n=0}^N \sum_{k=0}^n (k + 1)^2$. You can find a formula for sum-of-conesecutive-squares, and then apply formulas for sums of consecutive powers for powers up to $3$ to get a closed form formula.

user2566092
  • 26,450
1

For pyramids with a $1\times 1$ base (not sure if that counts) there are $1+2^2+3^2+\cdots+n^2$ possible.

For those with a $2\times 2$ base there are $1+2^2+\cdots+(n-1)^2$ possible.

And so on. The total sum is therefore $$(1^2+\cdots +n^2)+(1^2+\cdots +(n-1)^2)+\cdots+(1^2)$$ $${1\over 6}\sum_{k=1}^n{k(k+1)(2k+1)}={1\over 6}\left(2\sum{k^3}+3\sum{k^2}+\sum{k}\right)$$ $$={1\over 6}\left(2\left(\frac{n(n+1)}{2}\right)+3\frac{n(n+1)(2n+1)}{6}+\frac{n(n+1)}{2}\right)$$ And you can simplify from there. PS I strongly encourage you to build that model you were talking about. Just use some Legos or something.

1

Some clarification first, to make sure I understand your question correctly: I assume that you mean a step pyramid which has a single unit cube at its pinnacle. Every lower tier will be one unit in height and have edges which are two units longer than the tier above, so that you get a constant one unit step width all around.

I assume that you mean a pyramid is included in another pyramid if all the cubes which make up the smaller pyramid are also included in the larger pyramid, and if the vertical directions of the two pyramids are the same. In other words, your smaller pyramids need not necessarily stand on the same ground plane as the larger pyramid, but they are not allowed to lie on their side.

At level $i$ of the pyramid, counting from the top and starting at $1$, the edge length will be $2i-1$ so there will be $(2i-1)^2$ cubes in that level. These cubes can each be the pinnacle of different smaller pyramids, ranging from the single cube minimal one to the one which extends up to the base of the big pyramid. So if the big pyramid has $n$ tiers, then you get $n-i+1$ smaller pyramids with that cube at its pinnacle. Now you can count pyramids:

$$\sum_{i=1}^n(n-i+1)(2i-1)^2=\tfrac16n(2n^3+4n^2+n-1)$$

This is A006324: 1, 11, 46, 130, 295, 581, 1036, 1716, 2685, 4015, 5786, 8086…

Of course, it might be that a smaller pyramid is only a pyramid if it starts at ground level. Then things are even easier, since for every cube there is exactly one pyramid which has that cube as its pinnacle and extends all the way down to the ground. So in fact you only have to count cubes.

$$\sum_{i=1}^n(2i-1)^2=\tfrac13n(4n^2-1)$$

This is A000447: 1, 10, 35, 84, 165, 286, 455, 680, 969, 1330, 1771, 2300…

MvG
  • 44,006
  • Are you sure that the formula include those that are upside down? – most venerable sir Apr 22 '14 at 17:11
  • @user139024: I am sure that it does not contain upside-down ones. I should make that fact more explicit. Do you need those as well? – MvG Apr 22 '14 at 17:33
  • Yes, it would be nice if you can include those in your formula. – most venerable sir Apr 22 '14 at 17:47
  • Oh wait I got it. The second part of the formula 2i-1 is only counting the number of one by one square that can be seen as pinnacles. Ok, the formula does not repeat in fact. – most venerable sir Apr 22 '14 at 18:08
  • You basically make a pyramids that is composed of cubes. But the problem with this is that then, it would be hard for me to see where are the pinnacle of upside down pyramids. – most venerable sir Apr 22 '14 at 18:11
  • @user139024: Including upside-down is certainly harder, and will probably lead to a distinction between even and odd $n$, as also seen in this 2d case. I'll try to have a closer look when I find the time. Until then, I encourage you to clarify your question as to what exactly you want to count. – MvG Apr 22 '14 at 19:14