Octahedral Number Calculator

Count spheres in an octahedral stack from n times two n squared plus one, divided by three.

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

What it does

An octahedral number counts the spheres in a complete octahedral arrangement, with one sphere at the centre and successive shells around it. The sequence begins 0, 1, 6, 19, 44 and 85. It is the three dimensional counterpart of the centred square numbers.

The octahedron has eight faces, which gives the family its name. Counting the shells leads to the formula n times two n squared plus one, divided by three. The division is always exact for whole n, and the tool checks this before returning a value.

Because the formula is cubic, these numbers grow much faster than polygonal numbers. Doubling the side length multiplies the count by roughly eight. The ratio of consecutive terms tends to one only slowly compared with a quadratic family.

This page evaluates the formula with exact integer arithmetic and reports the previous count and ratio beside it. It does not draw the solid, only counts the spheres it would contain.

The side limit is one hundred thousand, which produces a value with about sixteen digits, printed in full.

How to use

  1. Enter a side length n from 0 to 100,000.
  2. Read the octahedral count in the main result box.
  3. Check the previous count and growth beside it.
  4. The default side 5 reproduces the worked example.
  5. Try n = 4 to confirm the value 44.
  6. Compare with tetrahedral numbers to see a different solid family.

Formula

O(n) = n x (2n^2 + 1) / 3
n
The side length of the octahedral stack.
O(n)
The number of spheres in the stack.

The octahedral number is also the sum of two consecutive square pyramidal numbers. The numerator n times two n squared plus one is always divisible by three, so the result is an integer for every n. The value at n = 0 is zero and at n = 1 is one.

Worked example

Example: side 5

The page opens with n = 5.

  1. Compute n squared: 5 x 5 = 25.
  2. Double it: 50, then add one to get 51.
  3. Multiply by n: 5 x 51 = 255.
  4. Divide by three: 255 / 3 = 85.
  5. The tool reports 85, previous count 44, and growth 1.93x.
  6. Check the previous value: 4 x (32 + 1) / 3 = 44.

Reference table

Octahedral numbers for small stacks
nO(n)PreviousGrowth
00n/an/a
110n/a
2616.00x
31963.17x
444192.32x
585441.93x

Limits

  • Inputs above 100,000 are rejected to keep the printed value manageable.
  • The growth column is rounded to two decimals.
  • The tool counts spheres but does not draw the arrangement.
  • Only the standard octahedral family starting at zero is used.

Common mistakes

  • Using octahedral numbers where octagonal numbers are meant.
  • Forgetting to divide by three.
  • Treating the growth as quadratic when it is cubic.
  • Rounding the division instead of checking exactness.
  • Counting only one pyramid instead of the full octahedron.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is the octahedral number for side 5?

5 x 51 / 3 = 85.

What is the value for side 4?

4 x 33 / 3 = 44.

How does the count scale when the side doubles?

Since the formula is cubic, the count grows by roughly a factor of eight.

Questions

What does this number count?

The spheres in a complete stack shaped like an octahedron.

Is the division always exact?

Yes, the numerator is divisible by three for every whole n, and the tool verifies it.

How is this related to square pyramidal numbers?

An octahedral number is the sum of two consecutive square pyramidal numbers.

How fast do they grow?

Cubically, much faster than polygonal numbers.

Are values exact?

Yes, arbitrary precision integer arithmetic is used.

What side lengths are accepted?

Whole numbers from 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.