Monday, June 16, 2014

2014/053) Let P(n) be the sum of the first n terms of the sequence 0,1,1,2,2,3,3,4,4,5,5,6,6,⋯

find a formula for P(n) and prove that P(x+y) - P(x-y) is xy for x and y integers and when x > y
It becomes easier if we take 2 forms one for odd and another for even and knowing that both (x+y) and (x-y) are of same parity that is both are odd or even

Now consider the case that n is even say 2m ( and further x+y and x- y even)

in the sum there is one 0 one m and 2 instances of numbers from 1 to m- 1

so the sum = 2m(m-1)/2 + m = m^2 or (n/2)^2 .. (1)

so p(x+y) - p(x-y) = ((x+y)/2)^2 - ((x-y)/2)^2 = ((x+y)^2-(x-y)^2)/4 = (4xy)/4 = xy

Now consider the case that n is odd say 2m+1 ( and further x+y and x- y both odd )

sum = m^2 + m ( m^2 from previous even calculation and the term m)

= m(m+1) = (n-1)/2 * (n+1)/2 = (n/2)^2 - 1/4 .. (2)

Now consider the case that n is even say 2m ( and further x+y and x- y even)

so p(x+y) - p(x-y) = (((x+y)/2)^2- 1/4) - (((x-y)/2)^2- 1/4) = ((x+y)^2-(x-y)^2)/4 = (4xy)/4 = xy

from (1) and (2)

p(n) = floor((n/2)^2)

 

No comments: