# What Are Triangular Numbers?

*I am a former maths teacher and owner of DoingMaths. I love writing about maths, its applications, and fun mathematical facts.*

## What Are Triangular Numbers?

The triangular numbers are a sequence of numbers created by arranging dots into equilateral triangles of increasing size. You can see from the diagram below that the first triangular number, 1, is formed from just one dot.

To get the second triangular number, 3, we add another row, this time containing two dots, underneath our original dot.

We then add a row of three dots to get the third triangular number 6.

We continue to do this, each time adding an extra row to the bottom of the triangle which contains one more dot than the previous row. This gives the sequence 1, 3, 6, 10, 15, 21, etc.

## Describing Triangular Numbers Algebraically

We have seen how to construct the sequence of triangular numbers using a pictorial method, but now let's try to formalise this mathematically. We can see from what we have done so far, that the difference between one triangular number and the next increases by one each time.

If we denote the first triangular number as T_{1}, the second as T_{2}, and so on so that the n^{th} triangular number is T_{n}, and furthermore define the zero-th triangular number as 0, we get that:

T_{0} = 0

T_{1} = T_{0} + 1 = 1

T_{2} = T_{1} + 2 = 3

T_{3} = T_{2} + 3 = 6

T_{4} = T_{3} + 4 = 10

and so on.

We therefore get that any triangular number is the sum of all of the positive integers up to and including its term number i.e. T_{n} = 1 + 2 + 3 + 4 + ... + n._{}

In sum notation, this can be expressed as in the following picture.

## How to Calculate the nth Triangular Number

We know that T_{n} = 1 + 2 + 3 + … + n.

If we rewrite T_{n} but with the sum in reverse we get that T_{n} = n + n−1 + n−2 + … + 2 + 1

Adding these two lines together we get that:

T_{n} + T_{n} = (n + 1) + (n − 1 + 2) + (n − 2 + 3) + … + (n + 1)

2T_{n} = (n + 1) + (n + 1) + (n + 1) + … + (n + 1)

As there are n terms in this series we then get:

2T_{n} = n × (n + 1)

T_{n} = n × (n + 1) / 2

Using this formula we can quickly calculate any term in the series.

E.g. T_{50} = 50 × 51 / 2 = 1275

T_{1000} = 1000 × 1001 / 2 = 500 500

## The Link Between the Triangular Numbers and the Square Numbers

Perhaps surprisingly, there is a very simple link between the triangular numbers and the square numbers. Firstly let's think about this pictorially.

If we align our triangles to the side, creating right-angled triangles instead of equilaterals, we can then take two consecutive triangles and by rotating one through 180°, put them together to make a square. This can be seen in the picture below where we have taken the 3rd triangular number (in red) and the 4th triangular number (in blue). By adding them together we get a square of size 4 × 4 = 16.

## Triangular and Square Numbers: The Algebra

We can see quite easily that this method can be applied to all of the triangular numbers we have seen so far and if we add together any consecutive triangular numbers, we do indeed get a square number.

For example; 1 + 3 = 4, 3 + 6 = 9, 6 + 10 = 16.

Furthermore, we can see that so far we are getting all of the square numbers 1 (equal to the first triangular number), 4, 9, 16, etc. without skipping any.

This can be shown algebraically by considering the formula we created earlier.

T_{n} + T_{n−1} = n × (n + 1) / 2 + (n − 1) × n / 2

= (n^{2} + n) / 2 + (n^{2} − n) / 2

= 2n^{2} / 2

= n^{2}

We have therefore shown that any consecutive triangular numbers must add together to create a square number and any square number n^{2} can be formed by adding together T_{n} and T_{n−1}.

## The Link Between Triangular Numbers and Cube Numbers - Nicomachus's Theorem

There is also a surprisingly simple link between the triangular numbers and the cube numbers. The square of the n^{th} triangular number is equal to the sum of the first n cube numbers.

Algebraically, this can be expressed as:

T_{n}^{2} = (1 + 2 + 3 + … + n)^{2} = 1^{3} + 2^{3} + 3^{3} + … + n^{3}.

This is known as Nichomachus's theorem, named after the ancient Greek mathematician Nichomachus of Gerasa.

## Practical Uses of the Triangular Numbers

Perhaps the most famous application of the triangular numbers is in the Handshake problem. If we have n people in a room, how many handshakes are needed so that each person had shaken hands with everybody else exactly once?

If there are only 2 people in a room, then 1 handshake takes place.

If there are 3 people in a room, then person a shakes hands with person b and person c, followed by person b and person c shaking hands for a total of 3 handshakes.

If there are 4 people in a room, it can be calculated fairly easily that 6 handshakes are needed.

This can be expanded to n people. With n people in a room, the first person would need to shake hands with everybody else in the room, making n − 1 handshakes featuring the first person. The second person needs to shake hands with everybody, but we have already counted his handshake with person 1, so they have a further n − 2 people to shake hands with.

By continuing this logic we can see that for n people, there will be (n − 1) + (n − 2) + … + 2 + 1 handshakes. As we have already seen, this is equal to T_{n−1}.

Therefore, regardless of how many people there are in the room, the number of handshakes required will always be a triangular number.

For further reading visit my article about the Handshake Problem.

The Handshake problem is also equivalent to calculating how many games need to be played in a round-robin group stage of a tournament where each team plays each other a single time. For example, in a group of 4 teams there would be 6 matches to play.

*This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.*

**© 2021 David**