Nth Triangular Number Generator

Enter an index n to get its triangular number.

Result

55
45
66

How it is calculated

The tool uses the closed form T(n) = n × (n + 1) ÷ 2, where n is the position in the sequence 0, 1, 3, 6, 10, 15 and so on, so T(0) = 0 and T(1) = 1. It also prints the neighbours: the previous value (n − 1) × n ÷ 2 (shown as 0 when n is 0) and the next value (n + 1) × (n + 2) ÷ 2. The index must be a whole number from 0 up to 134,217,726; fractions, negatives and larger values show no result. That upper limit keeps every printed digit exact, so results are whole numbers with thousands separators and are never rounded approximations.

Worked example

Enter n = 10. The tool computes 10 × 11 ÷ 2 = 110 ÷ 2 = 55, the tenth triangular number. The previous value is 9 × 10 ÷ 2 = 45 and the next is 11 × 12 ÷ 2 = 66. Check: 55 − 45 = 10 and 66 − 55 = 11, because each triangular number is the one before it plus its own index. Adding 1 + 2 + ... + 10 by hand also gives 55.

Try this example →

Common mistakes

  • Mixing up the index with the value. The number 10 is the fourth triangular number, so you enter n = 4 to get it; entering n = 10 gives 55.
  • Confusing a triangular number with a square or with n². T(10) is 55, not 100; T(n) is about half of n².
  • Entering a decimal index and expecting interpolation. The index must be a whole number, so 2.5 shows no result; enter 2 or 3.
  • Entering a negative index to mirror the sequence. The tool returns nothing for n below 0.
  • Checking whether a given number is triangular by typing it in as n. The field takes the position in the sequence, not the value, so to test 55 you must find the n that gives it.

About this calculator

A triangular number counts how many dots it takes to arrange objects into an equilateral triangle — 1, then 3, then 6, then 10 — and is given by the closed-form formula T(n) = n(n+1)/2, the same sum 1+2+3+...+n that a young Gauss is famously said to have shortcut by pairing the first and last terms. Triangular numbers show up throughout combinatorics (T(n) equals the number of ways to choose 2 items from n+1, and the number of unique handshakes among n+1 people) and recreational math (they're the numbers a bowling-pin or pool-ball rack naturally forms).

This calculator takes an index n and returns T(n) along with the previous and next triangular numbers in the sequence, so you can see the pattern around your chosen index. Students learning summation formulas and mathematical induction, puzzle and combinatorics enthusiasts, and programmers checking a closed-form result against a loop-based sum use it to quickly get or verify a triangular number without hand-summing a long series.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators