Heptagonal Pyramidal Number Calculator
Count a stack of heptagonal layers with n times n plus one times five n minus two over six.
What it does
Heptagonal pyramidal numbers count a stack built from heptagonal layers. The nth term is the sum of the first n heptagonal numbers. The sequence begins 0, 1, 8, 26, 60 and 115, with a cubic closed form that follows the same pattern as the other polygonal pyramids.
The general rule for a polygonal pyramid is to sum the polygonal numbers for the chosen side count. Pentagons, hexagons and heptagons each produce their own family, and the coefficients in the formula change in a predictable way as the side count rises.
For heptagons the formula is n times n plus one times five n minus two, divided by six. The numerator is divisible by six for every whole n, and the tool verifies exactness before returning the answer.
This page computes the term with exact integer arithmetic and reports the previous value and ratio beside it. It gives a count only, not a drawing of the arrangement.
The layer limit is one hundred thousand, which keeps the printed value around sixteen digits.
How to use
- Enter the number of layers n from 0 to 100,000.
- Read the heptagonal pyramidal number in the main result box.
- Check the previous term and growth beside it.
- The default n = 8 reproduces the worked example.
- Try n = 5 to confirm the value 115.
- Compare with hexagonal pyramidal numbers at the same count.
Formula
- n
- The number of heptagonal layers.
- P(n)
- The total number of points in the stack.
The formula comes from summing k times five k minus three over two for k from one to n. It simplifies to n times n plus one times five n minus two over six. The value at n = 0 is zero and at n = 1 is one.
Worked example
Example: eight layers
The page opens with n = 8.
- Compute n plus one: 9.
- Compute five n minus two: 40 - 2 = 38.
- Multiply the three factors: 8 x 9 x 38 = 2736.
- Divide by six: 2736 / 6 = 456.
- The tool reports 456, previous term 308, and growth 1.48x.
- Check the previous value: 7 x 8 x 33 / 6 = 308.
Reference table
| n | P(n) | Previous | Growth |
|---|---|---|---|
| 0 | 0 | n/a | n/a |
| 1 | 1 | 0 | n/a |
| 2 | 8 | 1 | 8.00x |
| 4 | 60 | 26 | 2.31x |
| 5 | 115 | 60 | 1.92x |
| 8 | 456 | 308 | 1.48x |
Limits
- Layer counts above 100,000 are rejected to keep the output readable.
- The growth column is rounded to two decimals.
- The tool returns counts without drawing the solid.
- Only the standard heptagonal pyramid family is used.
Common mistakes
- Using five n minus three instead of five n minus two.
- Forgetting to divide by six.
- Using only the heptagonal number at index n.
- Expecting quadratic rather than cubic growth.
- Rounding the final division instead of checking exactness.
Try it yourself
Quick checks. Answers sit tucked under each question.
What is P(8)?
P(8) = 8 x 9 x 38 / 6 = 456.
What is P(5)?
P(5) = 5 x 6 x 23 / 6 = 115.
What is P(2)?
P(2) = 2 x 3 x 8 / 6 = 8.
Questions
How is this built?
By stacking ordinary heptagonal numbers as layers.
What is the general polygonal pyramid rule?
Sum the polygonal numbers of the chosen side count from one to n.
Is the division exact?
Yes, and the tool verifies it before returning a value.
What is the growth rate?
Cubic, from three linear factors in n.
Are values exact?
Yes. Integer arithmetic is used.
What layer count is accepted?
Zero through 100,000.