Jan 14, 2009

Sum of consecutive numbers from 1 to n is: sum(1…n)=(n+1)*n/2
Choose any 2 numbers from n numbers is: C(2,n)=n(n-1)/2
Sum of consecutive numbers from a to b is: sum(1…b)-sum(1…a-1)=(a+b)(b-a+1)/2

No comments:

Post a Comment