You are on page 1of 46

Random Olympiad Problems

Aharshi Roy
17 August 2023

Started on 7th July 2023

Contents
1 Algebra 3
1.1 Standard Functional Equations . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 Canada National Olympiad 2002/5 . . . . . . . . . . . . . . . . . . 3
1.1.2 Baltic Way 2010/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3 IMO 2009/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.4 USEMO 2020/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.5 USAJMO 2019/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1.6 Balkan Mathematical Olympiad 2013/3 . . . . . . . . . . . . . . . 8
1.1.7 Irish National Olympiad 1991/2/4 . . . . . . . . . . . . . . . . . . 9
1.1.8 Gauss Mathematical Olympiad 2022/4 . . . . . . . . . . . . . . . . 11
1.1.9 Infinity Dots JMO 2019/1 . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.10 IMOSL 2011/A3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.1.11 Balkan Mathematical Olympiad 2023/1 . . . . . . . . . . . . . . . 14
1.1.12 APMO 2023/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.1.13 IMO 2011/5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.1.14 Japan TST 2022/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1.15 IMOSL 2015/A2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.1.16 RMM SL 2019/A1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.17 Japan Mathematical Olympiad Finals 2021/1 . . . . . . . . . . . . 21
1.2 Wrapped Functional Equations . . . . . . . . . . . . . . . . . . . . . . . . 22
1.2.1 Baltic Way 2014/4 . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.2.2 IMO 2010/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.3 Monster Functional Equations . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.3.1 PAMO 2018/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.3.2 IZhO 2017/2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.3.3 PFTB 4.20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2 Combinatorics 28
2.0.1 ELMO 2022/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.0.2 India TST 2016/3/3 . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.0.3 PAGMO 2022/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.0.4 Italy Mathematical Olympiad 2023/2 . . . . . . . . . . . . . . . . 31
2.0.5 C-UnS-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
2.0.6 IMO 2022/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

1
Random Olympiad Problems updated 17 August 2023

