Sum of Consecutive Integers and Triangular Numbers Calculator
The sum of the first n integers, 1 + 2 + 3 + ... + n, is called the nth triangular number. Triangular numbers are so-called because they can be represented by triangular formations.
Triangular numbers and the sum of any sequence of consecutive integers can either be calculated the long way by adding each term individually, or the short way by using a simple formula.
Triangular Number FormulaLet T(n) be the nth triagular number. We know that
T(n) = 1 + 2 + ... + (n-1) + n. n terms
2*T(n) = 1 + 2 + ... + (n-1) + n + 1 + 2 + ... + (n-1) + n.
We can rearrange the terms of 2*T(n) by pairing the smallest term with the largest term, the second smallest term with the second largerst term, etc. This new arrangment doesn't change the value of the sum; it does provide an easier way to calculate its value:
2*T(n) = [1 + n] + [2 + (n-1)] + ... + [(n-1) + 2] + [n + 1] n terms
= [1 + n] + [1 + n] + ... + [1 + n] + [1 + n]
Thus, T(n) = n(n+1)/2.
Consecutive Integer Sum FormulaThe sum of consecutive numbers from a to b inclusive is the difference between the bth triangular number and the ath triangular number plus a. (You need to add a because the sum is inclusive of the endpoints a and b.) That is,
Sum from a to b inclusive = T(b) - T(a) + a.
T(b) - T(a) + a = (b+a)(b-a+1)/2.
Fun Facts about Triangular Numbers1. The sum of two consecutive triangular numbers is always square. This is best explained by the picture below:
|x(x+1)/2 = y2|
X(n+2) = 6X(n+1) - X(n) + 2
Y(n+2) = 6Y(n+1) - Y(n).
Also, X(n) is itself a square number for odd values of n, and twice a square number for even values of n.
3. The sum of the first n triangular numbers is the nth tetrahedral (triangular pyramidal) number, P(n).
T(1) + T(2) + ... + T(n) = P(n), and
P(n) = n(n+1)(n+2)/6.
4. The infinte sum of the reciprocals of the triangular numbers is 2. This can be demonstrated as follows:
Σn=1...∞1/T(n) = Σn=1...∞2/[n(n+1)]
= 2Σn=1...∞[1/n - 1/(n+1)]
This is a telescoping sum, meaning consecutive terms in the series cancel out, which leaves only the first term, 1. Thus, the sum is equal to 2(1) = 2.
© Had2Know 2010