Search

Summing an arithmetic sequence

Say we were tasked to find the sum of the series from 51 through 375 of a series whose values are all separated by a common difference of six. That's a difference of 324 so it would take 324 hops if the hops were each one in size, but the hops are six times bigger than that so it takes six times fewer hops. 324/6 = (300+24)/6 = 50 + 4 = 54.
 
So note that there are 55 numbers in the series!  Only one of the initial and last numbers corresponds to any of those hops (take your pick, it all depends on your perspective which one).  In any case, there is one more stop than hop, considering that you are already at a stop before the first hop and you'll arrive at a stop after the last hop.

Option A:

We could subtract the first number from every number in the series, and end up with 55 of those subtracted terms.

So we could compute our sum as 55*51 + 6,12,18...318, 324
The first part is as easy as (here's an easy way to multiply any number by 51, write 51 as (100/2 + 1)): e.g. (55*(50+1)) = 55*50 + 55*1 = 55*100/2 + 55 = (55/2) * 100 + 55 = 2750 + 55 = 2805.

The second part could be thought of as 6 times the first 54 integers (1 through 54). So in that series there are 27 pairs each totaling 55. So our answer becomes 55*51 + 6*27*55 or if we factor out 55,
Answer = 55*(51+6*27) = 55* (51+162) = 55*213 = 5*11*213 = (2130+213)*5 = 5*2343 = 11715.


Option B:
Say... you know what, there are 55 numbers in the series, so I'm just going to keep the first number (51) outside the series and only sum up the other 54 numbers from 57 through 375 using the series formula. That's an even count (54) so comprises 27 pairs that each total 57+375 = 432.

Therefore the answer is
(this shows an easy way to multiply by 25 is to multiply by 100 and divide by four --- it doesn't matter in which order, whichever is easier for you)
51 + 27*432. = 51+ 25*432 + 2*432 = 51 + 432*100/4 + 864 = 915 + 108*100 = 10800 + 915 = 11715
if (isMyPost) { }