Quote:
Originally Posted by Acemanhattan
Just a check: All I do here is substitute the identity for i and then substitute my n, correct?
No, add 5 not 1 to get 35. That's because the sum of 5 ones is 5.
sum(2i+1) = 2*sum(i) + sum(1) for i = 1 to 5
= 2*5*6/2 + 5
= 35.
You should be able to check for yourself that this is
3 + 5 + 7 + 9 + 11 = 35.
Also, the sum of the first n odd integers is n^2, but we're starting from 3 instead of 1, so this is the sum of the first 6 odd integers minus 1 or 6^2 - 1 = 35.
You can derive the general formula for an arithmetic series:
a + (a + k) + (a + 2k) + (a + 3k) + ... + [a + (n-2)k] + [a + (n-1)k]
where in your case
a = 3, the starting value
k = 2, what you have to add to each value to get the next value
n = 5, the number of items to sum.
Call the sum S, and write it forwards and backwards.
S = a + (a + k) + (a + 2k) + (a + 3k) + ... + [a + (n-2)k] + [a + (n-1)k]
S = [a + (n-1)k] + (a + (n-2)k] + ... + (a + k) + a
adding these term by term gives n terms that are all the same value 2a + (n-1)k so
2S = [2a + (n-1)k] * n
S = a*n + n(n-1)k/2
S = 3*5 + 5*4*2/2
S = 35.
Note that when a = 1 and k = 1, this simplifies to the n(n+1)/2 that you know for 1+2+3+...+n.
Last edited by BruceZ; 02-02-2013 at 03:33 PM.