Iran 2022
Iran 2022
39
Iranian
Mathematical
Olympiad
39th Iranian Mathematical Olympiad
Selected Problems with Solutions
1
Iranian Team Members at
at the 63rd IMO (Oslo - Norway)
2
Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Problems
Second Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Third Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Solutions
Second Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Third Round . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3
Preface
1. Ali Ahmadvand
2. Abolfazl Daniali
3. Mohammad Davodabadi Farahani
4. Arshia Eslami
5. Ehsan Heidari
6. Amirmohammad Karami Abolverdi
7. Pooria Mahmoodkhan Shirazi
8. Matin Mohammadi
9. Mohammad Mohammadian Bisheh
10. Danial Parnian
11. Pooria Rahmani
12. Seyed Mobin Razavi
13. Mehran Talaei Khajehroshanaei
14. Pooria Zareei
The Team Selection Test was held on 4 days, having the same structure
as the International Mathematical Olympiad (IMO). In the end, the top 6
participants were selected to become members of the Iranian Team at the
63rd IMO.
4
In this booklet, we present the 6 problems of the Second Round, 16 prob-
lems of the Third Round, and 12 problems of the Team Selection Tests,
together with their solutions.
It’s a pleasure for the authors to offer their grateful appreciation to all the
people who have contributed to the conduction of the 39th Iranian Mathemat-
ical Olympiad, including the National Committee of Mathematics Olympiad,
problem proposers, problem selection groups, exam preparation groups, coor-
dinators, editors, instructors and all those who have shared their knowledge
and effort to increase the Mathematics enthusiasm in our country, and as-
sisted in various ways to the conduction of this scientific event.
5
Problems
Second Round
(→ p.19)
7
6. (Morteza Saghafian) Is it possible to write 1400 natural numbers(not
necessarily distinct) around a circle such that 2021 used at least once and
each number be the sum of greatest common divisor of the two previous
numbers and the greatest common divisor of the two next numbers? For
example, if a, b, c, d, e are five consecutive numbers on the circle then c =
gcd(a, b) + gcd(d, e).
(→ p.19)
8
Third Round
Algebra
1. (Mohammad Sharifi Kiasari) Let a, b, c, d be positive real numbers such
that a + b + c + d = 4. Prove that
ab bc cd da
+ + + ≤ 4.
a2 − 34 a + 4
3 b2 − 43 b + 4
3 c2 − 43 c + 4
3 d2 − 43 d + 4
3
(→ p.21)
2. (Navid Safaei) Let a, b, c, d be four non-zero complex numbers such that
Prove that
b
+ c + d + a > 7.
a b c d 2
(→ p.22)
3. (Mojtaba Zare and Ali Mirzayee) Given a polynomial P (x) with non-
negative real coefficients and a function f : R+ → R+ such that for all
positive real numbers x, y :
(→ p.23)
9
Combinatorics
1. Let S be an infinite set of positive integers, such that there exist four
pairwise distinct a, b, c, d ∈ S with gcd(a, b) ̸= gcd(c, d). Prove that there exist
three pairwise distinct x, y, z ∈ S such that gcd(x, y) = gcd(y, z) ̸= gcd(z, x).
(→ p.27)
2. (Morteza Saghafian) Is it possible to write a permutation of positive in-
tegers on the cells of an infinite table (infinite from all sides) such that the
sequence of numbers in each column from bottom to top and also in each row
from left to right be increasing?
(→ p.28)
3. Let n ≥ 3 be an integer. An integer m ≥ n + 1 is called n-colorful if,
given infinitely many marbles in each of n colors C1 , C2 , . . . , Cn , it is possible
to place m of them around a circle such that for each i = 1, 2, . . . , n, in any
group of n + 1 consecutive marbles there is at least one marble of color Ci .
a. Prove that there are only finitely many positive integers which are not
n-colorful.
Geometry
1. (Ali Zamani) Let ABC be an acute=angled triangle and D be the foot of
altitude from A. Let K, L be the touching points of tangent lines from D to
the circles with diagonals AB and AC, respectively. Point S is given on the
plane such that
10
3. (Amir Mahdi Mohseni) Given triangle ABC, variable points X and Y are
chosen on segments AB and AC, respectively. Let Z be a point on the line
BC such that ZX = ZY . The circumcircle of XY Z intersects the line BC at
T , for the second time. Point P is chosen on line XY such that ∠P T Z = 90◦ .
Let Q be a point on the same side of line XY as A, satisfying ∠QXY = ∠ACP
and ∠QY X = ∠ABP . Prove that the circumcircle of triangle QXY passes
through a fixed point (as X and Y vary).
(→ p.31)
Number Theory
1. (Morteza Saghafian) For each positive integer n, denote by f (n) the total
number of positive integers less than n such that neither are coprime to n nor
are a divisor of n. For example f (12) = 3 because among positive integers less
than 12 there are only three numbers, i.e., 8, 9, 10 with the aforementioned
property.
Prove that for each positive integer k the equation f (n) = k has only finitely
many solutions.
(→ p.32)
2. (Ilia Mahrooghi) Find all functions f : N → N such that for all positive
integers a, b we have
Final Exam
1. (Morteza Saghafian) Is it possible to assign numbers 1, 2, . . . , 8 to the ver-
tices of a cube in a way that the assigned number of each vertex divides the
sum of numbers assigned to its neighbours? (Note that every number should
be used once).
(→ p.36)
11
2. (Mahdi Etesamifard) Given an acute-angled triangle ABC with an altitude
AD and orthocenter H. Let E be the reflection of H with respect to A. A
point X lies on the circumcircle of the triangle BDE such that DX ∥ AC,
and similarly a point Y lies on the circumcircle of the triangle CDE such
that DY ∥ AB. Prove that the circumcircles of triangles AXY and ABC are
tangent to each other.
(→ p.37)
3. (Matin Yousefi) Find all functions f : Q[X] → R such that for all polyno-
mials P (x)andQ(x) in Q[X];
(→ p.38)
4. (Sam Khanaki) Arash and Babak play the following game on a 1400×1401
table. Starting with Arash, He in his turns colors k number of L-shaped
trominos on the table (rotation and reflection are allowed). Also, Babak in
his turns colors one 2 × 2 square from the table. Every cell of the table can
be colored at most once and a player who can not color the cells in his turn
will lose. Find all values of k for which Arash has a winning strategy.
(→ p.38)
12
Team Selection Test
1. (Morteza Saghafian) Morteza has 100 sets. At each step Mahdi can choose
two distinct sets from them and Morteza tell him the intersection and union
of those two sets. Find the least possible number of steps that Mahdi can
determine all of 100 sets.
(→ p. 40)
2. (Mohammadamin Sharifi) For a positive integer n, let τ (n) and σ(n) be
the number of positive divisors of n and the sum of positive divisors of n,
respectively. Let a and b be positive integers such that σ (an ) divides σ (bn )
for all n ∈ N. Prove that each prime factor of τ (a) divides τ (b).
(→ p. 40)
3. (Mahdi Etesamifard and Alireza Dadgarnia) Incircle ω of triangle ABC
is tangent to sides CB and CA at D and E, respectively. Point X is the
reflection of D with respect to B. Suppose that the line DE is tangent to the
A-excircle at Z. Let the circumcircle of triangle XZE intersects ω at K, for
the second time. Prove that the intersection of BK and AZ lies on ω.
(→ p. 41)
4. (Amir Parsa Hosseini Nayeri) Cyclic quadrilateral ABCD with circumcen-
ter O is given. Point P is the intersection of diagonals AC and BD. Let M
and N be midpoints of the sides AD and BC, respectively. Suppose that ω1 ,
ω2 and ω3 are circumcircles of triangles ADP , BCP and OM N , respectively.
Let E and F be intersection points of ω1 and ω3 , which is not on the arc
AP D of ω1 , and the intersection point of ω2 and ω3 , which is not on the arc
BP C of ω2 , respectively. Prove that OE = OF .
(→ p. 42)
5. (Navid Safaei) Find all real numbers C such that every sequence an of
integers which is bounded from below and for all n ≥ 2 satisfies:
it is periodic. (→ p. 43)
13
6. (Shayan Gholami) Let m, n and a1 , a2 . . . , am be arbitrary positive inte-
gers. Ali and Mohammad play the following game; At each step, Ali chooses
b1 , b2 . . . , bm ∈ N, then Mohammad chooses a positive integer s and obtains
a new sequence {ci = ai + bi+s }m i=1 , where
Through a finite number of steps, Ali intends to make all the numbers divisible
by n. Find all positive integers m and n such that Ali,independent of the
initial values a1 , a2 . . . , am , has a winning strategy.
(→ p. 45)
7. (Mohammad Ahmadi) Suppose that n is a positive integer. Consider a
regular 2n-gon such that one of its largest diagonals is parallel to the x-axis.
Find the smallest integer d such that there is a polynomial P (x) of degree
d whose graph intersects all sides of the polygon on points other than its
vertices.
(→ p. 46)
8. (Amirmahdi Mohseni) In triangle ABC, with AB < AC, I is the incenter,
E is the intersection of A-excircle, and BC. Point F lies on the external
angle bisector of ∠BAC such that E and F lies on the same side of the line
AI and ∠AIF = ∠AEB. Point Q lies on BC such that ∠AIQ = 90◦ . Circle
ωb is tangent to F Q and AB at B, circle ωc is tangent to F Q and AC at C
and both circles are passing through the inside of triangle ABC. If M is the
midpoint of the arc BC, which does not contain A, prove that M lies on the
radical axis of ωb and ωc .
(→ p. 47)
9. (Morteza Saghafian) Consider n ≥ 6 points x1 , x2 , . . . , xn on the plane such
that no three of them are colinear. We call a graph with vertices x1 , x2 , . . . , xn
a "road network " if it is connected, each of its edges is a line segment, and
no two edges intersect at a point other than its vertices. Prove that there are
three road networks G1 , G2 , G3 such that Gi and Gj don’t have a common
edge for 1 ≤ i, j ≤ 3.
(→ p. 48)
10. (Seyed Reza Hosseini Dolatabadi) We call an infinite set S ⊆ N good if
ac − bc
for all pairwise distinct integers a, b, c ∈ S, all positive divisors of are
a−b
in S. For all positive integers n > 1, prove that there exists a good set S such
that n ̸∈ S.
(→ p. 49)
14
11. (Seyed Mohammad Seyedjavadi and Alireza Tavakoli) Consider a table
with n rows and 2n columns. We put some blocks in some of the cells. After
putting blocks on the table we put a robot on a cell and it starts moving in
one of the following four directions: right, left, down, or up. It can change the
direction only when it reaches a block or a border. Find the smallest value
of m such that we can put m blocks on the table and choose a starting point
for the robot so it can visit all of the unblocked cells. (the robot cannot enter
the blocked cells.)
(→ p. 49)
12. (Matin Yousefi) Suppose that A is the set of all closed intervals [a, b] ⊂ R.
Find all functions f : R → A such that
i x ∈ f (y) if and only if y ∈ f (x).
15
Solutions
Second Round
2. We prove that a nice number has at most 20 digits which proves that
there are finitely many nice numbers. Assume that n = abc where a, c can
have more than one digit and b is a digit such that ac = nk for some natural
number k. If c has t digits, then n = ac (mod 10t−1 ) therefore we have kn = n
(mod 10t−1 ). Because there is no zero digit in n, we know that gcd(n, 2) = 1
or gcd(n, 5) = 1. If gcd(n, 2) = 1 then we have k = 1 (mod 2t−1 ), on the other
hand n < 100ac so k < 7 which implies that t < 9. Similarly if gcd(n, 2) = 5
we have t < 4.
Now assume that a has more than 10 digits, we have ac | ac0, ac | abc
therefore ac | abc − ac0. But the previous paragraph implies that abc − ac0
has at most 10 digits which implies that abc − ac0 | ac. So we should have
n = ac0 which is in contradiction with the fact that n is an interesting number.
■
17
It is clear that AF XZ is an isosceles trapezoid therefore AF XZ is cyclic
and it is suffices to prove that the circumcircle of F XZ passes through C.
>
Note that ∠BEF = ∠F XE = F XD 2 = ∠F DC therefore F ECD is cyclic and
we have
∠F CZ = ∠F CD = ∠F ED = ∠F EX = ∠F XY = 180 − ∠F XZ.
A ω
Y F
l E
X
D
Z
18
5. Putting C = 9
1000 , n = 1400. Assume to the contrary that for all z ≥ y ≥ x
we have
(z − y)(y − x)(z − x) ≥ C(1 + x4 + y 4 + z 4 ).
Notice that 4(y − x)(z − y) ≤ (y − x + z − y)2 = (z − x)2 . Whence,
(z − x)3
≥ 4C.
x4 + z 4
Since 2(x4 +z 4 ) ≥ (x2 +z 2 )2 and 2(x2 +z 2 ) ≥ (x−z)2 . Therefore, 8(x4 +z 4 ) ≥
(x − z)4 . We would obtain
That is,
√
3 2
4C ≤ z − x < .
C
Finally,
√ assume that x1 ≤ · · · ≤ xn are given. We would then have xk+2 −xk >
3
4C. Hence,
n−1 √
2 3
> xn − x1 ≥ 4C.
C 2
Hence, √
3
2
C< 3 .
n−1 2
2
Yielding, C < 87
10000 . A contradiction. Thus, we are done. ■
6. We shall show that this is impossible. Assume that there are such 2021
numbers. First of all, note that of we divide all the numbers by k then the
new numbers satisfy the second condition and one of them is a divisor of 2021,
so we can assume that the greatest common divisor of the numbers is 1.
Lemma. the gcd of each three consecutive number on the circle is 1.
Proof. Assume that a, b, c, d, e are five consecutive numbers on the circle, if
a, b, c has a common divisor d, then the equality c = gcd(a, b) + gcd(d, e)
implies that d, e are also divisible by d.Similarly all the numbers should be
divisible by d which is in contradiction with our assumption. This completes
our proof.
19
Assume that m is the maximum number on the circle, and x, y, m, z, t
be five consecutive numbers. We know that m > 4 because at least one of
the numbers should be a divisor of 2021 and 2021 is not divisible by 2, 3, 4.
We have m = gcd(x, y) + gcd(z, t) so at least one of the gcd(x, y), gcd(z, t)
should be at least m 2 . Without the loss of generality we can assume that
gcd(x, y) ≥ m 2 .
If x ̸= y then max(x, y) ≥ m, yielding max(x, y) = m. If y = m then by
the assumption x > gcd(m, y) = m we shall arrive at a contradiction hence we
have x = m, y = m 2 . This implies that gcd(z, t) = 2 therefore z = 2 , y = m
m m
m m m m
m = gcd(x, y) + gcd(z, t) = + 1 + ( , t) =⇒ −1 .
2 2 2 2
Which contradicts to the fact that m
2 > 2. ■
20
Third Round
Algebra
1. First Solution Note that a2 − 43 a+ 34 = a2 +1− 43 a+ 13 ≥ 2a− 34 a+ 13 = 2a+1
3 .
Hence,
ab ab 3ab 1 3b
≤ = = 3b − .
a2 − 43 a + 43 2a+1
3
2a + 1 2 2a + 1
That is,
X ab 1X 3b 3 3X b
≤ 3b − = (a + b + c + d) −
cyc
a − 43 a +
2 4
3
2 cyc 2a + 1 2 2 cyc 2a + 1
3X b
=6− .
2 cyc 2a + 1
Notice that
X b X b2 (a + b + c + d)2 8
= ≥ = .
cyc
2a + 1 cyc
2ab + b 2(a + c)(b + d) + 4 2 + (a + c)(b + d)
Second Solution. We can prove that a2 − 4aa+ 4 ≤ a+2 3 by using the equation
3 3
of the tangent line to graph of f (a) = a2 − 4 a+ 4 at a = 1 or prove it by
a
3 3
21
algebraic calculations leading to (a − 1)2 (3a + 8) ≥ 0. Then, the left side is
less than or equal to
X a + 2 1 8 4 8
b = (a + c)(b + d) + ≤ + = 4.
cyc
3 3 3 3 3
■
Comment. The original statement of the problem was:
Let λ ∈ [1, 2] and a, b, c, d be positive real numbers such that a + b + c + d = 4.
Prove that
ab bc cd da
+ 2 + 2 + 2 ≤ 4.
a2 − λa + λ b − λb + λ c − λc + λ d − λd + λ
Indeed, since the left side is a convex function with respect to λ, its maximum
achieved at the endpoints. So, it suffices to prove the statement for λ =
1, 2. Both cases are so easy. That was the chief reason why we changed the
statement to a particular case, i.e., λ = 34 .
1
+ 1 + 1 + 1 > 7.
x y z t 2
1 u − iv
= 2 ,
x u + v2
We would obtain
X !
1
+ 1 + 1 + 1 =
u − iv X u − iv
≥ |ℜ |
x y z t u2 + v 2 cyc
u2 + v 2
X u X u
= 2 2
≥ .
u +v
cyc
u + v2
2
22
Since u ≥ 1 3
we would obtain
2 u2 + v 2 + 4
3
X u 1 X u2 + v 2 + 4 3X 1 3X 1
≥ =2+ =2+ .
cyc
u2 +v 2 2 cyc u2 + v 2 2
8 cyc u + v 2 8 cyc |x|2
Hence,
X u 3 7
≥2+4· = .
cyc
u2 + v 2 8 2
It follows that X 7
u≥ .
cyc
2
Thus, |x + y + z + t| ≥ u ≥ 72 .
P
cyc
3. First Solution. We shall provide the solution for each part, separately;
Part i. Since f (x) is injective and limx→+∞ f (x) = +∞ set f (y) − 1 instead
of y, it follows that
23
Therefore
x − a + P (x)f (b − 1) x − a + AP (x)
f (f (x) − 1) = = .
P (a) B
That is
y − a + AP (y) x − a + AP (x)
x + P (x) = y + P (y) .
B B
Hence, Bx+(y −a)P (x) = By +(x−a)P (y). That is, setting y = c ̸= a,
Thus,
(P (c) − B)x + Bc − aP (c)
P (x) = .
c−a
Hence, P (x) = rx + s or P (x) = C.
Part ii. If P (x) = rx + s, then f (f (y) − 1) = ux + v. Then
24
Hence,
g(Z)g(Y ) = g(Y Z).
So, we have a multiplicative function which is bounded from below, thus
g(x) = xk for some real number k. We can easily find that g(x) = x.
The rest is clear.
■
Comment 1. If P (x) = C then f (f (x) − 1) = ux + v and hence,
f (x + Cy + D) = f (x)f (y).
f (x + y + D) = f (x)f (y),
Assume to the contrary that d = deg P > 1. Let ad be the leading coeffi-
2
cient of P (x), the coefficient of xd in the right is ad+1
d AB Ad−1 − B d−1 .
2
Since A ̸= ±B, we find that the coefficient of xd in the right side is not
zero. That is, the right side is of degree d2 However, since d > 1 the
left side is of degree d < d2 . A contradiction. Thus, d ≤ 1.
Part ii. Let P (x) = ax + b for some a > 0, b ≥ 0. Then, the original equation
can be rewritten as
25
We want to prove that b = 0. Assume that b > 0. Plugging bf (x) instead
of x yielding
f (bf (x + (ax + b)f (y))) = f (bf (x)(y + 1)) = c(x + (ax + b)f (y) + 1).
Hence,
f (b(y + 1)f (x)) = c(x + (ax + b)f (y) + 1).
Put x = t to obtain f (bc(y + 1)) = c(t + (at + b)f (y) + 1) = c(1 +
bf (y)). This equation is not true. Hence, b = 0. Rewrite the original
equation in the form f (x(1 + af (y))) = (1 + y)f (x). Define ff (x)
(1) = g(x),
if we rewrite the preceding equation in terms of g(x) we would obtain
g(x(1 + rg(y))) = (1 + y)g(x), for some positive real number r, i.e.,
r = af (1). This equation is quite similar to the aforementioned equation
while g(1) = 1. If x = 1 we have g(1 + rg(y)) = 1 + y this implies
that g(x) is surjective on big enough numbers, hence g(x(1 + rg(y))) =
g(x)g(1 + rg(y)). Since 1 + rg(y) covers all real numbers after some
26
certain point, we can find that g(xz) = g(x)g(z) for all z > M. Now,
we can extend it. Let z < M choose y such that yz, y > M then
Putting y = z
x for some z > 0 yielding
Therefore,
g(z + z) = g(z) + g(x).
Thus, g(x) is both additive and multiplicative. Hence, g(x) = x.
Combinatorics
1. Note that for any natural number x ∈ S we have gcd(a, x) ≤ a. Therefore,
according to the pigeonhole principle there is an infinite subset S ′ ⊂ S − {a}
such that for x, y ∈ S ′ , gcd(a, x) = gcd(a, y). If there are x, y ∈ S ′ such that
gcd(x, y) ̸= gcd(a, x), then x, a, y satisfy the desired condition. So for every
x, y ∈ S ′ , we have gcd(x, a) = gcd(y, a) = gcd(x, y). Fix the sum s ∈ S ′
and replace S ′ with the set consisting of all the elements x ∈ S such that
27
(s, a) = (x, a). We claim that S − (S ′ ∪ {a}) intersects with {b, c, d} and so is
non-empty. Besides, if b, c, d ∈ S ′ then we have
From this and since gcd(s′ , a) ̸= gcd(s, a) we conclude that triple (a, s′ , s)
satisfies the desired condition. ■
2. The answer is yes. First, we choose a cell as origin and fill it with zero, then
we fill the table in a way that the numbers in the cells of (2k + 1) × (2k + 1)
table centered at the origin be a permutations of numbers
It can be easily verified that the columns and rows of this table form
increasing sequences. So it is clear that with this algorithm the table will be
filled with a permutation of integers and has the desired properties. ■
28
3. A block of n marble with colors 1, 2, 3, . . . , n is called a nice block. We
prove that every m ≥ n(n − 1) is colorful. Assume that m = nk + r where
0 ≤ r ≤ n−1 and n−1 ≤ k. Put k nice blocks around the circle, now consider
r consecutive nice blocks and put a marble between any two adjacent blocks
among these r blocks, inclusively (note that k ≥ n − 1 ≥ r, so r blocks are
distinct). It is easy to see that these marbles satisfy the desired condition.
Now we want to prove that n(n − 1) − 1 is not n-colorful. Assume the
contrary. Then by the pigeonhole principle, we at least have n − 2 marbles of
the same color, and by our assumption between each two of these marbles we
have at most n marbles, hence we have at most (n − 2)(n + 1) marbles. But
n(n − 1) − 1 = n(n − 2) + n − 1 > n(n − 2) + n − 2 = (n + 1)(n − 2),
which is a contradiction. ■
Comment. This problem was IMO 2021 Shortlist-C2.
Geometry
1. Suppose that L and K lie on the circumcircle of ABD and ADC, respec-
tively.
L
M
K
B D C
29
Note that ∡LAB = 90◦ − ∡ABL = 90◦ − ∡ADL = 90◦ − ∡ACB. Similarly
we have ∡CAK = 90◦ − ∡CBA. Summing these two implies that ∡LAK =
2∡BAC. Denote by T the intersection of BL, CK, then
∡M CE = ∡M CK = ∡M F K = ∡M F A = ∡M OA = ∡BCA.
On the other hand, 180 − ∡BCA = ∡BAE = ∡M AE. These facts together
imply that AECM is cyclic.
Note that ∡CEM = ∡CAM = ∡CAB, hence △BCA ∼ △M CE. Now
denote the midpoint of M E by D. As M is the midpoint of BA, similarity of
triangles BCA and M CE implies that that ∡BCM = ∡M CD. Analogously,
D lies on the reflection of line BC with respect to CM , as desired.
30
K
A
E
O
F
B C
31
This shows that S is the intersection of the circumcircle of ABC with sym-
median and the proof is complete as the circumcircle of triangle QXY passes
through this fixed point S.
F
E
F′
P Q
Y
R
T
G
B Z D C
Number Theory
1. First Solution. We first state a well-known bound for the left side.
Lemma. For each composite n we have
√
n − φ(n) ≥ n.
φ(n) Qt pi −1
Proof. Let n = pα
1 . . . pt such that p1 < · · · < pt . Then,
1 αt
n = i=1 p1 ≤
p1 −1
p1 . Hence,
n √
n − φ(n) ≥ ≥ n.
p1
This completes our proof.
32
On the other hand, none of integers from pn1 to n are not a divisor of n.
Hence,
n n n φ(n)
f (n) ≥ n − − φ(n) − φ ≥n− − φ(n) −
p1 p1 p1 p1
√
1 n
≥ 1− (n − φ(n)) ≥ .
p1 2
Hence, √
n
k = f (n) ≥ .
2
It follows that n ≤ 4k 2 . ■
. It is also clear than n is not a prime number. Rewrite The equation f (n) = k
as
n − d(n) = φ(n) + k + 1.
The left side is equal to number of integers between 2 and n that doesn’t divide
n. The right sides is equal to k + 1 plus total number of integers between 2
and n such that are coprime to n. Whence, there are k + 1 numbers like a
such that a doesn’t divide n and gcd(a, n) > 1. Let p be a prime divisor of
n. If n = pm then all numbers of the form a = pr, gcd(r, m) = 1 such that
2 ≤ r ≤ m have the desired property. Hence, we at least have φ(m) − 1
choices for a. Thus,
n
φ(m) = φ ≤ k + 2.
p
Since p was arbitrary, it follows that all primes dividing n as well as their
exponents must be bounded. Hence, we at most have finitely many choices
for n. ■
2. Let b = 1 we have f a (1) + f (a) 2f (a). Hence, 2f (a) = C(f a (1) + +f (a)),
for some positive integer C. Thus, C = 1 and f a (1) = f (a). Whence, f a (b) =
f a−1 (f (b)) = f a−1 (f b (1)) = f a+b−1 (1) = f (a + b − 1). By the same argument
f b (a) = f (a + b − 1). It then follows that f (a + b − 1) divides f (ab) + b2 − 1.
Interchanging a, b to obtain f (a + b − 1) | b2 − a2 . Hence, f (2a) divides 2a + 1.
If the function is injective, it follows that
33
positive integer m; f (m + r) = f m (f r (1)) = f m (f s (1)) = f (m + s). Hence,
the function is periodic with a period of r − s. This implies that the function
is indeed bounded. That is, for all n we have f (n) < M. Choose a prime
p > M it follows that f (p − 1) divides p and f (p − 1) < M < p. Yielding
f (p − 1) = 1. Whence, for all large enough p; f (p − 1) = f p−1 (1) = 1.
Let d be the smallest positive integer such that f d (1) = 1 by using the
divison algorithm, we can easily prove that d divides p − 1 . This means that
for all large enough p we have p ≡ 1 (mod d). This implies that d ∈ {1, 2}.
2k
Thus f (f (1)) = 1. Hence, f (2k) = f (1) = 1 for all positive integers k. On
2k+1
the other hand, f (2k + 1) = f (1) = f (1) for all non-negative integers k.
Finally putting a = b = 2 to obtain f (1) divides 4. Hence, f (2k+1) ∈ {1, 2, 4}.
Whence, we have four functions satisfying the statement of the problem. ■
Proof. Since m is not a power of two it would have an odd prime divisor,
say p. Since the sequence xn (mod m) is eventually periodic it follows that
xn (mod p) is also eventually periodic. Hence, for all large n, xn+T − xn is
divisible by p. Fix b, large enough such that a ≡ xb (mod p) and a ̸= 0, 1.
Since p ≥ 3, such a b exists because each 0 (mod p) followed by 1 which is
followed by 2. Clearly xb+kT ≡ a (mod p) for each a ≥ 0.
Notice that p divides ayb+kT − ayb . Hence, |yb+kT − yb | is divisible by the
order of a mod p, namely d. That is, yb+kT (mod d) is periodic. As desired.
Now, we shall prove a nice fact about the periodicity of S(b + kT ), k =
0, . . .
Lemma 2. Let b, T, d be positive integers, if the sequence S(b + kT ), k =
0, . . . is constant mod d then d divides T and d ∈ {1, 3, 9}.
Proof. Letting k = 10r s for some large enough r it follows that S(b+10r sT ) =
S(b) + S(sT ) ≡ S(b) (mod d). Whence, S(sT ) ≡ 0 (mod d). We can also
assume gcd(10, T ) = 1 indeed, if T = 2α 5β T1 , gcd(T1 , 10) = 1 then, by a
suitable choice of s we can make power of 10.
Then, there are s0 , s1 such that
T s0 ≡ 1 (mod 100)
34
and
T s1 ≡ 9 (mod 10r+1 ).
Further, by a suitable choice of r we can ensure that T s0 < 10r . It follows
that
S((s0 + s1 )T ) = S(s0 T ) + S(s1 T ) − 9.
Since d divides S(s0 T ), S(s1 T ), S((s0 + s1 )T ) it follows that d divides 9. That
is, S((s0 + s1 )T ). And since S(sT ) ≡ sT (mod 9) it follows that sT ≡ 0
(mod d), Hence, d divides T. This completes our proof.
Back to our problem. We shall firstly prove that m has no odd prime
divisor. Assume the sequence is periodic with the minimal period of T. Since
there are infinitely many i such that S(i) is divisible by p − 1 if p divides xi
then xi+2 ≡ 2 (mod p). If p doesn’t divide xi then xi+1 ≡ 2 (mod p). Hence,
2 is among the residues of xn modulo p. Take a = 2 in the first lemma. It
follows that the sequence S(kT + i) is constant modulo the order of 2 modulo
p, namely d. Hence, d divides 9. That is, p divides 29 −1 = 7×73. If p = 7 then
for i ≡ 0 (mod 3) we have xi+1 ≡ 2 (mod 7) and xi+2 ≡ 3 (mod 7) since
the order of 3 mod 7 is 6 we reached to a contradiction. The same holds for the
case i ≡ 1 (mod 3). Finally, for i ≡ 2 (mod 3) we have xi+1 ≡ 5 (mod 7)
and since the order of 5 modulo 7 is 6 we again reached to a contradiction.
If p = 73 the numbers with orders that dividing 9 are
35
Final Exam
1. The answer is no. First for every 1 ≤ i ≤ 8 we define Ni to be the set of
numbers assigned to the vertices adjacent to the vertex with number i. By
the problem’s assumption the sum of elements of Ni is divisible by i. Since
the sum of every three numbers less than 8 is at most 7 + 6 + 5 = 18, the sum
of elements of N8 is either 8 or 16. By checking different cases it is easy to
see N8 equals to either {3, 6, 7}, {4, 5, 7}, {5, 2, 1} or {4, 3, 1}. We will check
these different cases.
• If N8 = {3, 6, 7}, let N6 = {x, y, 8}. Evidently N8 ∩ N6 = ∅. Now, by
assumption, 6 | x + y + 8, and 11 = 1 + 2 + 8 ≤ x + y + 8 ≤ 17 = 4 + 5 + 8.
These imply x + y = 4 and so {x, y} = {1, 3}. This contradicts to
N8 ∩ N6 = ∅.
• The case N8 = {4, 5, 7} is similar to the previous case. We only need to
consider N7 instead of N6 .
• If N8 = {1, 3, 4}, denote by x, y, z, t the numbers of other vertices as
is the figure below. We have {x, y, z, t} = {2, 5, 6, 7}. It follows from
t | x + y + z that t is a divisor of t + x + y + z = 20 so t = 5. On the other
hand, y | 1 + 3 + t. Therefore y must be either 1, 3 which is impossible.
36
Therefore in each case the numbers can not be assigned to the vertices of the
cube and the solution is complete. ■
Y
E
A F
X
G
B C
D
37
3. Let P (x) is a non-zero polynomial and d = deg P ,We shall prove that
f (P (x)) = Cd, for some constant C, furthermore f (0) = 0. It is easy to check
that such a function properly works.
Letting (P (x), Q(x)) = (P (x), 1), (b, P (x)) in the second equation as well
as (P (x), Q(x)) = (a, 1) in the first equation for some non-zero constants a, b
we conclude that f (a) = 0 and f (bP (x)) = f (P (x)). Letting (P (x), Q(x)) =
(bx, xb + 1) to obtain f (x + b) = f (x + 1) for all b ̸= 0. Let c, d be two arbitrary
real numbers such that cd ̸= 0 it follows that
d d
f x+ =f c x+ = f (cx + d) = f (x + 1).
c c
equation yields
1
f (x) = f (cx) = f cx + 1 − = f (x + 1).
c
38
have numbers 1, 2, . . . , 467 (from top to bottom), then the rectangles filling
the third and forth column have numbers 468, 469, . . . , 934, etc. We consider
two different trominos in each 2 × 3 table, as in the figure below.
Now if k ≥ 700 × 467, Arash will color the trominos of type 1 in all the
rectangles and then k ′ = k − 700 × 467 trominos of type 2 in rectangles of
numbers 1, 2, . . . , k ′ . It is easy to find that after Arash’s turn, every 2 × 2
square has a colored cell. So, Babak can not color any 2 × 2 square in his
turn and Arash will win.
If k ≤ 700 × 467, Arash in his first turn colors the trominos of type 1 in
rectangles 1, 2, . . . , k. For the next turns, suppose that Babak has filled some
square and now this is Arash’s turn. If he can find k disjoint trominos do
not intersecting rectangles 1, 2, . . . , k, he will color them. In the case that
there is not k disjoint trominos, let k ′ be the maximal number such trominos
(k ′ < k). Now, he will color k ′ trominos without intersection with rectangles
1, 2, . . . , k, and also color k − k ′ trominos in rectangles 1, 2, . . . , k − k ′ . After
this step, there would be no uncolored 2 × 2 square left in the table and so
Babak will lose the game. ■
39
Team Selection Test
1. Suppose that the sets are A1 , A2 , . . . , A100 . We claim that Mahdi needs
100 steps. First of all, notice that 100 would be enough; by calling (1, 2),
(1, 3) and (2, 3) he can understand A1 , A2 and A3 . Because we have
2. Let
a = pα1 α2 α3 αn
1 p2 p3 . . . pn and b = q1β1 q2β2 q3β3 . . . qm
βm
40
kβ +1 zkβ +1
νs qj j − 1 = νs qj j − 1 and if s ∤ q kβi +1 − 1 then by Fermat’s
little theorem s ∤ q zkβi +1 − 1 and we again have
zkβ +1 zkβ +1
νs qj j − 1 = νs qj j − 1 .
In concise
a contradiction. ■
3. Let I be the incenter and Ia the A-excenter of triangle ABC and J the
C-excenter of triangle CDE. J lies on ω, since
1
∠EJD = 90◦ − ∠ECD = ∠CDE.
2
We claim that A, J, and Z are collinear. Point T lies on AC such that
IT ∥ DE. To prove our claim, we just need to show that IT IJ
= IIaa C
Z
, since
IT ∥ CIa , IJ ∥ Ia Z and IIa passes through A. Notice that
IE Ia Y
∠IT E = ∠DEC = ∠EDC = ∠Ia CY =⇒ △IET ∼ △Ia Y C =⇒ = ,
IT Ia C
hence IT
IJ
= IIaa C
Z
, since IE = IJ and Ia Y = Ia Z. So the claim is proved. Let
BC touches A-excircle at Y . The extensions of sides of quadrilateral AEDB
are tangent to A-excircle, therefore
AE + ED = AB + BD =⇒ ED = 2BD. (1)
41
therefore ∠Y JD = ∠BKD, since ∠BJY = ∠BKY . According to our as-
sumption, J lies on the angle bisector of ∠Y DZ and Y D = DZ. It yields
that JD is the perpendicular bisector of Y Z and ∠Y JD = ∠ZJD. Hence
∠ZJD = ∠BKD and the result follows.
A
T
E
K
J
I N M
X C
B D Y
Ia
42
A B
ω3
E′ ≡ E
P
F′ ≡ F
M
ω1 N
O ω2
D
Proof. Let Jm denotes the infinite set of indices j such that aj = m. Then,
−Cm ≤ aj−1 + aj+1 < −Cm + 1 holds for all j ∈ Jm . Thus, −aj−1 − Cm ≤
aj+1 < −aj−1 − Cm + 1. Assume that the sub-sequence aj−1 is unbounded
from above for j ∈ Jm .
Since an > −K for some constant K and all n, then there is j ∈ Jm such
that aj−1 ≥ K − Cm + 1. Then, aj+1 < −K this is impossible. Therefore,
aj−1 is bounded from above for j ∈ Jm . Thus, there is an integer r and
j1 , j2 ∈ Jm , and j1 ̸= j2 such that aj1 −1 = aj2 −1 = r. Thus, (aj1 −1 , aj1 ) =
(aj2 −1 , aj2 ) = (r, m). Hence the sequence is periodic.
Now, we prove the following lemma.
Lemma 2. If the sequence is unbounded from above then it has infinitely
positive and infinitely many negative terms.
43
Proof. A collection of positive (negative) terms of the sequence is called a
positive (negative) run. We shall prove that a run is always finite. This
implies the statement immediately. If C ≥ 0. then the length of the run is at
most two. If −1 ≤ C < 0, we would obtain
44
6. We claim that the second player has winning strategy for (m, n) = (pα , pβ )
where p is a prime number and α, β ∈ Z≥0 . We call a pair (m, n) a good pair
if you the second player has winning strategy.
Lemma 1. If (m, n) is a good pair and d | m then (d, n) is also a good pair.
Proof. Assume that the games starts with the sequence a1 , a2 , ..., ad . Moham-
mad Considers a second game that starts with the sequence (ã1 , ã2 , ..., ãm )
where ã mi
d
= ai and a˜j = 0, for m
d ∤ j. Now if Ali chooses s in the first game,
Mohammad assumes that Ali chooses m d s in the second game and follows his
strategy and wins the second game. But the first game is just a restriction of
the second game to the components m d i so he can also win the first game.
Lemma 2. (m, nk) is a good pair if and only if (m, n), (m, k) are also good
pairs.
Proof. If (m, nk) is a good pair then it is clear that (m, n), (m, k) are good
pairs. Now if (m, n), (m, k) are good pairs, starting with a sequence a1 , ..., am
then using the afore-mentioned strategy for (m, n), making all the components
divisible by n. Considering the sequence ( ani ), applying the preceding strategy
for (m, k) to ensure that k| ani , by the very end all the terms are divisible by
nk and hence nk is a good pair.
By these lemmas we see that if (m, n) is a good pair and p|m, q|n then
(p, q) is also a good pair. Now by the next lemma we would obtain p = q.
Hence (m, n) should be of the form (pα , pβ ) .
Lemma 3. If (m, n) is a good pair and m, n > 1 then gcd(m, n) > 1.
Proof. Assume that gcd(m, n) = 1. Consider one step before the end of the
game. The sequence (ai ) must be constant; otherwise for each sequence (bi )
there is some j such that ai + bj ̸≡ 0 (mod n) and the first player can choose
j − i. In the second step before the last step, we should have
otherwise Ali could choose a shift s such that (ai + bi + s) is not constant. So
we must have m(a1 − a0 ) ≡ 0 (mod n), implying that a1 − a0 ≡ 0 (mod n).
So the sequence is constant. We then use induction to deduce that sequence
should be constant from the starting point. So, for a non-constant sequence
the first player has a winning strategy.
45
First proof. Let T : (Z/pZ)m → (Z/pZ)m denotes a shift by 1. Then at
each step the sequence changes to (T s − id)(a1 , . . . , apα ). Suffices to prove
that
Ypα
(T sj − id) ≡ 0 (mod p)
j=1
α
but T − id | T sj − id. So it is enough to prove (T − id)p ≡ 0 (mod p) but
α α
(T − id)p ≡ T p − id ≡ 0 (mod p).
Second proof.
Lemma 4. There is an integer-valued polynomial Q(x) such that Q(i) ≡ ai
(mod p) for all 1 ≤ i ≤ pα .
Proof. Consider the polynomial Pi (x) = x−i−1
pα −1 . One can see that Pi (i) ≡ 1
(mod p) and for j ̸≡ i (mod pα ), we have Pi (j) ≡ 0 (mod p). Then we can
choose
pα
X
Q(x) = ai Pi (x).
i=1
Now, in the next step we have ai ≡ Q(i) − Q(i + s) (mod p) but the degree
of Q(x) − Q(x + s) is less than deg(Q) so after pα steps the second player
wins. ■
46
4
−2 −1 1 2 3 4 5
−1
−2
we are done.
47
F
X
I
B D C
Q
H E
OB
M
OC Ia
Let S be a set of n points in the plane and let e = (r, b) be an edge spanned
by S having exactly 4 points of S on one side (i.e., on one side of the straight
line ℓe supporting e). Let S ′ be the set of 6 points containing r, b, and the
exactly 4 points on one side of e. By the above claim, S ′ contains 3 edge-
disjoint plane spanning trees. For sake of simplicity, we call them red, blue,
and green. Without loss of generality, assume that e is a part of the red tree.
Note that each point of S ′ is incident to all three trees, and that r and b
are extremal points for S\(S ′ \{r, b}). We construct a red and a blue plane
spanning trees by connecting r and b, respectively, with all points in S\S ′ .
48
Next, we shall construct the third (green) plane spanning tree on S. Note
that the green plane spanning tree on S ′ can be completed by a triangulation
T . Let q be a point of S ′ \{r, b}, such that qrb is a triangle in T . Observe
that any edge incident to q and crossing e does not cross a green edge.
Assume that there exists a point q ′ ∈ (S\S ′ ) such that the edge qq ′ crosses
e. Then we connect q and q ′ with a green edge and complete the green plane
spanning tree by connecting all points in S\(S ′ ∪ {q ′ }) with q ′ . If such a point
q ′ does not exist, then there must be an edge e′ of the convex hull of S, such
that e′ crosses ℓe . Denote by p the endpoint of e′ in S\S ′ . We shall color e
by green and complete the green plane spanning tree by connecting all points
in S\(S ′ ∪ {p}) with p. ■
if j = 1
i ≡ 5 (mod 8),
i ≡ 8 (mod 8), i ≥ 1, if j = 2
i ≡ 0 (mod 8), if j = 2n − 1
i ≡ 4 (mod 8), if j = 2n.
49
Lemma 1. Assume that the starting point of the move is not in column j
(1 < j < n), and there is no block in columns j − 1, j, j + 1. Then we do not
ever change direction in column j. (The same is true for rows.)
Proof. Consider the direction firstly changes at cell (i, j) in the column j.
Since there is no block in this column, before reaching this row we have been
moving vertically, so there should be some block in (i, j + 1) or (i, j − 1). A
contradiction.
Lemma 2. If we reach the cell (i, j) then the starting cell or a cell where we
change direction should either be in the row i or in the column j.
Proof. Obvious!
If there are three columns j − 1, j, j + 1 that do not contain the starting
cell or any blocks, then by the first lemma, we cannot change our direction
at any cell in column j. By the second lemma, to reach all the cells in the
column j we need to change direction at all rows except the rows containing
the starting point. Assume that the staring point is (i0 , j0 ). Then by the first
lemma, because we can change direction at rows i ̸= i0 , 1, n there should be
a block in one of the (i − 1)-th or (i + 1)-th rows. Each block could work for
at most two rows so we need at least ⌈ n−3 n
2 ⌉ = [ 2 ] − 1.
If there are not three such columns, then we need at least [2n/3] blocks.
So in each case we need at least [ n2 ] − 1 blocks. ■
Lemma 2. If the interval I has length 2, then there is a real number r such
that f (r) = I.
Proof. If I = [x, x + 2] then by condition 2 there is r ∈ f (x) ∩ f (x + 2) so
we have x, x + 2 ∈ f (r). But the length of f (r) is at most 2 hence we have
f (r) = [x, x + 2], this completes our proof.
50
Define a new function g : R → R such that for all r, g(r) is the midpoint
of f (r). Since we know the length of f (r) we can forget about f and work
with g. We apt to find all bijective functions g such that:
i. |x − g(y)| ≤ 1 ⇐⇒ |y − g(x)| ≤ 1.
ii. |g(x) − g(y)| ≤ 2 ⇐⇒ |x − y| ≤ 2.
iii. g(r) = r2 for all 0 ≤ r ≤ 1.
Lemma 4. g is strictly increasing.
Proof. It suffices to prove if x < y, y − x < 1 then g(x) < g(y). We firstly
consider the case y = 0. For each −2 ≤ x ≤ 0 by condition 2 and g(0) = 0
we have
|g(x) − g(2)| > 2, |g(x)| ≤ 2, |g(2)| ≤ 2
so we can deduce that g(x) and g(2) have different signs, similarly we can
deduce that g(2), g(1) = 1 have the same sign (they are both opposite to the
sign of g(−2)). Hence we have g(2) > 0, g(x) < 0.
We prove by induction on |⌊x⌋| (We only prove the case that 0 ≤ x < y
the other case is similar). For the base if 0 ≤ x < y < 1 then x2 < y 2 . We
know that y − x − 2 > 2 hence by the second condition we have
|g(y) − g(x − 2)| > 2, |g(y) − g(x)| ≤ 2, |g(x) − g(x − 2)| ≤ 2.
We know by induction that g(x) − g(x − 2) > 0 hence we have g(y) > g(x).
Lemma 5. we have g(x + 1) = g −1 (x) + 1.
Proof. We know that g is bijective so it suffices to prove that g(g(x) + 1) =
x + 1. Assume that g(r) = x + 1 then we have r ≤ g(x) + 1. Now if r′ > r we
have g(r′ ) > x + 1 hence by condition 1; r′ > g(x) + 1 so we get r = g(x) + 1.
By the last lemma we obtain that there is only one function that satisfies the
condition of the problem and that function is:
(
(x − ⌊x⌋)2 + ⌊x⌋ ⌊x⌋ ≡ 0 (mod 2);
g(x) = p
x − ⌊x⌋ + ⌊x⌋ ⌊x⌋ ≡ 1 (mod 2).
It is easy to check that this function actually works. ■
Remark. If we replace the condition 3 in the problem with the weaker con-
dition f (0) = [−1, 1], f (1) = [0, 2] we can still finds all the solutions. By the
above proof it is clear that any such f would be of the form [g(r) − 1, g(r) + 1]
where g was constructed by choosing a monotonically increasing yet bijective
function h : [0, 1] → [0, 1] such that:
(
h(x − ⌊x⌋) + ⌊x⌋ ⌊x⌋ ≡ 0 (mod 2);
g(x) = −1
h (x − ⌊x⌋) + ⌊x⌋ ⌊x⌋ ≡ 1 (mod 2).
51