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
Jan 14, 2009
Subscribe to:
Post Comments (Atom)
DFS the life without backtracking
No comments:
Post a Comment