Octagonal Pyramidal Number Calculator

Count a stack of octagonal layers with n times n plus one times two n minus one over two.

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

What it does

Octagonal pyramidal numbers count a stack built from octagonal layers. The nth term is the sum of the first n octagonal numbers. The sequence begins 1, 9, 30, 70, 135 and 231, and it follows a cubic rule with a single division by two.

The octagonal pyramid is the next member of the polygonal pyramid family after heptagons. As the number of sides rises, the coefficient in the formula changes, but the general cubic shape remains the same.

The closed form is n times n plus one times two n minus one, divided by two. This family is conventionally indexed from one, so the tool rejects zero rather than inventing a value for it.

This page evaluates the product with exact integer arithmetic and shows the previous term and ratio beside the answer. It gives counts only, not a drawing of the stack.

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 1 to 100,000.
  2. Read the octagonal 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 231.
  6. Compare with heptagonal pyramidal numbers at the same count.

Formula

P(n) = n(n + 1)(2n - 1) / 2
n
The number of octagonal layers, starting at one.
P(n)
The total number of points in the stack.

The formula comes from summing k times three k minus two for k from one to n. It simplifies to n times n plus one times two n minus one over two. The value at n = 1 is one, matching the first octagonal number.

Worked example

Example: eight layers

The page opens with n = 8.

  1. Compute n plus one: 9.
  2. Compute two n minus one: 16 - 1 = 15.
  3. Multiply the three factors: 8 x 9 x 15 = 1080.
  4. Divide by two: 1080 / 2 = 540.
  5. The tool reports 540, previous term 364, and growth 1.48x.
  6. Check the previous value: 7 x 8 x 13 / 2 = 364.

Reference table

Octagonal pyramidal numbers
nP(n)PreviousGrowth
11n/an/a
2919.00x
33093.33x
470302.33x
5135701.93x
85403641.48x

Limits

  • The index starts at one, so zero is rejected.
  • Layer counts above 100,000 are rejected to keep the output readable.
  • The growth column is rounded to two decimals.
  • The tool gives counts, not drawings of the stack.

Common mistakes

  • Starting the index at zero and expecting a value there.
  • Using two n minus two instead of two n minus one.
  • Forgetting the division by two.
  • Using the octagonal number rather than the pyramidal sum.
  • Expecting quadratic growth from a cubic formula.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is P(8)?

P(8) = 8 x 9 x 15 / 2 = 540.

What is P(5)?

P(5) = 5 x 6 x 9 / 2 = 135.

What is P(2)?

P(2) = 2 x 3 x 3 / 2 = 9.

Questions

How is this stack built?

Each layer is an ordinary octagonal number.

Why does indexing start at one?

That is the standard convention for this family, with the first value equal to one.

Is the division always exact?

Yes, and the tool checks it before returning a value.

What is the growth rate?

Cubic, from three linear factors.

Are values exact?

Yes. Integer arithmetic is used.

What layer count is accepted?

One 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.