What are triangular numbers?
A triangular number or triangle number counts the objects that can form an equilateral triangle. The nth triangle number is the number of dots composing a triangle with n dots on a side, and is equal to the sum of the n natural numbers from 1 to n.
The general representation of a triangular number is
Tn= 1 + 2 + 3 + 4 +...+ (n-2) + (n-1) + n,
where n is a natural number.
This sum is Tn = n * (n + 1) / 2. This is the triangular number formula to find the nth triagular number.
To prove that this formula is true, write twice the general representation and rearange the terms as below
Tn = 1 + 2 + 3 + ...+ (n-2) + (n-1) + n
Tn = n + (n-1) + (n-2) +... + 3 + 2 + 1
---------------------------------------
Tn = (1 + n) + 2 + ( n - 1) + 3 + (n - 2) + ...+ (n-1) + 2 + n + 1
Tn = (1 + n) + (1 + n) + (1 + n) +...+ (1 + n) + (1 + n). There are n terms, so
2Tn = n * (n+1) or Tn = n * (n + 1) / 2