Advertisement

Triangular numbers calculator

Choose whether to find the nth triangular number or to test a value. The calculator returns the term, its index and the neighbouring terms.

Calculator

A whole number from 0 to 100,000,000.

Triangular number
55
Index k
10
Result
T(10) = 55.

Advertisement

How this calculator works

Triangular numbers count objects arranged in equilateral triangles. The first row has one dot, the second adds two, the third adds three, so the nth triangular number is the sum 1 + 2 + ... + n. Instead of adding, the closed form n(n + 1)/2 gives the answer directly. To test a value, the calculator takes the largest index whose triangular number does not exceed it and compares exactly.

Formula

T(n) = n(n + 1)/2. A whole number v is triangular exactly when 8v + 1 is a perfect square, and then its index is (√(8v + 1) - 1)/2.

Worked example

T(10) = 10 × 11 / 2 = 55, so 55 is triangular. The number 56 is not: it lies between T(10) = 55 and T(11) = 66.

Advertisement

Frequently asked questions

Why is the formula n(n + 1)/2?

Pair the first number with the last, the second with the second last, and so on. Each pair totals n + 1, and there are n/2 pairs, giving n(n + 1)/2. When n is odd, one middle term is left unpaired but the formula still works.

Is every triangular number also a square?

No, but some are both. The numbers 1, 36, 1225 and 41616 are simultaneously triangular and square; they come from the square triangular numbers and grow very quickly.

What is the difference between triangular numbers and digital roots?

They are unrelated despite both being about digits and patterns. Triangular numbers count sums of consecutive integers; the digital root repeatedly adds a number's digits to one digit.

Can the index be zero?

Yes. T(0) = 0 is included by convention, so zero counts as the triangular number of index zero. Starting the count at one instead is a common textbook choice and changes only that first term.

Sources

Advertisement