These notes are adapted from Evan Chenβs Summations handout. I placed the generating functions material on the Recursion page, since that technique is especially useful for recurrence relations.
Olympiad-style summation problems usually fall into a few categories:
Algebraic sums, such as βn(n+1)1β, where the main tools are partial fractions, telescoping, and algebraic manipulation.
Combinatorial sums, which often involve binomial coefficients and counting arguments.
Number-theoretic sums, which involve divisors, arithmetic functions, or modular arithmetic.
However, one idea that resonates through all three categories is swapping the order of summation.
Theorem 1.1 (Swapping the Order of Summation). Let A,B be finite sets and f(a,b) a function on AΓB. Then
For infinite sums, the same rearrangements are valid when all terms are nonnegative or the double sum is absolutely convergent. Under one of those conditions, grouping by k=a+b gives
The notation βk=1nβakβ means a1β+β―+anβ. The index is a temporary variable, and both endpoints are included. Constants can be pulled out, and a sum of terms can be split into separate sums with the same bounds.
For an arithmetic sequence with first term a and common difference d, pairing the first and last terms gives
k=0βnβ1β(a+kd)=2nβ(2a+(nβ1)d).
For a geometric sequence, subtract a shifted copy of the sum:
k=0βnβ1βark=a1βr1βrnβ,rξ =1.
If r=1, the sum is na. For an infinite geometric series with β£rβ£<1, the tail tends to zero and the sum is a/(1βr).
Example. Evaluate 7+11+15+β―+99 and 3+3/2+3/4+β―.
The arithmetic sum has (99β7)/4+1=24 terms, so its value is 24(7+99)/2=1272. The geometric sum has first term three and ratio one-half, with absolute value below one, so its value is 3/(1β1/2)=6.
When the denominator factors, partial fractions can expose a difference whose middle terms cancel. First work with a finite partial sum, cancel its terms, and only then take a limit if the sum is infinite. A convergent series need not telescope, so check for a useful difference rather than assuming one exists.
Example. (Stanford 2011) Evaluate
nβ₯1ββn(n+2)7n+32β(43β)n.
Solution. Note that the sum lacks an upper bound, meaning it is implied that it goes to infinity. First decompose into partial fractions:
Example. A permutation of {1,2,β¦,n} is chosen uniformly at random. Find the expected number of fixed points.
The clean way to see this is not to count fixed points row by row over all permutations, but column by column. For each position, exactly (nβ1)! permutations fix that position, so the total number of fixed points over all n! permutations is
nβ (nβ1)!.
Dividing by n! gives the average:
n!n(nβ1)!β=1.
Proof (Linearity of expectation). For random variables with finite expectations, prove that
E[X+Y]=E[X]+E[Y].
Assume for simplicity that X and Y take nonnegative integer values. Then
Lemma 3.6 (Harmonic Modulo p Trick). For k=1,2,β¦,pβ1,
k1ββ‘(β1)kβ1p1β(kpβ)(modp).
The quantity (kpβ)/p is an integer for 1β€kβ€pβ1. It equals (kβ1pβ1β)/k, interpreted using the inverse of k modulo p. Since (kβ1pβ1β)β‘(β1)kβ1(modp), the identity follows. There is no inverse of p modulo p; the division by p happens in the integers first.
This converts harmonic-looking expressions into binomial expressions, which are often easier to manipulate.
For the first identity, every divisor contributes one. In the second, summing id(n/d) over divisors gives the sum of all divisors. In the third, every summand is d(n/d)=n and there are Ο(n) of them. The fourth is the totient divisor identity proved earlier. In the fifth, only d=1 contributes because Ξ΄(d)=0 for every other divisor.
Useful properties:
β is commutative.
β is associative.
β distributes over addition.
The identity element is Ξ΄.
The convolution of multiplicative functions is multiplicative.
Exercise 4.5. Prove that the convolution of multiplicative functions is multiplicative.
Example. Reinterpret
dβ£nββΟ(d)=n
as
Οβ1=id.
Both sides are multiplicative, so it is enough to check prime powers:
1+(pβ1)+(p2βp)+β―+(peβpeβ1)=pe.
Lemma 4.7. The MΓΆbius function is the inverse of 1 under Dirichlet convolution:
ΞΌβ1=Ξ΄.
Exercise 4.8. Prove this by checking prime powers.
Example. (IMO Shortlist 1989) Define {anβ}nβ₯1β by
dβ£nββadβ=2n.
Show that nβ£anβ.
By MΓΆbius inversion,
anβ=dβ£nββΞΌ(n/d)2d.
To finish, let bnβ count binary strings of length n whose smallest repeating block has length n. Every binary string of length n is obtained by repeating a unique shortest block of length dβ£n, so
2n=dβ£nββbdβ.
MΓΆbius inversion gives the same formula for bnβ as for anβ, hence anβ=bnβ. Rotate a string counted by bnβ cyclically. Its n rotations are distinct, since an earlier return would give a shorter repeating block. These strings therefore split into groups of size n, proving nβ£anβ.
Telescoping can be extended to a product of two sequences. If Akβ=a1β+β―+akβ and A0β=0, then akβ=AkββAkβ1β. Substituting this difference and shifting indices gives summation by parts:
This is useful when the partial sums of akβ are simple even though the individual product is not. It separates oscillation, stored in Akβ, from the gradual variation of bkβ. Keep the boundary term; omitting it is the discrete version of forgetting an integration constant.
For instance, take akβ=(β1)kβ1 and bkβ=1/k. The partial sums Akβ are either zero or one. In the summation-by-parts expression, the differences 1/kβ1/(k+1) are nonnegative and telescope, while Anβ/nβ0. This proves convergence of the alternating harmonic series without claiming that the sum of the absolute values converges. The bounded oscillation is doing essential work.
A difference of nearby polynomial expressions lowers degree, which lets telescoping derive power sums. Let Tkβ=k(k+1)/2. Then TkββTkβ1β=k and Tkβ+Tkβ1β=k2, so
Tk2ββTkβ12β=k3.
Summing yields βk=1nβk3=[n(n+1)/2]2. This proof explains why the sum of cubes is a square, rather than merely supplying a formula.
Weighted geometric sums come from differentiating a finite geometric polynomial. Because the sum is finite, differentiating term by term requires no convergence argument.
Example. Evaluate βk=1nβk2k.
Start from 1+t+β―+tn=(1βtn+1)/(1βt), differentiate, and multiply by t. The result is
The integer βN/dβ counts positive multiples of d not exceeding N. It also counts positive integers b with dbβ€N. Therefore
d=1βNββdNββ=#{(a,b)βZ>02β:abβ€N}.
This is a count under a hyperbola. Every point either has its first coordinate at most m=βNββ or its second coordinate at most m; otherwise the product exceeds N. Points with both coordinates at most m were counted twice.
Example. Evaluate βd=1100ββ100/dβ using only ten floor evaluations.
With m=10, symmetry of the lattice-point count gives
The ten values are 100,50,33,25,20,16,14,12,11,10, totaling 291. The answer is 2(291)β100=482.
This method is also called the hyperbola method. Its advantage is structural: a sum with N terms becomes one with roughly Nβ terms. Another useful observation is that βN/dβ remains constant over intervals of consecutive d. If the current quotient is q, its last occurrence is βN/qβ. Grouping those intervals is useful when a weight accompanies the floor.
Before exchanging two infinite sums, distinguish a formal coefficient calculation from a numerical sum. For a formal power series, it is enough that each coefficient receives finitely many contributions. For numerical sums, nonnegative terms or absolute convergence justify the rearrangement. Conditional convergence does not allow arbitrary exchanges.
For a finite triangular region such as 1β€iβ€jβ€n, sketch or describe the index set first. Summing over i first uses j=i,β¦,n, while summing over j first uses i=1,β¦,j. Writing rectangular bounds for a triangular region changes the sum.
The most useful exchange is often motivated by a counting interpretation. A divisor sum suggests pairs with a fixed product; a convolution suggests pairs with a fixed sum; a floor suggests an inequality. Once the underlying pairs are clear, the new bounds follow from the same set of objects.
for n=1,2,β¦,2013. If a0β=b2013β and b0β=a2013β, compute
k=1β2013β(akβbkβ1ββakβ1βbkβ).
Problem 6.8 (IMO Shortlist 2014 N6). Let a1β<a2β<β―<anβ be pairwise coprime positive integers, with a1β prime and a1ββ₯n+2. On the interval [0,a1βa2ββ―anβ] mark all integers divisible by at least one of a1β,β¦,anβ. These split the interval into smaller segments. Prove that the sum of the squares of the lengths of these segments is divisible by a1β.
Problem 6.9 (OMO 2014 S25). Compute
n=1βββ(1+21β+β―+n1β)(100n+100β)1β.
Problem 6.10 (OMO 2015 F30). Ryan defines a function Ξ:NβN by Ξ(1)=1 and