Heptagonal Pyramidal Number Calculator

Count a stack of heptagonal layers with n times n plus one times five n minus two over six.

Math and PercentUpdated 2026-11-182 min read
Heptagonal Pyramidal Number Calculator
A whole number from 0 to 100,000.
Heptagonal pyramidal number
...
Previous term...
Growth from previous...

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

  1. Enter the number of layers n from 0 to 100,000.
  2. Read the heptagonal pyramidal number in the main result box.
  3. Check the previous term and growth beside it.
  4. The default n = 8 reproduces the worked example.
  5. Try n = 5 to confirm the value 115.
  6. Compare with hexagonal pyramidal numbers at the same count.

Formula

P(n) = n(n + 1)(5n - 2) / 6
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.

  1. Compute n plus one: 9.
  2. Compute five n minus two: 40 - 2 = 38.
  3. Multiply the three factors: 8 x 9 x 38 = 2736.
  4. Divide by six: 2736 / 6 = 456.
  5. The tool reports 456, previous term 308, and growth 1.48x.
  6. Check the previous value: 7 x 8 x 33 / 6 = 308.

Reference table

Heptagonal pyramidal numbers
nP(n)PreviousGrowth
00n/an/a
110n/a
2818.00x
460262.31x
5115601.92x
84563081.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.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.