# Not a trained mathematician, but this seems to work consistently

stoneange
To calculate the sum of numbers between to set integers, at any separation, without adding individually.

End set number times ( ½ End set number divided by Separation increment) plus ½ End Set number
E ( ½E / S ) + ½E = SUM

For example:

• To calculate all whole numbers 1 – 100 (i.e. 1 +2 +3 +4, etc…)

• 100 ( 50 / 1 ) + 50 = 5050

This formula works with any separation increment, for example:

• To calculate whole numbers in separation increments of 5 from 1 – 100 (i.e. 5+10+15, etc…)

• 100 (50/ 5) + 50 = 1050

• Delta2

Mentor
2022 Award
The sum ##1+2+\ldots+ n## is always ##\dfrac{n\cdot (n+1)}{2}##.

All other cases follow from this.

• sysprog and Klystron
Gold Member
To prove it, trying writing the same sum forwards and backwards and add them together, e.g.
\begin{align*} (1 + 3 + 5 + 7 &) \\ + (7 + 5 + 3 + 1 &) \\ = 8 + 8 + 8 + 8 &= 4 \times 8 \end{align*}
But you've counted each number twice, so divide by two: ##\tfrac{1}{2} \times 4 \times 8.##

Now see how that relates to your formula.

stoneange
The sum ##1+2+\ldots+ n## is always ##\dfrac{n\cdot (n+1)}{2}##.

All other cases follow from this.

Thank you. How would that work with non-consecutive series, such as 5+10+15...100?

Mentor
Thank you. How would that work with non-consecutive series, such as 5+10+15...100?
Did you understand the trick that @DrGreg described above in post #3? How would you apply it to the sum you just posted? Gold Member
Thank you. How would that work with non-consecutive series, such as 5+10+15...100?
$$5 +10 + 15 + ... + 100 = 5 \times \left(1 + 2 + 3 + ... +\frac{100}{5} \right)$$

• Delta2 and berkeman
Homework Helper
Gold Member
2022 Award
Thank you. How would that work with non-consecutive series, such as 5+10+15...100?
That's ##5 \times (1 + 2 + \dots + 20)##, surely?

• SammyS and pbuk
ktoz
Thank you. How would that work with non-consecutive series, such as 5+10+15...100?
Here's general formula for these types of problems.

To generate terms in any regularly spaced series, use: mth term = a + m * c, where m = {0, 1, 2, 3, ...}. Applying to your series it looks like this:

a + 0c = 5, solve for a, a = 5
a + 1c = 10, solve for c, c = 5
a + 2c = 15, 5 + 2 * 5 = 15
a + 3c = 5 + 3 * 5 = 20
etc

Summing the term generator looks like this
a + 0c +
a + 1c +
a + 2c +
... +
a + mc =

a(m + 1) + c(0 + 1 + 2 ... + m) =
a(m + 1) + cm(m + 1) / 2 =
(m + 1)(a + cm/2)

Testing with your example 5 + 10 + 15 + 20 + 25
solve for m
5 + 5m = 25
5m = 20
m = 4

using formula
sum = (4 + 1)(5 + 5 * 4/2) = 5 * 15 = 75

checking manually
sum = 5 + 10 + 15 + 20 + 25 = 75

Correct

With another, less obvious series
1 + 7 + 13 + 19 + 25 + 31 + 37 = 133
a + 0c = 1, a = 1
a + 1c = 7, c = 6
a + mc = 37
1 + 6m = 37
6m = 36
m = 6

plugging into sum formula
(6 + 1)(1 + 6 * 6 / 2) = 7 * 19 = 133

• Delta2
sysprog
Karl Gauss elicidated this when he was a young schoolboy -- the teacher had assigned the class to add up the integers from 1 to 100 -- Gauss immediately wrote 5050 on his slate -- the teacher became infuriated because he had himself arrived at a different answer -- Gauss was sent to the Headmaster's Office, where he explained that the sum was of a set of pairs each of which was equal to 101 -- 1 and 100, 2 and 99, 3 and 98, and so on until 50 and 51, so that, there being 50 such pairs, and 50 times 101 being 5050, that was the answer - they sent the kid to college early . . .