# Sums

### Sum of integers

is the number of terms times the average of the first term and the last, .

The picture shows that twice the sum, , so .

General arithmetic progression
The sum of terms of an arithmetic progression is the average of the first and last terms, times the number of terms.

This diagram shows that is the size of a rectangle of height and width .

### Sum of cubes

For the sum of higher powers, see Jacob Bernoulli’s power sum problem

Manipulating sums

where is a permutation of the elements of – i.e. the elements can be taken in any order.

Gauss’ boyhood trick of finding can be seen as an application of these 3 laws.
To find the general sum of an arithmetic progression

We can replace by (commutative law):

Add these 2 together. (associative law)

Take the constant outside the sum. (distributive law)

Divide this by to get:

– the average of the first and last terms, , times the number of terms.

Example of finding a sum

I wanted to make a video that starts in very slow-motion, and gradually accelerates up to 30 (different) frames a second. Maybe start with 2 images each 1/2 second long (15 frames each), then 3 images 14 frames long, 4×13, 5×12 etc until 14×3, 15 2 frames long, then return to regular 1 image per 1/30 second. How long would this take? It would take:
frames/30ths of a second.
If we represent the numbers rising (the number of images shown for a given number of frames, e.g. initially, 2 images last for 15 frames each) by , then the other is , and the sum is:

These two are the above 2 series for and , with only slight modification:

So the sum can be written as:

with , i.e.

Another way using Newton’s formula:

where
and the falling power

The sought value is a term in the series:

We need the term ending in , evidently the 14th term.
Add a first term for , and the values in this case are:

Newton’s formula gives:

Well, what’s the general formula, for starting with a number of images each shown for 30ths of a second? i.e. the sum is then:

If one number from each of these pairs is , the other will be equal to . (Like both numbers always added to 17 in the last example.)
So this time we have

And just to check this formula, plugging in and :

frames.

Knuth et al – Concrete Mathematics