Triangular Numbers Calculator

Find the nth triangular number, check whether any number is triangular, or generate a sequence of triangular numbers instantly.

Choose a mode, enter your value, and get instant results with step-by-step explanations.

Triangular Numbers Calculator
Find the nth triangular number, check whether any number is triangular, or generate a sequence of triangular numbers instantly.

About the Triangular Numbers Calculator

Triangular numbers are a fascinating sequence in mathematics that represent the total number of dots needed to fill an equilateral triangle of a given size. The first few triangular numbers are 1, 3, 6, 10, 15, 21, 28, 36, 45, and 55. Each term is obtained by adding the next natural number to the previous triangular number: 1, 1+2=3, 3+3=6, 6+4=10, and so on. The formula for the nth triangular number is T(n) = n(n+1)/2. This elegant expression is equivalent to summing all integers from 1 to n. The result is always a whole number because one of the two consecutive integers n and n+1 is always even, making their product divisible by 2. The formula can be verified visually: if you arrange n rows of dots in a triangle, the top row has 1 dot, the second has 2, the third has 3, and so on up to n dots in the bottom row. The total is 1 + 2 + 3 + … + n = n(n+1)/2. Triangular numbers have several remarkable mathematical properties. The sum of two consecutive triangular numbers T(n) + T(n+1) always equals a perfect square: specifically (n+1)². For example, T(4) + T(5) = 10 + 15 = 25 = 5². This identity reveals a deep geometric relationship between triangular and square numbers. Similarly, eight times any triangular number plus one is always a perfect square: 8T(n) + 1 = (2n+1)². These properties are widely used in number theory proofs and recreational mathematics. Checking whether a given number x is triangular involves solving T(n) = n(n+1)/2 = x for a positive integer n. Rearranging gives n² + n − 2x = 0, which by the quadratic formula yields n = (−1 + √(1+8x)) / 2. If this value is a positive integer, x is triangular; otherwise it is not. Triangular numbers appear in many practical contexts. In combinatorics, the number of handshakes among n+1 people equals T(n). In programming, triangular numbers count iterations in nested loops: the number of comparisons in a simple sort of n items is T(n−1). Pascal's triangle contains triangular numbers in its third diagonal. In physics, triangular numbers arise in the study of closed-shell electron configurations and molecular orbital theory. Their blend of simplicity and depth makes them an excellent entry point into number theory and combinatorics.

Triangular Number Examples

Examples demonstrating all three calculation modes with step-by-step results.

InputResultExplanation
Find Nth: n = 7T(7) = 28T(7) = 7 × 8 / 2 = 28. The 7th triangular number counts the dots in a 7-row triangle.
Check: 36Triangular: T(8) = 36n = (−1 + √(1 + 8×36)) / 2 = (−1 + √289) / 2 = (−1 + 17) / 2 = 8. Integer, so triangular.
Check: 20Not triangularn = (−1 + √161) / 2 ≈ 5.84. Not an integer, so 20 is not a triangular number.
Generate: first 5 terms1, 3, 6, 10, 15T(1)=1, T(2)=3, T(3)=6, T(4)=10, T(5)=15. Each term adds the next integer.

How to Use the Triangular Numbers Calculator

  1. Select a mode: "Find Nth Triangular Number" to compute a specific term, "Check If Number Is Triangular" to test any integer, or "Generate Sequence" to list multiple terms.
  2. Enter a positive integer in the input field: the position n for the first two modes, or the count of terms to generate.
  3. Click "Calculate". The result appears instantly with an explanation showing the formula applied.
  4. For the sequence mode, all triangular numbers from T(1) to T(n) are listed in order.
  5. Click "Reset" to clear the field and switch modes or enter a new value.

Triangular Numbers FAQ

What is a triangular number?
A triangular number is a number that can be represented as an equilateral triangular arrangement of dots. The nth triangular number equals the sum of all integers from 1 to n: T(n) = n(n+1)/2. The sequence begins 1, 3, 6, 10, 15, 21…
What is the formula for the nth triangular number?
The formula is T(n) = n(n+1)/2. To find, say, the 10th triangular number: T(10) = 10 × 11 / 2 = 55. The formula works because summing the integers 1 through n produces n(n+1)/2, as Gauss famously demonstrated.
How do I check if a number is triangular?
Solve n(n+1)/2 = x for n using the quadratic formula: n = (−1 + √(1+8x)) / 2. If n is a positive integer, x is triangular. For example, for x = 21: n = (−1 + √169) / 2 = (−1 + 13) / 2 = 6. Since 6 is a positive integer, 21 is triangular (T(6) = 21).
Are there any special properties of triangular numbers?
Yes. Two consecutive triangular numbers always sum to a perfect square: T(n) + T(n+1) = (n+1)². Also, 8T(n) + 1 is always a perfect square: 8T(n) + 1 = (2n+1)². Every perfect square is the sum of two consecutive triangular numbers, and every triangular number is a binomial coefficient C(n+1, 2).
Where do triangular numbers appear in everyday life?
Triangular numbers appear in bowling (T(4) = 10 pins), billiard racks (T(5) = 15 balls), and coin stacking. In combinatorics, T(n) equals the number of handshakes among n+1 people. In programming, they count the comparisons in a simple nested loop over n items.
Is zero considered a triangular number?
In many definitions, T(0) = 0(0+1)/2 = 0 is included as a degenerate triangular number. However, in most practical and educational contexts the sequence starts at T(1) = 1. This calculator starts from T(1) = 1 for the generate-sequence mode and treats only positive integers as valid input.