🧮
🧮 Math & statistics

Triangular Numbers Calculator (n-th triangular number & triangular test)

Results update as you type.

Your numbers

Understanding the triangular numbers calculator — concept and principle

This calculator gives the n-th triangular number, the previous one, the square they add up to, and tests whether any whole number is triangular, giving its position or the nearest triangular numbers. Use it for number patterns, puzzles, counting handshakes or bowling pins, and maths competitions.

Triangular number T10Rows of 1, 2, 3, … 10 dotsT₁₀ = 5510 × 11 ÷ 2T₉ = 45 → 45 + 55 = 10²5050 is triangularT₁₀₀(√(8·5050 + 1) − 1) ÷ 2 = (201 − 1) ÷ 2 = 100
Stacking 1 + 2 + … + 10 dots gives a triangle of 55; two copies make a 10 × 11 rectangle.

How it is calculated

The test uses exact whole-number arithmetic up to 10¹⁵.

The principle

Triangular numbers count dots arranged in a triangle with 1, 2, 3, … dots per row. Two copies of the triangle, one turned upside down, fit together into an n × (n + 1) rectangle, so twice the sum is n(n + 1). That is the trick often credited to a young Carl Friedrich Gauss adding 1 to 100. Two neighbouring triangles form a square, which is why Tₙ + Tₙ₋₁ = n². Solving x = k(k + 1)/2 for k with the quadratic formula gives the test with 8x + 1.

Worked example

Default inputs: n = 10, test number 5,050.

  1. T₁₀ = 10 × 11 ÷ 2 = 55.
  2. T₉ = 45, and 55 + 45 = 100 = 10².
  3. Test 5,050: 8 × 5,050 + 1 = 40,401 = 201².
  4. k = (201 − 1) ÷ 2 = 100, so 5,050 = T₁₀₀: yes, it is triangular.

How to read the result

Tₙ answers questions like "how many handshakes among n + 1 people?" (each pair shakes once: Tₙ) or "how many pins in a triangle with 4 rows?" (T₄ = 10). For the test, a "no" comes with the triangular numbers on either side, which shows how close the number is.

Common mistakes

Keep in mind: Very large inputs above 10¹⁵ are outside the exact-arithmetic range, so the test is not performed for them.

Frequently asked questions

What are the first triangular numbers?

1, 3, 6, 10, 15, 21, 28, 36, 45, 55.

What is the sum of 1 to 100?

T₁₀₀ = 100 × 101 ÷ 2 = 5,050.

Can a triangular number also be a square?

Yes, for example 1, 36 and 1,225. There are infinitely many.

Sources: Weisstein, E. W., "Triangular Number", Wolfram MathWorld

Checked 9 Nov 2026. Weisstein, E. W., “Triangular Number”, Wolfram MathWorld (Tₙ = n(n + 1)/2, eq. 2; an integer k is triangular iff 8k + 1 is a square; (2n + 1)² = 8Tₙ + 1, eq. 9).

🧮 All math & statistics tools →🌍 Calculators by country →