View Single Post
Old 07-23-2008, 03:02 AM   #1 (permalink)
samal
Within my grasp!
 
Join Date: Mar 2008
Posts: 222
samal just joined TestMagic.
Sum of even numbers:-

Got this question from a compilation.
Q. The sum of the even numbers between 1 and n is 79*80, where n is an odd number, then n=?

My approach has been:-
The set of numbers give is (1,2,3,4,5,6,....n-1,n)

So the num of even numbers in that set is
sum = 2 + 4 + 6 + 8 ...(n-1)
=2*(1+2+3+4...+(n-1)/2)
=2*(((n-1)/2)*((n-1)/2)+1))/2 (sum of ni consecutive numbers)
= ((n-1)*(n+1))/4 = 79*80

Solving gives n = 159.

But the answer given is 79. Can somebody confirm my answer?
samal is offline   Reply With Quote