Triangular number
From Wikipedia, the free encyclopedia
A triangular number is a natural number such that the shape of an equilateral triangle can be formed by that number of points. Every triangular number can be written as the sum 1 + 2 + 3 + ... + n for some natural number n. The sequence of triangular numbers (sequence A000217 in OEIS) for n = 1, 2, 3... is:
1 | ![]() |
3 | ![]() |
6 | ![]() |
10 | ![]() |
15 | ![]() |
21 | ![]() |
Since each row is one unit longer than the previous row it can be seen that the nth triangular number is the sum of the first n consecutive natural numbers.
The formula for the nth triangular number is: ('Whereby ‘n’ is the row number, and the result is the number of points in the triangle.')
Or as the sum:
It is the binomial coefficient
counting the number of distinct pairs to be selected from n + 1 objects. In this form it solves the 'handshake problem': the number of handshakes if everyone in a room shakes hands with everyone else.
The sum of the n first triangular numbers is
. This is the nth tetrahedral number.
One of the most famous triangular numbers is 666, also known as the Number of the Beast. Every even perfect number is triangular, and no odd perfect numbers are known, hence all known perfect numbers are triangular.
The sum of two consecutive triangular numbers is a square number. This can be shown mathematically:
Alternatively, it can be demonstrated graphically:
16 | ![]() |
25 | ![]() |
In each of the above examples, a square is formed from two interlocking triangles. The previous formula of is easily derived with geometry. If the square's length is n, then its area is n2. Halving the area leaves only some triangles to include, which when counted are half of n. Adding the two numbers outputs the triangular number.
More generally, the difference between the nth m-gonal number and the nth (m+1)-gonal number is the (n-1)th triangular number. For example, the sixth heptagonal number (81) minus the sixth hexagonal number (66) equals the fifth triangular number, 15.
Also, the square of a triangular number n is the same as the sum of the cubes of the integers 1 to n.
In base 10, the digital root of a triangular number is always 1, 3, 6 or 9. Hence every triangular number is either divisible by three or has a remainder of 1 when divided by nine:
- 6 = 3×2,
- 10 = 9×1+1,
- 15 = 3×5,
- 21 = 3×7,
- 28 = 9×3+1,
- ...
The inverse of the statement above is, however, not always true. For example, the digital root of 12, which is not a triangular number, is 3 and it is divided by three. An efficient discrimination to see if a positive integer, x, is a triangular number can be used as following:
If n is an integer, then x is the nth triangular number. If n is not an integer, then x is not triangular.
Another way to determine whether x is triangular is:
where ⌊ ⌋ is a floor function. If x is equal to Tn, then x is the nth triangular number. For example, n is 36 for x=666 and T36 is also 666, therefore 666 is the 36th triangular number.
Triangular numbers have a wide variety of relations to other figurate numbers. Whenever a triangular number is divisible by 3, one third of it will be a pentagonal number. Every other triangular number is a hexagonal number.
Knowing the triangular numbers, one can reckon any centered polygonal number. The nth centered k-gonal number is obtained by the formula
- Ckn = kTn − 1 + 1
where T is a triangular number.
There are infinitely many triangular numbers that are also square numbers; e.g., 1, 36. Some of them can be generated by a simple recursive formula:
with S1 = 1
All square triangular numbers are found from the recursion
- Sn = 34Sn − 1 − Sn − 2 + 2 with S0 = 0 and S1 = 1
Two other interesting formulas regarding triangular numbers are:
- Ta + b = Ta + Tb + ab
and
- Tab = TaTb + Ta − 1Tb − 1,
both of which can easily be established either by looking at dot patterns (see above) or with some simple algebra.
The sum of the reciprocals of all the triangular numbers is:
This can be shown by using the basic sum of a telescoping series:
[edit] See also
- Tetrahedral number, a three dimensional version of triangular numbers
- Figurate number
- Centered triangular number