Triangular Numbers Calculator

Calculate triangular numbers — enter your values and get an accurate result with the underlying formula.

Quick Facts

nth triangular number
Tn = n(n + 1) / 2
Sum of every whole number from 1 to n.
Recurrence relation
Tn = Tn-1 + n, with T0 = 0
Each term adds the next counting number to the previous term.
Triangularity test
x is triangular iff 8x + 1 is a perfect square
Solve n = (sqrt(8x+1) - 1) / 2 and check that n is a whole number.

Your Results

Calculated
nth Triangular Number
-
Tn = n(n+1) / 2
Sum of First n Triangular Numbers
-
Tetrahedral number: n(n+1)(n+2) / 6
Triangularity Check
-
Is the entered value a triangular number?
Sequence Preview
-
First terms of the triangular number sequence

Ready

Enter a term number n and press Calculate.

How the Triangular Numbers Calculator Works

A triangular number counts the dots that form an equilateral triangle: 1 dot, then a row of 2 beneath it, then a row of 3, and so on. The nth triangular number, written Tn, is the sum of every whole number from 1 to n: 1 + 2 + 3 + ... + n. Gauss's classic trick — pairing the first and last terms — gives the closed-form formula Tn = n(n + 1) / 2, so you never have to add the terms one at a time.

Formula and derivation

Write the sum forwards and backwards, then add the two rows together: (1+2+...+n) + (n+...+2+1) forms n pairs, each summing to (n+1), for a total of n(n+1). Dividing by 2 (because you added the sum to itself) gives Tn = n(n+1)/2. This calculator also finds the tetrahedral number — the sum of the first n triangular numbers — using the related closed form n(n+1)(n+2)/6, and tests whether an arbitrary value is a triangular number by checking whether 8x+1 is a perfect square, derived by solving n² + n − 2x = 0 with the quadratic formula.

Reading the sequence and the triangularity test

Enter n to get Tn directly, along with a preview of the sequence T₁, T₂, T₃, ... up to the length you choose. To check whether some other number is triangular, enter it in the third field: the calculator solves n = (√(8x+1) − 1) / 2 and reports the matching index only when that value works out to a non-negative whole number.

Common mistakes

  • Starting the sequence at the wrong term: by convention T₀ = 0 and T₁ = 1 — the first "row" already contains a single dot.
  • Confusing triangular numbers with square numbers: Tn grows roughly like n²/2, not n² — for example, T₅ = 15, not 25.
  • Assuming every number is triangular: most integers are not; only values where 8x+1 is a perfect square qualify (1, 3, 6, 10, 15, 21, 28, ...).

Real-world applications

  • Counting handshakes or round-robin matchups among n people or teams: the number of unique pairings equals Tn-1, the same as the combination C(n, 2).
  • Stacking problems, such as cannonball piles, bowling pins (T₄ = 10), or a rack of pool balls (T₅ = 15) arranged in a triangle.
  • Combinatorics: Tn equals the binomial coefficient C(n+1, 2), the number of ways to choose 2 items from n+1.
  • Computer science: triangular numbers describe the comparison count in simple nested loops and the edge count of a complete graph.

Frequently Asked Questions

What is the formula for the nth triangular number?
Tn = n(n+1)/2, the sum of all whole numbers from 1 through n. For example, T₆ = 6 × 7 / 2 = 21.
How do I check if a number is a triangular number?
Compute 8x+1. If the result is a perfect square, x is triangular, and its position is n = (√(8x+1) − 1)/2. For example, 8 × 45 + 1 = 361 = 19², so n = (19 − 1)/2 = 9, meaning 45 = T₉.
What is a tetrahedral number and how does it relate to triangular numbers?
A tetrahedral number is the sum of the first n triangular numbers: T₁+T₂+...+Tn = n(n+1)(n+2)/6. It counts objects stacked into a triangular pyramid instead of a flat triangle.
How are triangular numbers connected to combinations?
Tn equals the binomial coefficient C(n+1, 2) — the number of ways to choose 2 items from a set of n+1 — which is also why triangular numbers count the unique pairings among n+1 people or objects.