Tetrahedral Number Calculator
This tetrahedral number calculator works out the nth tetrahedral number, the count of spheres you could stack into a solid triangular pyramid with n layers, like a pile of cannonballs or oranges built up in a tetrahedron shape. You enter the index n, any whole number from 1 to 1,000,000, and the calculator instantly returns three figures: the tetrahedral number itself, Te(n), the next tetrahedral number in the sequence, and the triangular base number T(n), the count of spheres in just the bottom layer of the pyramid. The underlying formula is Te(n) equals n times (n plus 1) times (n plus 2), divided by 6, and because each tetrahedral number is simply the running total of the triangular numbers up to that layer, the sequence climbs quickly: 1, 4, 10, 20, 35 and onward. This makes the tool handy for students and teachers working through figurate numbers, for programmers checking combinatorial formulas, and for anyone curious about the maths behind stacked-sphere puzzles. Type in your index number and the result updates straight away, with large results grouped using commas for easy reading. Because tetrahedral numbers also form the third diagonal of Pascal’s triangle, the calculator doubles as a quick way to check that relationship. A worked example, the formula, and background on how tetrahedral numbers relate to triangular numbers are set out further down the page.
The formula
The nth tetrahedral number is Te(n) = n(n + 1)(n + 2) / 6. It is the sum of the first n triangular numbers, and the sequence begins 1, 4, 10, 20, 35.
Worked example
For n = 4, Te(4) = 4 times 5 times 6 divided by 6 = 120 / 6 = 20. Enter 4 to confirm.
Frequently asked questions
What is a tetrahedral number?
The number of items in a triangular pyramid of n layers, n(n+1)(n+2)/6, like stacked cannonballs.
How do they relate to triangular numbers?
Each tetrahedral number is the running total of the triangular numbers up to that layer.
Where do they appear in Pascal’s triangle?
Along the third diagonal, as the values C(n+2, 3).
Who this calculator is for
This calculator is for students, programmers and anyone exploring number theory.
What this calculator assumes
- You enter a whole number within the stated range.
- The exact integer algorithm is used.
- Very large results are shown grouped for readability.
Formula and sources
Related calculators
- Prime Factorization Calculator: break a number into prime factors.
- LCM Calculator: lowest common multiple.
- GCF Calculator: greatest common factor.