What this calculator does
A triangular number is what you get by stacking dots into a triangle: 1 dot, then a row of 2 under it, then a row of 3, and so on. Add up all the dots and you get the nth triangular number, T(n). The sequence runs 1, 3, 6, 10, 15, 21, 28… and it turns up anywhere something is being paired off or counted cumulatively, from handshake problems to scheduling round-robin tournaments.
The triangle number formula, T(n) = n(n+1)/2, is a shortcut for adding up every whole number from 1 to n without actually doing the addition. This calculator works in either direction: give it n and it returns T(n), or give it a number and it tells you whether that number is triangular, and which two triangular numbers it sits between if not.
The formula
To find T(n), multiply n by (n+1) and divide by 2. To check whether a number x is triangular, solve the formula backwards: n = (√(8x+1) − 1) / 2. If that comes out to a whole number, x is triangular and that whole number is its position in the sequence; if not, the calculator rounds down to show the nearest triangular number either side.
| Term | Meaning |
|---|---|
| T(n) | The nth triangular number: the sum of every whole number from 1 to n. |
| n | The position in the sequence, a positive whole number. |
| x | A number being tested for whether it is triangular. |
The inputs explained
| Field | What to enter |
|---|---|
| What to find | Choose whether you want to calculate T(n) from a position n, or check a specific number. |
| n | The position in the sequence, used when finding T(n). |
| Number to check | The number to test, used when checking whether it is triangular. |
When to use it
Round-robin scheduling
In a round-robin tournament of n teams, the total number of matches needed for every team to play every other team once is the (n−1)th triangular number, since each new team added plays one more game than the last.
Handshake and pairing problems
The number of handshakes in a room of n people, or the number of unique pairs that can be formed from n items, is the (n−1)th triangular number: each person shakes hands with everyone who arrived before them.
Spotting a pattern in a sequence
If a sequence of totals looks like it is growing by one more each time (1, 3, 6, 10…), checking whether a term is triangular confirms whether it follows this well-known pattern rather than a coincidence.
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
What are the first ten triangular numbers?
The triangular numbers grow by one more than the previous gap each time.
Is a given number triangular?
Not every number is triangular; here are a few checked against the formula.
Questions
What is the formula for a triangular number?
T(n) = n(n+1)/2, where n is a positive whole number. It comes from pairing the sequence 1+2+…+n with itself reversed, which turns every pair into (n+1), repeated n times, then halved.
How do I check if a number is triangular?
Solve n = (√(8x+1) − 1)/2 for your number x. If n comes out as a whole number, x is triangular; if it has a decimal part, it sits between the two triangular numbers either side of it.
Are triangular numbers the same as an arithmetic sequence?
A triangular number is the running total (the sum) of the arithmetic sequence 1, 2, 3, 4… up to n, rather than a term of that sequence itself. The arithmetic sequence gives you each step; the triangular number gives you the accumulated total after n steps.
What is the 100th triangular number?
T(100) = 100 × 101 ÷ 2 = 5,050, a figure often mentioned alongside the story of a young Gauss summing 1 to 100 quickly by spotting this exact pairing trick.
For a running total of a general arithmetic sequence rather than the fixed 1,2,3… case, see the arithmetic sequence calculator.