terican

Last verified · v1.0

Calculator · math

Triangular Numbers Calculator

Compute the nth triangular number using T(n) = n(n+1)/2, verify if any integer is triangular, or find a triangular number's index — fast and accurate.

FreeInstantNo signupOpen source

Inputs

Result

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Result

The formula

How the
result is
computed.

What Are Triangular Numbers?

A triangular number is a positive integer that represents the total count of dots arranged in an equilateral triangle with n rows, where each row k contains exactly k dots. The sequence begins 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, and grows indefinitely. Each term equals the sum of all consecutive integers from 1 through n, making triangular numbers a foundational concept in combinatorics, number theory, and geometric pattern recognition, as defined in the Everyday Mathematics Glossary published by the University of Chicago.

The Triangular Number Formula

The nth triangular number, written T(n), is computed using:

T(n) = n(n + 1) / 2

For n = 5: T(5) = 5 × 6 / 2 = 15. For n = 12: T(12) = 12 × 13 / 2 = 78. For n = 100: T(100) = 100 × 101 / 2 = 5,050. The formula applies to any non-negative integer, with T(0) = 0 by convention.

Deriving the Formula

The derivation uses Carl Friedrich Gauss's pairing method for arithmetic series. Write S = 1 + 2 + 3 + ... + n, then write the identical sum reversed: S = n + (n-1) + ... + 1. Adding both lines produces 2S = n identical pairs each summing to (n+1), giving S = n(n+1)/2. No calculus is required — only the symmetry of addition. This approach is documented in the FMCC Going Deeper: Number Patterns resource and its pedagogical significance for students is analyzed by Abramovich, Fujii, and Wilson at the University of Georgia.

Calculator Modes

  • Find T(n): Enter a position n to compute the nth triangular number directly using n(n+1)/2.
  • Test if triangular: Enter any positive integer m. The calculator evaluates whether 8m + 1 is a perfect square; if so, m is a triangular number.
  • Find index: Given a known triangular number m, the calculator solves n = (-1 + sqrt(1 + 8m)) / 2 to return its position in the sequence.
  • Sum mode: Computes the cumulative sum of all triangular numbers from T(1) through T(n), producing the tetrahedral number n(n+1)(n+2)/6.

Testing Whether a Number Is Triangular

To verify that a positive integer m belongs to the triangular sequence, apply the perfect square discriminant test: compute 8m + 1 and check whether the result has an integer square root. If it does, m is triangular. Example — m = 55: 8 × 55 + 1 = 441 = 21², confirming T(10) = 55. Example — m = 50: 8 × 50 + 1 = 401, which has no integer square root, so 50 is not triangular. This test inverts the quadratic T(n) = m by applying the quadratic formula to n² + n - 2m = 0.

Real-World Applications

  • Bowling: Standard 10-pin bowling uses T(4) = 10 pins arranged in a four-row triangular formation.
  • Handshake problem: Among n people, the number of unique handshakes equals T(n-1) = n(n-1)/2, a direct combinatorial identity.
  • Pascal's triangle: Triangular numbers occupy the third diagonal of Pascal's triangle, where T(n) = C(n+1, 2).
  • Stacking objects: Layers of stacked spheres or cans in triangular grids produce triangular numbers at each horizontal level.
  • Square numbers: Every perfect square satisfies n² = T(n-1) + T(n), the sum of two adjacent triangular numbers. For example, 36 = T(7) + T(8) = 28 + 36 — wait, 36 = T(7) + T(8) = 28 + 8... let me correct: 16 = T(3) + T(4) = 6 + 10.

Sum of Triangular Numbers and Tetrahedral Numbers

The sum of the first n triangular numbers equals the tetrahedral number:

T(1) + T(2) + ... + T(n) = n(n+1)(n+2) / 6

For n = 5: 1 + 3 + 6 + 10 + 15 = 35 = 5 × 6 × 7 / 6 = 35. For n = 6: 1 + 3 + 6 + 10 + 15 + 21 = 56 = 6 × 7 × 8 / 6 = 56. Tetrahedral numbers represent spheres stacked in pyramid form and equal the binomial coefficient C(n+2, 3). Their connection to Diophantine equations and Pell's equation is explored in Problems Leading to Pell's Equation from the University of Kentucky Mathematics Department.

Reference

Frequently asked questions

What is a triangular number?
A triangular number is a positive integer that equals the sum of all whole numbers from 1 to n, and can be visually arranged as dots in an equilateral triangle. The sequence begins 1, 3, 6, 10, 15, 21, 28, 36. For example, T(4) = 10 because 1+2+3+4 = 10, forming a triangle with rows of 1, 2, 3, and 4 dots. These numbers appear throughout combinatorics, number theory, and geometric pattern analysis.
How do you calculate the nth triangular number using the formula?
Apply the formula T(n) = n(n+1)/2: multiply n by (n+1), then divide by 2. For the 9th triangular number: T(9) = 9 × 10 / 2 = 45. For T(20): 20 × 21 / 2 = 210. For T(50): 50 × 51 / 2 = 1,275. This formula eliminates the need to add every integer individually, making it practical for any value of n, including very large ones.
How do you check if a number is a triangular number?
Compute 8m + 1 and test whether the result is a perfect square. If sqrt(8m + 1) is a whole number, then m is triangular. For m = 36: 8 × 36 + 1 = 289 = 17², so 36 is triangular (T(8) = 36). For m = 40: 8 × 40 + 1 = 321, which has no integer square root, so 40 is not triangular. This test comes from inverting the quadratic equation n(n+1)/2 = m using the quadratic formula.
What are real-world examples of triangular numbers?
Triangular numbers appear across many everyday situations. Ten-pin bowling uses T(4) = 10 pins set in a triangular rack. Among n people, the number of unique handshakes equals T(n-1) = n(n-1)/2; 10 people generate T(9) = 45 handshakes. Stacking cans or oranges in triangular layers produces triangular counts per layer. In Pascal's triangle, triangular numbers run along the third diagonal. The number of diagonals in a convex polygon with n+2 sides also involves triangular numbers.
What is the sum of the first n triangular numbers?
The sum of the first n triangular numbers equals n(n+1)(n+2)/6, which generates the tetrahedral number sequence: 1, 4, 10, 20, 35, 56, 84. For n = 4: 1+3+6+10 = 20 = 4×5×6/6 = 20. For n = 6: 1+3+6+10+15+21 = 56 = 6×7×8/6 = 56. Tetrahedral numbers also equal the binomial coefficient C(n+2, 3) and describe the number of spheres in a tetrahedral stacking arrangement.
How are triangular numbers related to square numbers and Pascal's triangle?
Every perfect square equals the sum of two consecutive triangular numbers: n² = T(n-1) + T(n). For example, 25 = T(4) + T(5) = 10 + 15, and 49 = T(6) + T(7) = 21 + 28. In Pascal's triangle, triangular numbers appear along the third diagonal and equal the binomial coefficient C(n+1, 2). Every hexagonal number H(n) = T(2n-1), so all hexagonal numbers are also triangular, revealing deep structural links across figurate number families.