Triangular Numbers Calculator
- Figurate numbers: an introduction
- What are triangular numbers?
- How to find triangular numbers?
- Proofs for the triangular numbers formula
- Properties of the triangular numbers
- Do triangular numbers have applications?
- How to use our triangular numbers calculator?
- The triangular numbers sequence
- I know how to find triangular numbers; now what?
You've already heard of square numbers: now get ready for triangular numbers with our triangular numbers calculator!
Keep reading and you will find everything you need (and don't need) to know about triangular numbers. This field of math is rich in conjectures and open problems: we hope this calculator will stimulate your curiosity!
Here you will learn:
- What figurate numbers are;
- What triangular numbers are;
- How to calculate and build the triangular numbers;
- The most important properties of triangular numbers;
- A list of triangular numbers; and
- Much more!
Figurate numbers: an introduction
, , , ... These are the first square numbers. Why "square"? Because you can arrange them in a square shape. If you think of each unit as a dot, the image becomes immediately clear:
Squares are not the only shapes in which you can arrange specific numbers of "dots". Since the time of ancient Greeks, mathematicians have developed a passion for two categories of such numbers:
- Figurate numbers, which you can arrange in any shape (with any dimensions);
- Polygonal numbers, which fit into regular polygons.
Polygonal numbers are a subset of figurate numbers and the more interesting of the two types.
What are triangular numbers?
Triangular numbers are numbers you can arrange in the shape of an equilateral triangle. Note that we are not "measuring" the sides as much as we are counting them.
Which numbers can we pack in a triangle? Let's start with the most trivial triangular number, . The next one would be... . Surprised?
How did we build the second triangular number? Imagine working with "dots".
- We started from the previous triangular number, ; and
- We added a row of dots, enough to create sides of equal length.
In this case, it sufficed to add two dots at the bottom. The remaining sides would use a single dot of this new row and the previous vertex.
We can go on and build the next one too. The steps are the same: add a row, as long as you need to make it composed of the same number of dots that will be on the tilted sides after the addition.
From , we add other three dots at the bottom. The sides, composed initially of two dots, now count, accordingly, .
The geometrical construction of triangular numbers is pretty straightforward. To find the numbers themselves, simply count the dots in each triangle: , , , and so on.
Can you list the first 5 triangular numbers?
They are: , , , , and .
Do you see a pattern?
How to find triangular numbers?
You can keep on adding dots and counting to find all the triangular numbers you want, or you can look for a relationship that would easily give you the same result.
Let's introduce the triangular numbers formula:
The last equality introduces the binomial coefficient, an essential operation in combinatorics. It is definitely not a fraction, and you can see its definition in the equality before.
The binomial coefficient counts the number of subsets of size you can build starting from elements.
🙋 The series we sum to generate the triangular number closely resembles the factorial function, apart from the fact that we sum instead of multiply. Donald Knuth, the legendary computer scientist, proposed the name termial (from "terms" instead of factors) and the notation .
Proofs for the triangular numbers formula
We can prove the formula for triangular numbers in two different ways:
- A graphical proof; and
- An induction proof.
Take the construction of any triangular number, and rotate it on one side. Now duplicate, flip, and arrange it to create a rectangle (maintaining the spacing between dots).
We showed you how to do it in the image above. Now, let's count what's going on there. The triangle has a side (, in this case), which is also the value of one of the rectangle's sides. The rectangle's other side is equal to : this is the best way we can pack them!
Now, let's calculate the "area" of the rectangle, which is the number of dots it contains.
We also know that the "area" of the triangle is half the one of the rectangle, thus:
The result corresponds to the one you met before — there are dots in the triangle!
The induction proof of the formula for the triangular numbers is slightly more abstract. Luckily, the trivial case gives us the first step on the ladder. We need to prove that if the relation:
is true for , then it is true also for .
We expand the formula above and proceed from there:
This is the same relationship we assumed to be true before, but for the value :
Induction works, and we got our proof!
Properties of the triangular numbers
As for many seemingly unimpressive concepts in math, triangular numbers are a treasure trove of properties and relations. Let's check some of them out!
First: triangular numbers and square numbers are intimately connected. Take any pair of adjacent triangular numbers and sum them: you'll obtain a square number. How?
First, look at the graphic representation:
Easy peasy: it's just a matter of tilting and fitting. What about taking a look at the formula? Let's consider the triangular numbers and , as per the example above.
That is the size of a square number.
Triangular numbers are also related to the hexagonal numbers, and since hexagon. Starting from , alternating triangular numbers are hexagonal numbers: , , , , and so on., we expected it. Hexagonal numbers are numbers you can arrange in the shape of the perimeter of a regular
Let's go on! There is a relationship between triangular numbers and Mersenne primes, a particular type of prime number in the form . In particular, every even perfect number is a triangular number, and we find them by calculating the triangular number associated with the Mersenne prime :
The last equality comes from the definition of Mersenne primes: .
The sequence grows rapidly: the numbers that satisfy this rule are , , , , , ...
We are not commenting on this, just appreciating!
More? Take a triangular number , and consider it with its four adjacent numbers, two on each "side":
Let's sum them:
This result is always true!
Do triangular numbers have applications?
Even if triangular numbers look so abstract, they find some applications. If you have a fully connected network with nodes, then the number of connections is :
- for a single node, and ;
- for two nodes, and ;
- for , ;
- for , .
🙋 This result is also a solution to the handshake problem: how many handshakes will be in a party with guests? With a bit of order, we can assume that the first guest shakes hands, the second , and so on, till the most introverted of them, which never initiates a handshake.
How to use our triangular numbers calculator?
You can use our triangular numbers calculator in various ways:
- To build a triangular number;
- To find the triangular number from the value of ; or
- To find a specific portion of the sequence of triangular numbers.
If you choose the first option,
build, you will see a graphical representation of the triangular number (if you inserted a valid number), and you will be able to download a CSV-ready text file with the number. Maybe you want to play with it!
If you choose
generate, simply insert a non-negative integer. We will return the value of the corresponding triangular number.
Our triangular numbers calculator's last option is the
range one. Select it, then choose a starting and ending value. We will print the range of numbers (if it isn't too long) and give you a link to download it.
The triangular numbers sequence
The on-line encyclopedia of integer sequences, a gold mine for any mathematics enthusiast, lists the triangular number sequence as A000217. On theof the project, you can find the list of the first triangular numbers. We report it here, partially:
I know how to find triangular numbers; now what?
Our triangular number calculator guided you in this brief exploration of a relatively obscure field of math. You can keep this knowledge and use it to show off at parties, expand it, or play a little with it.
What are the first triangular numbers?
Here is a list of triangular numbers:
91. To generate them, you can use the formula for the triangular numbers:
Tₙ = n × (n+1)/2.
0 to be a triangular number because it satisfies this relation (and many other properties of triangular numbers), but together with
1 is a trivial case.