Skip to content

Summations

Updated Β· Equations updated; Sections updated; Examples or practice updated; Explanations expanded What changed?
  1. β€” Equations updated; Sections updated; Examples or practice updated; Explanations expanded

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 βˆ‘1n(n+1)\sum \frac{1}{n(n+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,BA,B be finite sets and f(a,b)f(a,b) a function on AΓ—BA\times B. Then

βˆ‘a∈Aβˆ‘b∈Bf(a,b)=βˆ‘b∈Bβˆ‘a∈Af(a,b).\sum_{a \in A} \sum_{b \in B} f(a,b) = \sum_{b \in B} \sum_{a \in A} f(a,b).

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+bk=a+b gives

βˆ‘aβ‰₯0βˆ‘bβ‰₯0f(a,b)=βˆ‘kβ‰₯0βˆ‘a,bβ‰₯0a+b=kf(a,b).\sum_{a \ge 0} \sum_{b \ge 0} f(a,b) = \sum_{k \ge 0} \sum_{\substack{a,b \ge 0 \\ a+b=k}} f(a,b).

The notation βˆ‘k=1nak\sum_{k=1}^n a_k means a1+β‹―+ana_1+\cdots+a_n. 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 aa and common difference dd, pairing the first and last terms gives

βˆ‘k=0nβˆ’1(a+kd)=n2(2a+(nβˆ’1)d).\sum_{k=0}^{n-1}(a+kd)=\frac n2\bigl(2a+(n-1)d\bigr).

For a geometric sequence, subtract a shifted copy of the sum:

βˆ‘k=0nβˆ’1ark=a1βˆ’rn1βˆ’r,rβ‰ 1.\sum_{k=0}^{n-1}ar^k=a\frac{1-r^n}{1-r},\qquad r\ne1.

If r=1r=1, the sum is nana. For an infinite geometric series with ∣r∣<1\lvert r\rvert<1, the tail tends to zero and the sum is a/(1βˆ’r)a/(1-r).

Example. Evaluate 7+11+15+β‹―+997+11+15+\cdots+99 and 3+3/2+3/4+β‹―3+3/2+3/4+\cdots.

The arithmetic sum has (99βˆ’7)/4+1=24(99-7)/4+1=24 terms, so its value is 24(7+99)/2=127224(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)=63/(1-1/2)=6.

Example. Evaluate βˆ‘k=11001/[k(k+1)]\sum_{k=1}^{100}1/[k(k+1)].

The decomposition 1/[k(k+1)]=1/kβˆ’1/(k+1)1/[k(k+1)]=1/k-1/(k+1) gives

(1βˆ’12)+(12βˆ’13)+β‹―+(1100βˆ’1101)=100101.\left(1-\frac12\right)+\left(\frac12-\frac13\right)+\cdots+ \left(\frac1{100}-\frac1{101}\right)=\frac{100}{101}.

Writing the first and last few terms makes the surviving boundary terms visible.


These are the most direct summation techniques, and they appear most often in AMC/AIME problems.

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β‰₯17n+32n(n+2)(34)n.\sum_{n \ge 1} \frac{7n+32}{n(n+2)} \left(\frac34\right)^n.

Solution. Note that the sum lacks an upper bound, meaning it is implied that it goes to infinity. First decompose into partial fractions:

7n+32n(n+2)=16nβˆ’9n+2.\frac{7n+32}{n(n+2)} = \frac{16}{n} - \frac{9}{n+2}.

So the sum becomes

βˆ‘nβ‰₯1(16n(34)nβˆ’9n+2(34)n).\sum_{n \ge 1} \left( \frac{16}{n}\left(\frac34\right)^n - \frac{9}{n+2}\left(\frac34\right)^n \right).

Since 9=16(34)29 = 16\left(\frac34\right)^2, this telescopes:

βˆ‘nβ‰₯1(16n(34)nβˆ’16n+2(34)n+2).\sum_{n \ge 1} \left( \frac{16}{n}\left(\frac34\right)^n - \frac{16}{n+2}\left(\frac34\right)^{n+2} \right).

The tail tends to zero, so the answer is

16β‹…34+162β‹…916=12+92=332.16 \cdot \frac34 + \frac{16}{2} \cdot \frac{9}{16} = 12 + \frac92 = \frac{33}{2}.

Example. A permutation of {1,2,…,n}\{1,2,\dots,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)!(n-1)! permutations fix that position, so the total number of fixed points over all n!n! permutations is

nβ‹…(nβˆ’1)!.n \cdot (n-1)!.

Dividing by n!n! gives the average:

n(nβˆ’1)!n!=1.\frac{n(n-1)!}{n!} = 1.

Proof (Linearity of expectation). For random variables with finite expectations, prove that

E[X+Y]=E[X]+E[Y].\mathbb E[X+Y] = \mathbb E[X] + \mathbb E[Y].

Assume for simplicity that XX and YY take nonnegative integer values. Then

E[X+Y]=βˆ‘nβ‰₯0n Pr⁑(X+Y=n)=βˆ‘nβ‰₯0βˆ‘a+b=nn Pr⁑(X=a,Y=b).\mathbb E[X+Y] = \sum_{n \ge 0} n \, \Pr(X+Y=n) = \sum_{n \ge 0} \sum_{a+b=n} n \, \Pr(X=a,Y=b).

Now write n=a+bn=a+b and switch to summing directly over a,bβ‰₯0a,b \ge 0:

E[X+Y]=βˆ‘a,bβ‰₯0(a+b)Pr⁑(X=a,Y=b).\mathbb E[X+Y] = \sum_{a,b \ge 0} (a+b)\Pr(X=a,Y=b).

Split the sum:

E[X+Y]=βˆ‘aβ‰₯0βˆ‘bβ‰₯0aPr⁑(X=a,Y=b)+βˆ‘bβ‰₯0βˆ‘aβ‰₯0bPr⁑(X=a,Y=b).\mathbb E[X+Y] = \sum_{a \ge 0}\sum_{b \ge 0} a \Pr(X=a,Y=b) + \sum_{b \ge 0}\sum_{a \ge 0} b \Pr(X=a,Y=b).

Then

βˆ‘bβ‰₯0Pr⁑(X=a,Y=b)=Pr⁑(X=a),βˆ‘aβ‰₯0Pr⁑(X=a,Y=b)=Pr⁑(Y=b),\sum_{b \ge 0} \Pr(X=a,Y=b) = \Pr(X=a), \qquad \sum_{a \ge 0} \Pr(X=a,Y=b) = \Pr(Y=b),

so

E[X+Y]=βˆ‘aβ‰₯0aPr⁑(X=a)+βˆ‘bβ‰₯0bPr⁑(Y=b)=E[X]+E[Y].\mathbb E[X+Y] = \sum_{a \ge 0} a\Pr(X=a) + \sum_{b \ge 0} b\Pr(Y=b) = \mathbb E[X] + \mathbb E[Y].

This is philosophically a double-summation argument.

Lemma 2.4. For every positive integer nn,

βˆ‘d∣nΟ†(d)=n.\sum_{d \mid n} \varphi(d) = n.

Here Ο†(d)\varphi(d) counts integers in 1,…,d1,\ldots,d coprime to dd. See Fermat’s little theorem and orders for its formula and uses.

Proof (Totient divisor sum). Look at the fractions

1n,2n,…,nn.\frac1n,\frac2n,\dots,\frac nn.

After reducing them, exactly Ο†(d)\varphi(d) of them have denominator dd for each divisor d∣nd \mid n. Since there are nn fractions total, the sum of those counts is nn.

Example. (AMSP 2011 NT3 Exam) Prove that

βˆ‘kβ‰₯1Ο†(k)⌊nkβŒ‹=n(n+1)2.\sum_{k \ge 1} \varphi(k)\left\lfloor \frac{n}{k} \right\rfloor = \frac{n(n+1)}{2}.

Solution. Rewrite the floor as a divisor count:

⌊nkβŒ‹=βˆ‘m≀nk∣m1.\left\lfloor \frac{n}{k} \right\rfloor = \sum_{\substack{m \le n \\ k \mid m}} 1.

So

βˆ‘kβ‰₯1Ο†(k)⌊nkβŒ‹=βˆ‘kβ‰₯1βˆ‘m≀nk∣mΟ†(k).\sum_{k \ge 1} \varphi(k)\left\lfloor \frac{n}{k} \right\rfloor = \sum_{k \ge 1}\sum_{\substack{m \le n \\ k \mid m}} \varphi(k).

Now reverse the order:

=βˆ‘m=1nβˆ‘k∣mΟ†(k).= \sum_{m=1}^n \sum_{k \mid m} \varphi(k).

By Lemma 2.4 the inner sum is just mm, so

βˆ‘m=1nm=n(n+1)2.\sum_{m=1}^n m = \frac{n(n+1)}{2}.

Suppose we want to keep only terms with index divisible by 33 in a binomial sum. The basic idea is to build an indicator function using roots of unity.

Example. Compute

βˆ‘kβ‰₯0(10003k).\sum_{k \ge 0} \binom{1000}{3k}.

Let

f(n)={1n≑0(mod3),0otherwise.f(n) = \begin{cases} 1 & n \equiv 0 \pmod 3, \\ 0 & \text{otherwise}. \end{cases}

If Ο‰=e2Ο€i/3\omega = e^{2\pi i/3}, then

f(n)=13(1+Ο‰n+Ο‰2n).f(n) = \frac{1}{3}\left(1 + \omega^n + \omega^{2n}\right).

Hence

βˆ‘kβ‰₯0(10003k)=βˆ‘nβ‰₯0(1000n)f(n)=13βˆ‘nβ‰₯0(1000n)(1+Ο‰n+Ο‰2n).\sum_{k \ge 0} \binom{1000}{3k} = \sum_{n \ge 0} \binom{1000}{n} f(n) = \frac13 \sum_{n \ge 0} \binom{1000}{n} (1+\omega^n+\omega^{2n}).

Separate into three sums:

13[(1+1)1000+(1+Ο‰)1000+(1+Ο‰2)1000].\frac13 \left[(1+1)^{1000} + (1+\omega)^{1000} + (1+\omega^2)^{1000}\right].

Using 1+Ο‰=βˆ’Ο‰21+\omega = -\omega^2 and 1+Ο‰2=βˆ’Ο‰1+\omega^2=-\omega, this becomes

13[21000+(βˆ’Ο‰2)1000+(βˆ’Ο‰)1000]=13[21000+Ο‰+Ο‰2]=13(21000βˆ’1).\frac13 \left[2^{1000} + (-\omega^2)^{1000} + (-\omega)^{1000}\right] = \frac13 \left[2^{1000} + \omega + \omega^2\right] = \frac13 \left(2^{1000}-1\right).

Problem 2.7 (Putnam 2011). Let a1,a2,…a_1,a_2,\dots and b1,b2,…b_1,b_2,\dots be sequences of positive reals such that a1=b1=1a_1=b_1=1 and

bn=bnβˆ’1anβˆ’2b_n = b_{n-1}a_n - 2

for nβ‰₯2n \ge 2. Assume {bn}\{b_n\} is bounded. Prove that

S=βˆ‘n=1∞1a1a2β‹―anS = \sum_{n=1}^{\infty} \frac{1}{a_1a_2\cdots a_n}

converges, and evaluate SS.

Problem 2.8 (Putnam 2013). Let a0,a1,…,an,xa_0,a_1,\dots,a_n,x be real numbers with 0<x<10<x<1 and

a01βˆ’x+a11βˆ’x2+β‹―+an1βˆ’xn+1=0.\frac{a_0}{1-x} + \frac{a_1}{1-x^2} + \cdots + \frac{a_n}{1-x^{n+1}} = 0.

Prove that for some 0<y<10<y<1,

a0+a1y+a2y2+β‹―+anyn=0.a_0 + a_1y + a_2y^2 + \cdots + a_n y^n = 0.

Problem 2.9 (Putnam 2015). Let TT be the set of triples of positive integers that form the side lengths of a triangle. Compute

βˆ‘(a,b,c)∈T2a3b5c.\sum_{(a,b,c)\in T} \frac{2^a}{3^b5^c}.

Problem 2.10. How many nonempty subsets of {1,2,…,1000}\{1,2,\dots,1000\} have sum divisible by 33?

When working modulo a prime pp, many ordinary summation tricks still work, but now the finite nature of Fp\mathbb F_p creates extra symmetry.

Lemma 3.1 (Fermat’s Little Theorem). If pp is prime and gcd⁑(a,p)=1\gcd(a,p)=1, then

apβˆ’1≑1(modp).a^{p-1} \equiv 1 \pmod p.

Proof (Fermat’s little theorem). Multiplication by aa permutes the nonzero residue classes modulo pp, so

apβˆ’1(pβˆ’1)!≑(pβˆ’1)!(modp).a^{p-1}(p-1)! \equiv (p-1)! \pmod p.

Cancel (pβˆ’1)!(p-1)!.

Lemma 3.2 (Wilson’s Theorem). For any prime pp,

(pβˆ’1)!β‰‘βˆ’1(modp).(p-1)! \equiv -1 \pmod p.

Exercise 3.3. Prove Wilson’s theorem if you have not already seen it.

Lemma 3.4 (Sums of Powers Modulo pp). Let pp be prime and let mm be an integer. Then

1m+2m+β‹―+(pβˆ’1)m≑{0(modp)ifΒ pβˆ’1∀m,βˆ’1(modp)ifΒ pβˆ’1∣m.1^m + 2^m + \cdots + (p-1)^m \equiv \begin{cases} 0 \pmod p & \text{if } p-1 \nmid m, \\ -1 \pmod p & \text{if } p-1 \mid m. \end{cases}

Proof (Power sums modulo a prime). For negative exponents, use modular inverses. If gg is a primitive root modulo pp, then

1m+2m+β‹―+(pβˆ’1)m≑1+gm+g2m+β‹―+g(pβˆ’2)m(modp).1^m + 2^m + \cdots + (p-1)^m \equiv 1 + g^m + g^{2m} + \cdots + g^{(p-2)m} \pmod p.

This is a geometric series. If pβˆ’1∀mp-1 \nmid m then the denominator is nonzero modulo pp while the numerator vanishes.

Proof (Wolstenholme’s theorem). Prove that for a prime p>3p>3,

(pβˆ’1)!(1+12+β‹―+1pβˆ’1)≑0(modp2).(p-1)! \left(1+\frac12+\cdots+\frac{1}{p-1}\right) \equiv 0 \pmod{p^2}.

It is cleaner to study

S=1βˆ’1+2βˆ’1+β‹―+(pβˆ’1)βˆ’1(modp2).S = 1^{-1}+2^{-1}+\cdots+(p-1)^{-1} \pmod{p^2}.

Pair opposite terms:

2S=βˆ‘k=1pβˆ’1(1k+1pβˆ’k)=βˆ‘k=1pβˆ’1pk(pβˆ’k).2S = \sum_{k=1}^{p-1} \left(\frac1k + \frac{1}{p-k}\right) = \sum_{k=1}^{p-1} \frac{p}{k(p-k)}.

Thus it is enough to show

βˆ‘k=1pβˆ’11k(pβˆ’k)≑0(modp).\sum_{k=1}^{p-1} \frac{1}{k(p-k)} \equiv 0 \pmod p.

But modulo pp,

1k(pβˆ’k)β‰‘βˆ’1k2,\frac{1}{k(p-k)} \equiv -\frac{1}{k^2},

so the sum is

βˆ’βˆ‘k=1pβˆ’1kβˆ’2,-\sum_{k=1}^{p-1} k^{-2},

which vanishes by Lemma 3.4.

Lemma 3.6 (Harmonic Modulo pp Trick). For k=1,2,…,pβˆ’1k=1,2,\dots,p-1,

1k≑(βˆ’1)kβˆ’11p(pk)(modp).\frac1k \equiv (-1)^{k-1}\frac{1}{p}\binom{p}{k} \pmod p.

The quantity (pk)/p\binom pk/p is an integer for 1≀k≀pβˆ’11\le k\le p-1. It equals (pβˆ’1kβˆ’1)/k\binom{p-1}{k-1}/k, interpreted using the inverse of kk modulo pp. Since (pβˆ’1kβˆ’1)≑(βˆ’1)kβˆ’1(modp)\binom{p-1}{k-1}\equiv(-1)^{k-1}\pmod p, the identity follows. There is no inverse of pp modulo pp; the division by pp happens in the integers first.

This converts harmonic-looking expressions into binomial expressions, which are often easier to manipulate.

Problem 3.8 (ELMO 2009, John Berman). Let pp be an odd prime and let xx be an integer such that p∣x3βˆ’1p \mid x^3-1 but p∀xβˆ’1p \nmid x-1. Prove that pp divides

(pβˆ’1)!(xβˆ’x22+x33βˆ’β‹―βˆ’xpβˆ’1pβˆ’1).(p-1)! \left(x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots - \frac{x^{p-1}}{p-1}\right).

Problem 3.9. Let p>5p>5 be prime. Prove that

113+123+β‹―+1(pβˆ’1)3≑0(modp2).\frac{1}{1^3} + \frac{1}{2^3} + \cdots + \frac{1}{(p-1)^3} \equiv 0 \pmod{p^2}.

Problem 3.10 (OMO 2013 W42, Victor Wang). Find the remainder when

∏i=0100(1βˆ’i2+i4)\prod_{i=0}^{100} (1-i^2+i^4)

is divided by 101101.

Earlier we saw the identity

βˆ‘d∣nΟ†(d)=n.\sum_{d \mid n} \varphi(d)=n.

This section puts that kind of divisor sum into a larger framework.

Definition 4.1. An arithmetic function assigns a complex value to each positive integer. For multiplicative functions here, require f(1)=1f(1)=1.

  • It is multiplicative if f(mn)=f(m)f(n)f(mn)=f(m)f(n) whenever gcd⁑(m,n)=1\gcd(m,n)=1.
  • It is completely multiplicative if f(mn)=f(m)f(n)f(mn)=f(m)f(n) for all positive integers m,nm,n.

Example. Give examples of completely multiplicative arithmetic functions.

The following functions work because substituting a product into each definition gives the product of the two values:

  • The identity function id⁑(n)=n\operatorname{id}(n)=n.
  • The Dirichlet delta function Ξ΄(n)={1n=1,0nβ‰₯2.\delta(n)= \begin{cases} 1 & n=1, \\ 0 & n \ge 2. \end{cases}
  • The constant function 1(n)=11(n)=1.

Example. Give examples of arithmetic functions that are multiplicative but not completely multiplicative.

Prime-factorization formulas show that these functions multiply on coprime inputs:

  • Euler’s totient function Ο†\varphi.
  • The MΓΆbius function ΞΌ(n)={(βˆ’1)mifΒ nΒ isΒ aΒ productΒ ofΒ mΒ distinctΒ primes,0ifΒ nΒ isΒ notΒ squarefree.\mu(n)= \begin{cases} (-1)^m & \text{if } n \text{ is a product of } m \text{ distinct primes}, \\ 0 & \text{if } n \text{ is not squarefree}. \end{cases}
  • The divisor sum function Οƒ(n)\sigma(n).
  • The divisor counting function Ο„(n)\tau(n).

For example, Ο†(4)=2β‰ Ο†(2)2\varphi(4)=2\ne\varphi(2)^2, ΞΌ(4)=0β‰ ΞΌ(2)2\mu(4)=0\ne\mu(2)^2, Οƒ(4)=7β‰ Οƒ(2)2\sigma(4)=7\ne\sigma(2)^2, and Ο„(4)=3β‰ Ο„(2)2\tau(4)=3\ne\tau(2)^2. These checks explain why the stronger property fails.

For multiplicative functions, it is enough to know the values on prime powers.

Given arithmetic functions ff and gg, define

(fβˆ—g)(n)=βˆ‘d∣nf(d)g(n/d).(f*g)(n) = \sum_{d \mid n} f(d)g(n/d).

Equivalently,

(fβˆ—g)(n)=βˆ‘de=nf(d)g(e).(f*g)(n) = \sum_{de=n} f(d)g(e).

Example. Verify the following:

  • Divisor count: 1βˆ—1=Ο„1*1=\tau
  • Divisor sum: 1βˆ—id⁑=Οƒ1*\operatorname{id}=\sigma
  • Weighted divisor count: idβ‘βˆ—id⁑=nΟ„\operatorname{id}*\operatorname{id}=n\tau
  • Totient sum: 1βˆ—Ο†=id⁑1*\varphi=\operatorname{id}
  • Identity: Ξ΄βˆ—f=f\delta*f=f for any arithmetic function ff

For the first identity, every divisor contributes one. In the second, summing id⁑(n/d)\operatorname{id}(n/d) over divisors gives the sum of all divisors. In the third, every summand is d(n/d)=nd(n/d)=n and there are Ο„(n)\tau(n) of them. The fourth is the totient divisor identity proved earlier. In the fifth, only d=1d=1 contributes because Ξ΄(d)=0\delta(d)=0 for every other divisor.

Useful properties:

  • βˆ—* is commutative.
  • βˆ—* is associative.
  • βˆ—* distributes over addition.
  • The identity element is Ξ΄\delta.
  • 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\sum_{d \mid n} \varphi(d)=n

as

Ο†βˆ—1=id⁑.\varphi * 1 = \operatorname{id}.

Both sides are multiplicative, so it is enough to check prime powers:

1+(pβˆ’1)+(p2βˆ’p)+β‹―+(peβˆ’peβˆ’1)=pe.1 + (p-1) + (p^2-p) + \cdots + (p^e-p^{e-1}) = p^e.

Lemma 4.7. The MΓΆbius function is the inverse of 11 under Dirichlet convolution:

ΞΌβˆ—1=Ξ΄.\mu * 1 = \delta.

Exercise 4.8. Prove this by checking prime powers.

Theorem 4.9 (MΓΆbius Inversion Formula). Let ff and gg be arithmetic functions. Then

g(n)=βˆ‘d∣nf(d)⟺f(n)=βˆ‘d∣nΞΌ(d) g(n/d).g(n) = \sum_{d \mid n} f(d) \qquad\Longleftrightarrow\qquad f(n) = \sum_{d \mid n} \mu(d)\,g(n/d).

Equivalently, if g=fβˆ—1g=f*1 then f=gβˆ—ΞΌf=g*\mu.

Proof (MΓΆbius inversion). If g=fβˆ—1g=f*1, then

gβˆ—ΞΌ=(fβˆ—1)βˆ—ΞΌ=fβˆ—(1βˆ—ΞΌ)=fβˆ—Ξ΄=f.g*\mu = (f*1)*\mu = f*(1*\mu) = f*\delta = f.

Example. (IMO Shortlist 1989) Define {an}nβ‰₯1\{a_n\}_{n \ge 1} by

βˆ‘d∣nad=2n.\sum_{d \mid n} a_d = 2^n.

Show that n∣ann \mid a_n.

By MΓΆbius inversion,

an=βˆ‘d∣nΞΌ(n/d) 2d.a_n = \sum_{d \mid n} \mu(n/d)\,2^d.

To finish, let bnb_n count binary strings of length nn whose smallest repeating block has length nn. Every binary string of length nn is obtained by repeating a unique shortest block of length d∣nd\mid n, so

2n=βˆ‘d∣nbd.2^n=\sum_{d\mid n}b_d.

Mâbius inversion gives the same formula for bnb_n as for ana_n, hence an=bna_n=b_n. Rotate a string counted by bnb_n cyclically. Its nn rotations are distinct, since an earlier return would give a shorter repeating block. These strings therefore split into groups of size nn, proving n∣ann\mid a_n.

Problem 4.11. Prove that for every integer nβ‰₯1n \ge 1,

βˆ‘d∣n(Ο„(d))3=(βˆ‘d∣nΟ„(d))2.\sum_{d \mid n} (\tau(d))^3 = \left(\sum_{d \mid n} \tau(d)\right)^2.

Problem 4.12 (Bulgaria 1989). Let Ξ©(n)\Omega(n) denote the number of prime factors of nn counted with multiplicity. Evaluate

βˆ‘n=11989(βˆ’1)Ξ©(n)⌊1989nβŒ‹.\sum_{n=1}^{1989} (-1)^{\Omega(n)} \left\lfloor \frac{1989}{n} \right\rfloor.

Problem 4.13. Prove that for all positive integers nn,

ΞΌ(n)=βˆ‘1≀k≀ngcd⁑(k,n)=1cos⁑(2Ο€kn).\mu(n)=\sum_{\substack{1 \le k \le n \\ \gcd(k,n)=1}} \cos\left(\frac{2\pi k}{n}\right).

Telescoping can be extended to a product of two sequences. If Ak=a1+β‹―+akA_k=a_1+\cdots+a_k and A0=0A_0=0, then ak=Akβˆ’Akβˆ’1a_k=A_k-A_{k-1}. Substituting this difference and shifting indices gives summation by parts:

βˆ‘k=1nakbk=Anbn+βˆ‘k=1nβˆ’1Ak(bkβˆ’bk+1).\sum_{k=1}^n a_kb_k =A_nb_n+\sum_{k=1}^{n-1}A_k(b_k-b_{k+1}).

This is useful when the partial sums of aka_k are simple even though the individual product is not. It separates oscillation, stored in AkA_k, from the gradual variation of bkb_k. Keep the boundary term; omitting it is the discrete version of forgetting an integration constant.

For instance, take ak=(βˆ’1)kβˆ’1a_k=(-1)^{k-1} and bk=1/kb_k=1/k. The partial sums AkA_k are either zero or one. In the summation-by-parts expression, the differences 1/kβˆ’1/(k+1)1/k-1/(k+1) are nonnegative and telescope, while An/nβ†’0A_n/n\to0. 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)/2T_k=k(k+1)/2. Then Tkβˆ’Tkβˆ’1=kT_k-T_{k-1}=k and Tk+Tkβˆ’1=k2T_k+T_{k-1}=k^2, so

Tk2βˆ’Tkβˆ’12=k3.T_k^2-T_{k-1}^2=k^3.

Summing yields βˆ‘k=1nk3=[n(n+1)/2]2\sum_{k=1}^n k^3=[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=1nk2k\sum_{k=1}^n k2^k.

Start from 1+t+β‹―+tn=(1βˆ’tn+1)/(1βˆ’t)1+t+\cdots+t^n=(1-t^{n+1})/(1-t), differentiate, and multiply by tt. The result is

βˆ‘k=1nktk=tβˆ’(n+1)tn+1+ntn+2(1βˆ’t)2,tβ‰ 1.\sum_{k=1}^n kt^k =\frac{t-(n+1)t^{n+1}+nt^{n+2}}{(1-t)^2}, \qquad t\ne1.

At t=2t=2 this becomes (nβˆ’1)2n+1+2(n-1)2^{n+1}+2. Checking n=1n=1 gives two, which confirms the boundary terms.

The same differentiation idea handles binomial weights. Write k2=k(kβˆ’1)+kk^2=k(k-1)+k, so derivatives of (1+x)n(1+x)^n give

βˆ‘k=0nk2(nk)=n(nβˆ’1)2nβˆ’2+n2nβˆ’1=n(n+1)2nβˆ’2\sum_{k=0}^n k^2\binom nk =n(n-1)2^{n-2}+n2^{n-1} =n(n+1)2^{n-2}

for nβ‰₯1n\ge1. More complicated polynomial weights can be expressed using falling factorials, which match repeated derivatives naturally.


The integer ⌊N/dβŒ‹\lfloor N/d\rfloor counts positive multiples of dd not exceeding NN. It also counts positive integers bb with db≀Ndb\le N. Therefore

βˆ‘d=1N⌊NdβŒ‹=#{(a,b)∈Z>02:ab≀N}.\sum_{d=1}^N\left\lfloor\frac Nd\right\rfloor =\#\{(a,b)\in\mathbb Z_{>0}^2:ab\le N\}.

This is a count under a hyperbola. Every point either has its first coordinate at most m=⌊NβŒ‹m=\lfloor\sqrt N\rfloor or its second coordinate at most mm; otherwise the product exceeds NN. Points with both coordinates at most mm were counted twice.

Example. Evaluate βˆ‘d=1100⌊100/dβŒ‹\sum_{d=1}^{100}\lfloor100/d\rfloor using only ten floor evaluations.

With m=10m=10, symmetry of the lattice-point count gives

βˆ‘d=1100⌊100dβŒ‹=2βˆ‘d=110⌊100dβŒ‹βˆ’102.\sum_{d=1}^{100}\left\lfloor\frac{100}{d}\right\rfloor =2\sum_{d=1}^{10}\left\lfloor\frac{100}{d}\right\rfloor-10^2.

The ten values are 100,50,33,25,20,16,14,12,11,10100,50,33,25,20,16,14,12,11,10, totaling 291291. The answer is 2(291)βˆ’100=4822(291)-100=482.

This method is also called the hyperbola method. Its advantage is structural: a sum with NN terms becomes one with roughly N\sqrt N terms. Another useful observation is that ⌊N/dβŒ‹\lfloor N/d\rfloor remains constant over intervals of consecutive dd. If the current quotient is qq, its last occurrence is ⌊N/qβŒ‹\lfloor N/q\rfloor. 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≀n1\le i\le j\le n, sketch or describe the index set first. Summing over ii first uses j=i,…,nj=i,\ldots,n, while summing over jj first uses i=1,…,ji=1,\ldots,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.


These are strong practice problems from the original handout.

Problem 6.1 (AMSP 2011 NT3 Exam). For nβ‰₯1n \ge 1, evaluate

βˆ‘k=1nΞΌ(k)⌊nkβŒ‹.\sum_{k=1}^n \mu(k)\left\lfloor \frac{n}{k} \right\rfloor.

Problem 6.2 (USAMO 2010/5). Let q=3pβˆ’52q=\frac{3p-5}{2} where pp is an odd prime, and let

Sq=12β‹…3β‹…4+15β‹…6β‹…7+β‹―+1q(q+1)(q+2).S_q = \frac{1}{2 \cdot 3 \cdot 4} + \frac{1}{5 \cdot 6 \cdot 7} + \cdots + \frac{1}{q(q+1)(q+2)}.

Prove that if

1pβˆ’2Sq=mn\frac1p - 2S_q = \frac{m}{n}

for integers m,nm,n, then p∣(mβˆ’n)p \mid (m-n).

Problem 6.3 (Princeton Individual Finals 2015). Let pp be an odd prime. Prove that

p2∣2pβˆ’2p^2 \mid 2^p-2

if and only if

11β‹…2+13β‹…4+β‹―+1(pβˆ’2)(pβˆ’1)≑0(modp).\frac{1}{1 \cdot 2} + \frac{1}{3 \cdot 4} + \cdots + \frac{1}{(p-2)(p-1)} \equiv 0 \pmod p.

Problem 6.4 (Reed Dawson). For nβ‰₯0n \ge 0, compute

βˆ‘kβ‰₯0(2kk)(nk)(βˆ’14)k.\sum_{k \ge 0} \binom{2k}{k}\binom{n}{k}\left(-\frac14\right)^k.

Problem 6.5 (NIMO 24.8). For a complex number z≠3,4z \ne 3,4, let F(z)F(z) denote the real part of

1(3βˆ’z)(4βˆ’z).\frac{1}{(3-z)(4-z)}.

Compute

∫01F ⁣(cos⁑2Ο€t+isin⁑2Ο€t5)dt.\int_0^1 F\!\left(\frac{\cos 2\pi t + i \sin 2\pi t}{5}\right)dt.

Problem 6.6 (NIMO 14.8). Let xx be a positive real number. Define

A=βˆ‘k=0∞x3k(3k)!,B=βˆ‘k=0∞x3k+1(3k+1)!,C=βˆ‘k=0∞x3k+2(3k+2)!.A = \sum_{k=0}^{\infty} \frac{x^{3k}}{(3k)!}, \qquad B = \sum_{k=0}^{\infty} \frac{x^{3k+1}}{(3k+1)!}, \qquad C = \sum_{k=0}^{\infty} \frac{x^{3k+2}}{(3k+2)!}.

Given that

A3+B3+C3+8ABC=2014,A^3+B^3+C^3+8ABC=2014,

compute ABCABC.

Problem 6.7 (OMO 2013 F24). Real numbers a0,a1,…,a2013a_0,a_1,\dots,a_{2013} and b0,b1,…,b2013b_0,b_1,\dots,b_{2013} satisfy

an=1632n+2+anβˆ’1,bn=1962n+2βˆ’bnβˆ’1a_n = \frac{1}{63}\sqrt{2n+2}+a_{n-1}, \qquad b_n = \frac{1}{96}\sqrt{2n+2}-b_{n-1}

for n=1,2,…,2013n=1,2,\dots,2013. If a0=b2013a_0=b_{2013} and b0=a2013b_0=a_{2013}, compute

βˆ‘k=12013(akbkβˆ’1βˆ’akβˆ’1bk).\sum_{k=1}^{2013}(a_kb_{k-1}-a_{k-1}b_k).

Problem 6.8 (IMO Shortlist 2014 N6). Let a1<a2<β‹―<ana_1<a_2<\cdots<a_n be pairwise coprime positive integers, with a1a_1 prime and a1β‰₯n+2a_1 \ge n+2. On the interval [0,a1a2β‹―an][0,a_1a_2\cdots a_n] mark all integers divisible by at least one of a1,…,ana_1,\dots,a_n. These split the interval into smaller segments. Prove that the sum of the squares of the lengths of these segments is divisible by a1a_1.

Problem 6.9 (OMO 2014 S25). Compute

βˆ‘n=1∞1(1+12+β‹―+1n)(n+100100).\sum_{n=1}^{\infty} \frac{1}{\left(1+\frac12+\cdots+\frac1n\right)\binom{n+100}{100}}.

Problem 6.10 (OMO 2015 F30). Ryan defines a function Δ:N→N\Delta:\mathbb N \to \mathbb N by Δ(1)=1\Delta(1)=1 and

Ξ”(n)=βˆ‘d∣ndβ‰ nΞ”(d)\Delta(n)=\sum_{\substack{d \mid n \\ d \ne n}}\Delta(d)

for n>1n>1. Determine

βˆ‘k=0βˆžΞ”(15k)15k.\sum_{k=0}^{\infty} \frac{\Delta(15^k)}{15^k}.
  • 2.7 Telescope. The answer is 32\frac32.
  • 2.8 Use contradiction and the intermediate value theorem. Expand the geometric series and switch the order.
  • 2.9 The answer is 1721\frac{17}{21}. Try Ravi substitution.
  • 2.10 Apply a roots-of-unity filter to βˆ’1+(1+x)(1+x2)β‹―(1+x1000)-1 + (1+x)(1+x^2)\cdots(1+x^{1000}).
  • 3.8 Use Lemma 3.6.
  • 3.9 Repeat the proof of Wolstenholme by pairing opposite terms.
  • 3.10 The answer is 99. Rewrite 1βˆ’i2+i41-i^2+i^4 as i6+1i2+1\frac{i^6+1}{i^2+1} for i≑̸±10(mod101)i \not\equiv \pm 10 \pmod{101}.
  • 4.11 Both sides are multiplicative, so check prime powers.
  • 4.12 Compute βˆ‘d∣n(βˆ’1)Ξ©(d)\sum_{d \mid n}(-1)^{\Omega(d)}, then swap the order with the floor.
  • 4.13 Let F(n)F(n) be the right-hand side and show that Fβˆ—1=Ξ΄F*1=\delta.
  • 6.1 The answer is 11. Switch the order with the floor and use βˆ‘d∣nΞΌ(d)=Ξ΄(n)\sum_{d \mid n}\mu(d)=\delta(n).
  • 6.2 Partial fractions.
  • 6.3 Partial fractions and Lemma 3.6.
  • 6.9 The answer is 1009801\frac{100}{9801}. Switch the order, telescope the inverted binomial coefficients, then telescope again.
  • 6.10 The answer is 117\frac{11}{7}. Use a two-variable generating function.