Difference between revisions of "Triangular number"

m
m (revert)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The '''triangular numbers''' are the numbers <math>\displaystyle T_n</math> which are the sum of the first <math>\displaystyle n</math> [[natural number]]s from <math>\displaystyle 1</math> to <math>\displaystyle n</math>.  
+
The '''triangular numbers''' are the numbers <math>T_n</math> which are the sum of the first <math>n</math> [[natural number]]s from <math>1</math> to <math>n</math>.
 +
 
 +
==Definition==
 +
The <math>n^{th}</math> triangular number is the sum of all natural numbers from one to n.
 +
That is, the <math>n^{th}</math> triangle number is
 +
<math>1 +2+3 + 4............. +(n-1)+(n)</math>.
 +
 
 +
For example, the first few triangular numbers can be calculated by adding
 +
1, 1+2, 1+2+3, ... etc.
 +
giving the first few triangular numbers to be
 +
<math>1, 3, 6, 10, 15, 21</math>.
 +
 
 +
A rather simple recursive definition can be found by noting that <math>T_{n} = 1 + 2 + \ldots + (n-1) + n = (1 + 2 + \ldots + n-1) + n = T_{n-1} + n</math>.
 +
 
 +
They are called triangular because you can make a triangle out of dots, and the number of dots will be a triangular number:
 +
<asy>
 +
int draw_triangle(pair start, int n)
 +
{
 +
  real rowStart = start.x;
 +
  for (int row=1; row<=n; ++row)
 +
  {
 +
    for (real j=rowStart; j<(rowStart+row); ++j)
 +
    {
 +
      draw((j, start.y - row), linewidth(3));
 +
    }
 +
    rowStart -= 0.5;
 +
  }
 +
  return 0;
 +
}
 +
 
 +
for (int n=1; n<5; ++n)
 +
{
 +
  real value= n*(n+1)/2;
 +
  draw_triangle((value+5,n),n);
 +
  label( (string) value, (value+5, -2));
 +
}
 +
</asy>
 +
==Formula==
 +
 
 +
Using the sum of an [[arithmetic series]] formula, a formula can be calculated for <math>T_n</math>:
 +
 
 +
:<math>T_n =\sum_{k=1}^{n}k = 1 + 2 + \ldots + n = \frac{n(n+1)}2</math>
 +
 
 +
 
 +
The formula for finding the <math>n^{th}</math> triangular number can be written as <math>\dfrac{n(n+1)}{2}</math>.
 +
 
 +
It can also be expressed as the sum of the <math>n^{th}</math> row in [[Pascal's Triangle]] and all the rows above it. Keep in mind that the triangle starts at Row 0.
 +
 
  
Using the sum of an [[arithmetic series]] formula, a formula can be calculated for <math>\displaystyle T_n</math>:
 
  
:<math>T_n = \displaystyle\sum_{k=1}^{n}k = 1 + 2 + \ldots + n = \frac{n(n+1)}2</math>
 
  
The rather simple recursive definition can be easily found by noting that <math>\displaystyle T_{n} = 1 + 2 + \ldots + (n-1) + n = (1 + 2 + \ldots + n-1) + n = T_{n-1} + n</math>.
 
  
 
{{stub}}
 
{{stub}}

Latest revision as of 08:39, 7 July 2021

The triangular numbers are the numbers $T_n$ which are the sum of the first $n$ natural numbers from $1$ to $n$.

Definition

The $n^{th}$ triangular number is the sum of all natural numbers from one to n. That is, the $n^{th}$ triangle number is $1 +2+3 + 4............. +(n-1)+(n)$.

For example, the first few triangular numbers can be calculated by adding 1, 1+2, 1+2+3, ... etc. giving the first few triangular numbers to be $1, 3, 6, 10, 15, 21$.

A rather simple recursive definition can be found by noting that $T_{n} = 1 + 2 + \ldots + (n-1) + n = (1 + 2 + \ldots + n-1) + n = T_{n-1} + n$.

They are called triangular because you can make a triangle out of dots, and the number of dots will be a triangular number: [asy] int draw_triangle(pair start, int n) {   real rowStart = start.x;   for (int row=1; row<=n; ++row)   {     for (real j=rowStart; j<(rowStart+row); ++j)     {       draw((j, start.y - row), linewidth(3));     }     rowStart -= 0.5;   }   return 0; }  for (int n=1; n<5; ++n) {   real value= n*(n+1)/2;   draw_triangle((value+5,n),n);   label( (string) value, (value+5, -2)); } [/asy]

Formula

Using the sum of an arithmetic series formula, a formula can be calculated for $T_n$:

$T_n =\sum_{k=1}^{n}k = 1 + 2 + \ldots + n = \frac{n(n+1)}2$


The formula for finding the $n^{th}$ triangular number can be written as $\dfrac{n(n+1)}{2}$.

It can also be expressed as the sum of the $n^{th}$ row in Pascal's Triangle and all the rows above it. Keep in mind that the triangle starts at Row 0.



This article is a stub. Help us out by expanding it.