3 Number Theory 34
3.1 Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.1 IMOSL 2007/N2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.2 USMCA 2019/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Exponential NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.1 USAJMO 2011/1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.2.2 IMO 1999/4 (harder version) . . . . . . . . . . . . . . . . . . . . . 37
3.2.3 IMO 1990/3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.4 IMOSL 2022/N2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2.5 N-UnS-1 (China) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.2.6 China National Mathematical Olympiad 2009/2 . . . . . . . . . . 41
3.2.7 IMOSL 2006/N5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2.8 Mordell’s Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.2.9 N-UnS-2 (AMM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.2.10 N-UnS-3 (Pixton) . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.2.11 China TST 2006/1/2 . . . . . . . . . . . . . . . . . . . . . . . . . . 46

2
Random Olympiad Problems updated 17 August 2023

§1 Algebra
§1.1 Standard Functional Equations
§1.1.1 Canada National Olympiad 2002/5

Problem statement

Determine all functions f : Z≥0 → Z≥0 such that

xf (y) + yf (x) = (x + y)f (x2 + y 2 )

is satisfied for all x, y.

As usual let P (x, y) denote the assertion.


P (x, 0) → xf (0) = xf (x2 ) ⇐⇒ f (x2 ) = f (0).
P (x, x2 y 2 ) → f (0) + xy 2 f (x) = (1 + xy 2 )f (x2 + x4 y 4 ) ⇐⇒ f (1 + xy 2 ) | f (x) − f (0) for all
y, and hence if f (x) ̸= f (0) then picking an appropriately large y gives us a contradiction.
(See that the verification is trivial).
Hence the only solution is f (x) ≡ c ∀ x ∈ Z≥0 where c is a non-negative integer.

3
Random Olympiad Problems updated 17 August 2023

§1.1.2 Baltic Way 2010/5

Problem statement

Solve f (x2 ) + f (xy) = f (x)f (y) + yf (x) + xf (x + y) over reals.

As usual let P (x, y) denote the assertion to the problem statement.


P (0, x) → 2f (0) = f (x)f (0) + xf (0), and so if f (0) ̸= 0, then we get f (x) = 2 − x which
is a valid solution. Hence therefore assume f (0) = 0.

Then by P (x, 0), we get f (x2 ) = xf (x) = −xf (−x), which means f is odd.
Now finally by P (x, −x) we get f (x) = 0 or −x for each x ∈ R.
Now the most fun part about any FE for an insane person: POINT WISE TRAP!!!!
This part is just case bashing since we can assume for some non-zero a ̸= b, we have
f (a) = −a and f (b) = 0 and then by P (a, b) and P (b, a), we will get a contradiction.
One can easily verify both f (x) ≡ −x and f (x) ≡ 0, are solutions.

So in conclusion we get the only functions which work are:

f (x) ≡ 2 − x ∀ x ∈ R AND f (x) ≡ x ∀ x ∈ R AND f (x) ≡ 0 ∀ x ∈ R

4
Random Olympiad Problems updated 17 August 2023

§1.1.3 IMO 2009/5

Problem statement

Find all functions f : N → N such that for all positive integers x, y we have the
numbers x, f (y), f (y + f (x) − 1) are the sides of a non-degenerate triangle.

Let P (x, y) denote the statement. Also say that a ⇀ b ⇀ c if and only if a non-degenerate
triangle has side lengths a, b, c.
P (1, y) → 1 ⇀ f (y) ⇀ f (y + f (1) − 1) ⇐⇒ f (y) = f (y + f (1) − 1), now if f (1) ̸= 1, then
f is bounded and by picking a large enough x, in P (x, y) gives us an easy contradiction,
hence assume f (1) = 1.
Then by P (x, 1) we get f (f (x)) = x and so f is bijective also.
Now let f (2) = a ⇐⇒ f (a) = 2. Then by P (2, y) we get 2 ⇀ f (y) ⇀ f (a + y − 1) ⇐⇒
|f (y) − f (a + y − 1)| = 1 (see that this is since a ̸= 1 obviously).
Now look at the sequence {f (a), f (2a − 1), f (3a − 2), f (4a − 3), . . . } and by our previous
observation we get the absolute difference between any two consecutive terms of this
infinite sequence is 1. Now using this fact and that f is bijective with a ̸= 1, we get
f (ka − (k − 1)) = k + 1 ⇐⇒ f (k + 1) = ka − k + 1 for all k ≥ 1 and combining with the
fact f (1) = 1, we get f is linear. Now one can just verify easily that the only function
which works is the identity function.
Hence the only working function is f (x) ≡ x ∀ x ∈ N .

5
Random Olympiad Problems updated 17 August 2023

§1.1.4 USEMO 2020/4

Problem statement

A function f from the set of positive real numbers to itself satisfies

f (x + f (y) + xy) = xf (y) + f (x + y)

for all positive real numbers x and y. Prove that f (x) = x for all positive real
numbers x.

Proof. Let P (x, y) denote the assertion to the problem statement.

We begin by proving the following easy but nonetheless crucial claim.

Claim — We have f (x) ≥ x for all x ∈ R.

Proof. If for some c we have c > f (c), then by P ( c−fc (c) , c) we get f (c) · c−f (c)
c = 0, a
contradiction. □

Now define a function g : R>0 → R≥0 such that f (x) = x + g(x) for all positive x. And
so we rewrite the original equation as

g(x + y + g(y) + xy) + g(y) = xg(y) + g(x + y)

and let Q(x, y) denote the assertion to the above equation.

Claim — If for some a ̸= b we have g(a) = g(b) then it implies g(a) = g(b) = 0.

Proof. Because of the amazing symmetry in the rewritten equation, we get by Q(a, b)
and Q(b, a) that (a − 1)g(b) = (b − 1)g(a) ⇐⇒ g(a) = g(b) = 0 (since a ̸= b). □

And so by Q(1, x) and the previous claim, we obtain that g(x) = 0 for all x > 1. And
then picking any constant x0 > 1, we get by P (x0 , y) that (x0 − 1)g(y) = 0 ⇐⇒ g(y) =
0 ⇐⇒ f (y) = y. ■

Remark. Lol why is this 25 MOHS?

6
Random Olympiad Problems updated 17 August 2023

§1.1.5 USAJMO 2019/2

Problem statement

For which pairs of integers (a, b) do there exist functions f : Z → Z and g : Z → Z


obeying
f (g(x)) = x + a and g(f (x)) = x + b
for all integers x?

So obviously both f and g are bijective.


f (g(x)) = x + a =⇒ g(f (g(x)) = g(x + a) = g(x) + b and similarly we get f (x + b) =
f (x) + a.
Now we prove the following claim which is really the heart of the problem.

Claim — |a| = |b|

Proof. We begin by proving first that {g(0), g(1), . . . g(a − 1)} are all distinct modulo b.
Assume the contrary and so let 0 ≤ i, j ≤ a−1 where i ̸= j and g(i) = nb+r, g(j) = mb+r
(obviously n ≠ m). And then we get g(i + (m − n)a) = g(i) + (m − n)b = g(j) ⇐⇒
i + (m − n)a = j, but because 0 ≤ i, j ≤ a − 1, it implies m = n, a contradiction. And so
we get |a| ≤ |b|.
And then similarly we can consider the sequence of numbers {f (0), f (1), . . . , f (b − 1)}
modulo a and get that |b| ≤ |a|.
And so all in all, we have |a| = |b|. □

Hence in conclusion the only pairs which work are (a, b) = (k, ±k) where k ∈ Z (one
can see they obviously work since one can take f ≡ x + k, g ≡ x when a = b and take
f ≡ k − x, g ≡ −x when a = −b).

7
Random Olympiad Problems updated 17 August 2023

§1.1.6 Balkan Mathematical Olympiad 2013/3

Problem statement

3
Find all functions f : (R+ ) → R+ such that we have

(i) x · f (x, y, z) = z · f (z, y, x)

(ii) f (x, ky, k 2 z) = k · f (x, y, z)

(iii) f (1, k, k + 1) = k + 1

for all x, y, z, k ∈ R+ .

Let P (x, y, z); Q(x, y, z, k); and R(k) denote the assertions of the first, second and third
statement respectively.

Claim — x · f (x, y, z) = f (1, y, xz)


    √  
Proof. By Q x, y, z, √1z and P x, √yz , 1 we get f (x, y, z) = xz · f 1, √yz , x .
 √ 
Then by Q 1, √yz , x, z and by the previous statement we get x · f (x, y, z) = f (1, y, xz).

 √  √
y+ y 2 +4z y+ y 2 +4z
Now by Q 1, y, z, 2z (and the third condition) we get f (1, y, z) = 2 ⇐⇒

y+ y 2 +4xz
f (1, y, xz) = 2 .
p
y+ y 2 + 4xz
And then using this and the claim before we get f (x, y, z) = ∀ x, y,
2x
z ∈ R+ (verification is trivial).

8
Random Olympiad Problems updated 17 August 2023

§1.1.7 Irish National Olympiad 1991/2/4

Problem statement

Find all functions


  f from positive rationals to itself such that 2f (f (x)) = f (2x) and
f (x) + f x1 = 1 are satisfied for all x in positive rationals.

Let A(x) and B(x) denote the assertion to the two conditions given int the problem
statement, respectively.
x
We claim the only function which works is f (x) ≡ ∀ x ∈ Q+ . The verification is
x+1
trivial. Now we prove that this is the only function which works.
 
It is equivalent to prove that f pq = p+qp
for all relatively prime integers p and q.
Because of the second condition we only need to prove it for p < q.
We will induct on p + q = K.

¶ Base Case: K = 2, 3  
B(1) → f (1) = 21 ; A(1), B(2) → f 12 = 13 .

¶ Inductive Step
Assume it is true for all K ≤ 2K0 − 1. We will prove our claim for 2K0 , 2K0 + 1.

Subcase A: Proof
 of 2K
 0
p p p
A 2K0 −2p → 2f 2K0 −p = 2K0 .

Subcase B: Proof of 2K0 + 1  


p
From the first condition and the induction hypothesis we get 2l · f 2K0 +1−p =
l
  J
p·2
f 2K0 +1−p·2l ( ). So from now, it equivalent to prove our claim for all those p ≤ K0 ,
odd and relatively prime to 2K0 + 1 (call these numbers nice). Let the complement of p
to be 2K0 + 1 − p.

Define a cycle of 2K0 + 1 to be: take a number p0 which satisfies the previously listed
properties (basically it is nice), then multiply p0 with the highest power of 2 such that the
new number does not exceed 2K0 + 1 and then take the complement of the new number
and repeat the process. Call the numbers which you get by taking the complement (and
p0 ) to be the complementary numbers; and the numbers which you get by multiplying
the complementary numbers with a power of two be the exponential numbers. Keep
repeating the process until you get a complementary number which is already in the
cycle for the first time again, this is when the cycle stops (obviously the cycle must end
at some point).
Obviously see that since we started with a relatively prime number to 2K0 + 1, all the
number are relatively prime to it as well and all complement are obviously odd since the
exponent of 2 we are multiplying the complement must be atleast 1 (you can see trivially
why).

9
Random Olympiad Problems updated 17 August 2023

Claim — A cycle must end by getting the first complementary number (a.k.a p0 )
back.

Proof. This is because you can assume the contrary and then obviously the last number
of the cycle (which is an exponential number), maps back to the second of higher
complementary number in the cycle (call it N ), but then we can trace back and get
the second last exponential number maps to the complementary number before N , a
contradiction to the definition of a cycle. □

And obviously all the complementary numbers in a cycle are nice. Consider a cycle
non-distinct upto rotation. Also obviously hence all nice numbers must be in one and
only one cycle.

For example the cycles of 2K0 + 1 are (1 → 32); (5 → 20, 13 → 26, 7 → 28). And
for 2K0 + 1 = 37, we have: (1 → 32, 5 → 20, 17 → 34, 3 → 24, 13 → 26, 11 → 22, 15 →
30, 7 → 28, 9 → 36).
J
Now comes the moment of truth, why we did this: by and the second condition
given
  in the problem, this falls right in our trap; for example if we want to find out
5
f 28 , then using the cycles of 33, we get

5 1 20 1 13 1 1 26 1 1 7
             
f = ·f = · 1−f = · 1− ·f = · 1− · 1−f
28 4 13 4 20 4 2 7 4 2 26
1 1 1 28 1 1 1 5
        
= · 1− · 1− ·f = · 1− · 1− · f
4 2 4 5 4 2 4 28
 
5 5
Solving the linear equation we get f 28 = 33 . And since every nice number p0 belongs
to only one cycle, they are represented by one  and only  one linear equation of this
p0
form and one can see when the coefficient of f 2K0 +1−p 0
is different in both LHS (for
which it is 1) and in RHS (for which it is a negative integral power of 2, basically 2M
where M ∈Z −
  ); and hence it must have a unique solution. And since we already know
p0
f 2K0 +1−p0 = 2Kp00+1 works, this must be its only value.
Hence the inductive step is proven.

Remark. Never thought a single FE will make mew hate FE forever lol.

10
Random Olympiad Problems updated 17 August 2023

§1.1.8 Gauss Mathematical Olympiad 2022/4

Problem statement

Solve f [f (x) + y]2 = f (x2 ) + yf (2x + y) over reals.

As usual let P (x, y) denote the assertion of the statement.


P (x, 0) → f [f (x)]2 = f (x2 ) which means x ≥ 0 =⇒ f (x) ≥ 0 ( ).
J

Claim — There exists a ≥ 0 such that f (a) = 0

Proof. Say we have for all f (x0 ) = 0 we have x0 < 0, then we have f (1) < 1 (since
P (1, −1)).
P (1, 1 − f (1)) → f (3 − f (1)) + f (1) = 0 and then by , we get f (1) = f (3 − f (1)) = 0,
J

a contradiction. □

Claim — f (0) = 0

√ √
Proof. Now using P ( a, −2 a) and
J
we get f (0) = 0. □

Then by P (0, x) we obtain f (x) = 0 or x for each x ∈ R.


Obviously f ≡ x and f ≡ 0 works and if there exists another function which satisfies the
given FE, then let a ̸= b be non-zero real numbers such that f (a) = 0 and f (b) = b and
also by P (a, 0) gives us f (a2 ) = 0. Then P (a, b) gives us our required contradiction.

Hence in conclusion we get the only working functions are

f (x) ≡ x ∀ x ∈ R AND f (x) ≡ 0 ∀ x ∈ R

11
Random Olympiad Problems updated 17 August 2023

§1.1.9 Infinity Dots JMO 2019/1

Problem statement

Does there exist a function f : Z>1 → Z>1 such that

f f (n) (m) = mn

is satisfied for all m, n ∈ Z>1 ?

As usual let P (m, n) denote the assertion.

Claim — f (m2 ) = f (m)2


h i
Proof. f f (n)+1 (m) = f f f (n) (m) = f f (n) [f (m)] =⇒ f (mn ) = f (m)n =⇒ f (m2 ) =
f (m)2 . □

Claim — f is injective.

Proof. If f (a) = f (b) then P (m, a) and P (m, b) gives us our required. □

Now P (m, n2 ) and P (mn , n) gives us


2 2 )−2f (n)|
f f (n ) (m) = f f (n) (mn ) = f 2f (n) (m) ⇐⇒ f |f (n (m) = m

The last relation is since f is injective (and also we get f is bijective). And because of
the first claim we get f |f (n){f (n)−2}| (m) = m ( ).
J

See that gcd (|f (1){f (1) − 2}|, |f (2){f (2) − 2}|, |f (3){f (3) − 2}|, . . . ) | gcd [3(3 − 2), 4(4 − 2)] =
J
1 (the last relation is since f is bijective. And so by we get f must be the identity
function, but we can verify it is obviously not a solution.

Hence in conclusion we get that there are no functions which satisfy this equation.

12
Random Olympiad Problems updated 17 August 2023

§1.1.10 IMOSL 2011/A3

Problem statement

Find all pairs of functions f, g : R → R such that

g(f (x + y)) = f (x) + (2x + y)g(y)

is satisfied for all x, y ∈ R.

Let P (x, y) denote the assertion to the problem statement.


P (x, −x) → f (x) = g(f (0)) − xg(−x) ( ).
J

Claim — g(x) + g(−x) = 2g(0)

Proof. From P (x, −2x), P (x, 0), P (0, x) and P (x, −x) we get

f (−x) = f (x) + 2x · g(0) = f (0) + xg(x)

So basically we get f (−x) = f (x) + 2x · g(0) =⇒ g(x) + g(−x) = 2g(0). □

Claim — g must be linear.

J
Proof. Applying in the original parent equation give us

g [g(f (0)) − (x + y)g(−x − y)] = g(f (0)) − xg(−x) + (2x + y)g(y)

=⇒ g(f (0)) − xg(−x) + (2x + y)g(y) = g(f (0)) − yg(−y) + (2y + x)g(x)
Then using the last relation (which by the way comes by switching x and y in the first
relation) and the result first claim; gives us

g(y) − g(0) g(x) − g(0)


=
y x

for all non-zero x, y, and so we get g(x) = mx + g(0) where m is a constant, for all x
(see that x = 0 satisfies the relation anyways). □
J
So substituting in the parent FE and using gives us (with a bit of computation) that
the only working pairs of functions (with verification) are

f (x) ≡ x2 + c ∀ x ∈ R, g(x) ≡ x ∀ x ∈ R AND f (x) ≡ 0 ∀ x ∈ R, g(x) ≡ 0 ∀ x ∈ R

(where c is any real number)

13
Random Olympiad Problems updated 17 August 2023

§1.1.11 Balkan Mathematical Olympiad 2023/1

Problem Statement

Find all functions f : R → R such that for all x, y ∈ R,

xf (x + f (y)) = (y − x)f (f (x))

Let P (x, y) denote the assertion to the preceding problem.


P (0, y) → f (f (0)) = 0 and P (x, x) → f (x + f (x)) = 0.

¶ Case A: f is injective Then by P (x, x) we get f (x) = f (0) − x (can be checked to


be a solution).

¶ Case B: f is not injective If f (f (a)) = 0 (a ̸= 0) then P (a, f (0)) → f (a) = 0 =⇒


J
.
If f (c) = f (b) (c ̸= b) then P (c, b) → f (f (c)) = f (f (b)) = 0 (by ) =⇒ Ⓢ.
J

Now; f (x + f (x)) = f (f (0)); then there must exist some d for which d + f (d) ̸= f (0). So
then by Ⓢ we get f (f (d + f (d))) = 0 =⇒ f (0) = 0.
P (x, 0 → xf (x) = −xf (f (x)) =⇒ f (x) = −f (f (x)) (no need to worry about x = 0
since f (0) = 0).

P (−f (x), x) → f (x) = −x (OR) f (x) = 0 (OR) f (−f (x)) = 0 for each x ∈ R. Now
f (−f (x)) = 0 =⇒ f (f (f (x))) = 0 (since f (x) = −f (f (x))). If f (x) ̸= 0 then;
f (f (x)) = 0 =⇒ f (x) = 0 (by ). So the options basically are f (x) = −x or 0 for each
J

x.

Claim — f (x) ≡ 0 ∀ x ∈ R

Proof. So assume there exists m, n ̸= 0 such that f (m) = 0 and f (n) = −n (obviously
n ̸= m).
Now P (n, m) → n2 = (n−m)f (−n). If f (−n) = 0 =⇒ n2 = 0 (contradiction) and iff (n) =
−n =⇒ 0 = −nm (contradiction again).
So either f (x) ≡ 0 or f (x) ≡ −x, but since f is not injective only the former must hold
(which works as well obviously). □

So, in conclusion the only functions which work are

f (x) ≡ c − x ∀ x ∈ R (where c is any real number) AND f (x) ≡ 0 ∀ x ∈ R

14
Random Olympiad Problems updated 17 August 2023

§1.1.12 APMO 2023/4

Problem statement

Let c > 0 be a given positive real and R>0 be the set of all positive reals. Find all
functions f : R>0 → R>0 such that

f ((c + 1)x + f (y)) = f (x + 2y) + 2cx

for all x, y ∈ R>0 .

We begin by proving this crucial claim.

Claim — f (x) ≥ 2x for all x.

2a−f (a)
Proof. Assume for some a, we have 2a > f (a). Then substituting x = c in the
parent FE, we get 2cz = 0, a contradiction.

Hence we can define a function g : R>0 → R≥0 such that g(x) = f (x) − 2x. Hence we
can rewrite our original FE as

g(cx + g(y) + x + 2y) + 2g(y) = g(x + 2y) ∀ x, y ∈ R>0

Hence see that we get g(y) ≤ g(x + 2y), g(cx + g(y) + x + 2y) ≤ g(x + 2y) for all x, y.

Now in the second inequality, we can apply the inequality on the LHS multiple times
unless we get g(something) ≤ g(x + 2y) where something > 2x + 4y (note that applying
the inequality on LHS again, increases the input by atleast x(c2 + c) and then see that
each time the new value of x always increases and hence it must reach our desired value
at some point). For example we get

g(x + 2y) ≥ g(cx + g(y) + x + 2y) ≥ g[c(cx + x + g(y)) + cx + x + g(y) + g(y) + 2y] ≥ . . .

Now applying the first inequality we get g(something) ≥ g(x + 2y) ⇐⇒ g(something) =
g(x + 2y) =⇒ g(cx + g(y) + x + 2y) = g(x + 2y) ⇐⇒ g(y) = 0 ⇐⇒ f (y) = 2y (which is
a solution obviously).

Hence in conclusion we get that the only working function is

f (x) ≡ 2x ∀ x ∈ R>0

15
Random Olympiad Problems updated 17 August 2023

§1.1.13 IMO 2011/5

Problem statement

Let f : Z → Z>0 be a function such that f (m − n) | f (m) − f (n) for m, n ∈ Z. Prove


that if m, n ∈ Z satisfy f (m) ≤ f (n) then f (m) | f (n).

Proof. Let P (m, n) denote the assertion.

First see that by P (m(n + 1), mn) → f (m) | f (mn + m) − f (mn) and hence by in-
duction we get f (m) | f (mn) for all m, n ∈ Z. As a corollary we get f (n) | f (0) and
f (1) | f (n).

Claim — f is even.

Proof. P (0, b) → f (−n) | f (n) ⇐⇒ f (n) | f (−n) ⇐⇒ f is even. □

Hence by P (m, −n) we get f (m + n) | f (m) − f (n) and denote this statement’s assertion
by Q(m, n).
Now if f (m) ≤ f (n), then by Q(m, n − m) we get f (n) | f (m) − f (n − m) but since our
assumption, we get f (m) = f (n − m). And then by P (n, n − m) we get f (m) | f (n). ■

16
Random Olympiad Problems updated 17 August 2023

§1.1.14 Japan TST 2022/2

Problem statement

Find all functions f : R → R such that

f [x(f (y) + f (f (y))] + yf (f (x)) = f [(f (f (x)) + 1)f (y)] + xy

for all x, y ∈ R.

Let P (x, y) denote the assertion of the preceding statement.


P (x, 0) → f [xf (0) + f (f (0))] = f [(f (f (x)) + 1)f (0)]
P (0, x) → f (f (f (x))) + xf (f (0)) = f [(f (f (0)) + 1)f (x)]
Now we take cases on f (f (0)).

¶ Case A: f (f (0)) = −1 P (0, 0) → f (0) = −1 =⇒ f (−1) = −1 By P (x, 0) we get


f (−x − 1) = f [−f (f (x)) − 1]
P (x, −1) → f (−x − 1) − f (f (x)) = f [−f (f (x)) − 1] − x
And from the last two statements we get that f (f (x)) = x but since f (f (0)) = −1, we
get a contradiction and hence there are no solutions in this case.

¶ Case B: f (f (0)) = 0 So from P (0, x) we get f (f (f (x))) = f (f (x)) −→


J

P (x, f (0)) → f (0) · f (f (x)) = xf (0). If f (0) ̸= 0 then f (f (x)) = x but because of
J
we
get f (x) = x =⇒ f (0) = 0, contradiction. Hence f (0) = 0.

f (−1, f (x)) → f (x) · c = f [(c + 1)f (x)] − x (where c = f (f (−1))


J
And hence f is injective and by we get f is the identity function (which does satisfy
the original FE as well).

¶ Case C: f (f (0)) ̸= 0, −1 By P (0, x) we get f is injective. Now by P (x, 0) we get


xf (0) + f (f (0)) = f (f (x))f (0) + f (0). Now see that f (0) ̸= 0, because otherwise we get
f (f (0)) = 0 which is a contradiction to our original assumption and hence we get f is
not only injective, but is bijective.

Now assume f (f (a)) = 0, f (b) = 0 for constants a, b (See that a, b ̸= 0).


P (a, 0) → af (0) + f (f (0)) = f (0); P (b, 0) → bf (0) + f (f (0)) = f (0)2 + f (0); P (0, b) →
f (f (0)) + bf (f (0)) = f (0); P (a, b) → f (f (0)) = ab + f (0).

Now see that we have four equations and four variables (namely a, B, f (0), f (f (0))). So we
get f (f (−1)) = 0, f (− 12 ) = 0, f (0) = 12 , f (f (0)) = 1 and by P (x, 0) we get f (f (x)) = x+1.

So see that the original FE simplifies to f (xf (y) + y + 1) + y = f ((x + 2)f (y)).
P (−2, y) → f (−2f (y) + y + 1) = 12 − y ⇐⇒ −2f (y) + y + 32 = f ( 12 − y)
P (− 2f1(y) − 2, y) → f ( 12 − 2f (y) + y) = −y ⇐⇒ 1 − 2f (y) + y = f (−y) (Assume y ̸= − 21 ).
Now comparing the last two equations we got, we get that f (−y) + 12 = f ( 12 − y) ⇐⇒
f (y + 1) = f (y) + 1.

P (−1, f (y)) → f (f (y) − y) + f (y) = f (y + 1) = f (y) + 1 ⇐⇒ f (y) − y = 12 .


See that f (− 12 ) = 0 and hence f (y) − y = 12 for all y (can be verified easily).

17
Random Olympiad Problems updated 17 August 2023

Hence the solution set is:

1
f (x) = x ∀ x ∈ R AND f (x) = x + ∀x∈R
2

Remark. This has to be the longest FE I have ever done (as of July 2023 atleast). This
took me over four hours to do! But the satisfaction dude......

18
Random Olympiad Problems updated 17 August 2023

§1.1.15 IMOSL 2015/A2

Problem statement

Determine all functions f : Z → Z such that

f (x − f (y)) = f (f (x)) − f (y) − 1

for all integers x, y.

Let P (x, y) denote the assertion to the preceding problem.


P (f (x), x) → f (0) = f 3 (x) − f (x) − 1, P (x, f (x) → f (x − f (f (x))) = −1.
P (x, x − f (f (x))) → f (x + 1) = f (f (x)) and so then we get by P (f (x), x) that f (x +
2) − f (x) = f (0) + 1.

Now from the last line we actually get f (2x) = (c + 1)x + c (where c = f (0)).
P (2x + 1, 2x) → c = ±1 (with a bit of computation ofcourse).

¶ Case A: If c = −1 Then see that f (2x) = −1 and f (2x+1) = a (for some constant a).
P (2x, 2x + 1) → f (2x − a) = −1, now if a is odd then f is identically −1 (obviously a
solution). And if a is even then P (2x + 1, 2x + 1) → a = −1 but a is even and hence this
is a contradiction.

¶ Case B: If c = 1 This time we get f (2x) = 2x + 1 and f (2x + 1) = 2x +


b (for some constant b).
Now if we insert x ,→ 2x + 1 in the relation f (x + 1) = f (f (x)), we get b = 2 (since one
can take cases when b is odd or even but in both cases we get b = 2 but obviously that is
a contradiction the case when b is odd but not at the case where b is even and hence b = 2).

Hence in conclusion we get that the only two functions which work is

f (x) ≡ −1 ∀ x ∈ Z AND f (x) ≡ x + 1 ∀ x ∈ Z

19
Random Olympiad Problems updated 17 August 2023

§1.1.16 RMM SL 2019/A1

Problem statement

Determine all functions f : R → R that satisfies the equation

f (a2 + ab + f (b2 )) = af (b) + b2 + f (a2 )

for all a, b ∈ R.

As usual let P (a, b) denote the statement.


Compare P (a, b) and P (−a, −b) to get that f is odd and hence f (0) = 0.
P (0, a) → f (f (a2 )) = a2 and combined with the fact that f is odd, we get f is an
involution and hence also bijective.
P (a, −a) → af (a) = f (a2 ) =⇒ =⇒ af (a) = f (f (a)2 ) =⇒ f (a2 ) = f (f (a)2 ) =⇒
J
2 2
a = f (a) ⇐⇒ f (a) ± a for each a ∈ R.

Claim — The only two solutions are f (a) ≡ a or f (a) ≡ −a.

Proof. Obviously both work. Hence assume there is some other function as well.
Call the non zero numbers which are fixed points having positive behavior and the latter
note that x and x2 have the same behavior).
J
negative behavior (by
Choose distinct c, d ̸= 0 such that c has positive behavior and d has negative behavior.
P (c, d) → f (c2 +cd−d2 ) = −cd+d2 +c2 ⇐⇒ −cd+d2 +c2 = c2 +cd−d2 or −c2 −cd+d2 ;
but in both cases we get a simple contradiction.

Hence in conclusion we get that the only two functions which work is

f (x) ≡ x ∀ x ∈ R AND f (x) ≡ −x ∀ x ∈ R

20
Random Olympiad Problems updated 17 August 2023

§1.1.17 Japan Mathematical Olympiad Finals 2021/1

Problem statement

Find all functions f : N → N such that for any positive integers m, n; n | m ⇐⇒


f (n) | f (m) − n.

Plug in m = n to get f (n) | n and hence n | m ⇐⇒ f (n) | f (m).


If f (a) = f (b) ⇐⇒ a | b, b | a ⇐⇒ a = b and so f is injective.
Now also see that f (1) | 1 ⇐⇒ f (1) = 1. (Denote a||b if a | b, a ̸= b)

Claim — f (pα ) = pα where p is a prime and α ∈ N.

Proof. Now see that f (pα ) | pα =⇒ f (pα ) = pg(α) where g(α) ≤ α.


Also if i < j ⇐⇒ pi ||pj ⇐⇒ pg(i) ||pg(j) ⇐⇒ g(i) < g(j).
So by these observations we get 1 = f (1)||f (p)|| . . . ||f (pα ) = pα and hence we get
f (pα ) = pα .

So if n = p1 α1 · p2 α2 . . . pk αk (where Pi′ s are distinct primes and αi ∈ N); then pi αi |


n ⇐⇒ pi αi = f (pi αi ) | n ⇐⇒ n = ki=1 pi αi | f (n) ⇐⇒ n | f (n).
Q

Hence in conclusion we get that the only function which works is

f (n) ≡ n ∀ n ∈ N

21
Random Olympiad Problems updated 17 August 2023

§1.2 Wrapped Functional Equations


§1.2.1 Baltic Way 2014/4

Problem statement

Find all functions f defined on all reals and taking real values such that

f (f (y)) + f (x − y) = f (xf (y) − x)

for all real numbers x, y.

Let P (x, y) denote the assertion to the preceding statement.

Claim — If f (a) ̸= 2 for some a then f (f (a)) = 0.


 
a
Proof. Assume f (a) ̸= 2 then by P 2−f (a) , a gives us f (f (a)) = 0.

Assume f (b) = 2 for some b, and by P (b, b) we get f (2) = 2.


Then by P (x − 2, 2) we get f (x − 2) + 2 = f (x) and so we get f (2n) = 2n for all integers
n but then by P (x, 0) we get f is even (since f (0) = 0) but this is a contradiction, and
therefore f (f (x)) = 0 for all x.

But then by P (0, x) we get f is constant and plugging it back to the original equa-
tion we get that the only working function is f (x) ≡ 0 ∀ x ∈ R .

22
Random Olympiad Problems updated 17 August 2023

§1.2.2 IMO 2010/1

Problem statement

Find all functions f : R → R such that for all x, y ∈ R, the following equality holds

f (⌊x⌋ y) = f (x) ⌊f (y)⌋

Let P (x, y) denote the assertion.


P (0, 0) → f (0) = 0 or ⌊f (0)⌋ = 1.

¶ Case A: If ⌊f (0)⌋ = 1 Then P (x, 0) → f (x) is a constant.

¶ Case B: If f (0) = 0 Then P (1, 1) → f (1) = f (1) ⌊f (1)⌋ → f (1) = 0 or ⌊f (1)⌋ = 1.


If f (1) = 0 then by P (1, x) → f (x) ≡ 0.

If ⌊f (1)⌋ = 1 then by P (x, 1) → f (⌊x⌋) = f (x). Now choose 0 < a < 1 so P (x, a) →
f (⌊x⌋ a) = 0. Now see that x and a can be chosen appropriately such that ⌊x⌋ a can be
represented as any real number and hence f ≡ 0 but ⌊f (1)⌋ = 1 and so this is not a valid
solution in this case.

Hence in conclusion the only function which works is

f (x) ≡ c ∀ x ∈ R (where c = 0 or 1 ≤ c < 2)

23
Random Olympiad Problems updated 17 August 2023

§1.3 Monster Functional Equations


§1.3.1 PAMO 2018/1

Problem statement

Find all functions f : Z → Z such that

(f (x + y))2 = f (x2 ) + f (y 2 )

for all x, y ∈ Z.

Let P (x, y) denote the assertion to the preceding statement.


P (0, 0) → f (0)2 = 2f (0) ⇐⇒ f (0) = 0 or 2
f (0)2
P (x, −x) → 2f (x2 ) = f (0)2 ; P (x, 0) → f (x)2 = f (x2 ) + f (0) = 2 + f (0)

If f (0) = 0 then f ≡ 0 (obviously a solution).


If f (0) = 2 then f (x) ± 2 ∀ x ∈ Z. Now by P (x, −x) we get that f (x2 ) is always 2. And
now observing the parent equation we see that it does not matter what f (x + y) is.

Hence the solution set is:


(
2 if x ∈ S
f (x) ≡ 0 ∀ x ∈ Z AND f (x) =
−2 if x ∈/S

where S is any subset of integers such that it is a super set of the set of all perfect squares.

24
Random Olympiad Problems updated 17 August 2023

§1.3.2 IZhO 2017/2

Problem statement

Find all functions f : R → R, such that


 
(x + y 2 ) [f (yf (x)] = xy · f f (x) + y 2

holds true for all x, y ∈ R.

As usual let P (x, y) denote the assertion to the problem statement.


P (x, 0) → f (0) = 0. See that if one of x or y is 0 in the parent FE, then it is always
satisfied; so we only care about when x, y ̸= 0 (we will only work with this therefore from
now). Now we split up or solution in two different cases.

¶ Case A: ∃ a ̸= 0 such that f (a) = 0


P (a, y) → ayf (y 2 ) = 0 ⇐⇒ f (x) = 0 for all x > 0.

Claim — There does not exist some b such that f (b) < 0.

Proof. Assume the contrary, then by P (b, y) and P (b, −y) gives us f (x) = 0 for all x < 0
and so this implies f ≡ 0 which is a contradiction.

So this means f (x) ≥ 0 for all x, this means the f (y 2 + f (x)) term is always 0 in the
parent FE and so we get f (y(f (x))) = 0 ⇐⇒ f (x) = 0 (which is obviously a solution
also).

¶ Case B: f (a) = 0 ⇐⇒ a = 0 So from P (−y 2 , y) we get f (x) = x for all x < 0.


Then by P (x, y) (where x < 0, y > 0), we get f (y 2 + x) = y 2 + x ⇐⇒ f (x) = x for all
x ̸= 0, which basically means f (x) is the identity function (obviously a solution).

Hence in conclusion we get that the only two functions which satisfy this FE are

f (x) ≡ x ∀ x ∈ R AND f (x) ≡ 0 ∀ x ∈ R

25
Random Olympiad Problems updated 17 August 2023

§1.3.3 PFTB 4.20

Problem statement

Classify all functions f : N → Z such that for any positive integers a and b, the
following two properties holds

(i) we have f (ab) + f (a2 + b2 ) = f (a) + f (b)

(ii) a | b =⇒ f (a) ≤ f (b)

Let P (a, b) denote the assertion to the first condition.


See that the second condition basically translates to f (ab) ≥ f (a) for any a, b.

P (ab, a) → f (ba2 )+f (a2 b2 +a2 ) = f (ab)+f (a) ⇐⇒ f (ba2 ) = f (ba) → (1), f (a2 b2 +a2 ) =
f (a) → (2); which means f (a2 b2 + a2 ) = f (ab2 + a) = f (a) → (3) (also note that
f (2b) = f (b)).
Note that Y Y
f ( p i αi ) = f ( p i )
where (pi ) are pairwise distinct primes and αi ∈ N (by (1)). So basically we only need to
worry about the values of f on square-free numbers.
See that since f (a) ≥ f (1), then if f (a0 b0 ) = f (1) =⇒ f (a0 ) ≤ f (1) ⇐⇒ f (a0 ) = f (1).
From (3), we have f (b2 + 1) = f (1) =⇒ f (n) = f (1) for all n = qi where (qi ) are
Q

pairwise distinct primes which are congruent to 1 modulo 4. This is because all primes
1 modulo 4 divide some b0 2 + 1 and then by CRT, we can always find a b such that
qi | b2 + 1. P ( qi , rj ) → f ( qi · rj ) = f ( rj ), where (rj ) are pairwise distinct
Q Q Q Q Q Q

primes congruent to 3 modulo 4 (since no primes 3 modulo 4 divides a2 + b2 ).

Now so basically we need to find the values of f on square-free numbers with all
prime factors being congruent to 3 modulo 4. Now coming back to the parent equation,
we get that now if we take any arbitary a, b to satisfy f (a) + f (b) = f (a2 + b2 ) + f (ab),
then let X be the set of all prime factors of a being congruent to 3 modulo 4, and let Y
be defined similarly for b then see that the parent equation is equivalent to satisfying
!   ! !
Y Y Y Y
f x +f y = f z +f w → (4)
x∈A y∈B z∈A∪B w∈A∩B

(since if p ≡ 3 (mod 4) then p | a2 + b2 iff p | a, p | b).

Claim — f (p) can be anything if p ≡ 3 (mod 4) and these set of values uniquely
determines a function in terms of f (1) which satisfies the functional equation.

Proof. First note that we only need to show it satisfies equation (4).
Now one can see by simple induction that f ( ki=1 ri αi ) = ki=1 f (ri ) − (k − 1)f (1) (this
Q P

by taking P (r1 , r2 ); P (r1 r2 , r3 ); and so on).


Now we can verify that for any generic set of prime numbers in equation (4), this way of
defining f ( ki=1 ri αi ) will always satisfy equation (4) and hence satisfies the parent FE
Q

as well.

26
Random Olympiad Problems updated 17 August 2023

So in conclusion we get a function f satisfies this FE if and only if it is in the form


k
X Ql Qk
f (n) = f (rj ) − (k − 1)f (1) where n = 2v2 (n) · i=1 qi
αi · j=1 rj
βj and all qi ’s and
j=1
rj ’s are pairwise distinct primes and each qi ≡ 1 (mod 4) and each rj ≡ 3 (mod 4).

Remark. This was definitely one of the weirdest FE I have ever done (as of August 2023
atleast). I think the first time I did this, for some weird reason I got f is a constant function
but this was far from the truth. I think the motivation behind the solution of this problem
was actually trying to prove that the function is constant and for how many values n0 we
can find such that f (n0 ) = f (1). Some very basic facts of Number Theory was also required
in this problem.

27
Random Olympiad Problems updated 17 August 2023

§2 Combinatorics
§2.0.1 ELMO 2022/1

Problem statement

Let n > 1 be an integer. The numbers 1, . . . , n are written on a board. Aharshi and
Bryan take turns circling an uncircled number on the board with Aharshi going first.
When the product of the circled numbers becomes a multiple of n, the game ends
and the last player to have circled a number loses. For which values of n can Bryan
guarantee a victory?

We claim that Bryan is victorious if and only if n is odd and squarefree (at the same
time).

¶ Strategy for Bryan when n is an odd squarefree number This part is somewhat
confusing but trivial.
n
Now whatever Aharshi circles on his first move (say m), consider N = gcd(n,m) . See that
N= ̸ 1 since otherwise well Aharshi already lost (and Aharshi a.k.a me is not that dumb).
Now if N is a prime, then consider the list {N, 2N, . . . , n}, and see that none of the
numbers has been circled till now. So the only way the product of the circled numbers is
divisible by n is iff one of the numbers from the list is picked. Hence the number of ”safe”
n
numbers is n − N − 1 which is odd and since Bryan has the first move now, Aharshi will
run out of safe numbers first.
If N is composite, then let q be a prime such that q | N . Now Bryan circles Nq and
therefore by the same logic, there are n − nq − 2 safe numbers left with Aharshi going
first and see that the number of safe numbers left is even and hence Aharshi loses out on
safe numbers first.

¶ Strategy for Aharshi when n is not an odd squarefree number This part is a bit
tedious. Let n = kp where p is a prime.
First assume n is non-squarefree. Then let p be such that p | k. Then Aharshi will circle
k on his first move. Now the only way the product of the circled numbers is divisible
by n is iff one of the numbers which is divisible by p is picked. Now consider the list
{p, 2p, . . . , kp}, see that one of these numbers are already picked since p | k, and hence
that leaves us with kp − k ”safe” numbers with Bryan going first and see that kp − k is
always even and hence Bryan loses out on ”safe” numbers first.
Lastly assume n is even and squarefree. Then let p = 2. Then see that after Aharshi
circles k on his first move, then consider the list {2, 4, . . . , 2k} and see that hence there
is k − 1 safe numbers (since 2 ∤ k) and see that k − 1 is even and hence Bryan loses out
on safe numbers first again.

28
Random Olympiad Problems updated 17 August 2023

§2.0.2 India TST 2016/3/3

Problem statement

Let n be an odd natural number. We consider an n × n grid which is made up of n2


unit squares and 2n(n + 1) edges. We colour each of these edges either red or blue.
If there are at most n2 red edges, then show that there exists a unit square at least
three of whose edges are blue.

Proof. Assume the contrary.


Dye the n × n board as a chessboard (no checkers please), with the corner squares being
2
black. See that there are n 2+1 black squares and see that all the edges associated to
these black squares are disjoint and hence there are 2n2 + 2 edges of the black squares.
2
Because of the assumption this must mean that there must be atleast 2n 2+2 = n2 + 1 red
edges but this is a contradiction since there are at most n2 red edges. ■

29
Random Olympiad Problems updated 17 August 2023

§2.0.3 PAGMO 2022/1

Problem statement

Aharshi has a n × n toroidal board; each square thus has four orthogonal neighbors;
call it its friends. Aharshi will paint every square one of the three colors: green, blue
or red. Then in each square we write a number as follows:

(i) If the square is green, write the number of of red friends plus twice the number
of blue friends.

(ii) If the square is red, write the number of of blue friends plus twice the number
of green friends.

(iii) If the square is blue, write the number of of green friends plus twice the number
of red friends.

Considering Aharshi can choose the coloring of the squares on the board, find the
maximum possible value she can obtain when she sums the numbers in all the
squares.

We begin with the following crucial claim.

Claim — Each pair of neighboring distinct coloured squares adds three points to
the total sum, and zero points if they are same coloured.

Proof. The latter is trivial. For the former, see that one of the squares adds two points
to the total square and the other square adds one point to the total square, hence it adds
a total of three points in total.

Obviously the maximum occurs if and only if all the pair of neighboring squares have
distinct colors, which is always possible.
Since this is a toroidal board, obviously there is 2n2 pair of neighboring squares.

Hence the maximum total value possible is 6n2 .

30
Random Olympiad Problems updated 17 August 2023

§2.0.4 Italy Mathematical Olympiad 2023/2

Problem statement

Let n be a positive integer. On a blackboard, Bob writes a list of n non-negative


integers. He then performs a sequence of moves, each of which is as follows:
-for each i = 1, ..., n, he computes the number ai of integers currently on the board
that are at most i,
-he erases all integers on the board,
-he writes on the board the numbers a1 , a2 , . . . , an .
For instance, if n = 5 and the numbers initially on the board are 0, 7, 2, 6, 2, after
the first move the numbers on the board will be 1, 3, 3, 3, 3, after the second they
will be 1, 1, 5, 5, 5, and so on.

(i) Show that, whatever n and whatever the initial configuration, the numbers on
the board will eventually not change any more.

(ii) As a function of n, determine the minimum integer k such that, whatever the
initial configuration, after the k th list of numbers (inclusive), the configuration
will not change the numbers written on the board.

(i) Proof. We will induct on n.


Obviously this is true for n = 1, hence assume it is true for n = k − 1.
Take any k sequence of non-negative integers. See that after one move (and all
moves there after) the list becomes a sequence of non-negative non-increasing
integers. Now after our first move, the last number is either k or something less
than k. But see after the second move, the last number must be k.
Assume the second last number is also k; then after another move the second
last number is k − 2 or less and applying another move will give us the list to
be something of the form {. . . , k − 1, k} and observe that all numbers before the
second last number is less than or equal to k − 1 which is basically our induction
hypothesis, since after all the moves the last two numbers remain constant.
Now see that if the second last number was k − 1 or less, then the same moves will
give us our required result. ■

(ii) Let f (n) denote the minimum integer that satisfies our required criteria.
Let g(n) denote the minimum integer that will guarantee us that after those number
of moves, a list with last two integers as m, n (m ≤ n goes to a list with last two
integers n − 1, n. Assume g(1) = 0.
Now see that for all integers n ≥ 2, we have g(n) = 2.

Now looking back at the inductive process of part a, see that it takes us maximum
two moves to go from the initial list to a list with last two integers m, n with n ≤ n.
Hence see that f (n) = 1 + 2 + g(n) + g(n − 1) + · · · + g(1) ⇐⇒ f (n) = 2n + 1 .
(See that we added an extra one, since we are looking at the the k th sequence rather
than after k th move).
Now see that the maximum is always possible since we can work backwards from
the n − 1th case to the nth case. For example {1} ,→ {1, 2} ← {0, 2} ← {2, 2} ←
{1, 1} ← {3, 1}, and so see that in this case we again get f (2) = 5 as required.

31
Random Olympiad Problems updated 17 August 2023

§2.0.5 C-UnS-1

Problem statement

There are m binary string C1 , C2 , ..., Cm of length n where n is an odd integer. We


know that for 1 ≤ i < j ≤ n the strings Ci and Cj differ in at least n+1 2 positions.
Show that m ≤ n + 1.

Proof. Let Ci = {(ai )1 , (ai )2 , . . . , (ai )n } for each 1 ≤ i ≤ m.


Now we will compare (ai )k and (aj )k for all i, k, j; let’s define a score-system. If those
values are different, then it will add one point; and if they are same, it will add zero. Let
X be the total number of points. We will count X in two ways.

¶ First Way Take any two different binary strings, it will minimum add n+1 2 points
m m
and there are 2 such different binary strings. That gives us that X ≥ n+1
2 · 2 .

¶ Second Way Look at the ith position in each binary string. Say there are ki zeroes
and m − ki ones and so this position alone gives us exactly (m − k )k points. Hence
2 i i
X = ni=1 (m − ki ) · ki , and then by AM-GM we get: X ≤ n · m
P
2 .

Comparing the two inequalities, we get m ≤ n + 1. ■

32
Random Olympiad Problems updated 17 August 2023

§2.0.6 IMO 2022/1

Problem statement

The Bank of Oslo issues two types of coin: aluminum (denoted A) and bronze
(denoted B). Marianne has n aluminum coins and n bronze coins arranged in a row
in some arbitrary initial order. A chain is any subsequence of consecutive coins of
the same type. Given a fixed positive integer k ≤ 2n, Gilberty repeatedly performs
the following operation: he identifies the longest chain containing the k th coin from
the left and moves all coins in that chain to the left end of the row. For example,
if n = 4 and k = 4, the process starting from the ordering AABBBABA would be
AABBBABA → BBBAAABA → AAABBBBA → BBBBAAAA → · · · .

Find all pairs (n, k) with 1 ≤ k ≤ 2n such that for every initial ordering, at
some moment during the process, the leftmost n coins will all be of the same type.

Define a ”clump” as the a chain of only As or Bs. For example AABBBABA has 5
clumps. We begin with the following crucial claim.

Claim — After each move, the number of clumps can never increase. The number
of clumps will stay the same only if the k th coin and the nth coin or the k th coin
and the 1st coin are are in the same clump .

Proof. Pretty trivial to be honest.

¶ Case A: k < n
One can actually see that none of the k will actually work since one can just take the
case where the first k coins are A, then the immediately next coin is B. See that, because
of it is trivial to see that the configuration will always stay the same.

¶ Case B: k ≥ n
Now in this case, see that the only way the number of clumps won’t reach 2 (basically
the left n most coins will be same) is if the number of clumps say constant after a while.

See that that if k ∈ n, 2n − n2 , then all k work. This is because, see that the
  

number of clumps will be constant after a point only if the k th and nth coins are always
in a clump after a point. Also see that the number of clumps can never be more than 3
because of our choice of k and hence one of the clumps will be consisting of n coins and
hence after a point, there will be left only two clumps.

Now also see that if k ∈ 2n − n2 + 1, 2n , then no k will work.


  

This is because if 2 | n, then we can take the initial configuration as AA . . . ABB . . . BAA
. . . ABB . . . B, with each of the four clumps with n2 coins.
And if 2 ∤ n, then we can take our initial configuration as AA . . . ABB . . . BAA . . . ABB . . . B,
with one of the A-clumps being of size 2 and another one being ⌈ n2 ⌉ and similar for
n

the B clumps. See that the number of clumps will never decrease.

n
  
So in conclusion; we get (n, k) works if and only if k ∈ n, 2n − .
2

33
Random Olympiad Problems updated 17 August 2023

§3 Number Theory
§3.1 Constructions
§3.1.1 IMOSL 2007/N2

Problem statement

Let b, n > 1 be integers. Suppose that for each k > 1 there exists an integer ak such
that b − ak n is divisible by k. Prove that b = An for some integer A.

Proof. Let p be a prime such that p | b. Now if vp (b) ≥ cn + 1 for some non negative
integer c.
Then inserting k = p(c+1)n , we get

p(c+1)n | b − ak n =⇒ pcn+1 | b − ak n ⇐⇒ pcn+1 | ak n ⇐⇒ pc+1 | ak ⇐⇒ p(c+1)n | ak n


And so we get p(c+1)n | b. And so by induction we see that vp (b) must end on some
multiple of n for all primes p dividing b. Hence b = An for some integer A. ■

34
Random Olympiad Problems updated 17 August 2023

§3.1.2 USMCA 2019/1

Problem statement

Kelvin the Frog and Alex the Kat are playing a game on an initially empty blackboard.
Kelvin begins by writing a digit. Then, the players alternate inserting a digit
anywhere into the number currently on the blackboard, including possibly a leading
zero (e.g. 12 can become 123, 142, 512, 012, etc.). Alex wins if the blackboard shows
a perfect square at any time, and Kelvin’s goal is prevent Alex from winning. Does
Alex have a winning strategy?

On the contrary actually Kelvin has a winning strategy . We will proceed by deriving a
contradiction.

Kelvin starts by picking 7 on his first move. See that no matter what Alex does
next, he can never make a perfect square. Now whatever Alex picks next, Kelvin chooses
to place either 2, 3, 7 or 8 in the last position (see that none of these as a last digit can
ever make a perfect square). Also, if Alex does not place a digit in the last spot then
again the number can never be a perfect square.

But if he does place a digit in the last position and it is a perfect square, then re-
member that Kelvin had a choice of 4 different digits he can place namely 2, 3, 7, 8 on his
last move, and for Alex to win this must mean that there is a positive integer x for which
100x + 20 + k1 , 100x + 30 + k2 , 100x + 70 + k3 , 100x + 80 + k4 are all perfect squares (for
some k1 , k2 , k3 , k4 ∈ {0, 1, 2, . . . , 9}). But see that since this is a three digit number at
minimum, the difference between two three digit perfect squares is atleast 21, we get
100x + 20 + k1 and 100x + 30 + k2 both cannot be perfect squares.

35
Random Olympiad Problems updated 17 August 2023

§3.2 Exponential NT
§3.2.1 USAJMO 2011/1

Problem statement

Find all positive integers n such that 2n + 12n + 2011n is a perfect square.

We can see if n = 1, the the value of the expression is 452 = 2025. Hence assume n > 1
thereafter.
If we apply modulo 3, then we get n is odd and applying modulo 4, gives us n is even.
Hence the only solution is n=1 .

36
Random Olympiad Problems updated 17 August 2023

§3.2.2 IMO 1999/4 (harder version)

Problem statement

Find all pairs of positive integers (x, p) with p being a prime such that xp−1 divides
(p − 1)x + 1.

See that if p = 2, then x = 1, 2 works; and also see that if x = 1, then all p suffices.
Hence assume there after p ≥ 3 and also x ≥ 2.
Let q be the smallest prime factor dividing x (obviously x is odd and hence so is q). See
that we get

(p − 1)x ≡ −1 (mod q) =⇒ (p − 1)2x ≡ 1 (mod q) ⇐⇒ ordq (p−1) | gcd(2x, p−1) = 2

Which means q | p2 − 2p. Then see by LTE we get vq (x) · (p − 1) ≤ vq ((p − 1)2x − 1) =
vq (p2 − 2p) + vq (x) =⇒ vq (p2 − 2p) ≥ vq (x) · (p − 2) ≥ p − 2 =⇒ p2 − 2p ≥ q p−2 ≥
3p−2 =⇒ p, q = 3 =⇒ x2 | 2x + 1.

See that by LTE we get v3 (x) ≤ 1 ⇐⇒ v3 (x) = 1.


Let r be the second smallest prime factor of x (not equal to q) if it exists. By simple
modular arithmetic we get ordr (2) | gcd(2x, r − 1) = 3 or 6 =⇒ r = 7. Let x = 3y and
y
so we get 0 ≡ 2x + 1 ≡ (23 ) + 1 ≡ 2 (mod 7), a contradiction. Hence x has only one
prime factor. Also notice x = 3 is obviously a solution.

Hence in conclusion we get the only solutions are (x, p) = (1, p0 ); (2, 2); (3, 3) where p0
is any prime number.

Remark. The second part is just IMO 1990/3 lol.

37
Random Olympiad Problems updated 17 August 2023

§3.2.3 IMO 1990/3

Problem statement

Find all positive integers x for which x2 | 2x + 1.

Obviously x = 1 is a solution hence thereafter assume x ≥ 2.


Let q be the smallest prime factor of x. By simple modular arithmetic we will get q = 3.
See that by LTE we get v3 (x) ≤ 1 ⇐⇒ v3 (x) = 1.
Let r be the second smallest prime factor of x (not equal to q) if it exists. By simple
modular arithmetic we get ordr (2) | gcd(2x, r − 1) = 3 or 6 =⇒ r = 7. Let x = 3y and
y
so we get 0 ≡ 2x + 1 ≡ (23 ) + 1 ≡ 2 (mod 7), a contradiction. Hence x has only one
prime factor. Also notice x = 3 is obviously a solution.
Hence the only solutions are x = 1, 3 .

38
Random Olympiad Problems updated 17 August 2023

§3.2.4 IMOSL 2022/N2

Problem statement

Find all positive integers n ≥ 3 such that


Y
n! | (p + q)
p<q≤n, p,q, primes

Assume n ≥ 11 and let p0 be the largest prime number not exceeding n. This must mean
that there exists two prime numbers less than n whose sum gives us p0 and obviously
this is only possible only if one of them is 2 and let the other one be p1 (also we get p1 is
the second largest prime number not exceeding n).
Again by the same process we get p1 must divide p2 + p3 for some distinct prime numbers
p2 > p3 . Obviously if both of them are less than p1 then p1 = p2 + p3 but this happens
only if p3 = 2 but this means p0 , p1 , p2 is an AP of common difference 2 and we know
this cannot happen since n ≥ 11. But if one of p2 , p3 is more than p1 we get

p1 | p1 + 2 + p3 ⇐⇒ p1 | p3 + 2 =⇒ p1 ≤ p3 + 2 ⇐⇒ p1 = p3 + 2 (since p2 > p1 > p3 )

Hence it is the same story again.

For the case when n ≤ 10, we can just case-bash and see that the only solution to
this problem is n = 7 .

39
Random Olympiad Problems updated 17 August 2023

§3.2.5 N-UnS-1 (China)

Problem statement

Find all positive integer solutions to

(a + b)x = ay + by

¶ Case A: y = 1 This means x = 1 and any a, b suffices.

¶ Case B: y ≥ 2 Let k = gcd(a, b) and say a = kc, b = kd (see that x < y).
Assume for now that max(a, b) ̸= 1 (hence x > 1).
Let p be any prime which divides cy + dy . Then we get

p | cy + dy ⇐⇒ p | (c + d)x ⇐⇒ p | c + d

And now applying Zsigmondy’s Theorem, we get this is a contradiction unless {c, d} =
{1, 2} and y = 3.
And so then we get 3x · k x = k 3 · 9 =⇒ x = 2, k = 1.
Obviously if a = b = 1 then x = 1 and any y suffices.

Hence in conclusion we get that the only positive integer quadruples which satisfy
this equation are (a, b, x, y) = (n, m, 1, 1); (1, 2, 2, 3); (2, 1, 2, 3); (1, 1, 1, l) (where n, m, l
are any positive integers).

Remark. Did not expect such a trivial problem by China (probably an objective problem
tbh).

40
Random Olympiad Problems updated 17 August 2023

§3.2.6 China National Mathematical Olympiad 2009/2

Problem statement

Find all the pairs of prime numbers (p, q) such that pq | 5p + 5q .

¶ Case A: p, q ̸= 2, 5 and p ̸= q
Then see that by Fermat’s Little Theorem that 5p−1 ≡ −1 (mod q) and 5q−1 ≡ −1
(mod p). Hence ordp (5) | 2q − 2, p − 1, ordq (5) | 2p − 2, q − 1 but ordp (5) ∤ q − 1, ordq (5) ∤
p − 1.
Let v2 (ordp (5)) = a, v2 (ordq (5)) = b =⇒ v2 (q − 1) ≥ a, v2 (p − 1) ≥ b and also see that
v2 (q − 1) + 1 = b, v2 (p − 1) + 1 = a, which gives us a contradiction.

¶ Case B: p ̸= q
So we egt p2 | 2 · 5p ⇐⇒ p = 5.

¶ Case C: one of p, q = 2
Assume q = 2, and so we get 2p | 5p + 25 =⇒ p | 5p + 25 ⇐⇒ p | 30 ⇐⇒ p = 2, 3, 5 (But
see that p = q = 2 is not a solution).

¶ Case D: one of p, q = 5
Assume q = 5, and so we get 5p | 5p + 55 ⇐⇒ p | 5p + 55 ⇐⇒ p | 5 + 55 ⇐⇒ p = 2, 5, 313.

Hence in conclusion we get the only pairs which satisfy this equation are

(p, q) = (2, 3); (2, 5); (5, 5); (5, 313) and all permutations.

Remark. Wow, OK China really wanted all contestants to get 7 points in this problem.

41
Random Olympiad Problems updated 17 August 2023

§3.2.7 IMOSL 2006/N5

Problem statement

x7 −1
Prove that there are no integer solutions to x−1 = y 5 − 1.

Proof. See that the equation can be re-written as Φ7 (x) = (y − 1)Φ5 (y).
Also recall this crucial lemma about cyclotomic polynomials

Lemma
A prime number q divides Φn (x) only if q | n or q ≡ 1 (mod n).

If a prime number p divides Φ7 (x) then either p = 7 or p ≡ 1 (mod 7). If 7 | y 5 − 1 =⇒


7 | y − 1 =⇒ Φ5 (y) ≡ 5 (mod 7), but see that all prime factors of Φ5 (y) are prime
factors of Φ7 (x) and so it is either 7 or a prime congruent to 1 modulo 7 but 7 ∤ Φ5 (y)
and hence Φ5 (y) ≡ 1 (mod 7), a contradiction.
Hence all prime factors of y 5 − 1 are of the form 7k + 1 (and so are for Φ7 (x) and hence

y5 ≡ 2 (mod 7) ⇐⇒ y ≡ 4 (mod 7) ⇐⇒ y − 1 ≡ 3 (mod 7)

which means there is a prime factor of y − 1 which is not congruent to 1 modulo 7 and
so is for Φ7 (x), a contradiction. ■

42
Random Olympiad Problems updated 17 August 2023

§3.2.8 Mordell’s Equation

Problem statement

Solve in integers the equation


x3 − 2 = y 2

√ √ √
So we get x3 = (y + −2)(y√ − −2) over √ Z[ −2]. √
Assume D is √ the gcd of y + −2 and y − −2 and hence D | 2 −2 So let D = a + bw
where w = −2 and we get (a + bw)(c + dw) = 2w ⇐⇒ ad + bc = 2, ac = 2bd.
If c = 0 then see that ad = 2, bd = 0 and so b = 0 and we get D = ±1, ±2. But if D = ±2,
then see that 4 | x3 and so x, y are even but modulo 4 gives us the contradiction. Hence
assume c ̸= 0.
With a bit of computation, we get b(2d2 + c2 ) = 2c. See that (c, d) = (0, 0) is a solution
and hence assume 2d2 + c2 ̸= 0 and so we get b = 2d22c+c2 =⇒ |2c| ≥ c2 ⇐⇒ |c| ≤ 2. By
case bashing we get (c, d) = (±1, 0); (±2, 0) and so we get b = ±1, ±2 and then we get
D = ±2w, ±w =⇒ 2 | x3 and so we get x, y is even and again modulo 4 gives us the
contradiction. √ √ √ √
And hence gcd(y + −2), (y − −2) = 1 and so we get each of (y + −2), (y − −2) is a
perfect cube itself. So we get y + w = a + bw3 and so we get by equating the coefficients
that a3 − 6ab = y, 3a2 b − 2 = 1 and by case bashing we get (a, b) = (±1, 1) =⇒ y = ±5
which gives us x = 3.
And so after too much computation we get the only integer solutions are (x, y) = (3, ±5) .

43
Random Olympiad Problems updated 17 August 2023

§3.2.9 N-UnS-2 (AMM)

Problem statement

Find all integers m, n > 1 such that 1! · 3! . . . (2n − 1)! = m!.

If n = 2 then m = 3. There after assume n > 2.


By Chebyshev’s Estimate we get that there are atleast 2 primes between x2 and x iff
x ≥ 7.
Hence see that if m ≥ 7 then there are two primes such that they just divide m!. Hence
this means there are two primes ∈ (2n − 3, 2n − 1], and this means both 2n − 2, 2n − 1
are primes which is obviously a contradiction since n > 2. Then we can just casebash for
m ≤ 6.
In conclusion we get the only solutions are (m, n) = (3, 2); (6, 3); (10, 4) .

44
Random Olympiad Problems updated 17 August 2023

§3.2.10 N-UnS-3 (Pixton)

Problem statement

Solve x2 − y! = 2001 over positive integers.

Notice if y ≥ 6, then 3 | x ⇐⇒ 9 | x2 ⇐⇒ 9 | 2001, an obvious contradiction. Hence


y < 6, and then by case bashing we get the only solution is (x, y) = (45, 4) .

45
Random Olympiad Problems updated 17 August 2023

§3.2.11 China TST 2006/1/2

Problem statement

Find all positive integer pairs (a, n) such that n | (a + 1)n − an is an integer.

Obviously if n = 1 then all a suffices and hence assume there after that n ≥ 2.
n
Let p be the smallest prime factor of n. Then we get (a+1)n ≡ an (mod p) ⇐⇒ ( a+1a ) ≡
1 (mod p) ⇐⇒ ordp ( a+1 a+1
a ) | gcd(n, p−1) =⇒ ordp ( a ) = 1 (since p is the smallest prime
factor of n) ⇐⇒ a + 1 ≡ a (mod p), which is a contradiction.

Hence the only pairs which satisfy this relation are (a, n) = (k, 1) (where k is any
positive integer).

46

You might also like