Sums
Jesper Larsson, IT University of Copenhagen
Important basic knowledge required for the course Foundations of
Computing – Algorithms and Data Structures.

Notation
We use the following “capital-sigma notation” for a sum of a number of terms ti :
B

∑ ti

= t A + t A +1 + t A +2 + · · · + t B −1 + t B

i= A

We can vary the notation somewhat, as long as the meaning is clear.
The variant ∑i∈S ti denotes the sum over all i that belong to some
set S. For instance,

∑

B

∑

ti =

ti =

i = A...B

i ∈{ A,...,B}

∑ ti

i= A

If it is clear from the context what it means (or if we want to be less
precise) we can even write the following to sum “over all i”:

∑ ti
i

When B is a number, a sum ∑iB= A ti is called a finite series. If B
approaches infinity, we have an infinite series or just series: intuitively
a sum of infinitely many terms. Mathematical pedants would sneer
at that idea (because you can’t add up infinitely many terms). We
get around that by defining:
∞

∑

B

ti = lim

B→∞

i= A

∑ ti

i= A

This saves our honor by declaring that we are just using a shorthand for the limit of the sum as the number of terms approaches
infinity, which is mathematically well-defined.

Powers of two
The following sum of inverse powers of two, which is a special case
of a geometric series, appears frequently in analyzing algorithms:
1 1 1
1
+ + +
+ ··· = 1
2 4 8 16
Or, using the sigma notation:
∞

1

∑ 2i

=1

i =1

Rather than giving full formal proof, we shall settle for a sketch that
shows an intuitive idea, which is often more valuable for remembering and applying something. (But a formal proof is also a good

Finally, we give the finite series of positive powers of two:
1+2+4+8+ ··· +

N
+ N = 2N − 1, where N is a power of two.
2

Important to quickly recall and
motivate!

In sigma notation:
lg N

∑ 2i

= 2N − 1

i =0

For instance 1 + 2 + 4 + · · · + 64 = 127. The result can be proved by
induction, or deduced using previous equations as follows. The first
step is to reverse the order of the terms, to make them decreasing
like in previous series:
lg N

An easy way to deduce this is to rewrite it as N/2 terms, each
having the sum N + 1:
N
N
+ +1
(1 + N ) + (2 + N − 1) + (3 + N − 2) + · · · +
2
2
That doesn’t make it obvious that the equation holds for odd N as
well, but it does. It can be proved, e.g., by induction.
In algorithm analysis, we often disregard lower order terms, terms
with smaller exponents on the variable we are interested in (N in
this case). If we do, it only matters that
N