Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The series, , is an arithmetic series and the summation
is called the arithmetic series summation .
The summation can be solved as follows: First, we make the simple variable substitution i=n-j:
Note that the term in the first summation in Equation is independent of j. Also, the second summation is identical to the left hand side. Rearranging Equation , and simplifying gives
There is, of course, a simpler way to arrive this answer. Consider the series, , and suppose n is even. The sum of the first and last element is n+1. So too is the sum of the second and second-last element, and the third and third-last element, etc., and there are n/2 such pairs. Therefore, .
And if n is odd, then , where n-1 is even. So we can use the previous result for to get .