if we want to calculate the total sum from 1 to a certain number, we should add 1 to n*n and divide by two? I don't understand where that came from. Can someone explain?
-
Consider the sum 1 + 2 + 3 + ... + (n-1) + n.
There are n numbers in the sum.
The smallest is 1 and the largest is n.
The average of these numbers is ½(1 + n)
The sum is ½(1+n)n.
That's equivalent to (n+1)n/2.
There are n numbers in the sum.
The smallest is 1 and the largest is n.
The average of these numbers is ½(1 + n)
The sum is ½(1+n)n.
That's equivalent to (n+1)n/2.
-
Let's say we want to work out 1 + 2 + 3 + 4 + 5.
Writing in reverse we would get 5 + 4 + 3 + 2 + 1
Pairing up we would have (1 + 5), (2 + 4), (3 + 3), (4 + 2) and (5 + 1)
so, adding we would have 5 groups of 6.....which would be twice the amount needed.
=> (5 x 6)/2 = 30/2 = 15
so, 1 + 2 + 3 +....+ 10 would be (10 x 11)/2 = 110/2 = 55
=> 1 + 2 + 3 +....+ n would be n x (n + 1)/2 = n(n + 1)/2
:)>
Writing in reverse we would get 5 + 4 + 3 + 2 + 1
Pairing up we would have (1 + 5), (2 + 4), (3 + 3), (4 + 2) and (5 + 1)
so, adding we would have 5 groups of 6.....which would be twice the amount needed.
=> (5 x 6)/2 = 30/2 = 15
so, 1 + 2 + 3 +....+ 10 would be (10 x 11)/2 = 110/2 = 55
=> 1 + 2 + 3 +....+ n would be n x (n + 1)/2 = n(n + 1)/2
:)>
-
S = 1 + 2 + . . . + (n-1) + n ---> n numbers
S = n + (n-1) + . . . + 2 + 1 ---> n numbers
-------------------- ----------------
2S = (n+1) + (n+1) + . . . + (n+1) + (n+1) ---> n times
2S = n (n+1)
S = n (n+1) / 2
S = n + (n-1) + . . . + 2 + 1 ---> n numbers
-------------------- ----------------
2S = (n+1) + (n+1) + . . . + (n+1) + (n+1) ---> n times
2S = n (n+1)
S = n (n+1) / 2