Combinatorics in Mathematical Olympiads
Devansh Kumar Tripathi
January 2025
1 Preface
This handout is mainly for IOQM and RMO (later problems). This Pset in-
cludes general combinatorics, recurrences and general sequences and combi-
natorial number theory. Problems per-section are vaguely ordered according
to difficulty.
ENJOY !!
1
Devansh Kumar Tripathi
2 Strategies
• Break Down Problems
• Visualize
• Look for Patterns
• Pigeonhole Principle
• Casework
• Invariants
• Recursion
• Generating Functions
• Inclusion-Exclusion
• Graph Theory
• Practice
• Analyze
3 Problems
3.1 ASHME 2015
A box contains 2 red marbles, 2 green marbles, and 2 yellow marbles. Carol
takes 2 marbles from the box at random; then Claudia takes 2 of the remain-
ing marbles at random; and then Cheryl takes the last two marbles. What
is the probability that Cheryl gets 2 marbles of the same color?
3.2 AMC 12 2014
A fancy bed and breakfast inn has 5 rooms, each with a distinctive color-
coded decor. One day 5 friends arrive to spend the night. There are no other
guests that night. The friends can room in any combination they wish, but
with no more than 2 friends per room. In how many ways can the innkeeper
assign the guests to the rooms?
2
Devansh Kumar Tripathi
3.3 CHMMC Winter 2022
Select a number X from the set of all 3-digit natural numbers uniformly at
random. Let A ∈ [0, 1] be the probability that X is divisible by 11, given that
it is palindromic. Let B ∈ [0, 1] be the probability that X is palindromic,
given that it is divisible by 11. Compute B −A. Recall that a 3-digit number
is a palindrome if it reads the same left to right as right to left. For instance,
484 is a palindrome, but 603 is not a palindrome.
3.4 DMM 2015
Michael loses things, especially his room key. If in a day of the week he has
n classes he loses his key with probability n/5. After he loses his key during
the day he replaces it before he goes to sleep so the next day he will have a
key. During the weekend(Saturday and Sunday) Michael studies all day and
does not leave his room, therefore he does not lose his key. Given that on
Monday he has 1 class, on Tuesday and Thursday he has 2 classes and that
on Wednesday and Friday he has 3 classes, what is the probability that loses
his key at least once during a week?
3.5 PuMAC 2019
Prinstan Trollner and Dukejukem are competing at the game show WASS.
Both players spin a wheel which chooses an integer from 1 to 50 uniformly
at random, and this number becomes their score. Dukejukem then flips a
weighted coin that lands heads with probability 35 . If he flips heads, he adds
1 to his score. A player wins the game if their score is higher than the other
player’s score. A player wins the game if their score is higher than the other
player’s score. The probability Dukejukem defeats the Trollner to win WASS
equals mn
where m and n are coprime positive integers. Computer m + n.
3.6 CHMMC Fall 2013
The number of non-negative integers x1 , x2 , ..., x12 such that
x1 + x2 + ... + x12 ≤ 17
can be expressed in the form ab , where 2b ≤ a. Find a + b.
3
Devansh Kumar Tripathi
3.7 AIME 2004
How many positive integers less than 10,000 have at most two different digits?
3.8 Bulgaria MO Regional round 2024
A board 2025 × 2025 is filled with the numbers 1, 2, . . . , 2025, each appearing
exactly 2025 times. Show that there is a row or column with at least 45
distinct numbers.
3.9 Moscow MO 1996
Eight students solved 8 problems.
a) It turned out that each problem was solved by 5 students. Prove that
there are two students such that each problem is solved by at least one of
them.
b) If it turned out that each problem was solved by 4 students, it can happen
that there is no pair of students such that each problem is solved by at least
one of them. (Give an example.)
3.10 CMO Qualification Repechage 2018
Let n and k be positive integers with 1 ≤ k ≤ n. A set of cards numbered 1
to n are arranged randomly in a row from left to right. A person alternates
between performing the following moves: The leftmost card in the row is
moved k − 1 positions to the right while the cards in positions 2 through k
are each moved one place to the left. The rightmost card in the row is moved
k − 1 positions to the left while the cards in positions n − k + 1 through n − 1
are each moved one place to the right. Determine the probability that after
some number of moves the cards end up in order from 1 to n, left to right.
3.11 Canada National Olympiad 2020
There are finite many coins in David’s purse. The values of these coins are
pair wisely distinct positive integers. Is that possible to make such a purse,
such that David has exactly 2020 different ways to select the coins in his
purse and the sum of these selected coins is 2020?
4
Devansh Kumar Tripathi
3.12 239 Open Mathematical Olympiad 2018
Graph G becomes planar when any vertex is removed. Prove that its vertices
can be properly colored with 5 colors. (Using the four-color theorem without
proof is not allowed!)
3.13 Classics
3.13.1 P1
Let k be an integer. Which m∗n boards can be tiled with 1∗k tiles (rotations
allowed)?
3.13.2 P2
A 2003 × 2004 rectangle consists of unit squares. We consider rhombi formed
by four diagonals of unit squares. What maximum number of such rhombi
can be arranged in this rectangle so that no two of them have any common
points except vertices?
3.14 Tuymaada Junior 2003 p6
On a circle, numbers from 1 to 100 are arranged in some order. We call a
pair of numbers good if these two numbers do not stand side by side, and at
least on one of the two arcs into which they break a circle, all the numbers
are less than each of them. What can be the total number of good pairs?
3.15 PuMAC 2019
Let Sn be the set of points (x/2, y/2) ∈ R2 such that x and y are odd integers
and |x| ≤ y ≤ 2n. Let Tn be the number of graphs G with vertex set in Sn
satisfying the following conditions: G has no cycles. If two points share an
edge, then the distance between them is 1. For any path P = (a, . . . , b) in
G, the smallest y-coordinate among the points in P is either that of a or
that of b. However, multiple points may share this y-coordinate. Find the
100th-smallest positive integer n such that the units digit of T3n is 4.
5
Devansh Kumar Tripathi
3.16 AIME 2019
A soccer team has 22 available players. A fixed set of 11 players starts the
game, while the other 11 are available as substitutes. During the game, the
coach may make as many as 3 substitutions, where any one of the 11 players
in the game is replaced by one of the substitutes. No player removed from
the game may reenter the game, although a substitute entering the game
may be replaced later. No two substitutions can happen at the same time.
The players involved and the order of the substitutions matter. Let n be the
number of ways the coach can make substitutions during the game (including
the possibility of making no substitutions). Find the remainder when n is
divided by 1000.
3.17 AIME 1995
Let p be the probability that, in the process of repeatedly flipping a fair coin,
one will encounter a run of 5 heads before one encounters a run of 2 tails.
Given that p can be written in the form m/n where m and n are relatively
prime positive integers, find m + n.
3.18 Caucasus MO
16 NHL teams in the first playoff round divided in pairs and to play series
until 4 wins (thus the series could finish with score 4-0, 4-1, 4-2, or 4-3).
After that 8 winners of the series play the second playoff round divided into
4 pairs to play series until 4 wins, and so on. After all the final round is over,
it happens that k teams have non-negative balance of wins (for example, the
team that won in the first round with a score of 4-2 and lost in the second
with a score of 4-3 fits the condition: it has 4 + 3 = 7 wins and 2 + 4 = 6
losses). Find the least possible k.
3.19 239 Open Mathematical Olympiad 2016
A graph is called 7 − chip if it obtained by removing at most three edges
that have no vertex in common from a complete graph with seven vertices.
Consider a complete graph G with v vertices which each edge of its is colored
blue or red. Prove that there is either a blue path with 100 edges or a red
7 − chip.
6
Devansh Kumar Tripathi
3.20 Iranian RMM TST
There are n stations 1, 2, ..., n in a broken road (like in Cars) in that order
such that the distance between station i and i + 1 is one unit. The distance
betwen two positions of cars is the minimum units needed to be fixed so that
every car can go from its place in the first position to its place in the second
(two cars can be in the same station in a position). Prove that for every
α < 1 thre exist n and 100n positions such that the distance of every two
position is at least nα.
3.21 All-Russian Olympiad Regional Round 2023
Given is a positive integer k. There are n points chosen on a line, such the
distance between any two adjacent points is the same. The points are colored
in k colors. For each pair of monochromatic points such that there are no
points of the same color between them, we record the distance between these
two points. If all distances are distinct, find the largest possible n.
3.22 CNMO 2021
Nina and Tadashi play the following game. Initially, a triple (a, b, c) of non-
negative integers with a + b + c = 2021 is written on a blackboard. Nina and
Tadashi then take moves in turn, with Nina first. A player making a move
chooses a positive integer k and one of the three entries on the board; then
the player increases the chosen entry by k and decreases the other two en-
tries by k. A player loses if, on their turn, some entry on the board becomes
negative.
Find the number of initial triples (a, b, c) for which Tadashi has a winning
strategy.
3.23 All-Russian Olympiad 2019
Pasha and Vova play the following game, making moves in turn; Pasha moves
first. Initially, they have a large piece of plasticine. By a move, Pasha cuts
one of the existing pieces into three(of arbitrary sizes), and Vova merges two
existing pieces into one. Pasha wins if at some point there appear to be 100
pieces of equal weights. Can Vova prevent Pasha’s win?
7
Devansh Kumar Tripathi
3.24 CNMO 2022
Let n be a positive integer. A set of n distinct lines divides the plane into
various (possibly unbounded) regions. The set of lines is called “nice” if no
three lines intersect at a single point. A “colouring” is an assignment of two
colours to each region such that the first colour is from the set {A1 , A2 },
and the second colour is from the set {B1 , B2 , B3 }. Given a nice set of lines,
we call it “colourable” if there exists a colouring such that (a) no colour
is assigned to two regions that share an edge; (b) for each i ∈ {1, 2} and
j ∈ {1, 2, 3} there is at least one region that is assigned with both Ai and Bj
. Determine all n such that every nice configuration of n lines is colourable.
3.25 2022 China Second Round A1
Given r ∈ R. Alice and Bob plays the following game: An equation with
blank is written on the blackboard as below:
S =|−|+|−|+|−|
Every round, Alice choose a real number from [0, 1] (not necessary to be
different from the numbers chosen before) and Bob fill it in an empty box.
After 6 rounds, every blank is filled and S is determined at the same time.
If S ≥ r then Alice wins, otherwise Bob wins. Find all r such that Alice can
guarantee her victory.
3.26 ASDAN 2015
You have a circular necklace with 10 beads on it, all of which are initially
unpainted. You randomly select 5 of these beads. For each selected bead,
you paint that selected bead and the two beads immediately next to it (this
means we may paint a bead multiple times). Once you have finished painting,
what is the probability that every bead is painted?
3.27 RMO - Mexico Center Zone 2016
There are seven piles with 2014 pebbles each and a pile with 2008 pebbles.
Ana and Beto play in turns and Ana always plays first. One move consists
of removing pebbles from all the piles. From each pile is removed a different
amount of pebbles, between 1 and 8 pebbles. The first player who cannot
8
Devansh Kumar Tripathi
make a move loses. a) Who has a winning strategy? b) If there were seven
piles with 2015 pebbles each and a pile with 2008 pebbles, who has a winning
strategy?
3.28 CGMO 2022
There are 3 classes with n students in each class, and the heights of all 3n
students are pairwise distinct. Partition the students into groups of 3 such
that in each group, there is one student from each class. In each group,
call the tallest student the tall guy. Suppose that for any partition of the
students, there are at least 10 tall guys in each class, prove that the minimum
value of n is 40.
3.29 QEDMO 2013
Santa Claus wants to wrap presents. These are available in n sizes A1 < A2 <
... < An , and analogously, there are n packaging sizes B1 < B2 < ... < Bn ,
where Bi is enough to all gift sizes Aj can be grouped with j ≤ i, but too
small for those with j > i. On the shelf to the right of Santa Claus are
the gifts sorted by size, where the smallest are on the right, of course there
can be several gifts of the same size, or none of a size at all. To his left is
a shelf with packaging, and also these are sorted from small to large in the
same direction. He’s brooding in what way he should wrap the gifts and sees
two methods for doing this, which depend on his thinking and laziness of
movement have been optimized: a) He takes the present closest to him and
puts it in the closest packaging, in which it fits in. b) He takes the packaging
closest to him and packs in it the closest thing to him gift. In both cases
he then does the same again, although of course the one he was using the
gift and its packaging are missing, and so on. Once it is not large enough if
the packaging or the present is not small enough, he / she will provide the
present or the packaging back to its place on the shelf and takes the next-
closest. Prove that both methods lead to the same result in the end, they
are considered to be exactly the same gifts packed in the same packaging.
3.30 Bundeswettbewerb Mathematik 2020
Leo and Smilla find 2020 gold nuggets with masses 1, 2, . . . , 2020 gram, which
they distribute to a red and a blue treasure chest according to the following
9
Devansh Kumar Tripathi
rule:
First, Leo chooses one of the chests and tells its colour to Smilla. Then
Smilla chooses one of the not yet distributed nuggets and puts it into this
chest.
This is repeated until all the nuggets are distributed. Finally, Smilla
chooses one of the chests and wins all the nuggets from this chest.
How many gram of gold can Smilla make sure to win?
3.31 pOMA 2024
Marc has an n × n board, where n ≥ 3 is an integer, and an unlimited supply
of green and red apples. Marc wants to place some apples on the board, so
that the following conditions hold. Every cell of the board has exactly one
apple, be it red or green. All rows and columns of the board have at least
one red apple. No two rows or columns have the same apple color sequence.
Note that rows are read from left to right, and columns are read from top
to bottom. Also note that we do not allow a row and a column to have the
same color sequence. Find, in terms of n, the minimal number of red apples
that Marc needs in order to fill the board in this way.
3.32 Problem
Counting from the right end, what is the 2500th digit of 10000!?
3.33 IMOSL 2004
A and B play a game, given an integer N , A writes down 1 first, then every
player sees the last number written and if it is n then in his turn he writes
n + 1 or 2n, but his number cannot be bigger than N . The player who writes
N wins. For which values of N does B win?
10
Devansh Kumar Tripathi
4 Combinatorial Number Theory
4.1 P1
Let n and k be given relatively prime natural numbers, k < n. Each number
in the set M = {1, 2, ..., n − 1} is colored either blue or white. It is given that
for each i ∈ M, both i and n − i have the same color, for each i ∈ M, i ̸= k,
both i and |i − k| have the same color. Prove that all numbers in M have
the same color.
4.2 P2
Find the maximum number of pairwise disjoint sets of the form
Sa,b = {n2 + an + b | n ∈ Z},
with a, b ∈ Z.
4.3 P3
Prove that for each positive integer n, there exists a positive integer with
the following properties: it has exactly n digits, none of the digits is 0, it is
divisible by the sum of its digits.
4.4 P4
Let X be a non-empty set of positive integers
√ which satisfies the following:
if x ∈ X, then 4x ∈ X, if x ∈ X, then ⌊ x⌋ ∈ X. Prove that X = N .
4.5 P5
Suppose all the pairs of a positive integers from a finite collection
A = {a1 , a2 , · · · }
are added together to form a new collection
A∗ = {ai + aj | 1 ≤ i < j ≤ n}.
For example, A = {2, 3, 4, 7} would yield A∗ = {5, 6, 7, 9, 10, 11} and B =
{1, 4, 5, 6} would give B ∗ = {5, 6, 7, 9, 10, 11}. These examples show that it’s
11
Devansh Kumar Tripathi
possible for different collections A and B to generate the same collections A∗
and B ∗ . Show that if A∗ = B ∗ for different sets A and B, then |A| = |B|
and |A| = |B| must be a power of 2.
4.6 P6
Let M be a positive integer and consider the set
S = {n ∈ N | M 2 ≤ n < (M + 1)2 }.
Prove that the products of the form ab with a, b ∈ S are distinct.
4.7 P7
Let A be a non-empty set of positive integers. Suppose that there are positive
integers b1 , · · · , bn and c1 , · · · , cn such that for each i the set bi A + ci =
{bi a + ci |a ∈ A} is a subset of A, the sets bi A + ci and bj A + cj are disjoint
whenever i ̸= j. Prove that
1 1
+ ··· + ≤ 1.
b1 bn
4.8 P8
Let A be a set of N residues (mod N 2 ). Prove that there exists a set B
of N residues (mod N 2 ) such that the set A + B = {a + b|a ∈ A, b ∈ B}
contains at least half of all the residues (mod N 2 ).
4.9 P9
Let a1 < a2 < a3 < · · · be an infinite increasing sequence of positive integers
in which the number of prime factors of each term, counting repeated factors,
is never more than 1987. Prove that it is always possible to extract from A
an infinite subsequence b1 < b2 < b3 < · · · such that the greatest common
divisor (bi , bj ) is the same number for every pair of its terms.
4.10 P10
Suppose p is a prime with p ≡ 3 (mod 4). Show that for any set of p −
1 consecutive integers, the set cannot be divided two subsets so that the
12
Devansh Kumar Tripathi
product of the members of the one set is equal to the product of the members
of the other set.
4.11 P11
Let S be the set of all composite positive odd integers less than 79.
(a.) Show that S may be written as the union of three (not necessarily dis-
joint) arithmetic progressions.
(b.) Show that S cannot be written as the union of two arithmetic progres-
sions.
13
Devansh Kumar Tripathi
5 Recurrences
5.1 P1
An integer sequence {an }n≥1 is defined by
a0 = 0, a1 = 1, an+2 = 2an+1 + an
Show that 2k divides an if and only if 2k divides n.
5.2 Fibbonacci Sequences
5.2.1 P1
The Fibonacci sequence {Fn } is defined by
F1 = 1, F2 = 1, Fn+2 = Fn+1 + Fn .
m
Show that Fmn−1 − Fn−1 is divisible by Fn2 for all m ≥ 1 and n > 1.
5.2.2 P2
The Fibonacci sequence {Fn } is defined by
F1 = 1, F2 = 1, Fn+2 = Fn+1 + Fn .
Show that gcd(Fm , Fn ) = Fgcd(m,n) for all m, n ∈ N .
5.2.3 P3
The Fibonacci sequence {Fn } is defined by
F1 = 1, F2 = 1, Fn+2 = Fn+1 + Fn .
m m
Show that Fmn − Fn+1 + Fn−1 is divisible by Fn3 for all m ≥ 1 and n > 1.
5.3 P2
The sequence {xn }n≥1 is defined by
x1 = x2 = 1, xn+2 = 14xn+1 − xn − 4.
Prove that xn is always a perfect square.
14
Devansh Kumar Tripathi
5.4 P3
Let {un }n≥0 be a sequence of positive integers defined by
u0 = 1, un+1 = aun + b,
where a, b ∈ N . Prove that for any choice of a and b, the sequence {un }n≥0
contains infinitely many composite numbers.
5.5 P4
Let m be a positive integer. Define the sequence {an }n≥0 by
a0 = 0, a1 = m, an+1 = m2 an − an−1 .
Prove that an ordered pair (a, b) of non-negative integers, with a ≤ b, gives
a solution to the equation
a2 + b 2
= m2
ab + 1
if and only if (a, b) is of the form (an , an+1 ) for some n ≥ 0.
5.6 P5
Let the sequence {Kn }n≥1 be defined by
K1 = 2, K2 = 8, Kn+2 = 3Kn+1 − Kn + 5(−1)n .
Prove that if Kn is prime, then n must be a power of 3.
5.7 P6
The sequence {an }n≥1 is defined by
6a2n−1 an−3 − 8an−1 a2n−2
a1 = 1, a2 = 2, a3 = 24, an = (n ≥ 4).
an−2 an−3
Show that an is an integer for all n, and show that n|an for every n ∈ N .
15
Devansh Kumar Tripathi
5.8 P7
The Bernoulli sequence {Bn }n≥0 is defined by
n
1 X n+1
B0 = 1, Bn = − Bk (n ≥ 1)
n + 1 k=0 k
Show that for all n ∈ N ,
X1
(−1)n Bn − ,
p
is an integer where the summation is done over all primes p such that p|2k−1.
5.9 P8
A sequence of integers, {an }n≥1 with a1 > 0, is defined by
an
an+1 = if n ≡ 0 (mod 4),
2
an+1 = 3an + 1 if n ≡ 1 (mod 4),
an+1 = 2an − 1 if n ≡ 2 (mod 4),
an + 1
an+1 = if n ≡ 3 (mod 4).
4
Prove that there is an integer m such that am = 1.
5.10 P9
Let k be a positive integer. Prove that there exists an infinite monotone
increasing sequence of integers {an }n≥1 such that
an divides a2n+1 + k and an+1 divides a2n + k
for all n ∈ N .
5.11 P10
The first four terms of an infinite sequence S of decimal digits are 1, 9, 8,
2, and succeeding terms are given by the final digit in the sum of the four
immediately preceding terms. Thus S begins 1, 9, 8, 2, 0, 9, 9, 0, 8, 6, 3, 7,
4, · · · . Do the digits 3, 0, 4, 4 ever come up consecutively in S?
16
Devansh Kumar Tripathi
5.12 P11
An integer sequence {an }n≥1 is defined by
√
a1 = 1, an+1 = an + ⌊ an ⌋.
Show that an is a square if and only if n = 2k + k − 2 for some k ∈ N.
5.13 P12
Let P (x) be a nonzero polynomial with integer coefficients. Let a0 = 0 and
for i ≥ 0 define ai+1 = P (ai ). Show that gcd(am , an ) = agcd(m,n) for all
m, n ∈ N.
17
Devansh Kumar Tripathi
6 More Sequences
6.1 P1
The infinite sequence of 2’s and 3’s
2, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 2, 3, 3,
3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 2, 3, 3, 3, 2, · · ·
has the property that, if one forms a second sequence that records the number
of 3’s between successive 2’s, the result is identical to the given sequence.
Show that there exists a real number r such that, for any n, the nth term of
the sequence is 2 if and only if n = 1 + ⌊rm⌋ for some nonnegative integer
m.
6.2 P2
√
Show that the sequence {an }n≥1 defined by an = ⌊n 2⌋ contains an infinite
number of integer powers of 2.
6.3 P3
An integer sequence {an }n≥1 is given such that
X
2n = ad
d|n
for all n ∈ N . Show that an is divisible by n for all n ∈ N .
6.4 P4
Let q0 , q1 , · · · be a sequence of integers such that
a) for any m > n, m − n is a factor of qm − qn ,
b) |qn | ≤ n10 for all integers n ≥ 0.
Show that there exists a polynomial Q(x) satisfying qn = Q(n) for all n.
18
Devansh Kumar Tripathi
6.5 P5
The sequence {an }n≥1 is defined by
an = 1 + 2 2 + 3 3 + · · · + n n .
Prove that there are infinitely many n such that an is composite.
6.6 P6
In the sequence 00, 01, 02, 03, · · · , 99 the terms are rearranged so that each
term is obtained from the previous one by increasing or decreasing one of its
digits by 1 (for example, 29 can be followed by 19, 39, or 28, but not by 30
or 20). What is the maximal number of terms that could remain on their
places?
6.7 P7
Let
a1,1 a1,2 a1,3 ...
a2,1 a2,2 a2,3 ...
a3,1 a3,2 a3,3 ...
.. .. .. ..
. . . .
be a doubly infinite array of positive integers, and suppose each positive
integer appears exactly eight times in the array. Prove that am,n > mn for
some pair of positive integers (m, n).
6.8 P8
Let (an )n≥1 be a sequence of positive real numbers with the property that
(an+1 )2 + an an+2 ≤ an + an+2
for all positive integers n. Show that a2022 ≤ 1.
19
Devansh Kumar Tripathi
6.9 P8(IMOSL 2009)
Let n be a positive integer. Given a sequence ε1 , . . . , εn−1 with εi = 0 or
εi = 1 for each i = 1, . . . , n − 1, the sequences a0 , . . . , an and b0 , . . . , bn are
constructed by the following rules:
a0 = b0 = 1, a1 = b1 = 7,
(
2ai−1 + 3ai , if εi = 0,
ai+1 = for each i = 1, . . . , n − 1,
3ai−1 + ai , if εi = 1,
(
2bi−1 + 3bi , if εn−i = 0,
bi+1 = for each i = 1, . . . , n − 1.
3bi−1 + bi , if εn−i = 1,
Prove that an = bn .
20