Tetrahedral Number Calculator

Find any tetrahedral number Teₙ.

How it is calculated

The tool computes Te(n) = n × (n + 1) × (n + 2) ÷ 6, where n is the number of layers in the pyramid. Te(n) is a plain count, so it has no unit. The input is cut to a whole number, so 5.9 is treated as 5 and gives 35. Negative values and values above 200,000 return no result, and n = 0 gives 0. The three consecutive numbers always multiply to a multiple of 6, so the result is exact. The same value can be built by adding the triangular numbers 1, 3, 6, 10 and so on, one per layer.

Worked example

Take a pyramid of 10 layers. The three consecutive numbers are 10, 11 and 12. Multiply them: 10 × 11 = 110, and 110 × 12 = 1,320. Divide by 6: 1,320 ÷ 6 = 220. So 220 balls are needed. As a check, the triangular numbers 1 + 3 + 6 + 10 + 15 + 21 + 28 + 36 + 45 + 55 also add up to 220.

Try this example →

Common mistakes

  • Confusing tetrahedral numbers with triangular numbers. Triangular numbers count a flat triangle, tetrahedral numbers count a 3D stack.
  • Entering the number of balls instead of the number of layers. The input n is the layer count, and the ball count is the answer.
  • Typing a decimal and expecting rounding. The input is truncated, so 5.9 counts as 5 layers.
  • Using n(n+1)(n+2)/3 or leaving out the division by 6, which gives a result six times too large.
  • Counting the top ball as layer 0. The single top ball is layer 1, which gives Te(1) = 1.

About this calculator

The nth tetrahedral number Teₙ = n(n+1)(n+2)/6 counts the objects (like cannonballs or oranges) that can be stacked into a triangular pyramid n layers deep — it's the running sum of the first n triangular numbers (1, 3, 6, 10, …), the same way triangular numbers are the running sum of the first n integers.

These figurate numbers connect visual geometry to algebra and are a staple of combinatorics education for illustrating summation identities and Pascal's triangle relationships (Teₙ is the entry in the 4th diagonal of Pascal's triangle). They also appear in the classic “cannonball stacking” puzzles studied in recreational and number theory.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A handy way to size a real stack is to compare the answer with the full cube it would sit in: the pyramid holds roughly a sixth of n cubed once n is large, so 100 layers is near 171,700 against a million. Remember that the layers here are the stack's height, and the count assumes a perfect triangular base. What are you stacking, or counting, when you reach for this one?

Popular calculators

All Calculators