Thread: Sum of squares
View Single Post
  #3  
Old 06-16-2007, 04:04 AM
borisp borisp is offline
Senior Member
 
Join Date: Nov 2004
Posts: 201
Default Re: Sum of squares

One general trick for sums is "summation by parts." Essentially, it is the discrete version of integration by parts. Suppose you have finite sequences a_1,...,a_n and b_1,...,b_n. Then the following holds:

a_2 (b_2 - b_1) + a_3 (b_3 - b_2) + ... + a_n (b_n - b_(n-1)) = (a_n b_n - a_1 b_1) - (b_1 (a_2 - a_1) + ... + b_(n-1) (a_n - a_(n-1))

The trick here is to let a_n = n, and "find" b_n so that b_n - b_(n-1) = n. But presumably you already did that! (since that is simply the exponent 1 ie baby Gauss solution case). So let b_n = n(n+1)/2 = n^2/2 + n/2. The LHS is one less than what you want, call it P(n)-1, and notice the RHS is

n(n)(n+1)/2 - 1 - (P(n)/2 - n^2/2) - n(n-1)/4

using that we already "know" the sums of n^2/2 and n/2, and correcting for the indexing. Now just solve for P(n):

3P(n)/2 = (n^3 + n^2)/2 + n^2/4 +n/4

P(n) = n^3/3 + n^2/2 + n/6 = what you want.

This isn't easier necessarily, but it is a general technique that can tackle these summation problems.
Reply With Quote