Difference between revisions of "Triangular number"
Tanmaidarbha (talk | contribs) |
Pacingpoet (talk | contribs) m (revert) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
==Definition== | ==Definition== | ||
− | The <math>n^{th}</math> triangular number is the sum of all natural numbers from one | + | 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 | That is, the <math>n^{th}</math> triangle number is | ||
<math>1 +2+3 + 4............. +(n-1)+(n)</math>. | <math>1 +2+3 + 4............. +(n-1)+(n)</math>. | ||
Line 8: | Line 8: | ||
For example, the first few triangular numbers can be calculated by adding | For example, the first few triangular numbers can be calculated by adding | ||
1, 1+2, 1+2+3, ... etc. | 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; | rowStart -= 0.5; |
Revision as of 07:39, 7 July 2021
The triangular numbers are the numbers which are the sum of the first natural numbers from to .
Definition
The triangular number is the sum of all natural numbers from one to n. That is, the triangle number is .
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 .
A rather simple recursive definition can be found by noting that .
They are called triangular because you can make a triangle out of dots, and the number of dots will be a triangular number:
Formula
Using the sum of an arithmetic series formula, a formula can be calculated for :
The formula for finding the triangular number can be written as .
It can also be expressed as the sum of the 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.