Download as pdf or txt
Download as pdf or txt
You are on page 1of 781

Problems short list

with solutions
Shortlisted Problems with Solutions

55th International Mathematical Olympiad


Cape Town, South Africa, 2014
Note of Confidentiality

The shortlisted problems should be kept


strictly confidential until IMO 2015.

Contributing Countries

The Organising Committee and the Problem Selection Committee of IMO 2014 thank the
following 43 countries for contributing 141 problem proposals.

Australia, Austria, Belgium, Benin, Bulgaria, Colombia, Croatia,


Cyprus, Czech Republic, Denmark, Ecuador, Estonia, Finland,
France, Georgia, Germany, Greece, Hong Kong, Hungary, Iceland,
India, Indonesia, Iran, Ireland, Japan, Lithuania, Luxembourg,
Malaysia, Mongolia, Netherlands, Nigeria, Pakistan, Russia,
Saudi Arabia, Serbia, Slovakia, Slovenia, South Korea, Thailand,
Turkey, Ukraine, United Kingdom, U.S.A.

Problem Selection Committee

Johan Meyer
Ilya I. Bogdanov
Géza Kós
Waldemar Pompe
Christian Reiher
Stephan Wagner
4 IMO 2014 South Africa

Problems
Algebra
A1. Let z0 ă z1 ă z2 ă ¨ ¨ ¨ be an infinite sequence of positive integers. Prove that there
exists a unique integer n ě 1 such that
z0 ` z1 ` ¨ ¨ ¨ ` zn
zn ă ď zn`1 .
n
(Austria)
A2. Define the function f : p0, 1q Ñ p0, 1q by
#
1
x` 2
if x ă 21 ,
f pxq “
x2 if x ě 21 .

Let a and b be two real numbers such that 0 ă a ă b ă 1. We define the sequences an and bn
by a0 “ a, b0 “ b, and an “ f pan´1 q, bn “ f pbn´1 q for n ą 0. Show that there exists a positive
integer n such that
pan ´ an´1 qpbn ´ bn´1 q ă 0.
(Denmark)
A3. For a sequence x1 , x2 , . . . , xn of real numbers, we define its price as
max |x1 ` ¨ ¨ ¨ ` xi |.
1ďiďn

Given n real numbers, Dave and George want to arrange them into a sequence with a
low price. Diligent Dave checks all possible ways and finds the minimum possible price D.
Greedy George, on the other hand, chooses x1 such that |x1 | is as small as possible; among
the remaining numbers, he chooses x2 such that |x1 ` x2 | is as small as possible, and so on.
Thus, in the ith step he chooses xi among the remaining numbers so as to minimise the value
of |x1 ` x2 ` ¨ ¨ ¨ ` xi |. In each step, if several numbers provide the same value, George chooses
one at random. Finally he gets a sequence with price G.
Find the least possible constant c such that for every positive integer n, for every collection
of n real numbers, and for every possible sequence that George might obtain, the resulting
values satisfy the inequality G ď cD.
(Georgia)
A4. Determine all functions f : Z Ñ Z satisfying
` ˘
f f pmq ` n ` f pmq “ f pnq ` f p3mq ` 2014
for all integers m and n.
(Netherlands)
Shortlisted problems 5

A5. Consider all polynomials P pxq with real coefficients that have the following property:
for any two real numbers x and y one has

|y 2 ´ P pxq| ď 2 |x| if and only if |x2 ´ P pyq| ď 2 |y| .

Determine all possible values of P p0q.


(Belgium)
A6. Find all functions f : Z Ñ Z such that
n2 ` 4f pnq “ f pf pnqq2

for all n P Z.
(United Kingdom)
6 IMO 2014 South Africa

Combinatorics
C1. Let n points be given inside a rectangle R such that no two of them lie on a line parallel
to one of the sides of R. The rectangle R is to be dissected into smaller rectangles with sides
parallel to the sides of R in such a way that none of these rectangles contains any of the given
points in its interior. Prove that we have to dissect R into at least n ` 1 smaller rectangles.
(Serbia)
C2. We have 2 sheets of paper, with the number 1 written on each of them. We perform
m

the following operation. In every step we choose two distinct sheets; if the numbers on the two
sheets are a and b, then we erase these numbers and write the number a ` b on both sheets.
Prove that after m2m´1 steps, the sum of the numbers on all the sheets is at least 4m .
(Iran)
C3. Let n ě 2 be an integer. Consider an n ˆ n chessboard divided into n2 unit squares.
We call a configuration of n rooks on this board happy if every row and every column contains
exactly one rook. Find the greatest positive integer k such that for every happy configuration
of rooks, we can find a k ˆ k square without a rook on any of its k 2 unit squares.
(Croatia)
C4. Construct a tetromino by attaching two 2 ˆ 1 dominoes along their longer sides such
that the midpoint of the longer side of one domino is a corner of the other domino. This
construction yields two kinds of tetrominoes with opposite orientations. Let us call them S-
and Z-tetrominoes, respectively.

S-tetrominoes Z-tetrominoes

Assume that a lattice polygon P can be tiled with S-tetrominoes. Prove than no matter
how we tile P using only S- and Z-tetrominoes, we always use an even number of Z-tetrominoes.
(Hungary)
C5. Consider n ě 3 lines in the plane such that no two lines are parallel and no three have a
common point. These lines divide the plane into polygonal
Pa regions;
T let F be the set of regions
having finite area. Prove that it is possible to colour n{2 of the lines blue in such a way
that no region in F has a completely blue boundary. (For a real number x, rxs denotes the
least integer which is not smaller than x.)
(Austria)
Shortlisted problems 7

C6. We are given an infinite deck of cards, each with a real number on it. For every real
number x, there is exactly one card in the deck that has x written on it. Now two players draw
disjoint sets A and B of 100 cards each from this deck. We would like to define a rule that
declares one of them a winner. This rule should satisfy the following conditions:

1. The winner only depends on the relative order of the 200 cards: if the cards are laid down
in increasing order face down and we are told which card belongs to which player, but
not what numbers are written on them, we can still decide the winner.

2. If we write the elements of both sets in increasing order as A “ ta1 , a2 , . . . , a100 u and
B “ tb1 , b2 , . . . , b100 u, and ai ą bi for all i, then A beats B.

3. If three players draw three disjoint sets A, B, C from the deck, A beats B and B beats C,
then A also beats C.

How many ways are there to define such a rule? Here, we consider two rules as different if there
exist two sets A and B such that A beats B according to one rule, but B beats A according to
the other.
(Russia)
C7. Let M be a set of n ě 4 points in the plane, no three of which are collinear. Initially these
points are connected with n segments so that each point in M is the endpoint of exactly two
segments. Then, at each step, one may choose two segments AB and CD sharing a common
interior point and replace them by the segments AC and BD if none of them is present at this
moment. Prove that it is impossible to perform n3 {4 or more such moves.
(Russia)
C8. A card deck consists of 1024 cards. On each card, a set of distinct decimal digits is
written in such a way that no two of these sets coincide (thus, one of the cards is empty). Two
players alternately take cards from the deck, one card per turn. After the deck is empty, each
player checks if he can throw out one of his cards so that each of the ten digits occurs on an
even number of his remaining cards. If one player can do this but the other one cannot, the
one who can is the winner; otherwise a draw is declared.
Determine all possible first moves of the first player after which he has a winning strategy.
(Russia)
C9. There are n circles drawn on a piece of paper in such a way that any two circles
intersect in two points, and no three circles pass through the same point. Turbo the snail slides
along the circles in the following fashion. Initially he moves on one of the circles in clockwise
direction. Turbo always keeps sliding along the current circle until he reaches an intersection
with another circle. Then he continues his journey on this new circle and also changes the
direction of moving, i.e. from clockwise to anticlockwise or vice versa.
Suppose that Turbo’s path entirely covers all circles. Prove that n must be odd.
(India)
8 IMO 2014 South Africa

Geometry
G1. The points P and Q are chosen on the side BC of an acute-angled triangle ABC so
that =P AB “ =ACB and =QAC “ =CBA. The points M and N are taken on the rays AP
and AQ, respectively, so that AP “ P M and AQ “ QN. Prove that the lines BM and CN
intersect on the circumcircle of the triangle ABC.
(Georgia)
G2. Let ABC be a triangle. The points K, L, and M lie on the segments BC, CA, and AB,
respectively, such that the lines AK, BL, and CM intersect in a common point. Prove that it
is possible to choose two of the triangles ALM, BMK, and CKL whose inradii sum up to at
least the inradius of the triangle ABC.
(Estonia)
G3. Let Ω and O be the circumcircle and the circumcentre of an acute-angled triangle ABC
with AB ą BC. The angle bisector of =ABC intersects Ω at M ‰ B. Let Γ be the circle
with diameter BM. The angle bisectors of =AOB and =BOC intersect Γ at points P and Q,
respectively. The point R is chosen on the line P Q so that BR “ MR. Prove that BR k AC.
(Here we always assume that an angle bisector is a ray.)
(Russia)
G4. Consider a fixed circle Γ with three fixed points A, B, and C on it. Also, let us fix
a real number λ P p0, 1q. For a variable point P R tA, B, Cu on Γ, let M be the point on
the segment CP such that CM “ λ ¨ CP . Let Q be the second point of intersection of the
circumcircles of the triangles AMP and BMC. Prove that as P varies, the point Q lies on a
fixed circle.
(United Kingdom)
G5. Let ABCD be a convex quadrilateral with =B “ =D “ 90 . Point H is the foot of
˝

the perpendicular from A to BD. The points S and T are chosen on the sides AB and AD,
respectively, in such a way that H lies inside triangle SCT and

=SHC ´ =BSC “ 90˝ , =T HC ´ =DT C “ 90˝ .

Prove that the circumcircle of triangle SHT is tangent to the line BD.
(Iran)
G6. Let ABC be a fixed acute-angled triangle. Consider some points E and F lying on
the sides AC and AB, respectively, and let M be the midpoint of EF . Let the perpendicular
bisector of EF intersect the line BC at K, and let the perpendicular bisector of MK intersect
the lines AC and AB at S and T , respectively. We call the pair pE, F q interesting, if the
quadrilateral KSAT is cyclic.
Suppose that the pairs pE1 , F1 q and pE2 , F2 q are interesting. Prove that
E1 E2 F1 F2
“ .
AB AC
(Iran)
G7. Let ABC be a triangle with circumcircle Ω and incentre I. Let the line passing through I
and perpendicular to CI intersect the segment BC and the arc BC (not containing A) of Ω at
points U and V , respectively. Let the line passing through U and parallel to AI intersect AV
at X, and let the line passing through V and parallel to AI intersect AB at Y . Let W and Z be
the midpoints of AX and BC, respectively. Prove that if the points I, X, and Y are collinear,
then the points I, W , and Z are also collinear.
(U.S.A.)
Shortlisted problems 9

Number Theory
N1. Let n ě 2 be an integer, and let An be the set
An “ t2n ´ 2k | k P Z, 0 ď k ă nu.

Determine the largest positive integer that cannot be written as the sum of one or more (not
necessarily distinct) elements of An .
(Serbia)
N2. Determine all pairs px, yq of positive integers such that
a3
7x2 ´ 13xy ` 7y 2 “ |x ´ y| ` 1 .

(U.S.A.)
N3. A coin is called a Cape Town coin if its value is 1{n for some positive integer n. Given
a collection of Cape Town coins of total value at most 99 ` 21 , prove that it is possible to split
this collection into at most 100 groups each of total value at most 1.
(Luxembourg)
N4. Let n ą 1 be a given integer. Prove that infinitely many terms of the sequence pak qkě1 ,
defined by Z k^
n
ak “ ,
k
are odd. (For a real number x, txu denotes the largest integer not exceeding x.)
(Hong Kong)
N5. Find all triples pp, x, yq consisting of a prime number p and two positive integers x and y
such that xp´1 ` y and x ` y p´1 are both powers of p.
(Belgium)
N6. Let a1 ă a2 ă ¨ ¨ ¨ ă an be pairwise coprime positive integers with a1 being prime
and a1 ě n ` 2. On the segment I “ r0, a1 a2 ¨ ¨ ¨ an s of the real line, mark all integers that are
divisible by at least one of the numbers a1 , . . . , an . These points split I into a number of smaller
segments. Prove that the sum of the squares of the lengths of these segments is divisible by a1 .
(Serbia)
N7. Let c ě 1 be an integer. Define a sequence of positive integers by a1 “ c and
an`1 “ a3n ´ 4c ¨ a2n ` 5c2 ¨ an ` c

for all n ě 1. Prove that for each integer n ě 2 there exists a prime number p dividing an but
none of the numbers a1 , . . . , an´1 .
(Austria)
N8. For every real number x, let }x} denote the distance between x and the nearest integer.
Prove that for every pair pa, bq of positive integers there exist an odd prime p and a positive
integer k satisfying › › › › › ›
› a › › b › ›a ` b›
› ›`› ›`›
› pk › › pk › › pk › “ 1.

(Hungary)
10 IMO 2014 South Africa

Solutions

Algebra
A1. Let z0 ă z1 ă z2 ă ¨ ¨ ¨ be an infinite sequence of positive integers. Prove that there
exists a unique integer n ě 1 such that
z0 ` z1 ` ¨ ¨ ¨ ` zn
zn ă ď zn`1 . p1q
n
(Austria)
Solution. For n “ 1, 2, . . . define

dn “ pz0 ` z1 ` ¨ ¨ ¨ ` zn q ´ nzn .

The sign of dn indicates whether the first inequality in (1) holds; i.e., it is satisfied if and only
if dn ą 0.

Notice that

nzn`1 ´ pz0 ` z1 ` ¨ ¨ ¨ ` zn q “ pn ` 1qzn`1 ´ pz0 ` z1 ` ¨ ¨ ¨ ` zn ` zn`1 q “ ´dn`1 ,

so the second inequality in (1) is equivalent to dn`1 ď 0. Therefore, we have to prove that there
is a unique index n ě 1 that satisfies dn ą 0 ě dn`1 .

By its definition the sequence d1 , d2 , . . . consists of integers and we have

d1 “ pz0 ` z1 q ´ 1 ¨ z1 “ z0 ą 0.

From
` ˘ ` ˘
dn`1 ´ dn “ pz0 ` ¨ ¨ ¨ ` zn ` zn`1 q ´ pn ` 1qzn`1 ´ pz0 ` ¨ ¨ ¨ ` zn q ´ nzn “ npzn ´ zn`1 q ă 0

we can see that dn`1 ă dn and thus the sequence strictly decreases.

Hence, we have a decreasing sequence d1 ą d2 ą . . . of integers such that its first element d1
is positive. The sequence must drop below 0 at some point, and thus there is a unique index n,
that is the index of the last positive term, satisfying dn ą 0 ě dn`1 .

Comment. Omitting the assumption that z1 , z2 , . . . are integers allows the numbers dn to be all
positive. In such cases the desired n does not exist. This happens for example if zn “ 2 ´ 21n for all
integers n ě 0.
Shortlisted problems – solutions 11

A2. Define the function f : p0, 1q Ñ p0, 1q by


#
1
x` 2
if x ă 21 ,
f pxq “
x2 if x ě 21 .

Let a and b be two real numbers such that 0 ă a ă b ă 1. We define the sequences an and bn
by a0 “ a, b0 “ b, and an “ f pan´1 q, bn “ f pbn´1 q for n ą 0. Show that there exists a positive
integer n such that
pan ´ an´1 qpbn ´ bn´1 q ă 0.
(Denmark)
Solution. Note that
1
f pxq ´ x “ 2
ą0
1
if x ă 2
and
f pxq ´ x “ x2 ´ x ă 0
if x ě 21 . So if we consider p0, 1q as being divided into the two subintervals I1 “ p0, 21 q and
I2 “ r 21 , 1q, the inequality
` ˘` ˘
pan ´ an´1 qpbn ´ bn´1 q “ f pan´1 q ´ an´1 f pbn´1 q ´ bn´1 ă 0

holds if and only if an´1 and bn´1 lie in distinct subintervals.


Let us now assume, to the contrary, that ak and bk always lie in the same subinterval.
Consider the distance dk “ |ak ´ bk |. If both ak and bk lie in I1 , then
ˇ ˇ
dk`1 “ |ak`1 ´ bk`1 | “ ˇak ` 21 ´ bk ´ 21 ˇ “ dk .

If, on the other hand, ak and bk both lie in I2 , then minpak , bk q ě 21 and maxpak , bk q “
minpak , bk q ` dk ě 21 ` dk , which implies
ˇ ˇ ˇ ˇ
dk`1 “ |ak`1 ´ bk`1 | “ ˇa2k ´ b2k ˇ “ ˇpak ´ bk qpak ` bk qˇ ě |ak ´ bk | 21 ` 21 ` dk “ dk p1 ` dk q ě dk .
` ˘

This means that the difference dk is non-decreasing, and in particular dk ě d0 ą 0 for all k.
We can even say more. If ak and bk lie in I2 , then

dk`2 ě dk`1 ě dk p1 ` dk q ě dk p1 ` d0 q.

If ak and bk both lie in I1 , then ak`1 and bk`1 both lie in I2 , and so we have

dk`2 ě dk`1p1 ` dk`1 q ě dk`1p1 ` d0 q “ dk p1 ` d0 q.

In either case, dk`2 ě dk p1 ` d0 q, and inductively we get

d2m ě d0 p1 ` d0 qm .

For sufficiently large m, the right-hand side is greater than 1, but since a2m , b2m both lie in
p0, 1q, we must have d2m ă 1, a contradiction.
Thus there must be a positive integer n such that an´1 and bn´1 do not lie in the same
subinterval, which proves the desired statement.
12 IMO 2014 South Africa

A3. For a sequence x1 , x2 , . . . , xn of real numbers, we define its price as


max |x1 ` ¨ ¨ ¨ ` xi |.
1ďiďn

Given n real numbers, Dave and George want to arrange them into a sequence with a
low price. Diligent Dave checks all possible ways and finds the minimum possible price D.
Greedy George, on the other hand, chooses x1 such that |x1 | is as small as possible; among
the remaining numbers, he chooses x2 such that |x1 ` x2 | is as small as possible, and so on.
Thus, in the ith step he chooses xi among the remaining numbers so as to minimise the value
of |x1 ` x2 ` ¨ ¨ ¨ ` xi |. In each step, if several numbers provide the same value, George chooses
one at random. Finally he gets a sequence with price G.
Find the least possible constant c such that for every positive integer n, for every collection
of n real numbers, and for every possible sequence that George might obtain, the resulting
values satisfy the inequality G ď cD.
(Georgia)

Answer. c “ 2.
Solution. If the initial numbers are 1, ´1, 2, and ´2, then Dave may arrange them as
1, ´2, 2, ´1, while George may get the sequence 1, ´1, 2, ´2, resulting in D “ 1 and G “ 2. So
we obtain c ě 2.
Therefore, it remains to prove that G ď 2D. Let x1 , x2 , . . . , xn be the numbers Dave and
George have at their disposal. Assume that Dave and George arrange them into sequences
d1 , d2, . . . , dn and g1 , g2 , . . . , gn , respectively. Put

M “ max |xi |, S “ |x1 ` ¨ ¨ ¨ ` xn |, and N “ maxtM, Su.


1ďiďn

We claim that

D ě S, (1)
M
Dě , and (2)
2
G ď N “ maxtM, Su. (3)

These inequalities yield the desired estimate, as G ď maxtM, Su ď maxtM, 2Su ď 2D.
The inequality (1) is a direct consequence of the definition of the price.
To prove (2), consider an index i with |di | “ M. Then we have
ˇ ˇ
M “ |di | “ ˇpd1 ` ¨ ¨ ¨ ` di q ´ pd1 ` ¨ ¨ ¨ ` di´1 qˇ ď |d1 ` ¨ ¨ ¨ ` di | ` |d1 ` ¨ ¨ ¨ ` di´1 | ď 2D,

as required.
It remains to establish (3). Put hi “ g1 ` g2 ` ¨ ¨ ¨ ` gi . We will prove by induction on
i that |hi | ď N. The base case i “ 1 holds, since |h1 | “ |g1 | ď M ď N. Notice also that
|hn | “ S ď N.
For the induction step, assume that |hi´1 | ď N. We distinguish two cases.
Case 1. Assume that no two of the numbers gi , gi`1 , . . . , gn have opposite signs.
Without loss of generality, we may assume that they are all nonnegative. Then one has
hi´1 ď hi ď ¨ ¨ ¨ ď hn , thus (
|hi | ď max |hi´1 |, |hn | ď N.
Case 2. Among the numbers gi , gi`1 , . . . , gn there are positive and negative ones.
Shortlisted problems – solutions 13

Then there exists some index j ě i such that hi´1 gj ď 0. By the definition of George’s
sequence we have
(
|hi | “ |hi´1 ` gi | ď |hi´1 ` gj | ď max |hi´1 |, |gj | ď N.

Thus, the induction step is established.

M M
Comment 1. One can establish the weaker inequalities D ě 2 and G ď D ` 2 from which the
result also follows.

Comment 2. One may ask a more specific question to find the maximal suitable c if the number n
is fixed. For n “ 1 or 2, the answer is c “ 1. For n “ 3, the answer is c “ 32 , and it is reached e.g.,
for the collection 1, 2, ´4. Finally, for n ě 4 the answer is c “ 2. In this case the arguments from the
solution above apply, and the answer is reached e.g., for the same collection 1, ´1, 2, ´2, augmented
by several zeroes.
14 IMO 2014 South Africa

A4. Determine all functions f : Z Ñ Z satisfying

` ˘
f f pmq ` n ` f pmq “ f pnq ` f p3mq ` 2014 (1)

for all integers m and n.


(Netherlands)

Answer. There is only one such function, namely n ÞÝÑ 2n ` 1007.


Solution. Let f be a function satisfying (1). Set C “ 1007 and define the function g : Z Ñ Z
by gpmq “ f p3mq ´ f pmq ` 2C for all m P Z; in particular, gp0q “ 2C. Now (1) rewrites as
` ˘
f f pmq ` n “ gpmq ` f pnq

for all m, n P Z. By induction in both directions it follows that


` ˘
f tf pmq ` n “ tgpmq ` f pnq (2)
` ˘ ` ˘
holds for all m, n, t P Z. Applying this, for any r P Z, to the triples r, 0, f p0q and 0, 0, f prq
in place of pm, n, tq we obtain
` ˘
f p0qgprq “ f f prqf p0q ´ f p0q “ f prqgp0q .

Now if f p0q vanished, then gp0q “ 2C ą 0 would entail that f vanishes identically, contrary
to (1). Thus f p0q ‰ 0 and the previous equation yields gprq “ α f prq, where α “ fgp0q
p0q
is some
nonzero constant.
So the definition of g reveals f p3mq “ p1 ` αqf pmq ´ 2C, i.e.,
` ˘
f p3mq ´ β “ p1 ` αq f pmq ´ β (3)
2C
for all m P Z, where β “ α
. By induction on k this implies

f p3k mq ´ β “ p1 ` αqk f pmq ´ β


` ˘
(4)

for all integers k ě 0 and m.


Since 3 ∤ 2014, there exists by (1) some value d “ f paq attained by f that is not divisible
by 3. Now by (2) we have f pn ` tdq “ f pnq ` tgpaq “ f pnq ` α ¨ tf paq, i.e.,

f pn ` tdq “ f pnq ` α ¨ td (5)

for all n, t P Z.
Let us fix any positive integer k with d | p3k ´ 1q, which is possible, since gcdp3, dq “ 1.
E.g., by the Euler–Fermat theorem, we may take k “ ϕp|d|q. Now for each m P Z we get

f p3k mq “ f pmq ` αp3k ´ 1qm


` ˘` ˘
from (5), which in view of (4) yields p1 ` αqk ´ 1 f pmq ´ β “ αp3k ´ 1qm. Since α ‰ 0,
the right hand side does not vanish for m ‰ 0, wherefore the first factor on the left hand side
cannot vanish either. It follows that
αp3k ´ 1q
f pmq “ ¨m`β.
p1 ` αqk ´ 1
Shortlisted problems – solutions 15

So f is a linear function, say f pmq “ Am ` β for all m P Z with some constant A P Q. Plugging
this into (1) one obtains pA2 ´ 2Aqm ` pAβ ´ 2Cq “ 0 for all m, which is equivalent to the
conjunction of

A2 “ 2A and Aβ “ 2C . (6)

The first equation is equivalent to A P t0, 2u, and as C ‰ 0 the second one gives

A“2 and β “C. (7)

This shows that f is indeed the function mentioned in the answer and as the numbers found
in (7) do indeed satisfy the equations (6) this function is indeed as desired.

Comment 1. One may see that α “ 2. A more pedestrian version of the above solution starts with
a direct proof of this fact, that can be obtained by substituting some special values into (1), e.g., as
follows.
Set D “ f p0q. Plugging m “ 0 into (1) and simplifying, we get

f pn ` Dq “ f pnq ` 2C (8)

for all n P Z. In particular, for n “ 0, D, 2D we obtain f pDq “ 2C ` D, f p2Dq “ f pDq` 2C “ 4C ` D,


and f p3Dq “ f p2Dq ` 2C “ 6C ` D. So substituting m “ D and n “ r ´ D into (1) and applying (8)
with n “ r ´ D afterwards we learn
` ˘
f pr ` 2Cq ` 2C ` D “ f prq ´ 2C ` p6C ` Dq ` 2C ,

i.e., f pr ` 2Cq “ f prq ` 4C. By induction in both directions it follows that

f pn ` 2Ctq “ f pnq ` 4Ct (9)

holds for all n, t P Z.


Claim. If a and b denote two integers with the property that f pn ` aq “ f pnq ` b holds for all n P Z,
then b “ 2a.
Proof. Applying induction in both directions to the assumption we get f pn ` taq “ f pnq ` tb for all
n, t P Z. Plugging pn, tq “ p0, 2Cq into this equation and pn, tq “ p0, aq into (9) we get f p2aCq´ f p0q “
2bC “ 4aC, and, as C ‰ 0, the claim follows. l
Now by (1), for any m P Z, the numbers a “ f pmq and b “ f p3mq ´ f pmq ` 2C have the property
mentioned in the claim, whence we have
` ˘
f p3mq ´ C “ 3 f pmq ´ C .

In view of (3) this tells us indeed that α “ 2.


Now the solution may be completed as above, but due to our knowledge of α “ 2 we get the
desired formula f pmq “ 2m ` C directly without having the need to go through all linear functions.
Now it just remains to check that this function does indeed satisfy (1).

Comment 2. It is natural to wonder what happens if one replaces the number 2014 appearing in
the statement of the problem by some arbitrary integer B.
If B is odd, there is no such function, as can be seen by using the same ideas as in the above
solution.
If B ‰ 0 is even, however, then the only such function is given by n ÞÝÑ 2n`B{2. In case 3 ∤ B this
was essentially proved above, but for the general case one more idea seems to be necessary. Writing
B “ 3ν ¨ k with some integers ν and k such that 3 ∤ k one can obtain f pnq “ 2n ` B{2 for all n that
are divisible by 3ν in the same manner as usual; then one may use the formula f p3nq “ 3f pnq ´ B to
establish the remaining cases.
16 IMO 2014 South Africa

Finally, in case B “ 0 there are more solutions than just the function n ÞÝÑ 2n. It can be shown
that all these other functions are periodic; to mention just one kind of example, for any even integers
r and s the function #
r if n is even,
f pnq “
s if n is odd,
also has the property under discussion.
Shortlisted problems – solutions 17

A5. Consider all polynomials P pxq with real coefficients that have the following property:
for any two real numbers x and y one has
|y 2 ´ P pxq| ď 2 |x| if and only if |x2 ´ P pyq| ď 2 |y| . (1)

Determine all possible values of P p0q.


(Belgium)

Answer. The set of possible values of P p0q is p´8, 0q Y t1u.


Solution.
Part I. We begin by verifying that these numbers are indeed possible values of P p0q. To see
that each negative real´ number¯´C can be P p0q, it suffices to check that for every C ą 0 the
2
polynomial P pxq “ ´ 2xC ` C has the property described in the statement of the problem.
Due to symmetry it is enough for this purpose to prove |y 2 ´ P pxq| ą 2 |x| for any two real
numbers x and y. In fact we have

2 x2 p|x| ´ Cq2
2 x2
|y ´ P pxq| “ y ` ` ` 2 |x| ě ` 2 |x| ě 2 |x| ,
C C C
where in the first estimate equality can only hold if |x| “ C, whilst in the second one it can
only hold if x “ 0. As these two conditions cannot be met at the same time, we have indeed
|y 2 ´ P pxq| ą 2 |x|.
To show that P p0q “ 1 is possible as well, we verify that the polynomial P pxq “ x2 ` 1
satisfies (1). Notice that for all real numbers x and y we have
|y 2 ´ P pxq| ď 2 |x| ðñ py 2 ´ x2 ´ 1q2 ď 4x2
ðñ 0 ď py 2 ´ px ´ 1q2 px ` 1q2 ´ y 2
` ˘` ˘

ðñ 0 ď py ´ x ` 1qpy ` x ´ 1qpx ` 1 ´ yqpx ` 1 ` yq


ðñ 0 ď px ` yq2 ´ 1 1 ´ px ´ yq2 .
` ˘` ˘

Since this inequality is symmetric in x and y, we are done.


Part II. Now we show that no values other than those mentioned in the answer are possible
for P p0q. To reach this we let P denote any polynomial satisfying (1) and P p0q ě 0; as we shall
see, this implies P pxq “ x2 ` 1 for all real x, which is actually more than what we want.
First step: We prove that P is even.
By (1) we have
|y 2 ´ P pxq| ď 2 |x| ðñ |x2 ´ P pyq| ď 2 |y| ðñ |y 2 ´ P p´xq| ď 2 |x|
for all real numbers x and y. Considering just the equivalence of the first and third statement
and taking into account that y 2 may vary through Rě0 we infer that
“ ‰ “ ‰
P pxq ´ 2 |x|, P pxq ` 2 |x| X Rě0 “ P p´xq ´ 2 |x|, P p´xq ` 2 |x| X Rě0
holds for all x P R. We claim that there are infinitely many real numbers x such that
P pxq ` 2 |x| ě 0. This holds in fact for any real polynomial with P p0q ě 0; in order to see
this, we may assume that the coefficient of P appearing in front of x is nonnegative. In this
case the desired inequality holds for all sufficiently small positive real numbers.
For such numbers x satisfying P pxq ` 2 |x| ě 0 we have P pxq ` 2 |x| “ P p´xq ` 2 |x| by
the previous displayed formula, and hence also P pxq “ P p´xq. Consequently the polynomial
P pxq ´ P p´xq has infinitely many zeros, wherefore it has to vanish identically. Thus P is
indeed even.
18 IMO 2014 South Africa

Second step: We prove that P ptq ą 0 for all t P R.


Let us assume for a moment that there exists a real number t ‰ 0 with P ptq “ 0. Then
there is some open interval I around t such that |P pyq| ď 2 |y| holds for all y P I. Plugging
x “ 0 into (1) we learn that y 2 “ P p0q holds for all y P I, which is clearly absurd. We have
thus shown P ptq ‰ 0 for all t ‰ 0.
In combination with P p0q ě 0 this informs us that our claim could only fail if P p0q “ 0. In
this case there is by our first step a polynomial Qpxq such that P pxq “ x2 Qpxq. Applying (1)
to x “ 0 and an arbitrary y ‰ 0 we get |y Qpyq| ą 2, which is surely false when y is sufficiently
small.
Third step: We prove that P is a quadratic polynomial.
a
Notice that P cannot be constant, for otherwise if x “ P p0q and y is sufficiently large, the
first part of (1) is false whilst the second part is true. So the degree n of P has to be at least 1.
By our first step n has to be even as well, a whence in particular nˇě 2. `a ˘ˇ a
Now assume that n ě 4. Plugging y “ P pxq into (1) we get ˇx2 ´ P P pxq ˇ ď 2 P pxq
and hence `a a
P pxq ď x2 ` 2 P pxq
˘
P
for all real x. Choose positive real numbers x0 , a, and b such that if x P px0 , 8q, then axn ă
P pxq ă bxn ; this is indeed possible, for if d ą 0 denotes the leading coefficient of P , then
lim P pxq
n “ d, whence for instance the numbers a “ d2 and b “ 2d work provided that x0 is
xÑ8 x
chosen large enough.
Now for all sufficiently large real numbers x we have
2 `a a
an{2`1 xn {2 ă aP pxqn{2 ă P P pxq ď x2 ` 2 P pxq ă xn{2 ` 2b1{2 xn{2 ,
˘

i.e.
1 ` 2b1{2
2 ´nq{2
xpn ă ,
an{2`1
which is surely absurd. Thus P is indeed a quadratic polynomial.
Fourth step: We prove that P pxq “ x2 ` 1.
In the light of our first three steps there are?two real numbers a ą 0 and b such that P pxq “
ax2 ` b. Now if x is large ? enough and y “ a x, the left part of (1) holds and the right part
2 2
reads |p1 ´ a qx ´ b| ď 2 a x. In view of the fact that a ą 0 this is only possible if a “ 1.
Finally, substituting y “ x ` 1 with x ą 0 into (1) we get
|2x ` 1 ´ b| ď 2x ðñ |2x ` 1 ` b| ď 2x ` 2 ,
i.e.,
b P r1, 4x ` 1s ðñ b P r´4x ´ 3, 1s
for all x ą 0. Choosing x large enough, we can achieve that at least one of these two statements
holds; then both hold, which is only possible if b “ 1, as desired.

Comment 1. There are some issues with this problem in that its most natural solutions seem to
use some basic facts from analysis, such as the continuity of polynomials or the intermediate value
theorem. Yet these facts are intuitively obvious and implicitly clear to the students competing at this
level of difficulty, so that the Problem Selection Committee still thinks that the problem is suitable
for the IMO.

Comment 2. It seems that most solutions will in the main case, where P p0q is nonnegative, contain
an argument that is somewhat asymptotic in nature showing that P is quadratic, and some part
narrowing that case down to P pxq “ x2 ` 1.
Shortlisted problems – solutions 19

Comment 3. It is also possible to skip the first step and start with the second step directly, but
then one has to work a bit harder to rule out the case P p0q “ 0. Let us sketch one possibility of doing
this: Take the auxiliary polynomial Qpxq such that P pxq “ xQpxq. Applying (1) to x “ 0 and an
arbitrary y ‰ 0 we get |Qpyq| ą 2. Hence we either have Qpzq ě 2 for all real z or Qpzq ď ´2 for all
real z. In particular there is some η P t´1, `1u such that P pηq ě 2 and P p´ηq ď ´2. Substituting
x “ ˘η into (1) we learn

|y 2 ´ P pηq| ď 2 ðñ |1 ´ P pyq| ď 2 |y| ðñ |y 2 ´ P p´ηq| ď 2 .


a
But for y “ P pηq the first statement is true, whilst the third one is false.
Also, if one has not obtained the evenness of P before embarking on the fourth step, one needs to
work a bit harder there, but not in a way that is likely to cause major difficulties.

Comment 4. Truly curious people may wonder about the set of all polynomials having property (1).
As explained in the solution above, P pxq “ x2 ` 1 is the only one with P p0q “ 1. On the other hand,
it is not hard to notice that for negative P p0q there are more possibilities than those mentioned above.
E.g., as remarked by the proposer, if a and b denote two positive real `numbers with ab˘ ą 1 and Q
denotes a polynomial attaining nonnegative values only, then P pxq “ ´ ax2 ` b ` Qpxq works.
More generally, it may be proved that if P pxq satisfies (1) and P p0q ă 0, then ´P pxq ą 2 |x| holds
for all x P R so that one just considers the equivalence of two false statements. One may generate all
such polynomials P by going through all combinations of a solution of the polynomial equation

x “ ApxqBpxq ` CpxqDpxq

and a real E ą 0, and setting

P pxq “ ´ Apxq2 ` Bpxq2 ` Cpxq2 ` Dpxq2 ` E


` ˘

for each of them.


20 IMO 2014 South Africa

A6. Find all functions f : Z Ñ Z such that


n2 ` 4f pnq “ f pf pnqq2 (1)

for all n P Z.
(United Kingdom)

Answer. The possibilities are:

• f pnq “ n ` 1 for all n;


#
n ` 1, n ą ´a,
• or, for some a ě 1, f pnq “
´n ` 1, n ď ´a;
$
&n ` 1,
’ n ą 0,
• or f pnq “ 0, n “ 0,

´n ` 1, n ă 0.
%

Solution 1.
Part I. Let us first check that each of the functions above really satisfies the given functional
equation. If f pnq “ n ` 1 for all n, then we have

n2 ` 4f pnq “ n2 ` 4n ` 4 “ pn ` 2q2 “ f pn ` 1q2 “ f pf pnqq2 .

If f pnq “ n ` 1 for n ą ´a and f pnq “ ´n ` 1 otherwise, then we have the same identity for
n ą ´a and
n2 ` 4f pnq “ n2 ´ 4n ` 4 “ p2 ´ nq2 “ f p1 ´ nq2 “ f pf pnqq2
otherwise. The same applies to the third solution (with a “ 0), where in addition one has

02 ` 4f p0q “ 0 “ f pf p0qq2.

Part II. It remains to prove that these are really the only functions that satisfy our func-
tional equation. We do so in three steps:
Step 1: We prove that f pnq “ n ` 1 for n ą 0.
Consider the sequence pak q given by ak “ f k p1q for k ě 0. Setting n “ ak in (1), we get

a2k ` 4ak`1 “ a2k`2 .

Of course, a0 “ 1 by definition. Since a22 “ 1 ` 4a1 is odd, a2 has to be odd as well, so we set
a2 “ 2r ` 1 for some r P Z. Then a1 “ r 2 ` r and consequently

a23 “ a21 ` 4a2 “ pr 2 ` rq2 ` 8r ` 4.

Since 8r ` 4 ‰ 0, a23 ‰ pr 2 ` rq2 , so the difference between a23 and pr 2 ` rq2 is at least the
distance from pr 2 ` rq2 to the nearest even square (since 8r ` 4 and r 2 ` r are both even). This
implies that
ˇ ˇ
|8r ` 4| “ ˇa23 ´ pr 2 ` rq2 ˇ ě pr 2 ` rq2 ´ pr 2 ` r ´ 2q2 “ 4pr 2 ` r ´ 1q,

(for r “ 0 and r “ ´1, the estimate is trivial, but this does not matter). Therefore, we ave

4r 2 ď |8r ` 4| ´ 4r ` 4.
Shortlisted problems – solutions 21

If |r| ě 4, then

4r 2 ě 16|r| ě 12|r| ` 16 ą 8|r| ` 4 ` 4|r| ` 4 ě |8r ` 4| ´ 4r ` 4,

a contradiction. Thus |r| ă 4. Checking all possible remaining values of r, we find that
pr 2 ` rq2 ` 8r ` 4 is only a square in three cases: r “ ´3, r “ 0 and r “ 1. Let us now
distinguish these three cases:

• r “ ´3, thus a1 “ 6 and a2 “ ´5. For each k ě 1, we have


b
ak`2 “ ˘ a2k ` 4ak`1,

and the sign needs to be chosen in such a way that a2k`1 ` 4ak`2 is again a square. This
yields a3 “ ´4, a4 “ ´3, a5 “ ´2, a6 “ ´1, a7 “ 0, a8 “ 1, a9 “ 2. At this point
we have reached a contradiction, since f p1q “ f pa0 q “ a1 “ 6 and at the same time
f p1q “ f pa8 q “ a9 “ 2.

• r “ 0, thus a1 “ 0 and a2 “ 1. Then a23 “ a21 ` 4a2 “ 4, so a3 “ ˘2. This, however,


is a contradiction again, since it gives us f p1q “ f pa0 q “ a1 “ 0 and at the same time
f p1q “ f pa2 q “ a3 “ ˘2.

• r “ 1, thus a1 “ 2 and a2 “ 3. We prove by induction that ak “ k ` 1 for all k ě 0


in this case, which we already know for k ď 2 now. For the induction step, assume that
ak´1 “ k and ak “ k ` 1. Then

a2k`1 “ a2k´1 ` 4ak “ k 2 ` 4k ` 4 “ pk ` 2q2 ,

so ak`1 “ ˘pk ` 2q. If ak`1 “ ´pk ` 2q, then

a2k`2 “ a2k ` 4ak`1 “ pk ` 1q2 ´ 4k ´ 8 “ k 2 ´ 2k ´ 7 “ pk ´ 1q2 ´ 8.

The latter can only be a square if k “ 4 (since 1 and 9 are the only two squares whose
difference is 8). Then, however, a4 “ 5, a5 “ ´6 and a6 “ ˘1, so

a27 “ a25 ` 4a6 “ 36 ˘ 4,

but neither 32 nor 40 is a perfect square. Thus ak`1 “ k ` 2, which completes our
induction. This also means that f pnq “ f pan´1 q “ an “ n ` 1 for all n ě 1.

Step 2: We prove that either f p0q “ 1, or f p0q “ 0 and f pnq ‰ 0 for n ‰ 0.


Set n “ 0 in (1) to get
4f p0q “ f pf p0qq2.
This means that f p0q ě 0. If f p0q “ 0, then f pnq ‰ 0 for all n ‰ 0, since we would otherwise
have
n2 “ n2 ` 4f pnq “ f pf pnqq2 “ f p0q2 “ 0.
If f p0q ą 0, then we know that f pf p0qq “ f p0q ` 1 from the first step, so
` ˘2
4f p0q “ f p0q ` 1 ,

which yields f p0q “ 1.


22 IMO 2014 South Africa

Step 3: We discuss the values of f pnq for n ă 0.


Lemma. For every n ě 1, we have f p´nq “ ´n ` 1 or f p´nq “ n ` 1. Moreover, if f p´nq “
´n ` 1 for some n ě 1, then also f p´n ` 1q “ ´n ` 2.
Proof. We prove this statement by strong induction on n. For n “ 1, we get
1 ` 4f p´1q “ f pf p´1qq2.
Thus f p´1q needs to be nonnegative. If f p´1q “ 0, then f pf p´1qq “ f p0q “ ˘1, so f p0q “ 1
(by our second step). Otherwise, we know that f pf p´1qq “ f p´1q ` 1, so
` ˘2
1 ` 4f p´1q “ f p´1q ` 1 ,
which yields f p´1q “ 2 and thus establishes the base case. For the induction step, we consider
two cases:
• If f p´nq ď ´n, then
f pf p´nqq2 “ p´nq2 ` 4f p´nq ď n2 ´ 4n ă pn ´ 2q2 ,
so |f pf p´nqq| ď n ´ 3 (for n “ 2, this case cannot even occur). If f pf p´nqq ě 0, then we
already know from the first two steps that f pf pf p´nqqq “ f pf p´nqq ` 1, unless perhaps
if f p0q “ 0 and f pf p´nqq “ 0. However, the latter would imply f p´nq “ 0 (as shown in
Step 2) and thus n “ 0, which is impossible. If f pf p´nqq ă 0, we can apply the induction
hypothesis to f pf p´nqq. In either case, f pf pf p´nqqq “ ˘f pf p´nqq ` 1. Therefore,
˘2
f p´nq2 ` 4f pf p´nqq “ f pf pf p´nqqq2 “ ˘f pf p´nqq ` 1 ,
`

which gives us
˘2
n2 ď f p´nq2 “ ˘f pf p´nqq ` 1 ´ 4f pf p´nqq ď f pf p´nqq2 ` 6|f pf p´nqq| ` 1
`

ď pn ´ 3q2 ` 6pn ´ 3q ` 1 “ n2 ´ 8,
a contradiction.
• Thus, we are left with the case that f p´nq ą ´n. Now we argue as in the previous
case: if f p´nq ě 0, then f pf p´nqq “ f p´nq ` 1 by the first two steps, since f p0q “ 0
and f p´nq “ 0 would imply n “ 0 (as seen in Step 2) and is thus impossible. If
f p´nq ă 0, we can apply the induction hypothesis, so in any case we can infer that
f pf p´nqq “ ˘f p´nq ` 1. We obtain
˘2
p´nq2 ` 4f p´nq “ ˘f p´nq ` 1 ,
`

so either ˘2
n2 “ f p´nq2 ´ 2f p´nq ` 1 “ f p´nq ´ 1 ,
`

which gives us f p´nq “ ˘n ` 1, or


˘2
n2 “ f p´nq2 ´ 6f p´nq ` 1 “ f p´nq ´ 3 ´ 8.
`

Since 1 and 9 are the only perfect squares whose difference is 8, we must have n “ 1,
which we have already considered.
Finally, suppose that f p´nq “ ´n ` 1 for some n ě 2. Then
f p´n ` 1q2 “ f pf p´nqq2 “ p´nq2 ` 4f p´nq “ pn ´ 2q2 ,
so f p´n` 1q “ ˘pn´ 2q. However, we already know that f p´n` 1q “ ´n` 2 or f p´n` 1q “ n,
so f p´n ` 1q “ ´n ` 2. l
Shortlisted problems – solutions 23

Combining everything we know, we find the solutions as stated in the answer:


• One solution is given by f pnq “ n ` 1 for all n.

• If f pnq is not always equal to n ` 1, then there is a largest integer m (which cannot be
positive) for which this is not the case. In view of the lemma that we proved, we must
then have f pnq “ ´n ` 1 for any integer n ă m. If m “ ´a ă 0, we obtain f pnq “ ´n ` 1
for n ď ´a (and f pnq “ n ` 1 otherwise). If m “ 0, we have the additional possibility
that f p0q “ 0, f pnq “ ´n ` 1 for negative n and f pnq “ n ` 1 for positive n.

Solution 2. Let us provide an alternative proof for Part II, which also proceeds in several
steps.
Step 1. Let a be an arbitrary integer and b “ f paq. We first concentrate on the case where
|a| is sufficiently large.

1. If b “ 0, then (1) applied to a yields a2 “ f pf paqq2, thus

f paq “ 0 ñ a “ ˘f p0q. (2)

From now on, we set D “ |f p0q|. Throughout Step 1, we will assume that a R t´D, 0, Du,
thus b ‰ 0.

2. From (1), noticing that f pf paqq and a have the same parity, we get
ˇ ˇ ˘2
0 ‰ 4|b| “ ˇf pf paqq2 ´ a2 ˇ ě a2 ´ |a| ´ 2 “ 4|a| ´ 4.
`

Hence we have
|b| “ |f paq| ě |a| ´ 1 for a R t´D, 0, Du. (3)
For the rest of Step 1, we also assume that |a| ě E “ maxtD ` 2, 10u. Then by (3) we
have |b| ě D ` 1 and thus |f pbq| ě D.

3. Set c “ f pbq; by (3), we have |c| ě |b| ´ 1. Thus (1) yields


˘2
a2 ` 4b “ c2 ě |b| ´ 1 ,
`

which implies ˘2 ˘2 ˘2
a2 ě |b| ´ 1 ´ 4|b| “ |b| ´ 3 ´ 8 ą |b| ´ 4
` ` `

because |b| ě |a| ´ 1 ě 9. Thus (3) can be refined to

|a| ` 3 ě |f paq| ě |a| ´ 1 for |a| ě E.

Now, from c2 “ a2 ` 4b with |b| P r|a| ´ 1, |a| ` 3s we get c2 “ pa ˘ 2q2 ` d, where


d P t´16, ´12, ´8, ´4, 0, 4, 8u. Since |a ˘ 2| ě 8, this can happen only if c2 “ pa ˘ 2q2 ,
which in turn yields b “ ˘a ` 1. To summarise,

f paq “ 1 ˘ a for |a| ě E. (4)

We have shown that, with at most finitely many exceptions, f paq “ 1 ˘ a. Thus it will be
convenient for our second step to introduce the sets
( ( ` ˘
Z` “ a P Z : f paq “ a ` 1 , Z´ “ a P Z : f paq “ 1 ´ a , and Z0 “ Zz Z` Y Z´ .
24 IMO 2014 South Africa

Step 2. Now we investigate the structure of the sets Z` , Z´ , and Z0 .

4. Note that f pE `1q “ 1˘pE `1q. If f pE `1q “ E `2, then E `1 P Z` . Otherwise we have
f p1`Eq “ ´E; then the original equation (1) with n “ E `1 gives us pE ´1q2 “ f p´Eq2 ,
so f p´Eq “ ˘pE ´ 1q. By (4) this may happen only if f p´Eq “ 1 ´ E, so in this case
´E P Z` . In any case we find that Z` ‰ ∅.

5. Now take any a P Z` . We claim that every integer x ě a also lies in Z` . We proceed by
induction on x, the base case x “ a being covered by our assumption. For the induction
step, assume that f px ´ 1q “ x and plug n “ x ´ 1 into (1). We get f pxq2 “ px ` 1q2 , so
either f pxq “ x ` 1 or f pxq “ ´px ` 1q.
Assume that f pxq “ ´px ` 1q and x ‰ ´1, since otherwise we already have f pxq “ x ` 1.
Plugging n “ x into (1), we obtain f p´x ´ 1q2 “ px ´ 2q2 ´ 8, which may happen only if
x´2 “ ˘3 and f p´x´1q “ ˘1. Plugging n “ ´x´1 into (1), we get f p˘1q2 “ px`1q2 ˘4,
which in turn may happen only if x ` 1 P t´2, 0, 2u.
Thus x P t´1, 5u and at the same time x P t´3, ´1, 1u, which gives us x “ ´1. Since this
has already been excluded, we must have f pxq “ x ` 1, which completes our induction.

6. Now we know that either Z` “ Z (if Z` is not bounded below), or Z` “ ta P Z : a ě a0 u,


where a0 is the smallest element of Z` . In the former case, f pnq “ n ` 1 for all n P Z,
which is our first solution. So we assume in the following that Z` is bounded below and
has a smallest element a0 .
If Z0 “ ∅, then we have f pxq “ x ` 1 for x ě a0 and f pxq “ 1 ´ x for x ă a0 . In
particular, f p0q “ 1 in any case, so 0 P Z` and thus a0 ď 0. Thus we end up with the
second solution listed in the answer. It remains to consider the case where Z0 ‰ ∅.

7. Assume that there exists some a P Z0 with b “ f paq R Z0 , so that f pbq “ 1 ˘ b. Then we
have a2 ` 4b “ p1 ˘ bq2 , so either a2 “ pb ´ 1q2 or a2 “ pb ´ 3q2 ´ 8. In the former case
we have b “ 1 ˘ a, which is impossible by our choice of a. So we get a2 “ pb ´ 3q2 ´ 8,
which implies f pbq “ 1 ´ b and |a| “ 1, |b ´ 3| “ 3.
If b “ 0, then we have f pbq “ 1, so b P Z` and therefore a0 ď 0; hence a “ ´1. But then
f paq “ 0 “ a ` 1, so a P Z` , which is impossible.
If b “ 6, then we have f p6q “ ´5, so f p´5q2 “ 16 and f p´5q P t´4, 4u. Then f pf p´5qq2 “
25 ` 4f p´5q P t9, 41u, so f p´5q “ ´4 and ´5 P Z` . This implies a0 ď ´5, which
contradicts our assumption that ˘1 “ a R Z` .

8. Thus we have shown that f pZ0 q Ď Z0 , and Z0 is finite. Take any element c P Z0 , and
consider the sequence defined by ci “ f i pcq. All elements of the sequence pci q lie in Z0 ,
hence it is bounded. Choose an index k for which |ck | is maximal, so that in particular
|ck`1 | ď |ck | and |ck`2| ď |ck |. Our functional equation (1) yields

p|ck | ´ 2q2 ´ 4 “ |ck |2 ´ 4|ck | ď c2k ` 4ck`1 “ c2k`2 .

Since ck and ck`2 have the same parity and |ck`2 | ď |ck |, this leaves us with three possi-
bilities: |ck`2 | “ |ck |, |ck`2 | “ |ck | ´ 2, and |ck | ´ 2 “ ˘2, ck`2 “ 0.
If |ck`2 | “ |ck | ´ 2, then f pck q “ ck`1 “ 1 ´ |ck |, which means that ck P Z´ or ck P Z` ,
and we reach a contradiction.
If |ck`2 | “ |ck |, then ck`1 “ 0, thus c2k`3 “ 4ck`2. So either ck`3 ‰ 0 or (by maximality
of |ck`2 | “ |ck |) ci “ 0 for all i. In the former case, we can repeat the entire argument
Shortlisted problems – solutions 25

with ck`2 in the place of ck . Now |ck`4 | “ |ck`2 | is not possible any more since ck`3 ‰ 0,
leaving us with the only possibility |ck | ´ 2 “ |ck`2 | ´ 2 “ ˘2.
Thus we know now that either all ci are equal to 0, or |ck | “ 4. If ck “ ˘4, then either
ck`1 “ 0 and |ck`2 | “ |ck | “ 4, or ck`2 “ 0 and ck`1 “ ´4. From this point onwards, all
elements of the sequence are either 0 or ˘4.
Let cr be the last element of the sequence that is not equal to 0 or ˘4 (if such an element
exists). Then cr`1 , cr`2 P t´4, 0, 4u, so

c2r “ c2r`2 ´ 4cr`1 P t´16, 0, 16, 32u,

which gives us a contradiction. Thus all elements of the sequence are equal to 0 or ˘4,
and since the choice of c0 “ c was arbitrary, Z0 Ď t´4, 0, 4u.

9. Finally, we show that 4 R Z0 and ´4 R Z0 . Suppose that 4 P Z0 . Then in particular a0


(the smallest element of Z` ) cannot be less than 4, since this would imply 4 P Z` . So
´3 P Z´ , which means that f p´3q “ 4. Then 25 “ p´3q2 ` 4f p´3q “ f pf p´3qq2 “ f p4q2 ,
so f p4q “ ˘5 R Z0 , and we reach a contradiction.
Suppose that ´4 P Z0 . The only possible values for f p´4q that are left are 0 and ´4. Note
that 4f p0q “ f pf p0qq2 , so f p0q ě 0. If f p´4q “ 0, then we get 16 “ p´4q2 ` 0 “ f p0q2 ,
thus f p0q “ 4. But then f pf p´4qq R Z0 , which is impossible. Thus f p´4q “ ´4, which
gives us 0 “ p´4q2 ` 4f p´4q “ f pf p´4qq2 “ 16, and this is clearly absurd.
Now we are left with Z0 “ t0u and f p0q “ 0 as the only possibility. If 1 P Z´ , then
f p1q “ 0, so 1 “ 12 ` 4f p1q “ f pf p1qq2 “ f p0q2 “ 0, which is another contradiction. Thus
1 P Z` , meaning that a0 ď 1. On the other hand, a0 ď 0 would imply 0 P Z` , so we can
only have a0 “ 1. Thus Z` comprises all positive integers, and Z´ comprises all negative
integers. This gives us the third solution.

Comment. All solutions known to the Problem Selection Committee are quite lengthy and technical,
as the two solutions presented here show. It is possible to make the problem easier by imposing
additional assumptions, such as f p0q ‰ 0 or f pnq ě 1 for all n ě 0, to remove some of the technicalities.
26 IMO 2014 South Africa

Combinatorics
C1. Let n points be given inside a rectangle R such that no two of them lie on a line parallel
to one of the sides of R. The rectangle R is to be dissected into smaller rectangles with sides
parallel to the sides of R in such a way that none of these rectangles contains any of the given
points in its interior. Prove that we have to dissect R into at least n ` 1 smaller rectangles.
(Serbia)
Solution 1. Let k be the number of rectangles in the dissection. The set of all points that
are corners of one of the rectangles can be divided into three disjoint subsets:

• A, which consists of the four corners of the original rectangle R, each of which is the
corner of exactly one of the smaller rectangles,

• B, which contains points where exactly two of the rectangles have a common corner
(T-junctions, see the figure below),

• C, which contains points where four of the rectangles have a common corner (crossings,
see the figure below).

Figure 1: A T-junction and a crossing

We denote the number of points in B by b and the number of points in C by c. Since each
of the k rectangles has exactly four corners, we get

4k “ 4 ` 2b ` 4c.

It follows that 2b ď 4k ´ 4, so b ď 2k ´ 2.
Each of the n given points has to lie on a side of one of the smaller rectangles (but not
of the original rectangle R). If we extend this side as far as possible along borders between
rectangles, we obtain a line segment whose ends are T-junctions. Note that every point in B
can only be an endpoint of at most one such segment containing one of the given points, since
it is stated that no two of them lie on a common line parallel to the sides of R. This means
that
b ě 2n.

Combining our two inequalities for b, we get

2k ´ 2 ě b ě 2n,

thus k ě n ` 1, which is what we wanted to prove.


Shortlisted problems – solutions 27

Solution 2. Let k denote the number of rectangles. In the following, we refer to the directions
of the sides of R as ‘horizontal’ and ‘vertical’ respectively. Our goal is to prove the inequality
k ě n ` 1 for fixed n. Equivalently, we can prove the inequality n ď k ´ 1 for each k, which
will be done by induction on k. For k “ 1, the statement is trivial.
Now assume that k ą 1. If none of the line segments that form the borders between the
rectangles is horizontal, then we have k ´ 1 vertical segments dividing R into k rectangles. On
each of them, there can only be one of the n points, so n ď k ´ 1, which is exactly what we
want to prove.
Otherwise, consider the lowest horizontal line h that contains one or more of these line
segments. Let R1 be the rectangle that results when everything that lies below h is removed
from R (see the example in the figure below).
The rectangles that lie entirely below h form blocks of rectangles separated by vertical line
segments. Suppose there are r blocks and ki rectangles in the ith block. The left and right
border of each block has to extend further upwards beyond h. Thus we can move any points
that lie on these borders upwards, so that they now lie inside R1 . This can be done without
violating the conditions, one only needs to make sure that they do not get to lie on a common
horizontal line with one of the other given points.
All other borders between rectangles in the ith block have to lie entirely below h. There are
ki ´ 1 such line segments, each of which can contain at most one of the given points. Finally,
there can be one point that lies on h. All other points have to lie in R1 (after moving some of
them as explained in the previous paragraph).

R′

Figure 2: Illustration of the inductive argument


řr
We see that R1 is divided into k ´ i“1 ki rectangles. Applying the induction hypothesis
to R1 , we find that there are at most
´ r
ÿ ¯ r
ÿ
k´ ki ´ 1 ` pki ´ 1q ` 1 “ k ´ r
i“1 i“1

points. Since r ě 1, this means that n ď k ´ 1, which completes our induction.


28 IMO 2014 South Africa

C2. We have 2m sheets of paper, with the number 1 written on each of them. We perform
the following operation. In every step we choose two distinct sheets; if the numbers on the two
sheets are a and b, then we erase these numbers and write the number a ` b on both sheets.
Prove that after m2m´1 steps, the sum of the numbers on all the sheets is at least 4m .
(Iran)
Solution. Let Pk be the product of the numbers on the sheets after k steps.
Suppose that in the pk ` 1qth step the numbers a and b are replaced by a` b. In the product,
the number ab is replaced by pa ` bq2 , and the other factors do not change. Since pa ` bq2 ě 4ab,
we see that Pk`1 ě 4Pk . Starting with P0 “ 1, a straightforward induction yields
Pk ě 4 k
for all integers k ě 0; in particular
m´1 m
Pm¨2m´1 ě 4m¨2 “ p2m q2 ,
so by the AM–GM inequality, the sum of the numbers written on the sheets after m2m´1 steps
is at least
m
a
2m ¨ 2 Pm¨2m´1 ě 2m ¨ 2m “ 4m .

Comment 1. It is possible to achieve the sum 4m in m2m´1 steps. For example, starting from 2m
equal numbers on the sheets, in 2m´1 consecutive steps we can double all numbers. After m such
doubling rounds we have the number 2m on every sheet.

Comment 2. There are several versions of the solution above. E.g., one may try to assign to each
positive integer n a weight wn in such a way that the sum of the weights of the numbers written on
the sheets increases, say, by at least 2 in each step. For this purpose, one needs the inequality
2wa`b ě wa ` wb ` 2 (1)
to be satisfied for all positive integers a and b.
Starting from w1 “ 1 and trying to choose the weights as small as possible, one may find that
these weights can be defined as follows: For every positive integer n, one chooses k to be the maximal
integer such that n ě 2k , and puts
n ´ n¯
wn “ k ` k “ min d ` d . (2)
2 dPZě0 2
Now, in order to prove that these weights satisfy (1), one may take arbitrary positive integers a and b,
and choose an integer d ě 0 such that wa`b “ d ` a`b 2d
. Then one has
ˆ ˙
a`b ´ a ¯ b
2wa`b “ 2d ` 2 ¨ d “ pd ´ 1q ` d´1 ` pd ´ 1q ` d´1 ` 2 ě wa ` wb ` 2.
2 2 2
Since the initial sum of the weights was 2m , after m2m´1 steps the sum is at least pm ` 1q2m . To
finish the solution, one may notice that by (2) for every positive integer a one has
a
wa ď m ` m , i.e., a ě 2m p´m ` wa q. (3)
2
So the sum of the numbers a1 , a2 , . . . , a2m on the sheets can be estimated as
2m 2m 2m
ÿ ÿ ÿ
m m m m
ai ě 2 p´m ` wai q “ ´m2 ¨ 2 ` 2 wai ě ´m4m ` pm ` 1q4m “ 4m ,
i“1 i“1 i“1
as required.
For establishing the inequalities (1) and (3), one may also use the convexity argument, instead of
the second definition of wn in (2).
One may check that log2 n ď wn ď log2 n ` 1; thus, in some rough sense, this approach is obtained
by “taking the logarithm” of the solution above.
Shortlisted problems – solutions 29

Comment 3. An intuitive strategy to minimise the sum of numbers is that in every step we choose
the two smallest numbers. We may call this the greedy strategy. In the following paragraphs we prove
that the greedy strategy indeed provides the least possible sum of numbers.

Claim. Starting from any sequence x1 , . . . , xN of positive real numbers on N sheets, for any number
k of steps, the greedy strategy achieves the lowest possible sum of numbers.

Proof. We apply induction on k; for k “ 1 the statement is obvious. Let k ě 2, and assume that the
claim is true for smaller values.
` ˘
Every sequence of k steps can be encoded as S “ pi1 , j1 q, . . . , pik , jk q , where, for r “ 1, 2, . . . , k,
the numbers ir and jr are the indices of the two sheets that are chosen in the r th step. The resulting
final sum will be some linear combination of x1 , . . . , xN , say, c1 x1 ` ¨ ¨ ¨ ` cN xN with positive integers
c1 , . . . , cN that depend on S only. Call the numbers pc1 , . . . , cN q the characteristic vector of S.
` ˘
Choose a sequence S0 “ pi1 , j1 q, . . . , pik , jk q of steps that produces the minimal sum, starting
from x1 , . . . , xN , and let pc1 , . . . , cN q be the characteristic vector of S. We may assume that the sheets
are indexed in such an order that c1 ě c2 ě ¨ ¨ ¨ ě cN . If the sheets (and the numbers) are permuted by
a permutation π of the indices p1, 2, . . . , N q and then the same steps are performed, we can obtain the
řN
sum ct xπptq . By the rearrangement inequality, the smallest possible sum can be achieved when the
t“1
numbers px1 , . . . , xN q are in non-decreasing order. So we can assume that also x1 ď x2 ď ¨ ¨ ¨ ď xN .
Let ℓ be the largest index with c1 “ ¨ ¨ ¨ “ cℓ , and let the r th step be the first step for which cir “ c1
or cjr “ c1 . The role of ir and jr is symmetrical, so we can assume cir “ c1 and thus ir ď ℓ. We show
that cjr “ c1 and jr ď ℓ hold, too.
Before the r th step, on the ir th sheet we had the number xir . On the jr th sheet there was a linear
combination that contains the number xjr with a positive integer coefficient, and possibly some other
terms. In the r th step, the number xir joins that linear combination. From this point, each sheet
contains a linear combination of x1 , . . . , xN , with the coefficient of xjr being not smaller than the
coefficient of xir . This is preserved to the end of the procedure, so we have cjr ě cir . But cir “ c1 is
maximal among the coefficients, so we have cjr “ cir “ c1 and thus jr ď ℓ.
Either from cjr “ cir “ c1 or from the arguments in the previous paragraph we can see that none
of the ir th and the jr th sheets were used before step r. Therefore, the final linear combination of the
numbers does not change if the step pir , jr q is performed first: the sequence of steps
` ˘
S1 “ pir , jr q, pi1 , j1 q, . . . , pir´1 , jr´1 q, pir`1 , jr`1 q, . . . , piN , jN q

also produces the same minimal sum at the end. Therefore, we can replace S0 by S1 and we may
assume that r “ 1 and ci1 “ cj1 “ c1 .
As i1 ‰ j1 , we can see that ℓ ě 2 and c1 “ c2 “ ci1 “ cj1 . Let π be such a permutation of the
indices p1, 2, . . . , N q that exchanges 1, 2 with ir , jr and does not change the remaining indices. Let
` ˘
S2 “ pπpi1 q, πpj1 qq, . . . , pπpiN q, πpjN qq .

Since cπpiq “ ci for all indices i, this sequence of steps produces the same, minimal sum. Moreover, in
the first step we chose xπpi1 q “ x1 and xπpj1 q “ x2 , the two smallest numbers.
Hence, it is possible to achieve the optimal sum if we follow the greedy strategy in the first step.
By the induction hypothesis, following the greedy strategy in the remaining steps we achieve the
optimal sum.
30 IMO 2014 South Africa

C3. Let n ě 2 be an integer. Consider an n ˆ n chessboard divided into n2 unit squares.


We call a configuration of n rooks on this board happy if every row and every column contains
exactly one rook. Find the greatest positive integer k such that for every happy configuration
of rooks, we can find a k ˆ k square without a rook on any of its k 2 unit squares.
(Croatia)
X? \
Answer. n´1 .
Solution. Let ℓ be a positive integer. We will show that (i) if n ą ℓ2 then each happy
configuration contains an empty ℓ ˆ ℓ square, but (ii) if n ď ℓ2 then there exists a happy
configuration not containing such a square. These two statements together yield the answer.
(i). Assume that n ą ℓ2 . Consider any happy configuration. There exists a row R containing
a rook in its leftmost square. Take ℓ consecutive rows with R being one of them. Their union
U contains exactly ℓ rooks. Now remove the n ´ ℓ2 ě 1 leftmost columns from U (thus at least
one rook is also removed). The remaining part is an ℓ2 ˆ ℓ rectangle, so it can be split into ℓ
squares of size ℓ ˆ ℓ, and this part contains at most ℓ ´ 1 rooks. Thus one of these squares is
empty.
(ii). Now we assume that n ď ℓ2 . Firstly, we will construct a happy configuration with no
empty ℓ ˆ ℓ square for the case n “ ℓ2 . After that we will modify it to work for smaller values
of n.
Let us enumerate the rows from bottom to top as well as the columns from left to right
by the numbers 0, 1, . . . , ℓ2 ´ 1. Every square will be denoted, as usual, by the pair pr, cq of
its row and column numbers. Now we put the rooks on all squares of the form piℓ ` j, jℓ ` iq
with i, j “ 0, 1, . . . , ℓ ´ 1 (the picture below represents this arrangement for ℓ “ 3). Since each
number from 0 to ℓ2 ´ 1 has a unique representation of the form iℓ ` j (0 ď i, j ď ℓ ´ 1), each
row and each column contains exactly one rook.
8
r r
r
7

r
6

r r r
5
4
3

r
2

r
1
0
0 1 2 3 4 5 6 7 8

Next, we show that each ℓ ˆ ℓ square A on the board contains a rook. Consider such a
square A, and consider ℓ consecutive rows the union of which contains A. Let the lowest of
these rows have number pℓ ` q with 0 ď p, q ď ℓ ´ 1 (notice that pℓ ` q ď ℓ2 ´ ℓ). Then the
rooks in this union are placed in the columns with numbers qℓ ` p, pq ` 1qℓ ` p, . . . , pℓ ´ 1qℓ ` p,
p ` 1, ℓ ` pp ` 1q, . . . , pq ´ 1qℓ ` p ` 1, or, putting these numbers in increasing order,

p ` 1, ℓ ` pp ` 1q, . . . , pq ´ 1qℓ ` pp ` 1q, qℓ ` p, pq ` 1qℓ ` p, . . . , pℓ ´ 1qℓ ` p.

One readily checks that the first number in this list is at most ℓ ´ 1 (if p “ ℓ ´ 1, then q “ 0,
and the first listed number is qℓ ` p “ ℓ ´ 1), the last one is at least pℓ ´ 1qℓ, and the difference
between any two consecutive numbers is at most ℓ. Thus, one of the ℓ consecutive columns
intersecting A contains a number listed above, and the rook in this column is inside A, as
required. The construction for n “ ℓ2 is established.
Shortlisted problems – solutions 31

It remains to construct a happy configuration of rooks not containing an empty ℓ ˆ ℓ square


for n ă ℓ2 . In order to achieve this, take the construction for an ℓ2 ˆ ℓ2 square described above
and remove the ℓ2 ´ n bottom rows together with the ℓ2 ´ n rightmost columns. We will have
a rook arrangement with no empty ℓ ˆ ℓ square, but several rows and columns may happen to
be empty. Clearly, the number of empty rows is equal to the number of empty columns, so one
can find a bijection between them, and put a rook on any crossing of an empty row and an
empty column corresponding to each other.

Comment. Part (i) allows several different proofs. E.g., in the last paragraph of the solution, it
suffices to deal only with the case n “ ℓ2 ` 1. Notice now that among the four corner squares, at
least one is empty. So the rooks in its row and in its column are distinct. Now, deleting this row and
column we obtain an ℓ2 ˆ ℓ2 square with ℓ2 ´ 1 rooks in it. This square can be partitioned into ℓ2
squares of size ℓ ˆ ℓ, so one of them is empty.
32 IMO 2014 South Africa

C4. Construct a tetromino by attaching two 2 ˆ 1 dominoes along their longer sides such
that the midpoint of the longer side of one domino is a corner of the other domino. This
construction yields two kinds of tetrominoes with opposite orientations. Let us call them S-
and Z-tetrominoes, respectively.

S-tetrominoes Z-tetrominoes
Assume that a lattice polygon P can be tiled with S-tetrominoes. Prove than no matter
how we tile P using only S- and Z-tetrominoes, we always use an even number of Z-tetrominoes.
(Hungary)
Solution 1. We may assume that polygon P is the union of some squares of an infinite
chessboard. Colour the squares of the chessboard with two colours as the figure below illustrates.

Observe that no matter how we tile P , any S-tetromino covers an even number of black
squares, whereas any Z-tetromino covers an odd number of them. As P can be tiled exclusively
by S-tetrominoes, it contains an even number of black squares. But if some S-tetrominoes and
some Z-tetrominoes cover an even number of black squares, then the number of Z-tetrominoes
must be even.

Comment. An alternative approach makes use of the following two colourings, which are perhaps
somewhat more natural:

Let s1 and s2 be the number of S-tetrominoes of the first and second type (as shown in the figure above)
respectively that are used in a tiling of P . Likewise, let z1 and z2 be the number of Z-tetrominoes of
the first and second type respectively. The first colouring shows that s1 ` z2 is invariant modulo 2, the
second colouring shows that s1 ` z1 is invariant modulo 2. Adding these two conditions, we find that
z1 ` z2 is invariant modulo 2, which is what we have to prove. Indeed, the sum of the two colourings
(regarding white as 0 and black as 1 and adding modulo 2) is the colouring shown in the solution.
Shortlisted problems – solutions 33

Solution 2. Let us assign coordinates to the squares of the infinite chessboard in such a way
that the squares of P have nonnegative coordinates only, and that the first coordinate increases
as one moves to the right, while the second coordinate increases as one moves upwards. Write
the integer 3i ¨ p´3qj into the square with coordinates pi, jq, as in the following figure:

..
.

..
81 .

..
27 81 .

9 27 81 
3 9 27 81 
1 3 9 27 81 

The sum of the numbers written into four squares that can be covered by an S-tetromino
is either of the form

3i ¨ p´3qj ¨ 1 ` 3 ` 3 ¨ p´3q ` 32 ¨ p´3q “ ´32 ¨ 3i ¨ p´3qj


` ˘

(for the first type of S-tetrominoes), or of the form

3i ¨ p´3qj ¨ 3 ` 3 ¨ p´3q ` p´3q ` p´3q2 “ 0,


` ˘

and thus divisible by 32. For this reason, the sum of the numbers written into the squares
of P , and thus also the sum of the numbers covered by Z-tetrominoes in the second covering,
is likewise divisible by 32. Now the sum of the entries of a Z-tetromino is either of the form

3i ¨ p´3qj ¨ 3 ` 32 ` p´3q ` 3 ¨ p´3q “ 0


` ˘

(for the first type of Z-tetrominoes), or of the form

3i ¨ p´3qj ¨ 1 ` p´3q ` 3 ¨ p´3q ` 3 ¨ p´3q2 “ 16 ¨ 3i ¨ p´3qj ,


` ˘

i.e., 16 times an odd number. Thus in order to obtain a total that is divisible by 32, an even
number of the latter kind of Z-tetrominoes needs to be used. Rotating everything by 90˝ , we
find that the number of Z-tetrominoes of the first kind is even as well. So we have even proven
slightly more than necessary.

Comment 1. In the second solution, 3 and ´3 can be replaced by other combinations as well.
For example, for any positive integer a ” 3 pmod 4q, we can write ai ¨ p´aqj into the square with
coordinates pi, jq and apply the same argument.

Comment 2. As the second solution shows, we even have the stronger result that the parity of the
number of each of the four types of tetrominoes in a tiling of P by S- and Z-tetrominoes is an invariant
of P . This also remains true if there is no tiling of P that uses only S-tetrominoes.
34 IMO 2014 South Africa

C5. Consider n ě 3 lines in the plane such that no two lines are parallel and no three have a
common point. These lines divide the plane into polygonal
Pa regions;
T let F be the set of regions
having finite area. Prove that it is possible to colour n{2 of the lines blue in such a way
that no region in F has a completely blue boundary. (For a real number x, rxs denotes the
least integer which is not smaller than x.)
(Austria)
Solution. Let L be the given set of lines. Choose a maximal (by inclusion) subset B Ď L such
that when we colour the lines Paof B Tblue, no region in F has a completely blue boundary. Let
|B| “ k. We claim that k ě n{2 .
Let us colour all the
`k˘lines of LzB red. Call a point blue if it is the intersection of two blue
lines. Then there are 2 blue points.
Now consider any red line ℓ. By the maximality of B, there exists at least one region A P F
whose only red side lies on ℓ. Since A has at least three sides, it must have at least one blue
vertex. Let us take one such vertex and associate it to ℓ.
Since each blue point belongs to four regions (some of which may be unbounded), ` ˘ it is
associated to at most four red lines. Thus the total number of red lines is at most 4 k2 . On
the other hand, this number is n ´ k, so

n ´ k ď 2kpk ´ 1q, thus n ď 2k 2 ´ k ď 2k 2 ,


Pa T
and finally k ě n{2 , which gives the desired result.

Comment 1. The constant factor in the estimate can be improved in different ways; we sketch
two of them below. On the other hand, the Problem Selection Committee is not aware of any results
?
showing that it is sometimes impossible to colour k lines satisfying the desired condition for k " n.
In this situation we find it more suitable to keep the original formulation of the problem.
Pa T
1. Firstly, we show that in the proof above one has in fact k “ |B| ě 2n{3 .
Let us make weighted associations as follows. Let a region A whose only red side lies on ℓ have
k vertices, so that k ´ 2 of them are blue. We associate each of these blue vertices to ℓ, and put the
1
weight k´2 on each such association. So the sum of the weights of all the associations is exactly n ´ k.
Now, one may check that among the four regions adjacent to a blue vertex v, at most two are trian-
gles. This means that the sum of the weights of all associations involving v is at most 1 ` 1 ` 21 ` 12 “ 3.
This leads to the estimate ˆ ˙
k
n´k ď3 ,
2
or
2n ď 3k2 ´ k ă 3k2 ,
Pa T
which yields k ě 2n{3 .
?
2. Next, we even show that k “ |B| ě r n s. For this, we specify the process of associating points
to red lines in one more different way.
Call a point red if it lies on a red line as well as on a blue line. Consider any red line ℓ, and take an
arbitrary region A P F whose only red side lies on ℓ. Let r 1 , r, b1 , . . . , bk be its vertices in clockwise
order with r 1 , r P ℓ; then the points r 1 , r are red, while all the points b1 , . . . , bk are blue. Let us
associate to ℓ the red point r and the blue point b1 . One may notice that to each pair of a red point r
and a blue point b, at most one red line can be associated, since there is at most one region A having
r and b as two clockwise consecutive vertices.
We claim now that at most two red lines are associated to each blue point b; this leads to the
desired bound ˆ ˙
k
n´k ď2 ðñ n ď k2 .
2
Shortlisted problems – solutions 35

Assume, to the contrary, that three red lines ℓ1 , ℓ2 , and ℓ3 are associated to the same blue point b.
Let r1 , r2 , and r3 respectively be the red points associated to these lines; all these points are distinct.
The point b defines four blue rays, and each point ri is the red point closest to b on one of these rays.
So we may assume that the points r2 and r3 lie on one blue line passing through b, while r1 lies on
the other one.
ℓ1
r1
r3
A b

r2

Now consider the region A used to associate r1 and b with ℓ1 . Three of its clockwise consecutive
vertices are r1 , b, and either r2 or r3 (say, r2 ). Since A has only one red side, it can only be the
triangle r1 br2 ; but then both ℓ1 and ℓ2 pass through r2 , as well as some blue line. This is impossible
by the problem assumptions.

Comment 2. The condition that the lines be non-parallel is essentially not used in the solution, nor
in the previous comment; thus it may be omitted.
36 IMO 2014 South Africa

C6. We are given an infinite deck of cards, each with a real number on it. For every real
number x, there is exactly one card in the deck that has x written on it. Now two players draw
disjoint sets A and B of 100 cards each from this deck. We would like to define a rule that
declares one of them a winner. This rule should satisfy the following conditions:
1. The winner only depends on the relative order of the 200 cards: if the cards are laid down
in increasing order face down and we are told which card belongs to which player, but
not what numbers are written on them, we can still decide the winner.

2. If we write the elements of both sets in increasing order as A “ ta1 , a2 , . . . , a100 u and
B “ tb1 , b2 , . . . , b100 u, and ai ą bi for all i, then A beats B.

3. If three players draw three disjoint sets A, B, C from the deck, A beats B and B beats C,
then A also beats C.
How many ways are there to define such a rule? Here, we consider two rules as different if there
exist two sets A and B such that A beats B according to one rule, but B beats A according to
the other.
(Russia)

Answer. 100.
Solution 1. We prove a more general statement for sets of cardinality n (the problem being
the special case n “ 100, then the answer is n). In the following, we write A ą B or B ă A for
“A beats B”.
Part I. Let us first define n different rules that satisfy the conditions. To this end, fix an
index k P t1, 2, . . . , nu. We write both A and B in increasing order as A “ ta1 , a2 , . . . , an u and
B “ tb1 , b2 , . . . , bn u and say that A beats B if and only if ak ą bk . This rule clearly satisfies all
three conditions, and the rules corresponding to different k are all different. Thus there are at
least n different rules.
Part II. Now we have to prove that there is no other way to define such a rule. Suppose
that our rule satisfies the conditions, and let k P t1, 2, . . . , nu be minimal with the property
that

Ak “ t1, 2, . . . , k, n ` k ` 1, n ` k ` 2, . . . , 2nu ă Bk “ tk ` 1, k ` 2, . . . , n ` ku.

Clearly, such a k exists, since this holds for k “ n by assumption. Now consider two disjoint sets
X “ tx1 , x2 , . . . , xn u and Y “ ty1 , y2 , . . . , yn u, both in increasing order (i.e., x1 ă x2 ă ¨ ¨ ¨ ă xn
and y1 ă y2 ă ¨ ¨ ¨ ă yn ). We claim that X ă Y if (and only if – this follows automatically)
xk ă yk .
To prove this statement, pick arbitrary real numbers ui , vi , wi R X Y Y such that

u1 ă u2 ă ¨ ¨ ¨ ă uk´1 ă minpx1 , y1q, maxpxn , yn q ă vk`1 ă vk`2 ă ¨ ¨ ¨ ă vn ,

and

xk ă v1 ă v2 ă ¨ ¨ ¨ ă vk ă w1 ă w2 ă ¨ ¨ ¨ ă wn ă uk ă uk`1 ă ¨ ¨ ¨ ă un ă yk ,

and set
U “ tu1 , u2, . . . , un u, V “ tv1 , v2 , . . . , vn u, W “ tw1 , w2, . . . , wn u.
Then
• ui ă yi and xi ă vi for all i, so U ă Y and X ă V by the second condition.
Shortlisted problems – solutions 37

• The elements of U Y W are ordered in the same way as those of Ak´1 Y Bk´1 , and since
Ak´1 ą Bk´1 by our choice of k, we also have U ą W (if k “ 1, this is trivial).

• The elements of V Y W are ordered in the same way as those of Ak Y Bk , and since
Ak ă Bk by our choice of k, we also have V ă W .

It follows that
X ă V ă W ă U ă Y,
so X ă Y by the third condition, which is what we wanted to prove.

Solution 2. Another possible approach to Part II of this problem is induction on n. For


n “ 1, there is trivially only one rule in view of the second condition.
In the following, we assume that our claim (namely, that there are no possible rules other
than those given in Part I) holds for n´1 in place of n. We start with the following observation:
Claim. At least one of the two relations
` ˘ ` ˘
t2u Y t2i ´ 1 | 2 ď i ď nu ă t1u Y t2i | 2 ď i ď nu

and ` ˘ ` ˘
t2i ´ 1 | 1 ď i ď n ´ 1u Y t2nu ă t2i | 1 ď i ď n ´ 1u Y t2n ´ 1u
holds.
Proof. Suppose that the first relation does not hold. Since our rule may only depend on the
relative order, we must also have
` ˘ ` ˘
t2u Y t3i ´ 2 | 2 ď i ď n ´ 1u Y t3n ´ 2u ą t1u Y t3i ´ 1 | 2 ď i ď n ´ 1u Y t3nu .

Likewise, if the second relation does not hold, then we must also have
` ˘ ` ˘
t1u Y t3i ´ 1 | 2 ď i ď n ´ 1u Y t3nu ą t3u Y t3i | 2 ď i ď n ´ 1u Y t3n ´ 1u .

Now condition 3 implies that


` ˘ ` ˘
t2u Y t3i ´ 2 | 2 ď i ď n ´ 1u Y t3n ´ 2u ą t3u Y t3i | 2 ď i ď n ´ 1u Y t3n ´ 1u ,

which contradicts the second condition. l


Now we distinguish two cases, depending on which of the two relations actually holds:
` ˘ ` ˘
First case: t2u Y t2i ´ 1 | 2 ď i ď nu ă t1u Y t2i | 2 ď i ď nu .
Let A “ ta1 , a2 , . . . , an u and B “ tb1 , b2 , . . . , bn u be two disjoint sets, both in increasing
order. We claim that the winner can be decided only from the values of a2 , . . . , an and b2 , . . . , bn ,
while a1 and b1 are actually irrelevant. Suppose that this was not the case, and assume without
loss of generality that a2 ă b2 . Then the relative order of a1 , a2 , . . . , an , b2 , . . . , bn is fixed, and
the position of b1 has to decide the winner. Suppose that for some value b1 “ x, B wins, while
for some other value b1 “ y, A wins.
Write Bx “ tx, b2 , . . . , bn u and By “ ty, b2 , . . . , bn u, and let ε ą 0 be smaller than half the
distance between any two of the numbers in Bx Y By Y A. For any set M, let M ˘ ε be the set
obtained by adding/subtracting ε to all elements of M. By our choice of ε, the relative order
of the elements of pBy ` εq Y A is still the same as for By Y A, while the relative order of the
elements of pBx ´ εq Y A is still the same as for Bx Y A. Thus A ă Bx ´ ε, but A ą By ` ε.
Moreover, if y ą x, then Bx ´ ε ă By ` ε by condition 2, while otherwise the relative order of
38 IMO 2014 South Africa

the elements in pBx ´ εq Y pBy ` εq is the same as for the two sets t2u Y t2i ´ 1 | 2 ď i ď nu
and t1u Y t2i | 2 ď i ď nu, so that Bx ´ ε ă By ` ε. In either case, we obtain

A ă Bx ´ ε ă By ` ε ă A,

which contradicts condition 3.


So we know now that the winner does not depend on a1 , b1 . Therefore, we can define a new
rule ă˚ on sets of cardinality n ´ 1 by saying that A ă˚ B if and only if A Y tau ă B Y tbu for
some a, b (or equivalently, all a, b) such that a ă min A, b ă min B and A Y tau and B Y tbu
are disjoint. The rule ă˚ satisfies all conditions again, so by the induction hypothesis, there
exists an index i such that A ă˚ B if and only if the ith smallest element of A is less than the
ith smallest element of B. This implies that C ă D if and only if the pi ` 1qth smallest element
of C is less than the pi ` 1qth smallest element of D, which completes our induction.
` ˘ ` ˘
Second case: t2i ´ 1 | 1 ď i ď n ´ 1u Y t2nu ă t2i | 1 ď i ď n ´ 1u Y t2n ´ 1u .
Set ´A “ t´a | a P Au for any A Ď R. For any two disjoint sets A, B Ď R of cardinality n,
we write A ă˝ B to mean p´Bq ă p´Aq. It is easy to see that ă˝ defines a rule to determine
a winner that satisfies the three conditions of our problem as well as the relation of the first
case. So it follows in the same way as in the first case that for some i, A ă˝ B if and only if
the ith smallest element of A is less than the ith smallest element of B, which is equivalent to
the condition that the ith largest element of ´A is greater than the ith largest element of ´B.
This proves that the original rule ă also has the desired form.

Comment. The problem asks for all possible partial orders on the set of n-element subsets of R such
that any two disjoint sets are comparable, the order relation only depends on the relative order of the
elements, and ta1 , a2 , . . . , an u ă tb1 , b2 , . . . , bn u whenever ai ă bi for all i.
As the proposer points out, one may also ask for all total orders on all n-element subsets of R
(dropping the condition of disjointness and requiring that ta1 , a2 , . . . , an u ĺ tb1 , b2 , . . . , bn u whenever
ai ď bi for all i). It turns out that the number of possibilities in this case is n!, and all possible total
orders are obtained in the following way. Fix a permutation σ P Sn . Let A “ ta1 , a2 , . . . , an u and
B “ tb1 , b2 , . . . , bn u be two subsets of R with a1 ă a2 ă ¨ ¨ ¨ ă an and b1 ă b2 ă ¨ ¨ ¨ ă bn . Then we say
that A ąσ B if and only if paσp1q , . . . , aσpnq q is lexicographically greater than pbσp1q , . . . , bσpnq q.
It seems, however, that this formulation adds rather more technicalities to the problem than
additional ideas.
Shortlisted problems – solutions 39

This page is intentionally left blank


40 IMO 2014 South Africa

C7. Let M be a set of n ě 4 points in the plane, no three of which are collinear. Initially these
points are connected with n segments so that each point in M is the endpoint of exactly two
segments. Then, at each step, one may choose two segments AB and CD sharing a common
interior point and replace them by the segments AC and BD if none of them is present at this
moment. Prove that it is impossible to perform n3 {4 or more such moves.
(Russia)
Solution. A line is said to be red if it contains two points of M. As no three points of M are
collinear,
`n˘ n2 each red line determines a unique pair of points of M. Moreover, there are precisely
2
ă 2 red lines. By the value of a segment we mean the number of red lines intersecting it
in its interior, and the value of a set of segments is defined to be the sum of the values of its
elements. We will prove that piq the value of the initial set of segments is smaller than n3 {2
and that piiq each step decreases the value of the set of segments present by at least 2. Since
such a value can never be negative, these two assertions imply the statement of the problem.
To show piq we just need to observe that each segment has a value that is smaller than n2 {2.
Thus the combined value of the n initial segments is indeed below n ¨ n2 {2 “ n3 {2.
It remains to establish piiq. Suppose that at some moment we have two segments AB
and CD sharing an interior point S, and that at the next moment we have the two segments
AC and BD instead. Let XAB denote the set of red lines intersecting the segment AB in
its interior and let the sets XAC , XBD , and XCD be defined similarly. We are to prove that
|XAC | ` |XBD | ` 2 ď |XAB | ` |XCD |.
As a first step in this direction, we claim that

|XAC Y XBD | ` 2 ď |XAB Y XCD | . (1)

Indeed, if g is a red line intersecting, e.g. the segment AC in its interior, then it has to
intersect the triangle ACS once again, either in the interior of its side AS, or in the interior of
its side CS, or at S, meaning that it belongs to XAB or to XCD (see Figure 1). Moreover, the
red lines AB and CD contribute to XAB Y XCD but not to XAC Y XBD . Thereby (1) is proved.

h h
D D D
B B B

g S S S

C A C A C A

Figure 1 Figure 2 Figure 3

Similarly but more easily one obtains

|XAC X XBD | ď |XAB X XCD | . (2)

Indeed, a red line h appearing in XAC X XBD belongs, for similar reasons as above, also to
XAB X XCD . To make the argument precise, one may just distinguish the cases S P h (see
Figure 2) and S R h (see Figure 3). Thereby (2) is proved.
Adding (1) and (2) we obtain the desired conclusion, thus completing the solution of this
problem.
Shortlisted problems – solutions 41

Comment 1. There is a problem belonging to the folklore, in the solution of which one may use the
same kind of operation:
Given n red and n green points in the plane, prove that one may draw n nonintersecting segments
each of which connects a red point with a green point.
A standard approach to this problem consists in taking n arbitrary segments connecting the red
points with the green points, and to perform the same operation as in the above proposal whenever
an intersection occurs. Now each time one performs such a step, the total length of the segments that
are present decreases due to the triangle inequality. So, as there are only finitely many possibilities
for the set of segments present, the process must end at some stage.
In the above proposal, however, considering the sum of the Euclidean lengths of the segment that
are present does not seem to help much, for even though it shows that the process must necessarily
terminate after some finite number of steps, it does not seem to easily yield any upper bound on the
number of these steps that grows polynomially with n.
One may regard the concept of the value of a segment introduced in the above solution as an
appropriately discretised version of Euclidean length suitable for obtaining such a bound.
The Problem Selection Committee still believes the problem to be sufficiently original for the
competition.

Comment 2. There are some other essentially equivalent ways of presenting the same solution. E.g.,
put M “ tA1 , A2 , . . . , An u, denote the set of segments present at any moment by te1 , e2 , . . . , en u, and
called a triple pi, j, kq of indices with i ‰ j intersecting, if the line Ai Aj intersects the segment ek . It
may then be shown that the number S of intersecting triples satisfies 0 ď S ă n3 at the beginning
and decreases by at least 4 in each step.

Comment 3. It is not difficult to construct an example where cn2 moves are possible (for some
absolute constant c ą 0). It would be interesting to say more about the gap between cn2 and cn3 .
42 IMO 2014 South Africa

C8. A card deck consists of 1024 cards. On each card, a set of distinct decimal digits is
written in such a way that no two of these sets coincide (thus, one of the cards is empty). Two
players alternately take cards from the deck, one card per turn. After the deck is empty, each
player checks if he can throw out one of his cards so that each of the ten digits occurs on an
even number of his remaining cards. If one player can do this but the other one cannot, the
one who can is the winner; otherwise a draw is declared.
Determine all possible first moves of the first player after which he has a winning strategy.
(Russia)

Answer. All the moves except for taking the empty card.

Solution. Let us identify each card with the set of digits written on it. For any collection of
cards C1 , C2 , . . . , Ck denote by their sum the set C1 △ C2 △ ¨ ¨ ¨ △ Ck consisting of all elements
belonging to an odd number of the Ci ’s. Denote the first and the second player by F and S,
respectively.
Since each digit is written on exactly 512 cards, the sum of all the cards is ∅. Therefore,
at the end of the game the sum of all the cards of F will be the same as that of S; denote this
sum by C. Then the player who took C can throw it out and get the desired situation, while
the other one cannot. Thus, the player getting card C wins, and no draw is possible.
Now, given a nonempty card B, one can easily see that all the cards can be split into 512
pairs of the form pX, X △Bq because pX △Bq△B “ X. The following lemma shows a property
of such a partition that is important for the solution.
Lemma. Let B ‰ ∅ be some card. Let us choose 512 cards so that exactly one card is chosen
from every pair pX, X △ Bq. Then the sum of all chosen cards is either ∅ or B.
Proof. Let b be some element of B. Enumerate the pairs; let Xi be the card not containing b
in the ith pair, and let Yi be the other card in this pair. Then the sets Xi are exactly all the
sets not containing b, therefore each digit a ‰ b is written on exactly 256 of these cards, so
X1 △ X2 △ ¨ ¨ ¨ △ X512 “ ∅. Now, if we replace some summands in this sum by the other
elements from their pairs, we will simply add B several times to this sum, thus the sum will
either remain unchanged or change by B, as required. l
Now we consider two cases.
Case 1. Assume that F takes the card ∅ on his first move. In this case, we present a
winning strategy for S.
Let S take an arbitrary card A. Assume that F takes card B after that; then S takes A △ B.
Split all 1024 cards into 512 pairs of the form pX, X △Bq; we call two cards in one pair partners.
Then the four cards taken so far form two pairs p∅, Bq and pA, A △ Bq belonging to F and S,
respectively. On each of the subsequent moves, when F takes some card, S should take the
partner of this card in response.
Consider the situation at the end of the game. Let us for a moment replace card A belonging
to S by ∅. Then he would have one card from each pair; by our lemma, the sum of all these
cards would be either ∅ or B. Now, replacing ∅ back by A we get that the actual sum of the
cards of S is either A or A △ B, and he has both these cards. Thus S wins.
Case 2. Now assume that F takes some card A ‰ ∅ on his first move. Let us present a
winning strategy for F in this case.
Assume that S takes some card B ‰ ∅ on his first move; then F takes A △ B. Again, let
us split all the cards into pairs of the form pX, X △ Bq; then the cards which have not been
taken yet form several complete pairs and one extra element (card ∅ has not been taken while
its partner B has). Now, on each of the subsequent moves, if S takes some element from a
Shortlisted problems – solutions 43

complete pair, then F takes its partner. If S takes the extra element, then F takes an arbitrary
card Y , and the partner of Y becomes the new extra element.
Thus, on his last move S is forced to take the extra element. After that player F has cards
A and A △ B, player S has cards B and ∅, and F has exactly one element from every other
pair. Thus the situation is the same as in the previous case with roles reversed, and F wins.
Finally, if S takes ∅ on his first move then F denotes any card which has not been taken
yet by B and takes A △ B. After that, the same strategy as above is applicable.

Comment 1. If one wants to avoid the unusual question about the first move, one may change the
formulation as follows. (The difficulty of the problem would decrease somewhat.)

A card deck consists of 1023 cards; on each card, a nonempty set of distinct decimal digits is
written in such a way that no two of these sets coincide. Two players alternately take cards from
the deck, one card per turn. When the deck is empty, each player checks if he can throw out one of
his cards so that for each of the ten digits, he still holds an even number of cards with this digit. If
one player can do this but the other one cannot, the one who can is the winner; otherwise a draw is
declared.
Determine which of the players (if any) has a winning strategy.

The winner in this version is the first player. The analysis of the game from the first two paragraphs
of the previous solution applies to this version as well, except for the case C “ ∅ in which the result
is a draw. Then the strategy for S in Case 1 works for F in this version: the sum of all his cards at
the end is either A or A △ B, thus nonempty in both cases.

Comment 2. Notice that all the cards form a vector space over F2 , with △ the operation of addition.
Due to the automorphisms of this space, all possibilities for F’s first move except ∅ are equivalent.
The same holds for the response by S if F takes the card ∅ on his first move.

Comment 3. It is not that hard to show that in the initial game, F has a winning move, by the
idea of “strategy stealing”.
Namely, assume that S has a winning strategy. Let us take two card decks and start two games, in
which S will act by his strategy. In the first game, F takes an arbitrary card A1 ; assume that S takes
some B1 in response. Then F takes the card B1 at the second game; let the response by S be A2 .
Then F takes A2 in the first game and gets a response B2 , and so on.
This process stops at some moment when in the second game S takes Ai “ A1 . At this moment
the players hold the same sets of cards in both games, but with roles reversed. Now, if some cards
remain in the decks, F takes an arbitrary card from the first deck starting a similar cycle.
At the end of the game, player F’s cards in the first game are exactly player S’s cards in the second
game, and vice versa. Thus in one of the games F will win, which is impossible by our assumption.
One may notice that the strategy in Case 2 is constructed exactly in this way from the strategy
in Case 1. This is possible since every response by S wins if F takes the card ∅ on his first move.
44 IMO 2014 South Africa

C9. There are n circles drawn on a piece of paper in such a way that any two circles
intersect in two points, and no three circles pass through the same point. Turbo the snail slides
along the circles in the following fashion. Initially he moves on one of the circles in clockwise
direction. Turbo always keeps sliding along the current circle until he reaches an intersection
with another circle. Then he continues his journey on this new circle and also changes the
direction of moving, i.e. from clockwise to anticlockwise or vice versa.
Suppose that Turbo’s path entirely covers all circles. Prove that n must be odd.
(India)
Solution 1. Replace every cross (i.e. intersection of two circles) by two small circle arcs that
indicate the direction in which the snail should leave the cross (see Figure 1.1). Notice that
the placement of the small arcs does not depend on the direction of moving on the curves; no
matter which direction the snail is moving on the circle arcs, he will follow the same curves
(see Figure 1.2). In this way we have a set of curves, that are the possible paths of the snail.
Call these curves snail orbits or just orbits. Every snail orbit is a simple closed curve that has
no intersection with any other orbit.
anticlockwise anticlockwise

clockwise clockwise

anticlockwise anticlockwise
clockwise
clockwise

Figure 1.1 Figure 1.2


We prove the following, more general statement.
p˚q In any configuration of n circles such that no two of them are tangent, the
number of snail orbits has the same parity as the number n. (Note that it is not
assumed that all circle pairs intersect.)
This immediately solves the problem.
Let us introduce the following operation that will be called flipping a cross. At a cross,
remove the two small arcs of the orbits, and replace them by the other two arcs. Hence, when
the snail arrives at a flipped cross, he will continue on the other circle as before, but he will
preserve the orientation in which he goes along the circle arcs (see Figure 2).
a a

c d c d

b b

Figure 2
Consider what happens to the number of orbits when a cross is flipped. Denote by a, b, c,
and d the four arcs that meet at the cross such that a and b belong to the same circle. Before
the flipping a and b were connected to c and d, respectively, and after the flipping a and b are
connected to d and c, respectively.
The orbits passing through the cross are closed curves, so each of the arcs a, b, c, and d is
connected to another one by orbits outside the cross. We distinguish three cases.
Case 1: a is connected to b and c is connected to d by the orbits outside the cross (see
Figure 3.1).
Shortlisted problems – solutions 45

We show that this case is impossible. Remove the two small arcs at the cross, connect a
to b, and connect c to d at the cross. Let γ be the new closed curve containing a and b, and
let δ be the new curve that connects c and d. These two curves intersect at the cross. So one
of c and d is inside γ and the other one is outside γ. Then the two closed curves have to meet
at least one more time, but this is a contradiction, since no orbit can intersect itself.
a a a
γ a a

c d d d
c c c d c d
?!
b δ b b b b

Figure 3.1 Figure 3.2 Figure 3.3


Case 2: a is connected to c and b is connected to d (see Figure 3.2).
Before the flipping a and c belong to one orbit and b and d belong to another orbit. Flipping
the cross merges the two orbits into a single orbit. Hence, the number of orbits decreases by 1.
Case 3: a is connected to d and b is connected to c (see Figure 3.3).
Before the flipping the arcs a, b, c, and d belong to a single orbit. Flipping the cross splits
that orbit in two. The number of orbits increases by 1.
As can be seen, every flipping decreases or increases the number of orbits by one, thus
changes its parity.
Now flip every cross, one by one. Since every pair of circles has 0 or 2 intersections, the
number of crosses is even. Therefore, when all crosses have been flipped, the original parity of
the number of orbits is restored. So it is sufficient to prove p˚q for the new configuration, where
all crosses are flipped. Of course also in this new configuration the (modified) orbits are simple
closed curves not intersecting each other.
Orient the orbits in such a way that the snail always moves anticlockwise along the circle
arcs. Figure 4 shows the same circles as in Figure 1 after flipping all crosses and adding
orientation. (Note that this orientation may be different from the orientation of the orbit as a
planar curve; the orientation of every orbit may be negative as well as positive, like the middle
orbit in Figure 4.) If the snail moves around an orbit, the total angle change in his moving
direction, the total curvature, is either `2π or ´2π, depending on the orientation of the orbit.
Let P and N be the number of orbits with positive and negative orientation, respectively. Then
the total curvature of all orbits is pP ´ Nq ¨ 2π.

change (±)

Figure 4 Figure 5
Double-count the total curvature of all orbits. Along every circle the total curvature is 2π.
At every cross, the two turnings make two changes with some angles having the same absolute
value but opposite signs, as depicted in Figure 5. So the changes in the direction at the crosses
cancel out. Hence, the total curvature is n ¨ 2π.
Now we have pP ´ Nq ¨ 2π “ n ¨ 2π, so P ´ N “ n. The number of (modified) orbits is
P ` N, that has a same parity as P ´ N “ n.
46 IMO 2014 South Africa

Solution 2. We present a different proof of p˚q.

We perform a sequence of small modification steps on the configuration of the circles in


such a way that at the end they have no intersection at all (see Figure 6.1). We use two kinds
of local changes to the structure of the orbits (see Figure 6.2):

• Type-1 step: An arc of a circle is moved over an arc of another circle; such a step creates
or removes two intersections.

• Type-2 step: An arc of a circle is moved through the intersection of two other circles.

Type-1 Type-2

Figure 6.1 Figure 6.2

We assume that in every step only one circle is moved, and that this circle is moved over at
most one arc or intersection point of other circles.
We will show that the parity of the number of orbits does not change in any step. As every
circle becomes a separate orbit at the end of the procedure, this fact proves p˚q.

Consider what happens to the number of orbits when a Type-1 step is performed. The two
intersection points are created or removed in a small neighbourhood. Denote some points of the
two circles where they enter or leave this neighbourhood by a, b, c, and d in this order around
the neighbourhood; let a and b belong to one circle and let c and d belong to the other circle.
The two circle arcs may have the same or opposite orientations. Moreover, the four end-points
of the two arcs are connected by the other parts of the orbits. This can happen in two ways
without intersection: either a is connected to d and b is connected to c, or a is connected to b
and c is connected to d. Altogether we have four cases, as shown in Figure 7.
d d d d a d a d
a d a d
a a a a

b b b b
c b c b c
c c c b c b c

Figure 7

We can see that the number of orbits is changed by ´2 or `2 in the leftmost case when the
arcs have the same orientation, a is connected to d, and b is connected to c. In the other three
cases the number of orbits is not changed. Hence, Type-1 steps do not change the parity of the
number of orbits.

Now consider a Type-2 step. The three circles enclose a small, triangular region; by the
step, this triangle is replaced by another triangle. Again, the modification of the orbits is done
in some small neighbourhood; the structure does not change outside. Each side of the triangle
shaped region can be convex or concave; the number of concave sides can be 0, 1, 2 or 3, so
there are 4 possible arrangements of the orbits inside the neighbourhood, as shown in Figure 8.
Shortlisted problems – solutions 47

a f a f a f a f

b e b e b e b e

c d c d c d c d

all convex 1 concave 2 concave 3 concave


Figure 8
Denote the points where the three circles enter or leave the neighbourhood by a, b, c, d,
e, and f in this order around the neighbourhood. As can be seen in Figure 8, there are only
two essentially different cases; either a, c, e are connected to b, d, f , respectively, or a, c, e are
connected to f, b, d, respectively. The step either preserves the set of connections or switches
to the other arrangement. Obviously, in the earlier case the number of orbits is not changed;
therefore we have to consider only the latter case.
The points a, b, c, d, e, and f are connected by the orbits outside, without intersection. If
a was connected to c, say, then this orbit would isolate b, so this is impossible. Hence, each of
a, b, c, d, e and f must be connected either to one of its neighbours or to the opposite point.
If say a is connected to d, then this orbit separates b and c from e and f , therefore b must be
connected to c and e must be connected to f . Altogether there are only two cases and their
reverses: either each point is connected to one of its neighbours or two opposite points are
connected and the the remaining neigh boring pairs are connected to each other. See Figure 9.
a a a a
f f f f

b b b b
e e e e

c d c d c d c d

Figure 9
We can see that if only neighbouring points are connected, then the number of orbits is
changed by `2 or ´2. If two opposite points are connected (a and d in the figure), then the
orbits are re-arranged, but their number is unchanged. Hence, Type-2 steps also preserve the
parity. This completes the proof of p˚q.

Solution 3. Like in the previous solutions, we do not need all circle pairs to intersect but we
assume that the circles form a connected set. Denote by C and P the sets of circles and their
intersection points, respectively.
The circles divide the plane into several simply connected, bounded regions and one un-
bounded region. Denote the set of these regions by R. We say that an intersection point or
a region is odd or even if it is contained inside an odd or even number of circles, respectively.
Let Podd and Rodd be the sets of odd intersection points and odd regions, respectively.
Claim.
|Rodd | ´ |Podd | ” n pmod 2q. p1q
Proof. For each circle c P C, denote by Rc , Pc , and Xc the number of regions inside c, the
number of intersection points inside c, and the number of circles intersecting c, respectively.
The circles divide each other into several arcs; denote by Ac the number of such arcs inside c.
By double counting the regions and intersection points inside the circles we get
ÿ ÿ
|Rodd | ” Rc pmod 2q and |Podd | ” Pc pmod 2q.
cPC cPC
48 IMO 2014 South Africa

For each circle c, apply Euler’s polyhedron theorem to the (simply connected) regions in c.
There are 2Xc intersection points on c; they divide the circle into 2Xc arcs. The polyhedron
theorem yields pRc ` 1q ` pPc ` 2Xc q “ pAc ` 2Xc q ` 2, considering the exterior of c as a single
region. Therefore,
Rc ` Pc “ Ac ` 1. p2q
Moreover, we have four arcs starting from every interior points inside c and a single arc
starting into the interior from each intersection point on the circle. By double-counting the
end-points of the interior arcs we get 2Ac “ 4Pc ` 2Xc , so

Ac “ 2Pc ` Xc . p3q

The relations (2) and (3) together yield

Rc ´ Pc “ Xc ` 1. p4q

By summing up (4) for all circles we obtain


ÿ ÿ ÿ
Rc ´ Pc “ Xc ` |C|,
cPC cPC cPC

which yields ÿ
|Rodd | ´ |Podd | ” Xc ` n pmod 2q. p5q
cPC
ř
Notice that in Xc each intersecting circle pair is counted twice, i.e., for both circles in the
cPC
pair, so ÿ
Xc ” 0 pmod 2q,
cPC

which finishes the proof of the Claim. l

Now insert the same small arcs at the intersections as in the first solution, and suppose that
there is a single snail orbit b.
First we show that the odd regions are inside the curve b, while the even regions are outside.
Take a region r P R and a point x in its interior, and draw a ray y, starting from x, that does
not pass through any intersection point of the circles and is neither tangent to any of the circles.
As is well-known, x is inside the curve b if and only if y intersects b an odd number of times
(see Figure 10). Notice that if an arbitrary circle c contains x in its interior, then c intersects y
at a single point; otherwise, if x is outside c, then c has 2 or 0 intersections with y. Therefore,
y intersects b an odd number of times if and only if x is contained in an odd number of circles,
so if and only if r is odd.

y
x
r

Figure 10
Now consider an intersection point p of two circles c1 and c2 and a small neighbourhood
around p. Suppose that p is contained inside k circles.
Shortlisted problems – solutions 49

We have four regions that meet at p. Let r1 be the region that lies outside both c1 and c2 ,
let r2 be the region that lies inside both c1 and c2 , and let r3 and r4 be the two remaining
regions, each lying inside exactly one of c1 and c2 . The region r1 is contained inside the same
k circles as p; the region r2 is contained also by c1 and c2 , so by k ` 2 circles in total; each of
the regions r3 and r4 is contained inside k ` 1 circles. After the small arcs have been inserted
at p, the regions r1 and r2 get connected, and the regions r3 and r4 remain separated at p (see
Figure 11). If p is an odd point, then r1 and r2 are odd, so two odd regions are connected at p.
Otherwise, if p is even, then we have two even regions connected at p.
r1
c1 c2
p
r3 r4
r2

Figure 11 Figure 12
Consider the system of odd regions and their connections at the odd points as a graph.
In this graph the odd regions are the vertices, and each odd point establishes an edge that
connects two vertices (see Figure 12). As b is a single closed curve, this graph is connected and
contains no cycle, so the graph is a tree. Then the number of vertices must be by one greater
than the number of edges, so
|Rodd | ´ |Podd | “ 1. p9q
The relations (1) and (9) together prove that n must be odd.

Comment. For every odd n there exists at least one configuration of n circles with a single snail orbit.
˝
Figure 13 shows a possible configuration with 5 circles. In general, if a circle is rotated by k ¨ 360 n
(k “ 1, 2, . . . , n ´ 1q around an interior point other than the centre, the circle and its rotated copies
together provide a single snail orbit.

Figure 13
50 IMO 2014 South Africa

Geometry
G1. The points P and Q are chosen on the side BC of an acute-angled triangle ABC so
that =P AB “ =ACB and =QAC “ =CBA. The points M and N are taken on the rays AP
and AQ, respectively, so that AP “ P M and AQ “ QN. Prove that the lines BM and CN
intersect on the circumcircle of the triangle ABC.
(Georgia)
Solution 1. Denote by S the intersection point of the lines BM and CN. Let moreover
β “ =QAC “ =CBA and γ “ =P AB “ =ACB. From these equalities it follows that the
triangles ABP and CAQ are similar (see Figure 1). Therefore we obtain
BP BP AQ NQ
“ “ “ .
PM PA QC QC
Moreover,
=BP M “ β ` γ “ =CQN .
Hence the triangles BP M and NQC are similar. This gives =BMP “ =NCQ, so the trian-
gles BP M and BSC are also similar. Thus we get
=CSB “ =BP M “ β ` γ “ 180˝ ´ =BAC ,
which completes the solution.
A
A

γ β

β β +γ γ B C
B C Q P
Q P

L
S
S
K
N M N X M
Figure 1 Figure 2

Solution 2. As in the previous solution, denote by S the intersection point of the lines BM
and NC. Let moreover the circumcircle of the triangle ABC intersect the lines AP and AQ
again at K and L, respectively (see Figure 2).
Note that =LBC “ =LAC “ =CBA and similarly =KCB “ =KAB “ =BCA. It implies
that the lines BL and CK meet at a point X, being symmetric to the point A with respect
to the line BC. Since AP “ P M and AQ “ QN, it follows that X lies on the line MN.
Therefore, using Pascal’s theorem for the hexagon ALBSCK, we infer that S lies on the
circumcircle of the triangle ABC, which finishes the proof.

Comment. Both solutions can be modified to obtain a more general result, with the equalities
AP “ P M and AQ “ QN
replaced by
AP QN
“ .
PM AQ
Shortlisted problems – solutions 51

G2. Let ABC be a triangle. The points K, L, and M lie on the segments BC, CA, and AB,
respectively, such that the lines AK, BL, and CM intersect in a common point. Prove that it
is possible to choose two of the triangles ALM, BMK, and CKL whose inradii sum up to at
least the inradius of the triangle ABC.
(Estonia)
Solution. Denote
BK CL AM
a“ , b“ , c“ .
KC LA MB
By Ceva’s theorem, abc “ 1, so we may, without loss of generality, assume that a ě 1. Then at
least one of the numbers b or c is not greater than 1. Therefore at least one of the pairs pa, bq,
pb, cq has its first component not less than 1 and the second one not greater than 1. Without
loss of generality, assume that 1 ď a and b ď 1.
Therefore, we obtain bc ď 1 and 1 ď ca, or equivalently
AM LA MB BK
ď and ď .
MB CL AM KC
The first inequality implies that the line passing through M and parallel to BC intersects the
segment AL at a point X (see Figure 1). Therefore the inradius of the triangle ALM is not
less than the inradius r1 of triangle AMX.
Similarly, the line passing through M and parallel to AC intersects the segment BK at
a point Y , so the inradius of the triangle BMK is not less than the inradius r2 of the trian-
gle BMY . Thus, to complete our solution, it is enough to show that r1 ` r2 ě r, where r is
the inradius of the triangle ABC. We prove that in fact r1 ` r2 “ r.
C

L
K

X
Y

r
r1 r2
A M B
Figure 1
Since MX k BC, the dilation with centre A that takes M to B takes the incircle of the
triangle AMX to the incircle of the triangle ABC. Therefore
r1 AM r2 MB
“ , and similarly “ .
r AB r AB
Adding these equalities gives r1 ` r2 “ r, as required.

Comment. Alternatively, one can use Desargues’ theorem instead of Ceva’s theorem, as follows:
The lines AB, BC, CA dissect the plane into seven regions. One of them is bounded, and amongst
the other six, three are two-sided and three are three-sided. Now define the points P “ BC X LM ,
Q “ CA X M K, and R “ AB X KL (in the projective plane). By Desargues’ theorem, the points P ,
Q, R lie on a common line ℓ. This line intersects only unbounded regions. If we now assume (without
loss of generality) that P , Q and R lie on ℓ in that order, then one of the segments P Q or QR lies
inside a two-sided region. If, for example, this segment is P Q, then the triangles ALM and BM K
will satisfy the statement of the problem for the same reason.
52 IMO 2014 South Africa

G3. Let Ω and O be the circumcircle and the circumcentre of an acute-angled triangle ABC
with AB ą BC. The angle bisector of =ABC intersects Ω at M ‰ B. Let Γ be the circle
with diameter BM. The angle bisectors of =AOB and =BOC intersect Γ at points P and Q,
respectively. The point R is chosen on the line P Q so that BR “ MR. Prove that BR k AC.
(Here we always assume that an angle bisector is a ray.)
(Russia)
Solution. Let K be the midpoint of BM, i.e., the centre of Γ. Notice that AB ‰ BC implies
K ‰ O. Clearly, the lines OM and OK are the perpendicular bisectors of AC and BM,
respectively. Therefore, R is the intersection point of P Q and OK.
Let N be the second point of intersection of Γ with the line OM. Since BM is a diameter
of Γ, the lines BN and AC are both perpendicular to OM. Hence BN k AC, and it suffices to
prove that BN passes through R. Our plan for doing this is to interpret the lines BN, OK,
and P Q as the radical axes of three appropriate circles.
Let ω be the circle with diameter BO. Since =BNO “ =BKO “ 90˝ , the points N and K
lie on ω.
Next we show that the points O, K, P , and Q are concyclic. To this end, let D and E
be the midpoints of BC and AB, respectively. Clearly, D and E lie on the rays OQ and OP ,
respectively. By our assumptions about the triangle ABC, the points B, E, O, K, and D
lie in this order on ω. It follows that =EOR “ =EBK “ =KBD “ =KOD, so the line
KO externally bisects the angle P OQ. Since the point K is the centre of Γ, it also lies on
the perpendicular bisector of P Q. So K coincides with the midpoint of the arc P OQ of the
circumcircle γ of triangle P OQ.
Thus the lines OK, BN, and P Q are pairwise radical axes of the circles ω, γ, and Γ. Hence
they are concurrent at R, as required.

R N B γ

Q
E
E
D
ω
ω
O
K

A C

M
Shortlisted problems – solutions 53

G4. Consider a fixed circle Γ with three fixed points A, B, and C on it. Also, let us fix
a real number λ P p0, 1q. For a variable point P R tA, B, Cu on Γ, let M be the point on
the segment CP such that CM “ λ ¨ CP . Let Q be the second point of intersection of the
circumcircles of the triangles AMP and BMC. Prove that as P varies, the point Q lies on a
fixed circle.
(United Kingdom)
Solution 1. Throughout the solution, we denote by >pa, bq the directed angle between the
lines a and b.
Let D be the point on the segment AB such that BD “ λ ¨ BA. We will show that either
Q “ D, or >pDQ, QBq “ >pAB, BCq; this would mean that the point Q varies over the
constant circle through D tangent to BC at B, as required.
Denote the circumcircles of the triangles AMP and BMC by ωA and ωB , respectively. The
lines AP , BC, and MQ are pairwise radical axes of the circles Γ, ωA , and ωB , thus either they
are parallel, or they share a common point X.
Assume that these lines are parallel (see Figure 1). Then the segments AP , QM, and BC
have a common perpendicular bisector; the reflection in this bisector maps the segment CP
to BA, and maps M to Q. Therefore, in this case Q lies on AB, and BQ{AB “ CM{CP “
BD{AB; so we have Q “ D.

P
ωA
ωA
A
M
Y
A P D
Q
Q ωB

D=
D =Q
Q M
M
X

B
B C C
ωB
Figure 1 Figure 2

Now assume that the lines AP , QM, and BC are concurrent at some point X (see Figure 2).
Notice that the points A, B, Q, and X lie on a common circle Ω by Miquel’s theorem
applied to the triangle XP C. Let us denote by Y the symmetric image of X about the
perpendicular bisector of AB. Clearly, Y lies on Ω, and the triangles Y AB and △XBA are
congruent. Moreover, the triangle XP C is similar to the triangle XBA, so it is also similar to
the triangle Y AB.
Next, the points D and M correspond to each other in similar triangles Y AB and XP C,
since BD{BA “ CM{CP “ λ. Moreover, the triangles Y AB and XP C are equi-oriented, so
>pMX, XP q “ >pDY, Y Aq. On the other hand, since the points A, Q, X, and Y lie on Ω, we
have >pQY, Y Aq “ >pMX, XP q. Therefore, >pQY, Y Aq “ >pDY, Y Aq, so the points Y , D,
and Q are collinear.
Finally, we have >pDQ, QBq “ >pY Q, QBq “ >pY A, ABq “ >pAB, BXq “ >pAB, BCq,
as desired.
54 IMO 2014 South Africa

Comment. In the original proposal, λ was supposed to be an arbitrary real number distinct from 0
ÝÝÑ ÝÝ
Ñ
and 1, and the point M was defined by CM “ λ ¨ CP . The Problem Selection Committee decided to
add the restriction λ P p0, 1q in order to avoid a large case distinction.
Solution 2. As in the previous solution, we introduce the radical centre X “ AP X BC X MQ
of the circles ωA , ωB , and Γ. Next, we also notice that the points A, Q, B, and X lie on a
common circle Ω.
If the point P lies on the arc BAC of Γ, then the point X is outside Γ, thus the point Q
belongs to the ray XM, and therefore the points P , A, and Q lie on the same side of BC.
Otherwise, if P lies on the arc BC not containing A, then X lies inside Γ, so M and Q lie on
different sides of BC; thus again Q and A lie on the same side of BC. So, in each case the
points Q and A lie on the same side of BC.

P
ωA
A
M

Q
Q ωB

B
C

Figure 3

Now we prove that the ratio


QB QB QX
“ ¨
sin =QBC QX sin =QBX
is constant. Since the points A, Q, B, and X are concyclic, we have
QX AX
“ .
sin =QBX sin =ABC
Next, since the points B, Q, M, and C are concyclic, the triangles XBQ and XMC are similar,
so
QB CM CP
“ “λ¨ .
QX CX CX
Analogously, the triangles XCP and XAB are also similar, so
CP AB
“ .
CX AX
Therefore, we obtain
QB AB AX AB
“λ¨ ¨ “λ¨ ,
sin =QBC AX sin =ABC sin =ABC
so this ratio is indeed constant. Thus the circle passing through Q and tangent to BC at B is
also constant, and Q varies over this fixed circle.
Shortlisted problems – solutions 55

Comment. It is not hard to guess that the desired circle should be tangent to BC at B. Indeed, the
second paragraph of this solution shows that this circle lies on one side of BC; on the other hand, in
the limit case P “ B, the point Q also coincides with B.
Solution 3. Let us perform an inversion centred at C. Denote by X 1 the image of a point X
under this inversion.
The circle Γ maps to the line Γ1 passing through the constant points A1 and B 1 , and con-
taining the variable point P 1 . By the problem condition, the point M varies over the circle γ
which is the homothetic image of Γ with centre C and coefficient λ. Thus M 1 varies over the
constant line γ 1 k A1 B 1 which is the homothetic image of A1 B 1 with centre C and coefficient 1{λ,
and M “ γ 1 X CP 1 . Next, the circumcircles ωA and ωB of the triangles AMP and BMC map
to the circumcircle ωA1 of the triangle A1 M 1 P 1 and to the line B 1 M 1 , respectively; the point Q
thus maps to the second point of intersection of B 1 M 1 with ωA1 (see Figure 4).


ωB

P′ A′′′′
A B′


ωA Q′′′′
Q
V

M′ J γ′

Figure 4

Let J be the (constant) common point of the lines γ 1 and CA1 , and let ℓ be the (constant)
line through J parallel to CB 1 . Let V be the common point of the lines ℓ and B 1 M 1 . Applying
Pappus’ theorem to the triples pC, J, A1 q and pV, B 1 , M 1 q we get that the points CB 1 X JV ,
JM 1 X A1 B 1 , and CM 1 X A1 V are collinear. The first two of these points are ideal, hence so is
the third, which means that CM 1 k A1 V .
Now we have >pQ1 A1 , A1 P 1 q “ >pQ1 M 1 , M 1 P 1q “ =pV M 1 , A1 V q, which means that the
triangles B 1 Q1 A1 and B 1 A1 V are similar, and pB 1 A1 q2 “ B 1 Q1 ¨ B 1 V . Thus Q1 is the image of V
under the second (fixed) inversion with centre B 1 and radius B 1 A1 . Since V varies over the
constant line ℓ, Q1 varies over some constant circle Θ. Thus, applying the first inversion back
we get that Q also varies over some fixed circle.
One should notice that this last circle is not a line; otherwise Θ would contain C, and thus
ℓ would contain the image of C under the second inversion. This is impossible, since CB 1 k ℓ.
56 IMO 2014 South Africa

G5. Let ABCD be a convex quadrilateral with =B “ =D “ 90˝ . Point H is the foot of
the perpendicular from A to BD. The points S and T are chosen on the sides AB and AD,
respectively, in such a way that H lies inside triangle SCT and
=SHC ´ =BSC “ 90˝ , =T HC ´ =DT C “ 90˝ .
Prove that the circumcircle of triangle SHT is tangent to the line BD.
(Iran)
Solution. Let the line passing through C and perpendicular to the line SC intersect the line AB
at Q (see Figure 1). Then
=SQC “ 90˝ ´ =BSC “ 180˝ ´ =SHC ,
which implies that the points C, H, S, and Q lie on a common circle. Moreover, since SQ is a
diameter of this circle, we infer that the circumcentre K of triangle SHC lies on the line AB.
Similarly, we prove that the circumcentre L of triangle CHT lies on the line AD.
A

D
K
H
H
B

C
L
Q

Figure 1
In order to prove that the circumcircle of triangle SHT is tangent to BD, it suffices to show
that the perpendicular bisectors of HS and HT intersect on the line AH. However, these two
perpendicular bisectors coincide with the angle bisectors of angles AKH and ALH. Therefore,
in order to complete the solution, it is enough (by the bisector theorem) to show that
AK AL
“ . p1q
KH LH
We present two proofs of this equality.
First proof. Let the lines KL and HC intersect at M (see Figure 2). Since KH “ KC
and LH “ LC, the points H and C are symmetric to each other with respect to the line KL.
Therefore M is the midpoint of HC. Denote by O the circumcentre of quadrilateral ABCD.
Then O is the midpoint of AC. Therefore we have OM k AH and hence OM K BD. This
together with the equality OB “ OD implies that OM is the perpendicular bisector of BD
and therefore BM “ DM.
Since CM K KL, the points B, C, M, and K lie on a common circle with diameter KC.
Similarly, the points L, C, M, and D lie on a circle with diameter LC. Thus, using the sine
law, we obtain
AK sin =ALK DM CK CK KH
“ “ ¨ “ “ ,
AL sin =AKL CL BM CL LH
Shortlisted problems – solutions 57

which finishes the proof of p1q.


A
ω
A

D
K
H
H D
B K
M B H
N
C
L C
L
Figure 2 Figure 3
Second proof. If the points A, H, and C are collinear, then AK “ AL and KH “ LH, so
the equality p1q follows. Assume therefore that the points A, H, and C do not lie in a line and
consider the circle ω passing through them (see Figure 3). Since the quadrilateral ABCD is
cyclic,
=BAC “ =BDC “ 90˝ ´ =ADH “ =HAD .
Let N ‰ A be the intersection point of the circle ω and the angle bisector of =CAH. Then
AN is also the angle bisector of =BAD. Since H and C are symmetric to each other with
respect to the line KL and HN “ NC, it follows that both N and the centre of ω lie on the
line KL. This means that the circle ω is an Apollonius circle of the points K and L. This
immediately yields p1q.

Comment. Either proof can be used to obtain the following generalised result:
Let ABCD be a convex quadrilateral and let H be a point in its interior with =BAC “ =DAH. The
points S and T are chosen on the sides AB and AD, respectively, in such a way that H lies inside
triangle SCT and
=SHC ´ =BSC “ 90˝ , =T HC ´ =DT C “ 90˝ .
Then the circumcentre of triangle SHT lies on the line AH (and moreover the circumcentre of trian-
gle SCT lies on AC).
58 IMO 2014 South Africa

G6. Let ABC be a fixed acute-angled triangle. Consider some points E and F lying on
the sides AC and AB, respectively, and let M be the midpoint of EF . Let the perpendicular
bisector of EF intersect the line BC at K, and let the perpendicular bisector of MK intersect
the lines AC and AB at S and T , respectively. We call the pair pE, F q interesting, if the
quadrilateral KSAT is cyclic.
Suppose that the pairs pE1 , F1 q and pE2 , F2 q are interesting. Prove that

E1 E2 F1 F2
“ .
AB AC

(Iran)
Solution 1. For any interesting pair pE, F q, we will say that the corresponding triangle EF K
is also interesting.
Let EF K be an interesting triangle. Firstly, we prove that =KEF “ =KF E “ =A, which
also means that the circumcircle ω1 of the triangle AEF is tangent to the lines KE and KF .
Denote by ω the circle passing through the points K, S, A, and T . Let the line AM intersect
the line ST and the circle ω (for the second time) at N and L, respectively (see Figure 1).
Since EF k T S and M is the midpoint of EF , N is the midpoint of ST . Moreover, since K
and M are symmetric to each other with respect to the line ST , we have =KNS “ =MNS “
=LNT . Thus the points K and L are symmetric to each other with respect to the perpendicular
bisector of ST . Therefore KL k ST .
Let G be the point symmetric to K with respect to N. Then G lies on the line EF , and we
may assume that it lies on the ray MF . One has

=KGE “ =KNS “ =SNM “ =KLA “ 180˝ ´ =KSA

(if K “ L, then the angle KLA is understood to be the angle between AL and the tangent
to ω at L). This means that the points K, G, E, and S are concyclic. Now, since KSGT is a
parallelogram, we obtain =KEF “ =KSG “ 180˝ ´ =T KS “ =A. Since KE “ KF , we also
have =KF E “ =KEF “ =A.
After having proved this fact, one may finish the solution by different methods.
A
ω ω1
E A
E

M
F S
E1

G F2
B
B N
N E2
K C F1
Z1 Z2
T
L B K2 K1 C
Figure 1 Figure 2
First method. We have just proved that all interesting triangles are similar to each other.
This allows us to use the following lemma.
Shortlisted problems – solutions 59

Lemma. Let ABC be an arbitrary triangle. Choose two points E1 and E2 on the side AC, two
points F1 and F2 on the side AB, and two points K1 and K2 on the side BC, in a way that the
triangles E1 F1 K1 and E2 F2 K2 are similar. Then the six circumcircles of the triangles AEi Fi ,
BFi Ki , and CEi Ki (i “ 1, 2) meet at a common point Z. Moreover, Z is the centre of the
spiral similarity that takes the triangle E1 F1 K1 to the triangle E2 F2 K2 .
Proof. Firstly, notice that for each i “ 1, 2, the circumcircles of the triangles AEi Fi , BFi Ki ,
and CKi Ei have a common point Zi by Miquel’s theorem. Moreover, we have

>pZi Fi , Zi Ei q “ >pAB, CAq , >pZi Ki , Zi Fi q “ >pBC, ABq , >pZi Ei , Zi Ki q “ >pCA, BCq .

This yields that the points Z1 and Z2 correspond to each other in similar triangles E1 F1 K1
and E2 F2 K2 . Thus, if they coincide, then this common point is indeed the desired centre of a
spiral similarity.
Finally, in order to show that Z1 “ Z2 , one may notice that >pAB, AZ1 q “ >pE1 F1 , E1 Z1 q “
>pE2 F2 , E2 Z2 q “ >pAB, AZ2 q (see Figure 2). Similarly, one has >pBC, BZ1 q “ >pBC, BZ2 q
and >pCA, CZ1 q “ >pCA, CZ2 q. This yields Z1 “ Z2 . l
Now, let P and Q be the feet of the perpendiculars from B and C onto AC and AB,
respectively, and let R be the midpoint of BC (see Figure 3). Then R is the circumcentre
of the cyclic quadrilateral BCP Q. Thus we obtain =AP Q “ =B and =RP C “ =C, which
yields =QP R “ =A. Similarly, we show that =P QR “ =A. Thus, all interesting triangles are
similar to the triangle P QR.
A A

F1
P
P
F2 E2
Z
E1 Q
Q Z

B R C
B K1 K2 R C
Figure 3 Figure 4
Denote now by Z the common point of the circumcircles of AP Q, BQR, and CP R. Let
E1 F1 K1 and E2 F2 K2 be two interesting triangles. By the lemma, Z is the centre of any
spiral similarity taking one of the triangles E1 F1 K1 , E2 F2 K2 , and P QR to some other of them.
Therefore the triangles ZE1 E2 and ZF1 F2 are similar, as well as the triangles ZE1 F1 and ZP Q.
Hence
E1 E2 ZE1 ZP
“ “ .
F1 F2 ZF1 ZQ
Moreover, the equalities =AZQ “ =AP Q “ =ABC “ 180˝ ´ =QZR show that the point Z
lies on the line AR (see Figure 4). Therefore the triangles AZP and ACR are similar, as well
as the triangles AZQ and ABR. This yields

ZP ZP RB AZ AB AB
“ ¨ “ ¨ “ ,
ZQ RC ZQ AC AZ AC

which completes the solution.


60 IMO 2014 South Africa

Second method. Now we will start from the fact that ω1 is tangent to the lines KE and KF
(see Figure 5). We prove that if pE, F q is an interesting pair, then

AE AF
` “ 2 cos =A. (1)
AB AC

Let Y be the intersection point of the segments BE and CF . The points B, K, and C are
collinear, hence applying Pascal’s theorem to the degenerated hexagon AF F Y EE, we infer
that Y lies on the circle ω1 .
Denote by Z the second intersection point of the circumcircle of the triangle BF Y with
the line BC (see Figure 6). By Miquel’s theorem, the points C, Z, Y , and E are concyclic.
Therefore we obtain

BF ¨ AB ` CE ¨ AC “ BY ¨ BE ` CY ¨ CF “ BZ ¨ BC ` CZ ¨ BC “ BC 2 .

On the other hand, BC 2 “ AB 2 ` AC 2 ´ 2AB ¨ AC cos =A, by the cosine law. Hence

pAB ´ AF q ¨ AB ` pAC ´ AEq ¨ AC “ AB 2 ` AC 2 ´ 2AB ¨ AC cos =A ,

which simplifies to the desired equality (1).


Let now pE1 , F1 q and pE2 , F2 q be two interesting pairs of points. Then we get

AE1 AF1 AE2 AF2


` “ ` ,
AB AC AB AC
which gives the desired result.
A

E
ω1 A
M
S E
ω1
F Y
F
Y

B
K C
B Z C
T

Figure 5 Figure 6

Third method. Again, we make use of the fact that all interesting triangles are similar (and
equi-oriented). Let us put the picture onto a complex plane such that A is at the origin, and
identify each point with the corresponding complex number.
Let EF K be any interesting triangle. The equalities =KEF “ =KF E “ =A yield that the
ratio ν “ K´E
F ´E
is the same for all interesting triangles. This in turn means that the numbers E,
F , and K satisfy the linear equation

K “ µE ` νF, where µ “ 1 ´ ν. (2)


Shortlisted problems – solutions 61

Now let us choose the points X and Y on the rays AB and AC, respectively, so that
=CXA “ =AY B “ =A “ =KEF (see Figure 7). Then each of the triangles AXC and Y AB
is similar to any interesting triangle, which also means that

C “ µA ` νX “ νX and B “ µY ` νA “ µY. (3)

Moreover, one has X{Y “ C{B.


Since the points E, F , and K lie on AC, AB, and BC, respectively, one gets

E “ ρY, F “ σX, and K “ λB ` p1 ´ λqC

for some real ρ, σ, and λ. In view of (3), the equation (2) now reads λB ` p1 ´ λqC “ K “
µE ` νF “ ρB ` σC, or
pλ ´ ρqB “ pσ ` λ ´ 1qC.
Since the nonzero complex numbers B and C have different arguments, the coefficients in the
brackets vanish, so ρ “ λ and σ “ 1 ´ λ. Therefore,

E F
` “ ρ ` σ “ 1. (4)
Y X

Now, if pE1 , F1 q and pE2 , F2 q are two distinct interesting pairs, one may apply (4) to both
pairs. Subtracting, we get

E1 ´ E2 F2 ´ F1 E1 ´ E2 Y B
“ , so “ “ .
Y X F2 ´ F1 X C
Taking absolute values provides the required result.

E
K

A
F B X
Figure 7

Comment 1. One may notice that the triangle P QR is also interesting.

Comment 2. In order to prove that =KEF “ =KF E “ =A, one may also use the following
well-known fact:
Let AEF be a triangle with AE ‰ AF , and let K be the common point of the symmedian taken from A
and the perpendicular bisector of EF . Then the lines KE and KF are tangent to the circumcircle ω1
of the triangle AEF .
In this case, however, one needs to deal with the case AE “ AF separately.
62 IMO 2014 South Africa

Solution 2. Let pE, F q be an interesting pair. This time we prove that

AM
“ cos =A . (5)
AK

As in Solution 1, we introduce the circle ω passing through the points K, S, A, and T , together
with the points N and L at which the line AM intersect the line ST and the circle ω for the
second time, respectively. Let moreover O be the centre of ω (see Figures 8 and 9). As in
Solution 1, we note that N is the midpoint of ST and show that KL k ST , which implies
=F AM “ =EAK.
X A

ω
E
A
M S ω

F O

O
E
N M
B F S
K C N
T T
L B K =L C
Figure 8 Figure 9

Suppose now that K ‰ L (see Figure 8). Then KL k ST , and consequently the lines KM
and KL are perpendicular. It implies that the lines LO and KM meet at a point X lying on the
circle ω. Since the lines ON and XM are both perpendicular to the line ST , they are parallel
to each other, and hence =LON “ =LXK “ =MAK. On the other hand, =OLN “ =MKA,
so we infer that triangles NOL and MAK are similar. This yields

AM ON ON
“ “ “ cos =T ON “ cos =A .
AK OL OT

If, on the other hand, K “ L, then the points A, M, N, and K lie on a common line, and
this line is the perpendicular bisector of ST (see Figure 9). This implies that AK is a diameter
of ω, which yields AM “ 2OK ´ 2NK “ 2ON. So also in this case we obtain

AM 2ON
“ “ cos =T ON “ cos =A .
AK 2OT

Thus (5) is proved.

Let P and Q be the feet of the perpendiculars from B and C onto AC and AB, respectively
(see Figure 10). We claim that the point M lies on the line P Q. Consider now the composition
of the dilatation with factor cos =A and centre A, and the reflection with respect to the angle
bisector of =BAC. This transformation is a similarity that takes B, C, and K to P , Q, and M,
respectively. Since K lies on the line BC, the point M lies on the line P Q.
Shortlisted problems – solutions 63

A
ω
E
E
P
P
M
Q S
F

B
K C

Figure 10
Suppose that E ‰ P . Then also F ‰ Q, and by Menelaus’ theorem, we obtain
AQ F M EP
¨ ¨ “ 1.
F Q EM AP
Using the similarity of the triangles AP Q and ABC, we infer that
EP AP AB EP FQ
“ “ , and hence “ .
FQ AQ AC AB AC
The last equality holds obviously also in case E “ P , because then F “ Q. Moreover, since
the line P Q intersects the segment EF , we infer that the point E lies on the segment AP if
and only if the point F lies outside of the segment AQ.
Let now pE1 , F1 q and pE2 , F2 q be two interesting pairs. Then we obtain

E1 P F1 Q E2 P F2 Q
“ and “ .
AB AC AB AC
If P lies between the points E1 and E2 , we add the equalities above, otherwise we subtract
them. In any case we obtain
E1 E2 F1 F2
“ ,
AB AC
which completes the solution.
64 IMO 2014 South Africa

G7. Let ABC be a triangle with circumcircle Ω and incentre I. Let the line passing through I
and perpendicular to CI intersect the segment BC and the arc BC (not containing A) of Ω at
points U and V , respectively. Let the line passing through U and parallel to AI intersect AV
at X, and let the line passing through V and parallel to AI intersect AB at Y . Let W and Z be
the midpoints of AX and BC, respectively. Prove that if the points I, X, and Y are collinear,
then the points I, W , and Z are also collinear.
(U.S.A.)
Solution 1. We start with some general observations. Set α “ =A{2, β “ =B{2, γ “ =C{2.
Then obviously α ` β ` γ “ 90˝ . Since =UIC “ 90˝ , we obtain =IUC “ α ` β. Therefore
=BIV “ =IUC ´ =IBC “ α “ =BAI “ =BY V , which implies that the points B, Y , I,
and V lie on a common circle (see Figure 1).
Assume now that the points I, X and Y are collinear. We prove that =Y IA “ 90˝ .
Let the line XU intersect AB at N. Since the lines AI, UX, and V Y are parallel, we get
NX YN VU XU
“ “ “ ,
AI YA VI AI
implying NX “ XU. Moreover, =BIU “ α “ =BNU. This implies that the quadrilat-
eral BUIN is cyclic, and since BI is the angle bisector of =UBN, we infer that NI “ UI.
Thus in the isosceles triangle NIU, the point X is the midpoint of the base NU. This gives
=IXN “ 90˝ , i.e., =Y IA “ 90˝ .
A

x α
N
T
α
I
X
Y α

β γ
B U x C

Figure 1
Let S be the midpoint of the segment V C. Let moreover T be the intersection point of the
lines AX and SI, and set x “ =BAV “ =BCV . Since =CIA “ 90˝ ` β and SI “ SC, we
obtain

=T IA “ 180˝ ´ =AIS “ 90˝ ´ β ´ =CIS “ 90˝ ´ β ´ γ ´ x “ α ´ x “ =T AI ,

which implies that T I “ T A. Therefore, since =XIA “ 90˝ , the point T is the midpoint
of AX, i.e., T “ W .
To complete our solution, it remains to show that the intersection point of the lines IS
and BC coincide with the midpoint of the segment BC. But since S is the midpoint of the
segment V C, it suffices to show that the lines BV and IS are parallel.
Shortlisted problems – solutions 65

Since the quadrilateral BY IV is cyclic, =V BI “ =V Y I “ =Y IA “ 90˝ . This implies that


BV is the external angle bisector of the angle ABC, which yields =V AC “ =V CA. Therefore
2α ´ x “ 2γ ` x, which gives α “ γ ` x. Hence =SCI “ α, so =V SI “ 2α.
On the other hand, =BV C “ 180˝ ´ =BAC “ 180˝ ´ 2α, which implies that the lines BV
and IS are parallel. This completes the solution.

Solution 2. As in Solution 1, we first prove that the points B, Y , I, V lie on a common circle
and =Y IA “ 90˝ . The remaining part of the solution is based on the following lemma, which
holds true for any triangle ABC, not necessarily with the property that I, X, Y are collinear.
Lemma. Let ABC be the triangle inscribed in a circle Γ and let I be its incentre. Assume
that the line passing through I and perpendicular to the line AI intersects the side AB at the
point Y . Let the circumcircle of the triangle BY I intersect the circle Γ for the second time
at V , and let the excircle of the triangle ABC opposite to the vertex A be tangent to the
side BC at E. Then
=BAV “ =CAE .
?
Proof. Let ρ be the composition of the inversion with centre A and radius AB ¨ AC, and the
symmetry with respect to AI. Clearly, ρ interchanges B and C.
Let J be the excentre of the triangle ABC opposite to A (see Figure 2). Then we have
=JAC “ =BAI and =JCA “ 90˝ ` γ “ =BIA, so the triangles ACJ and AIB are similar,
and therefore AB ¨ AC “ AI ¨ AJ. This means that ρ interchanges I and J. Moreover, since
Y lies on AB and =AIY “ 90˝ , the point Y 1 “ ρpY q lies on AC, and =JY 1 A “ 90˝ . Thus ρ
maps the circumcircle γ of the triangle BY I to a circle γ 1 with diameter JC.
Finally, since V lies on both Γ and γ, the point V 1 “ ρpV q lies on the line ρpΓq “ AB as
well as on γ 1 , which in turn means that V 1 “ E. This implies the desired result. l

F
A W

I K
X
X ω1
Y
I
Y γ
E D
C B C
B U Z E
Y′
V
ω2
γ′
V
J
Figure 2 Figure 3

Now we turn to the solution of the problem.


Assume that the incircle ω1 of the triangle ABC is tangent to BC at D, and let the
excircle ω2 of the triangle ABC opposite to the vertex A touch the side BC at E (see Figure 3).
The homothety with centre A that takes ω2 to ω1 takes the point E to some point F , and the
66 IMO 2014 South Africa

tangent to ω1 at F is parallel to BC. Therefore DF is a diameter of ω1 . Moreover, Z is the


midpoint of DE. This implies that the lines IZ and F E are parallel.
Let K “ Y I X AE. Since =Y IA “ 90˝ , the lemma yields that I is the midpoint of XK.
This implies that the segments IW and AK are parallel. Therefore, the points W , I and Z are
collinear.

Comment 1. The properties =Y IA “ 90˝ and V A “ V C can be established in various ways. The
main difficulty of the problem seems to find out how to use these properties in connection to the points
W and Z.
In Solution 2 this principal part is more or less covered by the lemma, for which we have presented
a direct proof. On the other hand, this lemma appears to be a combination of two well-known facts;
let us formulate them in terms of the lemma statement.
Let the line IY intersect AC at P (see Figure 4). The first fact states that the circumcircle ω of
the triangle V Y P is tangent to the segments AB and AC, as well as to the circle Γ. The second fact
states that for such a circle, the angles BAV and CAE are equal.
The awareness of this lemma may help a lot in solving this problem; so the Jury might also consider
a variation of the proposed problem, for which the lemma does not seem to be useful; see Comment 3.

N W Q
A

I ω1
X′′′′
X
Y X
P
P D
B C
U Z E
Y I

ω2
B E C
ω V V′
ω2
V
Figure 4 Figure 5

Comment 2. The proposed problem stated the equivalence: the point I lies on the line XY if and
only if I lies on the line W Z. Here we sketch the proof of the “if” part (see Figure 5).
As in Solution 2, let BC touch the circles ω1 and ω2 at D and E, respectively. Since IZ k AE and W
lies on IZ, the line DX is also parallel to AE. Therefore, the triangles XU P and AIQ are similar.
Moreover, the line DX is symmetric to AE with respect to I, so IP “ IQ, where P “ U V X XD and
Q “ U V X AE. Thus we obtain
UV UX UP UP
“ “ “ .
VI IA IQ IP
So the pairs IU and P V are harmonic conjugates, and since =U DI “ 90˝ , we get =V DB “ =BDX “
=BEA. Therefore the point V 1 symmetric to V with respect to the perpendicular bisector of BC lies
on the line AE. So we obtain =BAV “ =CAE.
Shortlisted problems – solutions 67

The rest can be obtained by simply reversing the arguments in Solution 2. The points B, V , I, and Y
are concyclic. The lemma implies that =Y IA “ 90˝ . Moreover, the points B, U , I, and N , where
N “ U X X AB, lie on a common circle, so IN “ IU . Since IY K U N , the point X 1 “ IY X U N is
the midpoint of U N . But in the trapezoid AY V I, the line XU is parallel to the sides AI and Y V , so
N X “ U X 1 . This yields X “ X 1 .
The reasoning presented in Solution 1 can also be reversed, but it requires a lot of technicalities.
Therefore the Problem Selection Committee proposes to consider only the “only if” part of the original
proposal, which is still challenging enough.

Comment 3. The Jury might also consider the following variation of the proposed problem.
Let ABC be a triangle with circumcircle Ω and incentre I. Let the line through I perpendicular to CI
intersect the segment BC and the arc BC (not containing A) of Ω at U and V , respectively. Let the
line through U parallel to AI intersect AV at X. Prove that if the lines XI and AI are perpendicular,
then the midpoint of the segment AC lies on the line XI (see Figure 6).

α
N

α
M
I
X
A Y α

β γ
B C
U
I
X

B C
U
V

Figure 6 Figure 7

Since the solution contains the arguments used above, we only sketch it.
Let N “ XU X AB (see Figure 7). Then =BN U “ =BAI “ =BIU , so the points B, U , I, and N lie
on a common circle. Therefore IU “ IN , and since IX K N U , it follows that N X “ XU .
Now set Y “ XI X AB. The equality N X “ XU implies that
VX XU NX YX
“ “ “ ,
VA AI AI YI
and therefore Y V k AI. Hence =BY V “ =BAI “ =BIV , so the points B, V , I, Y are concyclic.
Next we have IY K Y V , so =IBV “ 90˝ . This implies that BV is the external angle bisector of the
angle ABC, which gives =V AC “ =V CA.
So in order to show that M “ XI X AC is the midpoint of AC, it suffices to prove that =V M C “ 90˝ .
But this follows immediately from the observation that the points V , C, M , and I are concyclic, as
=M IV “ =Y BV “ 180˝ ´ =ACV .
The converse statement is also true, but its proof requires some technicalities as well.
68 IMO 2014 South Africa

Number Theory
N1. Let n ě 2 be an integer, and let An be the set
An “ t2n ´ 2k | k P Z, 0 ď k ă nu.

Determine the largest positive integer that cannot be written as the sum of one or more (not
necessarily distinct) elements of An .
(Serbia)

Answer. pn ´ 2q2n ` 1.
Solution 1.
Part I. First we show that every integer greater than pn ´ 2q2n ` 1 can be represented as
such a sum. This is achieved by induction on n.
For n “ 2, the set An consists of the two elements 2 and 3. Every positive integer m except
for 1 can be represented as the sum of elements of An in this case: as m “ 2 ` 2 ` ¨ ¨ ¨ ` 2 if m
is even, and as m “ 3 ` 2 ` 2 ` ¨ ¨ ¨ ` 2 if m is odd.
Now consider some n ą 2, and take an integer m ą pn´ 2q2n ` 1. If m is even, then consider
m pn ´ 2q2n ` 2
ě “ pn ´ 2q2n´1 ` 1 ą pn ´ 3q2n´1 ` 1.
2 2
By the induction hypothesis, there is a representation of the form
m
“ p2n´1 ´ 2k1 q ` p2n´1 ´ 2k2 q ` ¨ ¨ ¨ ` p2n´1 ´ 2kr q
2
for some ki with 0 ď ki ă n ´ 1. It follows that

m “ p2n ´ 2k1 `1 q ` p2n ´ 2k2 `1 q ` ¨ ¨ ¨ ` p2n ´ 2kr `1 q,

giving us the desired representation as a sum of elements of An . If m is odd, we consider


m ´ p2n ´ 1q pn ´ 2q2n ` 1 ´ p2n ´ 1q
ą “ pn ´ 3q2n´1 ` 1.
2 2
By the induction hypothesis, there is a representation of the form
m ´ p2n ´ 1q
“ p2n´1 ´ 2k1 q ` p2n´1 ´ 2k2 q ` ¨ ¨ ¨ ` p2n´1 ´ 2kr q
2
for some ki with 0 ď ki ă n ´ 1. It follows that

m “ p2n ´ 2k1 `1 q ` p2n ´ 2k2 `1 q ` ¨ ¨ ¨ ` p2n ´ 2kr `1 q ` p2n ´ 1q,

giving us the desired representation of m once again.


Part II. It remains to show that there is no representation for pn ´ 2q2n ` 1. Let N be
the smallest positive integer that satisfies N ” 1 pmod 2n q, and which can be represented as a
sum of elements of An . Consider a representation of N, i.e.,

N “ p2n ´ 2k1 q ` p2n ´ 2k2 q ` ¨ ¨ ¨ ` p2n ´ 2kr q, (1)

where 0 ď k1 , k2 , . . . , kr ă n. Suppose first that two of the terms in the sum are the same, i.e.,
ki “ kj for some i ‰ j. If ki “ kj “ n ´ 1, then we can simply remove these two terms to get a
representation for
N ´ 2p2n ´ 2n´1 q “ N ´ 2n
Shortlisted problems – solutions 69

as a sum of elements of An , which contradicts our choice of N. If ki “ kj “ k ă n ´ 1, replace


the two terms by 2n ´ 2k`1, which is also an element of An , to get a representation for

N ´ 2p2n ´ 2k q ` 2n ´ 2k`1 “ N ´ 2n .

This is a contradiction once again. Therefore, all ki have to be distinct, which means that

2k1 ` 2k2 ` ¨ ¨ ¨ ` 2kr ď 20 ` 21 ` 22 ` ¨ ¨ ¨ ` 2n´1 “ 2n ´ 1.

On the other hand, taking (1) modulo 2n , we find

2k1 ` 2k2 ` ¨ ¨ ¨ ` 2kr ” ´N ” ´1 pmod 2n q.

Thus we must have 2k1 ` 2k2 ` ¨ ¨ ¨ ` 2kr “ 2n ´ 1, which is only possible if each element of
t0, 1, . . . , n ´ 1u occurs as one of the ki . This gives us

N “ n2n ´ p20 ` 21 ` ¨ ¨ ¨ ` 2n´1 q “ pn ´ 1q2n ` 1.

In particular, this means that pn ´ 2q2n ` 1 cannot be represented as a sum of elements of An .

Solution 2. The fact that m “ pn ´ 2q2n ` 1 cannot be represented as a sum of elements


of An can also be shown in other ways. We prove the following statement by induction on n:
Claim. If a, b are integers with a ě 0, b ě 1, and a ` b ă n, then a2n ` b cannot be written as
a sum of elements of An .
Proof. The claim is clearly true for n “ 2 (since a “ 0, b “ 1 is the only possibility). For
n ą 2, assume that there exist integers a, b with a ě 0, b ě 1 and a ` b ă n as well as elements
m1 , m2 , . . . , mr of An such that

a2n ` b “ m1 ` m2 ` ¨ ¨ ¨ ` mr .

We can suppose, without loss of generality, that m1 ě m2 ě ¨ ¨ ¨ ě mr . Let ℓ be the largest


index for which mℓ “ 2n ´ 1 (ℓ “ 0 if m1 ‰ 2n ´ 1). Clearly, ℓ and b must have the same parity.
Now
pa ´ ℓq2n ` pb ` ℓq “ mℓ`1 ` mℓ`2 ` ¨ ¨ ¨ ` mr
and thus
b`ℓ mℓ`1 mℓ`2 mr
pa ´ ℓq2n´1 ` “ ` ` ¨¨¨` .
2 2 2 2
Note that mℓ`1 {2, mℓ`2 {2, . . . , mr {2 are elements of An´1 . Moreover, a ´ ℓ and pb ` ℓq{2 are
integers, and pb ` ℓq{2 ě 1. If a ´ ℓ was negative, then we would have

a2n ` b ě ℓp2n ´ 1q ě pa ` 1qp2n ´ 1q “ a2n ` 2n ´ a ´ 1,

thus n ě a ` b ` 1 ě 2n , which is impossible. So a ´ ℓ ě 0. By the induction hypothesis, we


must have a ´ ℓ ` b`ℓ
2
ě n ´ 1, which gives us a contradiction, since

b`ℓ
a´ℓ` ď a ´ ℓ ` b ` ℓ ´ 1 “ a ` b ´ 1 ă n ´ 1. l
2

Considering the special case a “ n ´ 2, b “ 1 now completes the proof.


70 IMO 2014 South Africa

Solution 3. Denote by Bn the set of all positive integers that can be written as a sum of
elements of An . In this solution, we explicitly describe all the numbers in Bn by an argument
similar to the first solution.
For a positive integer n, we denote by σ2 pnq the sum of its digits in the binary representation.
Notice that every positive integer m has a unique representation of the form m “ s2n ´ t with
some positive integer s and 0 ď t ď 2n ´ 1.
Lemma. For any two integers s ě 1 and 0 ď t ď 2n ´ 1, the number m “ s2n ´ t belongs to Bn
if and only if s ě σ2 ptq.
Proof. For t “ 0, the statement of the Lemma is obvious, since m “ 2s ¨ p2n ´ 2n´1 q.
Now suppose that t ě 1, and let

t “ 2k1 ` ¨ ¨ ¨ ` 2kσ p0 ď k1 ă ¨ ¨ ¨ ă kσ ď n ´ 1, σ “ σ2 ptqq

be its binary expansion. If s ě σ, then m P Bn since


σ
ÿ
n n n n´1
m “ ps ´ σq2 ` pσ2 ´ tq “ 2ps ´ σq ¨ p2 ´ 2 q` p2n ´ 2ki q.
i“1

Assume now that there exist integers s and t with 1 ď s ă σ2 ptq and 0 ď t ď 2n ´ 1 such
that the number m “ s2n ´ t belongs to Bn . Among all such instances, choose the one for
which m is smallest, and let
d
ÿ
m“ p2n ´ 2ℓi q p0 ď ℓi ď n ´ 1q
i“1

be the corresponding representation. If all the ℓi ’s are distinct, then di“1 2ℓi ď j“0
řn´1 j
2 “ 2n ´1,
ř
řd ℓi
so one has s “ d and t “ i“1 2 , whence s “ d “ σ2 ptq; this is impossible. Therefore, two of
the ℓi ’s must be equal, say ℓd´1 “ ℓd . Then m ě 2p2n ´ 2ℓd q ě 2n , so s ě 2.
Now we claim that the number m1 “ m ´ 2n “ ps ´ 1q2n ´ t also belongs to Bn , which
contradicts the minimality assumption. Indeed, one has

p2n ´ 2ℓd´1 q ` p2n ´ 2ℓd q “ 2p2n ´ 2ℓd q “ 2n ` p2n ´ 2ℓd `1 q,

so
d´2
ÿ
1
m “ p2n ´ 2ℓi q ` p2n ´ 2ℓd `1 q
i“1

is the desired representation of m1 (if ℓd “ n ´ 1, then the last summand is simply omitted).
This contradiction finishes the proof. l
By our lemma, the largest number M which does not belong to Bn must have the form

mt “ pσ2 ptq ´ 1q2n ´ t

for some t with 1 ď t ď 2n ´ 1, so M is just the largest of these numbers. For t0 “ 2n ´ 1 we


have mt0 “ pn ´ 1q2n ´ p2n ´ 1q “ pn ´ 2q2n ` 1; for every other value of t one has σ2 ptq ď n ´ 1,
thus mt ď pσptq ´ 1q2n ď pn ´ 2q2n ă mt0 . This means that M “ mt0 “ pn ´ 2q2n ` 1.
Shortlisted problems – solutions 71

N2. Determine all pairs px, yq of positive integers such that


a
3
7x2 ´ 13xy ` 7y 2 “ |x ´ y| ` 1 . (1)
(U.S.A.)

Answer. Either px, yq “ p1, 1q or tx, yu “ tm3 ` m2 ´ 2m ´ 1, m3 ` 2m2 ´ m ´ 1u for some


positive integer m ě 2.
Solution. Let px, yq be any pair of positive integers solving (1). We shall prove that it appears
in the list displayed above. The converse assertion that all these pairs do actually satisfy (1)
either may be checked directly by means of a somewhat laborious calculation, or it can be seen
by going in reverse order through the displayed equations that follow.
In case x “ y the given equation reduces to x2{3 “ 1, which is equivalent to x “ 1, whereby
he have found the first solution.
To find the solutions with x ‰ y we may assume x ą y due to symmetry. Then the integer
n “ x ´ y is positive and (1) may be rewritten as
a
3
7py ` nq2 ´ 13py ` nqy ` 7y 2 “ n ` 1 .
Raising this to the third power and simplifying the result one obtains
y 2 ` yn “ n3 ´ 4n2 ` 3n ` 1 .
To complete the square on the left hand side, we multiply by 4 and add n2 , thus getting
p2y ` nq2 “ 4n3 ´ 15n2 ` 12n ` 4 “ pn ´ 2q2 p4n ` 1q .
This shows that the cases n “ 1 and n “ 2 are impossible, whence n ą 2, and 4n ` 1 is the
square of the rational number 2y`nn´2
. Consequently, it has to be a perfect square, and, since it
is odd as well, there has to exist some nonnegative integer m such that 4n ` 1 “ p2m ` 1q2 , i.e.
n “ m2 ` m .
Notice that n ą 2 entails m ě 2. Substituting the value of n just found into the previous
displayed equation we arrive at
p2y ` m2 ` mq2 “ pm2 ` m ´ 2q2 p2m ` 1q2 “ p2m3 ` 3m2 ´ 3m ´ 2q2 .
Extracting square roots and taking 2m3 ` 3m2 ´ 3m ´ 2 “ pm ´ 1qp2m2 ` 5m ` 2q ą 0 into
account we derive 2y ` m2 ` m “ 2m3 ` 3m2 ´ 3m ´ 2, which in turn yields
y “ m3 ` m2 ´ 2m ´ 1 .
Notice that m ě 2 implies that y “ pm3 ´ 1q ` pm ´ 2qm is indeed positive, as it should be. In
view of x “ y ` n “ y ` m2 ` m it also follows that
x “ m3 ` 2m2 ´ m ´ 1 ,
and that this integer is positive as well.

Comment. Alternatively one could ask to find all pairs px, yq of – not necessarily positive – integers
solving (1). The answer to that question is a bit nicer than the answer above: the set of solutions are
now described by
tx, yu “ tm3 ` m2 ´ 2m ´ 1, m3 ` 2m2 ´ m ´ 1u ,
where m varies through Z. This may be shown using essentially the same arguments as above. We
finally observe that the pair px, yq “ p1, 1q, that appears to be sporadic above, corresponds to m “ ´1.
72 IMO 2014 South Africa

N3. A coin is called a Cape Town coin if its value is 1{n for some positive integer n. Given
a collection of Cape Town coins of total value at most 99 ` 21 , prove that it is possible to split
this collection into at most 100 groups each of total value at most 1.
(Luxembourg)
Solution. We will show that for every positive integer N any collection of Cape Town coins
of total value at most N ´ 21 can be split into N groups each of total value at most 1. The
problem statement is a particular case for N “ 100.
We start with some preparations. If several given coins together have a total value also of
the form k1 for a positive integer k, then we may merge them into one new coin. Clearly, if the
resulting collection can be split in the required way then the initial collection can also be split.
After each such merging, the total number of coins decreases, thus at some moment we
come to a situation when no more merging is possible. At this moment, for every even k there
is at most one coin of value k1 (otherwise two such coins may be merged), and for every odd
k ą 1 there are at most k ´ 1 coins of value k1 (otherwise k such coins may also be merged).
Now, clearly, each coin of value 1 should form a single group; if there are d such coins then
we may remove them from the collection and replace N by N ´ d. So from now on we may
assume that there are no coins of value 1.
Finally, we may split all the coins in the following way. For each k “ 1, 2, . . . , N we put all
1 1
the coins of values 2k´1 and 2k into a group Gk ; the total value of Gk does not exceed

1 1
p2k ´ 2q ¨ ` ă 1.
2k ´ 1 2k
1
It remains to distribute the “small” coins of values which are less than 2N ; we will add them one
by one. In each step, take any remaining small coin. The total value of coins` in the˘ groups at
this moment is at most N ´ 21 , so there exists a group of total value at most N1 N ´ 12 “ 1 ´ 2N1
;
thus it is possible to put our small coin into this group. Acting so, we will finally distribute all
the coins.

Comment 1. The algorithm may be modified, at least the step where one distributes the coins of
1 1
values ě 2N . One different way is to put into Gk all the coins of values p2k´1q2s for all integer s ě 0.
One may easily see that their total value also does not exceed 1.

Comment 2. The original proposal also contained another part, suggesting to show that a required
splitting may be impossible if the total value of coins is at most 100. There are many examples of
such a collection, e.g. one may take 98 coins of value 1, one coin of value 21 , two coins of value 13 , and
four coins of value 51 .
The Problem Selection Committee thinks that this part is less suitable for the competition.
Shortlisted problems – solutions 73

N4. Let n ą 1 be a given integer. Prove that infinitely many terms of the sequence pak qkě1 ,
defined by
nk
Z ^
ak “ ,
k
are odd. (For a real number x, txu denotes the largest integer not exceeding x.)
(Hong Kong)
nm ´m
Solution 1. If n is odd, let k “ nm for m “ 1, 2, . . .. Then ak “ n , which is odd for
each m.
Henceforth, assume that n is even, say n “ 2t for some integer t ě 1. Then, for any m ě 2,
m m m
the integer n2 ´ 2m “ 2m p22 ´m ¨ t2 ´ 1q has an odd prime divisor p, since 2m ´ m ą 1. Then,
for k “ p ¨ 2m , we have
m
nk “ pn2 qp ” p2m qp “ p2p qm ” 2m ,
where the congruences are taken modulo p (recall that 2p ” 2 pmod pq, by Fermat’s little
nk
theorem). Also, from nk ´ 2m ă nk ă nk ` 2m pp ´ 1q, we see that the fraction lies strictly
k
nk ´ 2m nk ` 2m pp ´ 1q
between the consecutive integers and , which gives
p ¨ 2m p ¨ 2m
Z k^
n nk ´ 2m
“ .
k p ¨ 2m
n k
nk ´ 2m 2m
´1 nk
We finally observe that “ is an odd integer, since the integer ´ 1 is odd
p ¨ 2m p 2m
(recall that k ą m). Note that for different values of m, we get different values of k, due to the
different powers of 2 in the prime factorisation of k.

Solution 2. Treat the (trivial) case when n is odd as in Solution 1.


Now assume that n is even and n ą 2. Let p be a prime divisor of n ´ 1.
i
Proceed by induction on i to prove that pi`1 is a divisor of np ´ 1 for every i ě 0. The case
i “ 0 is true by the way in which p is chosen. Suppose the result is true for some i ě 0. The
factorisation
i`1 i i i i
np ´ 1 “ pnp ´ 1qrnp pp´1q ` np pp´2q ` ¨ ¨ ¨ ` np ` 1s,
together with the fact that each of the p terms between the square brackets is congruent to 1
modulo p, Zimplies that the result is also true for i ` 1.
i^ i
np np ´ 1
Hence “ , an odd integer for each i ě 1.
pi pi
i
Finally, we consider the case n “ 2. We observe that 3 ¨ 4i is a divisor of 23¨4 ´ 4i for every
i i
i ě 1: Trivially, 4i is a divisor of 23¨4 ´ 4i , since 3 ¨ 4i ą 2i. ZFurthermore, since 23¨4 and 4i are
i i i
23¨4 23¨4 ´ 4i 23¨4 ´2i ´ 1
^
ˇ 3¨4i i
both congruent to 1 modulo 3, we have 3 2 ´ 4 . Hence,
ˇ “ “ ,
3 ¨ 4i 3 ¨ 4i 3
which is odd for every i ě 1.

Comment. The case n even and n ą 2 can also be solved by recursively defining the sequence pki qiě1
by k1 “ 1 and ki`1 “ nki ´ 1 for i ě 1. Then pki q is strictly increasing and it follows (by induction
on i) that ki | nki ´ 1 for all i ě 1, so the ki are as desired.
The case n “ 2 can also be solved as follows: Let i ě 2. By Bertrand’s postulate, there exists a
i i
prime number p such that 22 ´1 ă p ¨ 2i ă 22 . This gives
i
p ¨ 2i ă 22 ă 2p ¨ 2i . (1)
74 IMO 2014 South Africa

i i
Also, we have that p ¨ 2i is a divisor of 2p¨2 ´ 22 , hence, using (1), we get that
i ^ i i i i
2p¨2 2p¨2 ´ 22 ` p ¨ 2i 2p¨2 ´i ´ 22 ´i ` p
Z
“ “ ,
p ¨ 2i p ¨ 2i p

which is an odd integer.


Solution 3. Treat the (trivial) case when n is odd as in Solution 1.
Let n be even, and let p be a prime divisor of n ` 1. Define the sequence pai qiě1 by

ai “ min a P Zą0 : 2i divides ap ` 1 .


(

Recall that there exists a with 1 ď a ă 2i such that ap ” ´1 pmod 2i q, so each ai satisfies
1 ď ai ă 2i . This implies that ai p ` 1 ă p ¨ 2i . Also, ai Ñ 8 as i Ñ 8, whence there are
infinitely many i such that ai ă ai`1 . From now on, we restrict ourselves only to these i.
i
Notice that p is a divisor of np ` 1, which, in turn, divides np¨2 ´Z1. It follows that p ¨ 2i is a
i i
np¨2 np¨2 ´ pai p ` 1q
^
p¨2i
divisor of n ´ pai p ` 1q, and we consequently see that the integer “
p ¨ 2i p ¨ 2i
i
is odd, since 2i`1 divides np¨2 , but not ai p ` 1.
Shortlisted problems – solutions 75

N5. Find all triples pp, x, yq consisting of a prime number p and two positive integers x and y
such that xp´1 ` y and x ` y p´1 are both powers of p.
(Belgium)
( (
Answer. pp, x, yq P p3, 2, 5q, p3, 5, 2q Y p2, n, 2k ´ nq | 0 ă n ă 2k .
Solution 1. For p “ 2, clearly all pairs of two positive integers x and y whose sum is a power
of 2 satisfy the condition. Thus we assume in the following that p ą 2, and we let a and b be
positive integers such that xp´1 ` y “ pa and x ` y p´1 “ pb . Assume further, without loss of
generality, that x ď y, so that pa “ xp´1 ` y ď x ` y p´1 “ pb , which means that a ď b (and
thus pa | pb ).
Now we have
pb “ y p´1 ` x “ ppa ´ xp´1 qp´1 ` x.
We take this equation modulo pa and take into account that p ´ 1 is even, which gives us
2
0 ” xpp´1q ` x pmod pa q.
2
If p | x, then pa | x, since xpp´1q ´1 ` 1 is not divisible by p in this case. However, this is
impossible, since x ď xp´1 ă pa . Thus we know that p ∤ x, which means that
2 ´1
pa | xpp´1q ` 1 “ xppp´2q ` 1.
2
By Fermat’s little theorem, xpp´1q ” 1 pmod pq, thus p divides x`1. Let pr be the highest
power of p that divides x ` 1. By the binomial theorem, we have
ppp´2q
ÿ ˆppp ´ 2q˙
ppp´2q
x “ p´1qppp´2q´k px ` 1qk .
k“0
k
Except for the terms corresponding to k “ 0, k “ 1 and k “ 2, all terms in the sum are clearly
divisible by p3r and thus by pr`2 . The remaining terms are
ppp ´ 2qpp2 ´ 2p ´ 1q
´ px ` 1q2 ,
2
which is divisible by p2r`1 and thus also by pr`2 ,
ppp ´ 2qpx ` 1q,
which is divisible by pr`1 , but not pr`2 by our choice of r, and the final term ´1 corresponding
to k “ 0. It follows that the highest power of p that divides xppp´2q ` 1 is pr`1 .
On the other hand, we already know that pa divides xppp´2q ` 1, which means that a ď r ` 1.
Moreover,
pr ď x ` 1 ď xp´1 ` y “ pa .
Hence we either have a “ r or a “ r ` 1.
If a “ r, then x “ y “ 1 needs to hold in the inequality above, which is impossible for
p ą 2. Thus a “ r ` 1. Now since pr ď x ` 1, we get
x2 ` x xp´1 ` y pa pa
x“ ď “ ď r “ p,
x`1 x`1 x`1 p
so we must have x “ p ´ 1 for p to divide x ` 1.
It follows that r “ 1 and a “ 2. If p ě 5, we obtain
pa “ xp´1 ` y ą pp ´ 1q4 “ pp2 ´ 2p ` 1q2 ą p3pq2 ą p2 “ pa ,
a contradiction. So the only case that remains is p “ 3, and indeed x “ 2 and y “ pa ´ xp´1 “ 5
satisfy the conditions.
76 IMO 2014 South Africa

Comment 1. In this solution, we are implicitly using a special case of the following lemma known
as “lifting the exponent”:
Lemma. Let n be a positive integer, let p be an odd prime, and let vp pmq denote the exponent of the
highest power of p that divides m.
If x and y are integers not divisible by p such that p | x ´ y, then we have

vp pxn ´ y n q “ vp px ´ yq ` vp pnq.

Likewise, if x and y are integers not divisible by p such that p | x ` y, then we have

vp pxn ` y n q “ vp px ` yq ` vp pnq.

Comment 2. There exist various ways of solving the problem involving the “lifting the exponent”
lemma. Let us sketch another one.
The cases x “ y and p | x are ruled out easily, so we assume that p ą 2, x ă y, and p ∤ x. In this
case we also have pa ă pb and p | x ` 1.
Now one has
y p ´ xp ” ypy p´1 ` xq ´ xpxp´1 ` yq ” 0 pmod pa q,
so by the lemma mentioned above one has pa´1 | y ´ x and hence y “ x ` tpa´1 for some positive
integer t. Thus one gets

xpxp´2 ` 1q “ xp´1 ` x “ pxp´1 ` yq ´ py ´ xq “ pa´1 pp ´ tq.

The factors on the left-hand side are coprime. So if p | x, then xp´2 ` 1 | p ´ t, which is impossible
since x ă xp´2 ` 1. Therefore, p ∤ x, and thus x | p ´ t. Since p | x ` 1, the only remaining case is
x “ p ´ 1, t “ 1, and y “ pa´1 ` p ´ 1. Now the solution can be completed in the same way as before.
Solution 2. Again, we can focus on the case that p ą 2. If p | x, then also p | y. In this case,
let pk and pℓ be the highest powers of p that divide x and y respectively, and assume without
loss of generality that k ď ℓ. Then pk divides x ` y p´1 while pk`1 does not, but pk ă x ` y p´1,
which yields a contradiction. So x and y are not divisible by p. Fermat’s little theorem yields
0 ” xp´1 ` y ” 1 ` y pmod pq, so y ” ´1 pmod pq and for the same reason x ” ´1 pmod pq.
In particular, x, y ě p ´ 1 and thus xp´1 ` y ě 2pp ´ 1q ą p, so xp´1 ` y and y p´1 ` x are
both at least equal to p2 . Now we have

xp´1 ” ´y pmod p2 q and y p´1 ” ´x pmod p2 q.

These two congruences, together with the Euler–Fermat theorem, give us

1 ” xppp´1q ” p´yqp ” ´y p ” xy pmod p2 q.

Since x ” y ” ´1 pmod pq, x ´ y is divisible by p, so px ´ yq2 is divisible by p2 . This means


that
px ` yq2 “ px ´ yq2 ` 4xy ” 4 pmod p2 q,
so p2 divides px ` y ´ 2qpx ` y ` 2q. We already know that x ` y ” ´2 pmod pq, so x ` y ´ 2 ”
´4 ı 0 pmod pq. This means that p2 divides x ` y ` 2.
Using the same notation as in the first solution, we subtract the two original equations to
obtain
pb ´ pa “ y p´1 ´ xp´1 ` x ´ y “ py ´ xqpy p´2 ` y p´3x ` ¨ ¨ ¨ ` xp´2 ´ 1q. (1)
The second factor is symmetric in x and y, so it can be written as a polynomial of the elementary
symmetric polynomials x ` y and xy with integer coefficients. In particular, its value modulo
Shortlisted problems – solutions 77

p2 is characterised by the two congruences xy ” 1 pmod p2 q and x ` y ” ´2 pmod p2 q. Since


both congruences are satisfied when x “ y “ ´1, we must have

y p´2 ` y p´3x ` ¨ ¨ ¨ ` xp´2 ´ 1 ” p´1qp´2 ` p´1qp´3 p´1q ` ¨ ¨ ¨ ` p´1qp´2 ´ 1 pmod p2 q,

which simplifies to y p´2 ` y p´3x ` ¨ ¨ ¨ ` xp´2 ´ 1 ” ´p pmod p2 q. Thus the second factor in (1)
is divisible by p, but not p2 .
This means that pa´1 has to divide the other factor y ´ x. It follows that

0 ” xp´1 ` y ” xp´1 ` x ” xpx ` 1qpxp´3 ´ xp´4 ` ¨ ¨ ¨ ` 1q pmod pa´1 q.

Since x ” ´1 pmod pq, the last factor is xp´3 ´ xp´4 ` ¨ ¨ ¨ ` 1 ” p ´ 2 pmod pq and in particular
not divisible by p. We infer that pa´1 | x ` 1 and continue as in the first solution.

Comment. Instead of reasoning by means of elementary symmetric polynomials, it is possible to


provide a more direct argument as well. For odd r, px ` 1q2 divides pxr ` 1q2 , and since p divides
x ` 1, we deduce that p2 divides pxr ` 1q2 . Together with the fact that xy ” 1 pmod p2 q, we obtain

0 ” y r pxr ` 1q2 ” x2r y r ` 2xr y r ` y r ” xr ` 2 ` y r pmod p2 q.

We apply this congruence with r “ p ´ 2 ´ 2k (where 0 ď k ă pp ´ 2q{2) to find that

xk y p´2´k ` xp´2´k y k ” pxyqk pxp´2´2k ` y p´2´2k q ” 1k ¨ p´2q ” ´2 pmod p2 q.

Summing over all k yields


p´1
y p´2 ` y p´3 x ` ¨ ¨ ¨ ` xp´2 ´ 1 ” 2 ¨ p´2q ´ 1 ” ´p pmod p2 q

once again.
78 IMO 2014 South Africa

N6. Let a1 ă a2 ă ¨ ¨ ¨ ă an be pairwise coprime positive integers with a1 being prime


and a1 ě n ` 2. On the segment I “ r0, a1 a2 ¨ ¨ ¨ an s of the real line, mark all integers that are
divisible by at least one of the numbers a1 , . . . , an . These points split I into a number of smaller
segments. Prove that the sum of the squares of the lengths of these segments is divisible by a1 .
(Serbia)
Solution 1. Let A “ a1 ¨ ¨ ¨ an . Throughout the solution, all intervals will be nonempty and
have integer end-points. For any interval X, the length of X will be denoted by |X|.

Define the following two families of intervals:


(
S “ rx, ys : x ă y are consecutive marked points
(
T “ rx, ys : x ă y are integers, 0 ď x ď A ´ 1, and no point is marked in px, yq

|X|2 modulo a1 .
ř
We are interested in computing
XPS
Note that the number A is marked, so in the definition of T the condition y ď A is enforced
without explicitly prescribing it.

Assign weights to the intervals` in ˘T , depending only on their lengths. The weight of an
arbitrary interval Y P T will be w |Y | , where
#
1 if k “ 1,
wpkq “
2 if k ě 2 .

Consider an arbitrary interval X P S and its sub-intervals Y P T . Clearly, X has one


sub-interval of length |X|, two sub-intervals of length |X| ´ 1 and so on; in general X has
|X| ´ d ` 1 sub-intervals of length d for every d “ 1, 2, . . . , |X|. The sum of the weights of the
sub-intervals of X is

ÿ |X|
` ˘ ÿ
p|X| ´ d ` 1q ¨ wpdq “ |X| ¨ 1 ` p|X| ´ 1q ` p|X| ´ 2q ` ¨ ¨ ¨ ` 1 ¨ 2 “ |X|2 .
` ˘
w |Y | “
Y PT , Y ĎX d“1

Since the intervals in S are non-overlapping, every interval Y P T is a sub-interval of a single


interval X P S. Therefore,
˜ ¸
ÿ ÿ ÿ ÿ ` ˘
|X|2 “
` ˘
w |Y | “ w |Y | . (1)
XPS XPS Y PT , Y ĎX Y PT

For every d “ 1, 2, . . . , a1 , we count how many intervals in T are of length d. Notice that
the multiples of a1 are all marked, so the lengths of the intervals in S and T cannot exceed a1 .
Let x be an arbitrary integer with 0 ď x ď A ´ 1 and consider the interval rx, x ` ds. Let r1 ,
. . . , rn be the remainders of x modulo a1 , . . . , an , respectively. Since a1 , . . . , an are pairwise
coprime, the number x is uniquely identified by the sequence pr1 , . . . , rn q, due to the Chinese
remainder theorem.
For every i “ 1, . . . , n, the property that the interval px, x`dq does not contain any multiple
of ai is equivalent with ri ` d ď ai , i.e. ri P t0, 1, . . . , ai ´ du, so there are ai ´ d ` 1 choices for
the number ri for each i. Therefore, the number of the remainder sequences pr1 , . . . , rn q that
satisfy rx, x ` ds P T is precisely pa1 ` 1 ´ dq ¨ ¨ ¨ pan ` 1 ´ dq. Denote this product by f pdq.
Shortlisted problems – solutions 79

Now we can group the last sum in (1) by length of the intervals. As we have seen, for every
d “ 1, . . . , a1 there are f pdq intervals Y P T with |Y | “ d. Therefore, (1) can be continued as
ÿ ÿ a1 a1
2
` ˘ ÿ ÿ
|X| “ w |Y | “ f pdq ¨ wpdq “ 2 f pdq ´ f p1q. (2)
XPS Y PT d“1 d“1

Having the formula (2), the solution can be finished using the following well-known fact:
Lemma. If p is a prime, F pxq is a polynomial with integer coefficients, and deg F ď p ´ 2, then
řp
F pxq is divisible by p.
x“1
Proof. Obviously, it is sufficient to prove the lemma for monomials of the form xk with k ď p´2.
Apply induction on k. If k “ 0 then F “ 1, and the statement is trivial.
Let 1 ď k ď p ´ 2, and assume that the lemma is proved for all lower degrees. Then
p p
˜ ˙ ¸
k ˆ
ÿ ÿ ÿ k ` 1
0 ” pk`1 “ xk`1 ´ px ´ 1qk`1 “ p´1qk´ℓ xℓ
` ˘
x“1 x“1 ℓ“0

p k´1 ˆ ˙ÿ p p
k´ℓ k ` 1
ÿ ÿ ÿ
k ℓ
“ pk ` 1q x ` p´1q x ” pk ` 1q xk pmod pq.
x“1 ℓ“0
ℓ x“1 x“1

p
xk ” 0 pmod pq.
ř
Since 0 ă k ` 1 ă p, this proves l
x“1

a1
ř
In (2), by applying the lemma to the polynomial f and the prime a1 , we obtain that f pdq
d“1

ř a1 . 2The term f p1q “ a1 ¨ ¨ ¨ an is also divisible by a1 ; these two facts together


is divisible by
prove that |X| is divisible by a1 .
XPS

Comment 1. With suitable sets of weights, the same method can be used to sum up other expressions
ř of3the segments. For example, wp1q “ 1 and wpkq “ 6pk ´ 1q for k ě 2 can be used to
on the lengths
compute |X| and to prove that this sum is divisible by a1 if a1 is a prime with a1 ě n ` 3. See
XPS
also Comment 2 after the second solution.
Solution 2. The conventions from the first paragraph of the first solution are still in force.
We shall prove the following more general statement:

p‘q Let p denote a prime number, let p “ a1 ă a2 ă ¨ ¨ ¨ ă an be n pairwise


coprime positive integers, and let d be an integer with 1 ď d ď p ´ n. Mark all
integers that are divisible by at least one of the numbers a1 , . . . , an on the interval
I “ r0, a1a2 ¨ ¨ ¨ an s of the real line. These points split I into a number of smaller
k ` ˘
ř bi
segments, say of lengths b1 , . . . , bk . Then the sum d
is divisible by p.
i“1

Applying p‘q to d “ 1 and d “ 2 and using the equation x2 “ 2 x2 ` x1 , one easily gets
`˘ `˘

the statement of the problem.


To prove p‘q itself, we argue by induction
`p ˘ on n. The base case n “ 1 follows from the
known fact that the binomial coefficient d is divisible by p whenever 1 ď d ď p ´ 1.
Let us now assume that n ě 2, and that the statement is known whenever n ´ 1 rather
than n coprime integers are given together with some integer d P r1, p ´ n ` 1s. Suppose that
80 IMO 2014 South Africa

śn´1
the numbers p “ a1 ă a2 ă ¨ ¨ ¨ ă an and d are as above. Write A1 “ i“1 ai and A “ A1 an .
Mark the points on the real axis divisible by one of the numbers a1 , . . . , an´1 green and those
divisible by an red. The green points divide r0, A1 s into certain sub-intervals, say J1 , J2 , . . . ,
and Jℓ .
To translate intervals we use the notation ra, bs ` m “ ra ` m, b ` ms whenever a, b, m P Z.
For each i P t1, 2, . . . , ℓu let Fi be the family of intervals into which the red points partition
the intervals Ji , Ji ` A1 , . . . , and Ji ` pan ´ 1qA1 . We are to prove that
ℓ ÿ ˆ ˙
ÿ |X|
i“1 XPF
d
i

is divisible by p.
Let us fix any index i with 1 ď i ď ℓ for a while. Since the numbers A1 and an are coprime
by hypothesis, the numbers 0, A1 , . . . , pan ´ 1qA1 form a complete system of residues modulo an .
Moreover, we have |Ji | ď p ă an , as in particular all multiples of p are green. So each of the
intervals Ji , Ji ` A1 , . . . , and Ji ` pan ´ 1qA1 contains at most one red point. More precisely,
for each j P t1, . . . , |Ji | ´ 1u there is exactly one amongst those intervals containing a red point
splitting it into an interval of length j followed by an interval of length |Ji | ´ j, while the
remaining an ´ |Ji | ` 1 such intervals have no red points in their interiors. For these reasons
ÿ ˆ|X|˙ ˆˆ ˙
1
ˆ
|Ji | ´ 1
˙˙ ˆ ˙
|Ji |
“2 ` ¨¨¨` ` pan ´ |Ji | ` 1q
XPFi
d d d d
ˆ ˙ ˆ ˙ ˆ ˙
|Ji | |Ji | |Ji |
“2 ` pan ´ d ` 1q ´ pd ` 1q
d`1 d d`1
ˆ ˙ ˆ ˙
|Ji | |Ji |
“ p1 ´ dq ` pan ´ d ` 1q .
d`1 d

So it remains to prove that


ℓ ˆ ˙ ℓ ˆ ˙
ÿ |Ji | ÿ |Ji |
p1 ´ dq ` pan ´ d ` 1q
i“1
d`1 i“1
d

is divisible by p. By the induction hypothesis, however, it is even true that both summands
are divisible by p, for 1 ď d ă d ` 1 ď p ´ pn ´ 1q. This completes the proof of p‘q and hence
the solution of the problem.

Comment 2. `The ˘statement p‘q can also be proved by the method of the first solution, using the
weights wpxq “ x´2
d´2 .
Shortlisted problems – solutions 81

This page is intentionally left blank


82 IMO 2014 South Africa

N7. Let c ě 1 be an integer. Define a sequence of positive integers by a1 “ c and


an`1 “ a3n ´ 4c ¨ a2n ` 5c2 ¨ an ` c

for all n ě 1. Prove that for each integer n ě 2 there exists a prime number p dividing an but
none of the numbers a1 , . . . , an´1 .
(Austria)
Solution. Let us define x0 “ 0 and xn “ an {c for all integers n ě 1. It is easy to see that the
sequence pxn q thus obtained obeys the recursive law

xn`1 “ c2 px3n ´ 4x2n ` 5xn q ` 1 (1)

for all integers n ě 0. In particular, all of its terms are positive integers; notice that x1 “ 1
and x2 “ 2c2 ` 1. Since

xn`1 “ c2 xn pxn ´ 2q2 ` c2 xn ` 1 ą xn (2)

holds for all integers n ě 0, it is also strictly increasing. Since xn`1 is by (1) coprime to c for
any n ě 0, it suffices to prove that for each n ě 2 there exists a prime number p dividing xn
but none of the numbers x1 , . . . , xn´1 . Let us begin by establishing three preliminary claims.
Claim 1. If i ” j pmod mq holds for some integers i, j ě 0 and m ě 1, then xi ” xj pmod xm q
holds as well.
Proof. Evidently, it suffices to show xi`m ” xi pmod xm q for all integers i ě 0 and m ě 1. For
this purpose we may argue for fixed m by induction on i using x0 “ 0 in the base case i “ 0.
Now, if we have xi`m ” xi pmod xm q for some integer i, then the recursive equation (1) yields

xi`m`1 ” c2 px3i`m ´ 4x2i`m ` 5xi`m q ` 1 ” c2 px3i ´ 4x2i ` 5xi q ` 1 ” xi`1 pmod xm q ,

which completes the induction. l

Claim 2. If the integers i, j ě 2 and m ě 1 satisfy i ” j pmod mq, then xi ” xj pmod x2m q
holds as well.
Proof. Again it suffices to prove xi`m ” xi pmod x2m q for all integers i ě 2 and m ě 1. As
above, we proceed for fixed m by induction on i. The induction step is again easy using (1),
but this time the base case i “ 2 requires some calculation. Set L “ 5c2 . By (1) we have
xm`1 ” Lxm ` 1 pmod x2m q, and hence

x3m`1 ´ 4x2m`1 ` 5xm`1 ” pLxm ` 1q3 ´ 4pLxm ` 1q2 ` 5pLxm ` 1q


” p3Lxm ` 1q ´ 4p2Lxm ` 1q ` 5pLxm ` 1q ” 2 pmod x2m q ,

which in turn gives indeed xm`2 ” 2c2 ` 1 ” x2 pmod x2m q. l

Claim 3. For each integer n ě 2, we have xn ą x1 ¨ x2 ¨ ¨ ¨ xn´2 .


Proof. The cases n “ 2 and n “ 3 are clear. Arguing inductively, we assume now that
the claim holds for some n ě 3. Recall that x2 ě 3, so by monotonicity and (2) we get
xn ě x3 ě x2 px2 ´ 2q2 ` x2 ` 1 ě 7. It follows that

xn`1 ą x3n ´ 4x2n ` 5xn ą 7x2n ´ 4x2n ą x2n ą xn xn´1 ,

which by the induction hypothesis yields xn`1 ą x1 ¨ x2 ¨ ¨ ¨ xn´1 , as desired. l


Shortlisted problems – solutions 83

Now we direct our attention to the problem itself: let any integer n ě 2 be given. By Claim 3
there exists a prime number p appearing with a higher exponent in the prime factorisation of xn
than in the prime factorisation of x1 ¨ ¨ ¨ xn´2 . In particular, p | xn , and it suffices to prove that
p divides none of x1 , . . . , xn´1 .
Otherwise let k P t1, . . . , n ´ 1u be minimal such that p divides xk . Since xn´1 and xn are
coprime by (1) and x1 “ 1, we actually have 2 ď k ď n ´ 2. Write n “ qk ` r with some
integers q ě 0 and 0 ď r ă k. By Claim 1 we have xn ” xr pmod xk q, whence p | xr . Due to
the minimality of k this entails r “ 0, i.e. k | n.
Thus from Claim 2 we infer
xn ” xk pmod x2k q .
Now let α ě 1 be maximal with the property pα | xk . Then x2k is divisible by pα`1 and by our
choice of p so is xn . So by the previous congruence xk is a multiple of pα`1 as well, contrary to
our choice of α. This is the final contradiction concluding the solution.
84 IMO 2014 South Africa

N8. For every real number x, let }x} denote the distance between x and the nearest integer.
Prove that for every pair pa, bq of positive integers there exist an odd prime p and a positive
integer k satisfying › › › › › ›
› a › › b › ›a ` b›
› ›`› ›`›
› pk › › pk › › pk › “ 1. (1)

(Hungary)
1
ˇX ˇ
is an integer nearest to x, so }x} “ ˇ x ` 12 ´ xˇ. Thus we
X \ \
Solution. Notice first that x ` 2
have Z ^
1
x` “ x ˘ }x}. (2)
2
For every rational number r and every prime number p, denote by vp prq the exponent of p
in the prime factorisation of r. Recall the notation p2n ´ 1q!! for the product of all odd positive
integers not exceeding 2n ´ 1, i.e., p2n ´ 1q!! “ 1 ¨ 3 ¨ ¨ ¨ p2n ´ 1q.
Lemma. For every positive integer n and every odd prime p, we have
8 Z ^
` ˘ ÿ n 1
vp p2n ´ 1q!! “ ` .
k“1
pk 2

Proof. For every positive integer k, let us count the multiples of pk among the factors 1, 3, . . . ,
2n ´ 1. If ℓ is an arbitrary integer, the number p2ℓ ´ 1qpk is listed above if and only if
Z ^
k 1 n 1 n 1
0 ă p2ℓ ´ 1qp ď 2n ðñ ăℓď k ` ðñ 1 ď ℓ ď k ` .
2 p 2 p 2

Hence, the number of multiples of pk among the factors is precisely mk “ pnk ` 21 . Thus we
X \

obtain
n n vp p2i´1q 8 ÿmk 8 Z ^
` ˘ ÿ ÿ ÿ ÿ ÿ n 1
vp p2n ´ 1q!! “ vp p2i ´ 1q “ 1“ 1“ ` . l
i“1 i“1 k“1 k“1 ℓ“1 k“1
pk 2

In order to prove the problem statement, consider the rational number


p2a ` 2b ´ 1q!! p2a ` 1qp2a ` 3q ¨ ¨ ¨ p2a ` 2b ´ 1q
N“ “ .
p2a ´ 1q!! ¨ p2b ´ 1q!! 1 ¨ 3 ¨ ¨ ¨ p2b ´ 1q

Obviously, N ą 1, so there exists a prime p with vp pNq ą 0. Since N is a fraction of two odd
numbers, p is odd.
By our lemma,
8 ˆZ ^ Z ^ Z ^˙
ÿ a`b 1 a 1 b 1
0 ă vp pNq “ ` ´ k` ´ k` .
k“1
pk 2 p 2 p 2

Therefore, there exists some positive integer k such that the integer number
Z ^ Z ^ Z ^
a`b 1 a 1 b 1
dk “ ` ´ k` ´ k`
pk 2 p 2 p 2

is positive, so dk ě 1. By (2) we have


› › › › › › › › › › › ›
a`b a b ›a ` b› › a › › b › ›a ` b› › a › › b ›
1 ď dk “ k ´ k ´ k ˘ › k › ˘ › k › ˘ › k › “ ˘ › k ›› ˘ ›› k ›› ˘ ›› k ›› .
› › › › › › › (3)
p p p p p p p p p
Shortlisted problems – solutions 85

Since }x} ă 21 for every rational x with odd denominator, the relation (3) can only be satisfied
if all three signs on the right-hand side are positive and dk “ 1. Thus we get
› › › › › ›
› a › › b › ›a ` b›
› ›`› ›`›
› pk › › pk › › pk › “ dk “ 1,

as required.

Comment 1. There are various choices for the number N in the solution. Here we sketch such a
version.
Let x and y be two rational numbers with odd denominators. It is easy to see that the condi-
tion }x} ` }y} ` }x ` y} “ 1 is satisfied if and only if
either txu ă 21 , tyu ă 12 , tx ` yu ą 12 , or txu ą 21 , tyu ą 12 , tx ` yu ă 12 ,
where txu denotes the fractional part of x.
In the context of our problem, the first condition seems easier to deal with. Also, one may notice
that
txu ă 12 ðñ κpxq “ 0 and txu ě 12 ðñ κpxq “ 1, (4)
where
κpxq “ t2xu ´ 2txu.
Now it is natural to consider the number
ˆ ˙
2a ` 2b
a`b
M “ ˆ ˙ˆ ˙ ,
2a 2b
a b
since ˜ ˆ ˆ ˙¸
8 ˙ ˆ ˙
ÿ 2pa ` bq 2a 2b
vp pM q “ κ k
´κ k
´κ .
k“1
p p pk
One may see that M ą 1, and that v2 pM q ď 0. Thus, there exist an odd prime p and a positive
integer k with ˆ ˙ ˆ ˙ ˆ ˙
2pa ` bq 2a 2b
κ k
´κ k
´κ ą 0.
p p pk
In view of (4), the last inequality yields
" * " * " *
a 1 b 1 a`b 1
k
ă , k
ă , and ą , (5)
p 2 p 2 pk 2
which is what we wanted to obtain.

Comment 2. Once one tries to prove the existence of suitable p and k satisfying (5), it seems somehow
natural to suppose that a ď b and to add the restriction pk ą a. In this case the inequalities (5) can
be rewritten as
2a ă pk , 2mpk ă 2b ă p2m ` 1qpk , and p2m ` 1qpk ă 2pa ` bq ă p2m ` 2qpk
for some positive integer m. This means exactly that one of the numbers 2a ` 1, 2a ` 3, . . . , 2a ` 2b ´ 1
is divisible by some number of the form pk which is greater than 2a.
Using more advanced techniques, one can show that such a number pk exists even with k “ 1.
This was shown in 2004 by Laishram and Shorey; the methods used for this proof are elementary
but still quite involved. In fact, their result generalises a theorem by Sylvester which states that
for every pair of integers pn, kq with n ě k ě 1, the product pn ` 1qpn ` 2q ¨ ¨ ¨ pn ` kq is divisible by
some prime p ą k. We would like to mention here that Sylvester’s theorem itself does not seem to
suffice for solving the problem.
Shortlisted Problems with Solutions

56th International Mathematical Olympiad


Chiang Mai, Thailand, 4–16
Note of Confidentiality

The shortlisted problems should be kept


strictly confidential until IMO 2016.

Contributing Countries
The Organizing Committee and the Problem Selection Committee of IMO 2015 thank the
following 53 countries for contributing 155 problem proposals:
Albania, Algeria, Armenia, Australia, Austria, Brazil, Bulgaria,
Canada, Costa Rica, Croatia, Cyprus, Denmark, El Salvador,
Estonia, Finland, France, Georgia, Germany, Greece, Hong Kong,
Hungary, India, Iran, Ireland, Israel, Italy, Japan, Kazakhstan,
Lithuania, Luxembourg, Montenegro, Morocco, Netherlands,
Pakistan, Poland, Romania, Russia, Saudi Arabia, Serbia,
Singapore, Slovakia, Slovenia, South Africa, South Korea, Sweden,
Turkey, Turkmenistan, Taiwan, Tanzania, Ukraine, United Kingdom,
U.S.A., Uzbekistan

Problem Selection Committee

Dungjade Shiowattana, Ilya I. Bogdanov, Tirasan Khandhawit,


Wittawat Kositwattanarerk, Géza Kós, Weerachai Neeranartvong,
Nipun Pitimanaaree, Christian Reiher, Nat Sothanaphan,
Warut Suksompong, Wuttisak Trongsiriwat, Wijit Yangjit
Assistants: Jirawat Anunrojwong, Pakawut Jiradilok
Shortlisted problems 3

Problems
Algebra
A1. Suppose that a sequence a1 , a2 , . . . of positive real numbers satisfies
kak
ak`1 ě
a2k ` pk ´ 1q

for every positive integer k. Prove that a1 ` a2 ` ¨ ¨ ¨ ` an ě n for every n ě 2.


(Serbia)
A2. Determine all functions f : Z Ñ Z with the property that
` ˘ ` ˘
f x ´ f pyq “ f f pxq ´ f pyq ´ 1

holds for all x, y P Z.


(Croatia)
A3. Let n be a fixed positive integer. Find the maximum possible value of
ÿ
ps ´ r ´ nqxr xs ,
1ďrăsď2n

where ´1 ď xi ď 1 for all i “ 1, 2, . . . , 2n.


(Austria)
A4. Find all functions f : R Ñ R satisfying the equation
` ˘
f x ` f px ` yq ` f pxyq “ x ` f px ` yq ` yf pxq

for all real numbers x and y.


(Albania)
A5. Let 2Z ` 1 denote the set of odd integers. Find all functions f : Z Ñ 2Z ` 1 satisfying
` ˘ ` ˘
f x ` f pxq ` y ` f x ´ f pxq ´ y “ f px ` yq ` f px ´ yq
for every x, y P Z.
(U.S.A.)
A6. Let n be a fixed integer with n ě 2. We say that two polynomials P and Q with real
coefficients are block-similar if for each i P t1, 2, . . . , nu the sequences

P p2015iq, P p2015i ´ 1q, . . . , P p2015i ´ 2014q and


Qp2015iq, Qp2015i ´ 1q, . . . , Qp2015i ´ 2014q

are permutations of each other.


paq Prove that there exist distinct block-similar polynomials of degree n ` 1.
pbq Prove that there do not exist distinct block-similar polynomials of degree n.
(Canada)
4 IMO 2015 Thailand

Combinatorics
C1. In Lineland there are n ě 1 towns, arranged along a road running from left to right.
Each town has a left bulldozer (put to the left of the town and facing left) and a right bulldozer
(put to the right of the town and facing right). The sizes of the 2n bulldozers are distinct.
Every time when a right and a left bulldozer confront each other, the larger bulldozer pushes
the smaller one off the road. On the other hand, the bulldozers are quite unprotected at their
rears; so, if a bulldozer reaches the rear-end of another one, the first one pushes the second one
off the road, regardless of their sizes.
Let A and B be two towns, with B being to the right of A. We say that town A can sweep
town B away if the right bulldozer of A can move over to B pushing off all bulldozers it meets.
Similarly, B can sweep A away if the left bulldozer of B can move to A pushing off all bulldozers
of all towns on its way.
Prove that there is exactly one town which cannot be swept away by any other one.
(Estonia)
C2. Let V be a finite set of points in the plane. We say that V is balanced if for any two
distinct points A, B P V, there exists a point C P V such that AC “ BC. We say that V is
center-free if for any distinct points A, B, C P V, there does not exist a point P P V such that
P A “ P B “ P C.

(a) Show that for all n ě 3, there exists a balanced set consisting of n points.

(b) For which n ě 3 does there exist a balanced, center-free set consisting of n points?

(Netherlands)
C3. For a finite set A of positive integers, we call a partition of A into two disjoint nonempty
subsets A1 and A2 good if the least common multiple of the elements in A1 is equal to the
greatest common divisor of the elements in A2 . Determine the minimum value of n such that
there exists a set of n positive integers with exactly 2015 good partitions.
(Ukraine)
C4. Let n be a positive integer. Two players A and B play a game in which they take turns
choosing positive integers k ď n. The rules of the game are:

piq A player cannot choose a number that has been chosen by either player on any previous
turn.

piiq A player cannot choose a number consecutive to any of those the player has already chosen
on any previous turn.

piiiq The game is a draw if all numbers have been chosen; otherwise the player who cannot
choose a number anymore loses the game.

The player A takes the first turn. Determine the outcome of the game, assuming that both
players use optimal strategies.
(Finland)
Shortlisted problems 5

C5. Consider an infinite sequence a1 , a2 , . . . of positive integers with ai ď 2015 for all i ě 1.
Suppose that for any two distinct indices i and j we have i ` ai ‰ j ` aj .
Prove that there exist two positive integers b and N such that
ˇ ˇ
ˇ ÿn ˇ
pa ´ bq ˇ ď 10072
ˇ ˇ
ˇ i
ˇi“m`1 ˇ

whenever n ą m ě N.
(Australia)
C6. Let S be a nonempty set of positive integers. We say that a positive integer n is clean if
it has a unique representation as a sum of an odd number of distinct elements from S. Prove
that there exist infinitely many positive integers that are not clean.
(U.S.A.)
C7. In a company of people some pairs are enemies. A group of people is called unsociable
if the number of members in the group is odd and at least 3, and it is possible to arrange all
its members around a round table so that every two neighbors are enemies. Given that there
are at most 2015 unsociable groups, prove that it is possible to partition the company into 11
parts so that no two enemies are in the same part.
(Russia)
6 IMO 2015 Thailand

Geometry
G1. Let ABC be an acute triangle with orthocenter H. Let G be the point such that the
quadrilateral ABGH is a parallelogram. Let I be the point on the line GH such that AC
bisects HI. Suppose that the line AC intersects the circumcircle of the triangle GCI at C
and J. Prove that IJ “ AH.
(Australia)
G2. Let ABC be a triangle inscribed into a circle Ω with center O. A circle Γ with center A
meets the side BC at points D and E such that D lies between B and E. Moreover, let F and
G be the common points of Γ and Ω. We assume that F lies on the arc AB of Ω not containing
C, and G lies on the arc AC of Ω not containing B. The circumcircles of the triangles BDF
and CEG meet the sides AB and AC again at K and L, respectively. Suppose that the lines
F K and GL are distinct and intersect at X. Prove that the points A, X, and O are collinear.
(Greece)
G3. Let ABC be a triangle with =C “ 900, and let H be the foot of the altitude from C.
A point D is chosen inside the triangle CBH so that CH bisects AD. Let P be the intersection
point of the lines BD and CH. Let ω be the semicircle with diameter BD that meets the
segment CB at an interior point. A line through P is tangent to ω at Q. Prove that the
lines CQ and AD meet on ω.
(Georgia)
G4. Let ABC be an acute triangle, and let M be the midpoint of AC. A circle ω passing
through B and M meets the sides AB and BC again at P and Q, respectively. Let T be
the point such that the quadrilateral BP T Q is a parallelogram. Suppose that T lies on the
circumcircle of the triangle ABC. Determine all possible values of BT {BM.
(Russia)
G5. Let ABC be a triangle with CA ‰ CB. Let D, F , and G be the midpoints of the
sides AB, AC, and BC, respectively. A circle Γ passing through C and tangent to AB at D
meets the segments AF and BG at H and I, respectively. The points H 1 and I 1 are symmetric
to H and I about F and G, respectively. The line H 1 I 1 meets CD and F G at Q and M,
respectively. The line CM meets Γ again at P . Prove that CQ “ QP .
(El Salvador)
G6. Let ABC be an acute triangle with AB ą AC, and let Γ be its circumcircle. Let H,
M, and F be the orthocenter of the triangle, the midpoint of BC, and the foot of the altitude
from A, respectively. Let Q and K be the two points on Γ that satisfy =AQH “ 900 and
=QKH “ 900 . Prove that the circumcircles of the triangles KQH and KF M are tangent to
each other.
(Ukraine)
G7. Let ABCD be a convex quadrilateral, and let P , Q, R, and S be points on the sides
AB, BC, CD, and DA, respectively. Let the line segments P R and QS meet at O. Suppose
that each of the quadrilaterals AP OS, BQOP , CROQ, and DSOR has an incircle. Prove that
the lines AC, P Q, and RS are either concurrent or parallel to each other.
(Bulgaria)
G8. A triangulation of a convex polygon Π is a partitioning of Π into triangles by diagonals
having no common points other than the vertices of the polygon. We say that a triangulation
is a Thaiangulation if all triangles in it have the same area.
Prove that any two different Thaiangulations of a convex polygon Π differ by exactly two
triangles. (In other words, prove that it is possible to replace one pair of triangles in the first
Thaiangulation with a different pair of triangles so as to obtain the second Thaiangulation.)
(Bulgaria)
Shortlisted problems 7

Number Theory
N1. Determine all positive integers M for which the sequence a0 , a1 , a2 , . . ., defined by
2M `1
a0 “ 2
and ak`1 “ ak tak u for k “ 0, 1, 2, . . ., contains at least one integer term.
(Luxembourg)
N2. Let a and b be positive integers such that a!b! is a multiple of a! ` b!. Prove that
3a ě 2b ` 2.
(United Kingdom)
N3. Let m and n be positive integers such that m ą n. Define xk “ pm ` kq{pn ` kq for k “
1, 2, . . . , n ` 1. Prove that if all the numbers x1 , x2 , . . . , xn`1 are integers, then x1 x2 ¨ ¨ ¨ xn`1 ´ 1
is divisible by an odd prime.
(Austria)
N4. Suppose that a0 , a1 , . . . and b0 , b1 , . . . are two sequences of positive integers satisfying
a0 , b0 ě 2 and
an`1 “ gcdpan , bn q ` 1, bn`1 “ lcmpan , bn q ´ 1
for all n ě 0. Prove that the sequence (an ) is eventually periodic; in other words, there exist
integers N ě 0 and t ą 0 such that an`t “ an for all n ě N.
(France)
N5. Determine all triples pa, b, cq of positive integers for which ab ´ c, bc ´ a, and ca ´ b are
powers of 2.
Explanation: A power of 2 is an integer of the form 2n , where n denotes some nonnegative
integer.
(Serbia)
N6. Let Zą0 denote the set of positive integers. Consider a function f : Zą0 Ñ Zą0 . For
any m, n P Zą0 we write f n pmq “ looomooon
f pf p. . . f pmq . . .qq. Suppose that f has the following two
n
properties:
f n pmq ´ m
piq If m, n P Zą0 , then P Zą0 ;
n
piiq The set Zą0 z tf pnq | n P Zą0 u is finite.

Prove that the sequence f p1q ´ 1, f p2q ´ 2, f p3q ´ 3, . . . is periodic.


(Singapore)
N7. Let Zą0 denote the set of positive
` integers. For˘ any positive integer k, a function
f : Zą0 Ñ Zą0 is called k-good if gcd f pmq ` n, f pnq ` m ď k for all m ‰ n. Find all k such
that there exists a k-good function.
(Canada)
śk αi
N8. For every positive integer n with prime factorization n “ i“1 pi , define
ÿ
℧pnq “ αi .
i : pi ą10100

That is, ℧pnq is the number of prime factors of n greater than 10100 , counted with multiplicity.
Find all strictly increasing functions f : Z Ñ Z such that
` ˘
℧ f paq ´ f pbq ď ℧pa ´ bq for all integers a and b with a ą b.

(Brazil)
8 IMO 2015 Thailand

Solutions

Algebra
A1. Suppose that a sequence a1 , a2 , . . . of positive real numbers satisfies
kak
ak`1 ě (1)
a2k ` pk ´ 1q
for every positive integer k. Prove that a1 ` a2 ` ¨ ¨ ¨ ` an ě n for every n ě 2.
(Serbia)
Solution. From the constraint (1), it can be seen that

k a2k ` pk ´ 1q k´1
ď “ ak ` ,
ak`1 ak ak
and so
k´1
k
ak ě . ´
ak`1 ak
Summing up the above inequality for k “ 1, . . . , m, we obtain
ˆ ˙ ˆ ˙ ˆ ˙
1 0 2 1 m m´1 m
a1 ` a2 ` ¨ ¨ ¨ ` am ě ´ ` ´ ` ¨¨¨` ´ “ . (2)
a2 a1 a3 a2 am`1 am am`1

Now we prove the problem statement by induction on n. The case n “ 2 can be done by
applying (1) to k “ 1:
1
a1 ` a2 ě a1 ` ě 2.
a1
For the induction step, assume that the statement is true for some n ě 2. If an`1 ě 1, then
the induction hypothesis yields
` ˘
a1 ` ¨ ¨ ¨ ` an ` an`1 ě n ` 1. (3)

Otherwise, if an`1 ă 1 then apply (2) as


ˆ ˙
` ˘ n n´1 1
a1 ` ¨ ¨ ¨ ` an ` an`1 ě ` an`1 “ ` ` an`1 ą pn ´ 1q ` 2.
an`1 an`1 an`1
That completes the solution.

Comment 1. It can be seen easily that having equality in the statement requires a1 “ a2 “ 1 in the
base case n “ 2, and an`1 “ 1 in (3). So the equality a1 ` ¨ ¨ ¨ ` an “ n is possible only in the trivial
case a1 “ ¨ ¨ ¨ “ an “ 1.

Comment 2. After obtaining (2), there are many ways to complete the solution. We outline three
such possibilities.

• With defining sn “ a1 ` ¨ ¨ ¨ ` an , the induction step can be replaced by


n
sn`1 “ sn ` an`1 ě sn ` ě n ` 1,
sn
n
because the function x ÞÑ x ` increases on rn, 8q.
x
Shortlisted problems – solutions 9

• By applying the AM–GM inequality to the numbers a1 ` ¨ ¨ ¨ ` ak and kak`1 , we can conclude

a1 ` ¨ ¨ ¨ ` ak ` kak`1 ě 2k

and sum it up for k “ 1, . . . , n ´ 1.

• We can derive the symmetric estimate


n n
ÿ ÿ ÿ npn ´ 1q
ai aj “ pa1 ` ¨ ¨ ¨ ` aj´1 qaj ě pj ´ 1q “
1ďiăjďn j“2 j“2
2

and combine it with the AM–QM inequality.


10 IMO 2015 Thailand

A2. Determine all functions f : Z Ñ Z with the property that


` ˘ ` ˘
f x ´ f pyq “ f f pxq ´ f pyq ´ 1 (1)

holds for all x, y P Z.


(Croatia)

Answer. There are two such functions, namely the constant function x ÞÑ ´1 and the successor
function x ÞÑ x ` 1.
Solution 1. It is immediately checked that both functions mentioned in the answer are as
desired.
Now let f denote any function satisfying (1) for ` all˘ x, y P Z. Substituting x “ 0 and
y “ f p0q into (1) we learn that the number z “ ´f f p0q satisfies f pzq “ ´1. So by plugging
y “ z into (1) we deduce that
` ˘
f px ` 1q “ f f pxq (2)
holds for all x P Z. Thereby (1) simplifies to
` ˘
f x ´ f pyq “ f px ` 1q ´ f pyq ´ 1 . (3)

We now work towards showing that f is linear by contemplating the difference f px`1q´f pxq
for any x P Z. By applying (3) with y “ x and (2) in this order, we obtain
` ˘ ` ˘
f px ` 1q ´ f pxq “ f x ´ f pxq ` 1 “ f f px ´ 1 ´ f pxqq ` 1 .
` ˘
Since (3) shows f x ´ 1 ´ f pxq “ f pxq ´ f pxq ´ 1 “ ´1, this simplifies to

f px ` 1q “ f pxq ` A ,

where A “ f p´1q ` 1 is some absolute constant.


Now a standard induction in both directions reveals that f is indeed linear and that in fact
we have f pxq “ Ax ` B for all x P Z, where B “ f p0q. Substituting this into (2) we obtain
that
Ax ` pA ` Bq “ A2 x ` pAB ` Bq
holds for all x P Z; applying this to x “ 0 and x “ 1 we infer A ` B “ AB ` B and A2 “ A.
The second equation leads to A “ 0 or A “ 1. In case A “ 1, the first equation gives B “ 1,
meaning that f has to be the successor function. If A “ 0, then f is constant and (1) shows
that its constant value has to be ´1. Thereby the solution is complete.

Comment. After (2) and (3) have been obtained, there are several other ways to combine them so as
to obtain linearity properties of f . For instance, using (2) thrice in a row and then (3) with x “ f pyq
one may deduce that
` ˘ ` ` ˘˘ ` ˘
f py ` 2q “ f f py ` 1q “ f f f pyq “ f f pyq ` 1 “ f pyq ` f p0q ` 1

holds for all y P Z. It follows that f behaves linearly on the even numbers and on the odd numbers
separately, and moreover that the slopes of these two linear functions coincide. From this point, one
may complete the solution with some straightforward case analysis.
A different approach using the equations (2) and (3) will be presented in Solution 2. To show
that it is also possible to start in a completely different way, we will also present a third solution that
avoids these equations entirely.
Shortlisted problems – solutions 11

Solution 2. We commence by deriving (2) and (3) as in the first solution. Now provided that f
is injective, (2) tells us that f is the successor function. Thus we may assume from now on that
f is not injective, i.e., that there are two integers a ą b with f paq “ f pbq. A straightforward
induction using (2) in the induction step reveals that we have f pa ` nq “ f pb ` nq for all
nonnegative integers n. Consequently, the sequence γn “ f pb ` nq is periodic and thus in
particular bounded, which means that the numbers

ϕ “ min γn and ψ “ max γn


ně0 ně0

exist. ` ˘
Let us pick any integer y with f pyq “ ϕ and then an integer x ě a with f x ´ f pyq “ ϕ.
Due to the definition of ϕ and (3) we have
` ˘
ϕ ď f px ` 1q “ f x ´ f pyq ` f pyq ` 1 “ 2ϕ ` 1 ,

whence ϕ ě ´1. The same reasoning applied to ψ yields ψ ď ´1. Since ϕ ď ψ holds trivially,
it follows that ϕ “ ψ “ ´1, or in other words that we have f ptq “ ´1 for all integers t ě a.
Finally, if any integer y is given, we may find an integer x which is so large that x ` 1 ě a
and x ´ f pyq ě a hold. Due to (3) and the result from the previous paragraph we get
` ˘
f pyq “ f px ` 1q ´ f x ´ f pyq ´ 1 “ p´1q ´ p´1q ´ 1 “ ´1 .

Thereby the problem is solved.

Solution 3. Set d “ f p0q. By plugging x “ f pyq into (1) we obtain

f 3 pyq “ f pyq ` d ` 1 (4)


` ˘
for all y P Z, where
` the left-hand
˘ side abbreviates f f pf pyqq . When we replace x in (1) by
f pxq we obtain f f pxq ´ f pyq “ f 3 pxq ´ f pyq ´ 1 and as a consequence of (4) this simplifies to
` ˘
f f pxq ´ f pyq “ f pxq ´ f pyq ` d . (5)

Now we consider the set


E “ tf pxq ´ d | x P Zu .
Given two integers a and b from E, we may pick some integers x and y with f pxq “ a ` d
and f pyq “ b ` d; now (5) tells us that f pa ´ bq “ pa ´ bq ` d, which means that a ´ b itself
exemplifies a ´ b P E. Thus,

E is closed under taking differences. (6)

Also, the definitions of d and E yield 0 P E. If E “ t0u, then f is a constant function


and (1) implies that the only value attained by f is indeed ´1.
So let us henceforth suppose that E contains some number besides zero. It is known that in
this case (6) entails E to be the set of all integer multiples of some positive integer k. Indeed,
this holds for ˇ (
k “ min |x| ˇ x P E and x ‰ 0 ,
as one may verify by an argument based on division with remainder.
Thus we have
tf pxq | x P Zu “ tk ¨ t ` d | t P Zu . (7)
Due to (5) and (7) we get
f pk ¨ tq “ k ¨ t ` d
12 IMO 2015 Thailand

for all t P Z, whence in particular f pkq “ k ` d. So by comparing the results of substituting


y “ 0 and y “ k into (1) we learn that

f pz ` kq “ f pzq ` k (8)

holds for all integers z. In plain English, this means that on any residue class modulo k the
function f is linear with slope 1.
Now by (7) the set of all values
` attained
˘ by f is such a residue class. Hence, there exists an
absolute constant c such that f f pxq “ f pxq ` c holds for all x P Z. Thereby (1) simplifies to
` ˘
f x ´ f pyq “ f pxq ´ f pyq ` c ´ 1 . (9)

On the other hand, considering (1) modulo k we obtain d ” ´1 pmod kq because of (7). So
by (7) again, f attains the value ´1.
Thus we may apply (9) to some integer y with f pyq “ ´1, which gives f px ` 1q “ f pxq ` c.
So f is a linear function with slope c. Hence, (8) leads to c “ 1, wherefore there is an absolute
constant d1 with f pxq “ x`d1 for all x P Z. Using this for x “ 0 we obtain d1 “ d and finally (4)
discloses d “ 1, meaning that f is indeed the successor function.
Shortlisted problems – solutions 13

A3. Let n be a fixed positive integer. Find the maximum possible value of
ÿ
ps ´ r ´ nqxr xs ,
1ďrăsď2n

where ´1 ď xi ď 1 for all i “ 1, 2, . . . , 2n.


(Austria)
Answer. npn ´ 1q.
Solution 1. Let Z be the expression to be maximized. Since this expression is linear in every
variable xi and ´1 ď xi ď 1, the maximum of Z will be achieved when xi “ ´1 or 1. Therefore,
it suffices to consider only the case when xi P t´1, 1u for all i “ 1, 2, . . . , 2n.
For i “ 1, 2, . . . , 2n, we introduce auxiliary variables
i
ÿ 2n
ÿ
yi “ xr ´ xr .
r“1 r“i`1

Taking squares of both sides, we have


2n
ÿ ÿ ÿ ÿ
yi2 “ x2r ` 2xr xs ` 2xr xs ´ 2xr xs
r“1 răsďi iărăs rďiăs
ÿ ÿ ÿ
“ 2n ` 2xr xs ` 2xr xs ´ 2xr xs , (1)
răsďi iărăs rďiăs

where the last equality follows from the fact that xr P t´1, 1u. Notice that for every r ă s, the
coefficient of xr xs in (1) is 2 for each i “ 1, . . . , r ´1, s, . . . , 2n,
ř and2this coefficient is ´2 for each
i “ r, . . . , s ´ 1. This implies that the coefficient of xr xs in 2n i“1 yi is 2p2n ´ s ` rq ´ 2ps ´ rq “
4pn ´ s ` rq. Therefore, summing (1) for i “ 1, 2, . . . , 2n yields
2n
ÿ ÿ
yi2 “ 4n2 ` 4pn ´ s ` rqxr xs “ 4n2 ´ 4Z. (2)
i“1 1ďrăsď2n

Hence, it suffices to find the minimum of the left-hand side.


Since xr P t´1, 1u, we see that yi is an even integer. In addition, yi ´ yi´1 “ 2xi “ ˘2,
and so yi´1 and yi are consecutive even integers for every i “ 2, 3, . . . , 2n. It follows that
2
yi´1 ` yi2 ě 4, which implies
2n
ÿ n
ÿ
yi2 “
` 2 2
˘
y2j´1 ` y2j ě 4n. (3)
i“1 j“1

Combining (2) and (3), we get


2n
ÿ
4n ď yi2 “ 4n2 ´ 4Z. (4)
i“1

Hence, Z ď npn ´ 1q.


If we set xi “ 1 for odd indices i and xi “ ´1 for even indices i, then we obtain equality
in (3) (and thus in (4)). Therefore, the maximum possible value of Z is npn ´ 1q, as desired.
Comment 1. Z “ npn ´ 1q can be achieved by several other examples. In particular, xi needs not
be ˘1. For instance, setting xi “ p´1qi for all 2 ď i ď 2n, we find that the coefficient of x1 in Z is 0.
Therefore, x1 can be chosen arbitrarily in the interval r´1, 1s.
Nevertheless, if xi P t´1, 1u for all i “ 1, 2, . . . , 2n, then the equality Z “ npn ´ 1q holds only
when py1 , y2 , . . . , y2n q “ p0, ˘2, 0, ˘2,
ř.2n. . , 0, ˘2q or p˘2, 0, ˘2, 0, . . . , ˘2, 0q. In each case, we can
reconstruct xi accordingly. The sum i“1 xi in the optimal cases needs not be 0, but it must equal 0
or ˘2.
14 IMO 2015 Thailand

Comment 2. Several variations in setting up the auxiliary variables are possible. For instance, one
may let x2n`i “ ´xi and yi1 “ xi ` xi`1 ` ¨ ¨ ¨ ` xi`n´1 for any 1 ď i ď 2n. Similarly to Solution 1,
we obtain Y :“ y112 ` y212 ` ¨ ¨ ¨ ` y2n12 “ 2n2 ´ 2Z. Then, it suffices to show that Y ě 2n. If n is odd,

then each yi1 is odd, and so yi12 ě 1. If n is even, then each yi1 is even. We can check that at least one
of yi1 , yi`1
1 , y1 1 12 12 12 12
n`i , and yn`i`1 is nonzero, so that yi ` yi`1 ` yn`i ` yn`i`1 ě 4; summing these up for
i “ 1, 3, . . . , n ´ 1 yields Y ě 2n.

Solution 2. We present a different method of obtaining the bound Z ď npn ´ 1q. As in


the previous solution, we reduce the problem to the case xi P t´1, 1u. For brevity, we use the
notation r2ns “ t1, 2, . . . , 2nu.
Consider any x1 , x2 , . . . , x2n P t´1, 1u. Let

A “ ti P r2ns : xi “ 1u and B “ ti P r2ns : xi “ ´1u .

For any subsets X and Y of r2ns we define


ÿ
epX, Y q “ ps ´ r ´ nq .
răs, rPX, sPY

One may observe that


ÿ pn ´ 1qnp2n ´ 1q
epA, Aq`epA, Bq`epB, Aq`epB, Bq “ epr2ns, r2nsq “ ps´r´nq “ ´ .
1ďrăsď2n
3

Therefore, we have
` ˘ pn ´ 1qnp2n ´ 1q
Z “ epA, Aq ´ epA, Bq ´ epB, Aq ` epB, Bq “ 2 epA, Aq ` epB, Bq ` . (5)
3
Thus, we need to maximize epA, Aq ` epB, Bq, where A and B form a partition of r2ns.
Due to the symmetry, we may assume that |A| “ n ´ p and |B| “ n ` p, where 0 ď p ď n.
From now on, we fix the value of p and find an upper bound for Z in terms of n and p.
Let a1 ă a2 ă ¨ ¨ ¨ ă an´p and b1 ă b2 ă ¨ ¨ ¨ ă bn`p list all elements of A and B, respectively.
Then
n´p ˆ ˙
ÿ ÿ n´p
epA, Aq “ paj ´ ai ´ nq “ p2i ´ 1 ´ n ` pqai ´ ¨n (6)
1ďiăjďn´p i“1
2
and similarly
n`p ˙ ˆ
ÿ n`p
epB, Bq “ p2i ´ 1 ´ n ´ pqbi ´ ¨ n. (7)
i“1
2
Thus, now it suffices to maximize the value of
n´p
ÿ n`p
ÿ
M“ p2i ´ 1 ´ n ` pqai ` p2i ´ 1 ´ n ´ pqbi . (8)
i“1 i“1

In order to get an upper bound, we will apply the rearrangement inequality to the se-
quence a1 , a2 , . . . , an´p , b1 , b2 , . . . , bn`p (which is a permutation of 1, 2, . . . , 2n), together with
the sequence of coefficients of these numbers in (8). The coefficients of ai form the sequence

n ´ p ´ 1, n ´ p ´ 3, . . . , 1 ´ n ` p ,

and those of bi form the sequence

n ` p ´ 1, n ` p ´ 3, . . . , 1 ´ n ´ p .
Shortlisted problems – solutions 15

Altogether, these coefficients are, in descending order:


‚ n ` p ` 1 ´ 2i, for i “ 1, 2, . . . , p;
‚ n ´ p ` 1 ´ 2i, counted twice, for i “ 1, 2, . . . , n ´ p; and
‚ ´pn ` p ` 1 ´ 2iq, for i “ p, p ´ 1, . . . , 1.
Thus, the rearrangement inequality yields
p
ÿ
Mď pn ` p ` 1 ´ 2iqp2n ` 1 ´ iq
i“1
n´p
ÿ ` ˘
` pn ´ p ` 1 ´ 2iq p2n ` 2 ´ p ´ 2iq ` p2n ` 1 ´ p ´ 2iq
i“1
p
ÿ
´ pn ` p ` 1 ´ 2iqi . (9)
i“1

Finally, combining the information from (5), (6), (7), and (9), we obtain
ˆˆ ˙ ˆ ˙˙
pn ´ 1qnp2n ´ 1q n´p n`p
Zď ´ 2n `
3 2 2
p
ÿ n´p
ÿ
` 2 pn ` p ` 1 ´ 2iqp2n ` 1 ´ 2iq ` 2 pn ´ p ` 1 ´ 2iqp4n ´ 2p ` 3 ´ 4iq ,
i“1 i“1

which can be simplified to


2
Z ď npn ´ 1q ´ ppp ´ 1qpp ` 1q .
3
Since p is a nonnegative integer, this yields Z ď npn ´ 1q.
16 IMO 2015 Thailand

A4. Find all functions f : R Ñ R satisfying the equation


` ˘
f x ` f px ` yq ` f pxyq “ x ` f px ` yq ` yf pxq (1)
for all real numbers x and y.
(Albania)
Answer. There are two such functions, namely the identity function and x ÞÑ 2 ´ x.
Solution. Clearly, each of the functions x ÞÑ x and x ÞÑ 2 ´ x satisfies (1). It suffices now to
show that they are the only solutions to the problem.
Suppose that f is any function satisfying (1). Then setting y “ 1 in (1), we obtain
` ˘
f x ` f px ` 1q “ x ` f px ` 1q; (2)
in other words, x ` f px ` 1q is a fixed point of f for every x P R.
We distinguish two cases regarding the value of f p0q.
Case 1. f p0q ‰ 0.
By letting x “ 0 in (1), we have
` ˘
f f pyq ` f p0q “ f pyq ` yf p0q.
So, if y0 is a fixed point of f , then substituting y “ y0 in the above equation we get y0 “ 1.
Thus, it follows from (2) that x ` f px ` 1q “ 1 for all x P R. That is, f pxq “ 2 ´ x for all x P R.
Case 2. f p0q “ 0.
By letting y “ 0 and replacing x by x ` 1 in (1), we obtain
` ˘
f x ` f px ` 1q ` 1 “ x ` f px ` 1q ` 1. (3)
From (1), the substitution x “ 1 yields
` ˘
f 1 ` f py ` 1q ` f pyq “ 1 ` f py ` 1q ` yf p1q. (4)
By plugging x “ ´1 into (2), we see that f p´1q “ ´1. We then plug y “ ´1 into (4) and
deduce that f p1q “ 1. Hence, (4) reduces to
` ˘
f 1 ` f py ` 1q ` f pyq “ 1 ` f py ` 1q ` y. (5)
Accordingly, if both y0 and y0 ` 1 are fixed points of f , then so is y0 ` 2. Thus, it follows
from (2) and (3) that x ` f px ` 1q ` 2 is a fixed point of f for every x P R; i.e.,
` ˘
f x ` f px ` 1q ` 2 “ x ` f px ` 1q ` 2.
Replacing x by x ´ 2 simplifies the above equation to
` ˘
f x ` f px ´ 1q “ x ` f px ´ 1q.
On the other hand, we set y “ ´1 in (1) and get
` ˘
f x ` f px ´ 1q “ x ` f px ´ 1q ´ f pxq ´ f p´xq.
Therefore, f p´xq “ ´f pxq for all x P R.
Finally, we substitute px, yq by p´1, ´yq in (1) and use the fact that f p´1q “ ´1 to get
` ˘
f ´1 ` f p´y ´ 1q ` f pyq “ ´1 ` f p´y ´ 1q ` y.
Since f is an odd function, the above equation becomes
` ˘
´f 1 ` f py ` 1q ` f pyq “ ´1 ´ f py ` 1q ` y.
By adding this equation to (5), we conclude that f pyq “ y for all y P R.
Shortlisted problems – solutions 17

A5. Let 2Z ` 1 denote the set of odd integers. Find all functions f : Z Ñ 2Z ` 1 satisfying
` ˘ ` ˘
f x ` f pxq ` y ` f x ´ f pxq ´ y “ f px ` yq ` f px ´ yq (1)
for every x, y P Z.
(U.S.A.)

Answer. Fix an odd positive integer d, an integer k, and odd integers ℓ0 , ℓ1 , . . . , ℓd´1 . Then
the function defined as

f pmd ` iq “ 2kmd ` ℓi d pm P Z, i “ 0, 1, . . . , d ´ 1q

satisfies the problem requirements, and these are all such functions.
Solution. Throughout the solution, all functions are assumed to map integers to integers.
For any function g and any nonzero integer t, define

∆t gpxq “ gpx ` tq ´ gpxq.

For any nonzero integers a and b, notice that ∆a ∆b g “ ∆b ∆a g. Moreover, if ∆a g “ 0 and


∆b g “ 0, then ∆a`b g “ 0 and ∆at g “ 0 for all nonzero integers t. We say that g is t-quasi-
periodic if ∆t g is a constant function (in other words, if ∆1 ∆t g “ 0, or ∆1 g is t-periodic). In
this case, we call t a quasi-period of g. We say that g is quasi-periodic if it is t-quasi-periodic
for some nonzero integer t.
Notice that a quasi-period of g is a period of ∆1 g. So if g is quasi-periodic, then its minimal
positive quasi-period t divides all its quasi-periods.
We now assume that f satisfies (1). First, by setting a “ x ` y, the problem condition can
be rewritten as ` ˘
∆f pxq f paq “ ∆f pxq f 2x ´ a ´ f pxq for all x, a P Z. (2)
Let b be an arbitrary integer and let k be an arbitrary positive integer. Applying (2) when
a is substituted by b, b ` f pxq, . . . , b ` pk ´ 1qf pxq and summing up all these equations, we get
` ˘
∆kf pxq f pbq “ ∆kf pxq f 2x ´ b ´ kf pxq .

Notice that a similar argument works when k is negative, so that

∆M f pbq “ ∆M f p2x ´ b ´ Mq for any nonzero integer M such that f pxq | M. (3)

We now prove two lemmas.


Lemma 1. For any distinct integers x and y, the function ∆lcmpf pxq,f pyqq f is 2py ´ xq-periodic.
` ˘
Proof. Denote L “ lcm f pxq, f pyq . Applying (3) twice, we obtain
` ˘ ` ˘
∆L f pbq “ ∆L f p2x ´ b ´ Lq “ ∆L f 2y ´ pb ` 2py ´ xqq ´ L “ ∆L f b ` 2py ´ xq .

Thus, the function ∆L f is 2py ´ xq-periodic, as required. l

Lemma 2. Let g be a function. If t and s are nonzero integers such that ∆ts g “ 0 and
∆t ∆t g “ 0, then ∆t g “ 0.
Proof. Assume, without loss of generality, that s is positive. Let a be an arbitrary integer.
Since ∆t ∆t g “ 0, we have
` ˘
∆t gpaq “ ∆t gpa ` tq “ ¨ ¨ ¨ “ ∆t g a ` ps ´ 1qt .

The sum of these s equal numbers is ∆ts gpaq “ 0, so each of them is zero, as required. l
18 IMO 2015 Thailand

We now return to the solution.


Step 1. We prove that f is quasi-periodic.
` ˘
Let Q “ lcm f p0q, f p1q . Applying Lemma 1, we get that the function g “ ∆Q f is
2-periodic. In other words, the values of g are constant on even numbers and on odd numbers
separately. Moreover, setting M “ Q and x “ b “ 0 in (3), we get gp0q “ gp´Qq. Since 0 and
´Q have different parities, the value of g at even numbers is the same as that at odd numbers.
Thus, g is constant, which means that Q is a quasi-period of f .
Step 2. Denote the minimal positive quasi-period of f by T . We prove that T | f pxq for all
integers x.
Since an odd number Q is a quasi-period of f , the number T is also odd. Now suppose, to
the contrary, that there exist an odd prime p, a positive integer α, and` an integer˘ u` such that˘
α α
p | T but p ∤ f puq. Setting x “ u and y “ 0 in (1), we have 2f puq “ f u`f puq `f u´f puq ,
so pα does not divide the value of f at one of the points u ` f puq or u ´ f puq. Denote this point
by v. ` ˘
Let L “ lcm f puq, f pvq . Since |u ´ v| “ f puq, from Lemma 1 we get ` ∆2f puq˘∆L f “ 0.
Hence the function ∆L f is 2f puq-periodic as well as T -periodic, so it is gcd T, 2f puq -periodic,
or ∆gcdpT,2f puqq ∆L f “ 0. Similarly, observe that the function ∆gcdpT,2f puqq f is L-periodic as
well` as T -periodic,
˘ so we may conclude that ∆gcdpT,Lq ∆gcdpT,2f puqq f “ 0. Since pα ∤ L, both
gcd T, 2f puq and gcdpT, Lq divide T {p. We thus obtain ∆T {p ∆T {p f “ 0, which yields

∆T {p ∆T {p ∆1 f “ 0.

Since ∆T ∆1 f “ 0, we can apply Lemma 2 to the function ∆1 f , obtaining ∆T {p ∆1 f “ 0.


However, this means that f is pT {pq-quasi-periodic, contradicting the minimality of T . Our
claim is proved.
Step 3. We describe all functions f .
Let d be the greatest common divisor of all values of f . Then d is odd. By Step 2, d is a
quasi-period of f , so that ∆d f is constant. Since the value of ∆d f is even and divisible by d,
we may denote this constant by 2dk, where k is an integer. Next, for all i “ 0, 1, . . . , d ´ 1,
define ℓi “ f piq{d; notice that ℓi is odd. Then

f pmd ` iq “ ∆md f piq ` f piq “ 2kmd ` ℓi d for all m P Z and i “ 0, 1, . . . , d ´ 1.

This shows that all functions satisfying (1) are listed in the answer.
It remains to check that all such functions indeed satisfy (1). This is equivalent to check-
ing (2), which is true because for every integer x, the value of f pxq is divisible by d, so that
∆f pxq f is constant.

Comment. After obtaining Lemmas 1 and 2, it is possible to complete the steps in a different order.
Here we sketch an alternative approach.
For any function g and any nonzero integer t, we say that g is t-pseudo-periodic if ∆t ∆t g “ 0. In
this case, we call t a pseudo-period of g, and we say that g is pseudo-periodic.
Let us first prove a basic property: if a function g is pseudo-periodic, then its minimal positive
pseudo-period divides all its pseudo-periods. To establish this, it suffices to show that if t and s
are pseudo-periods of g with t ‰ s, then so is t ´ s. Indeed, suppose that ∆t ∆t g “ ∆s ∆s g “ 0.
Then ∆t ∆t ∆s g “ ∆ts ∆s g “ 0, so that ∆t ∆s g “ 0 by Lemma 2. Taking differences, we obtain
∆t ∆t´s g “ ∆s ∆t´s g “ 0, and thus ∆t´s ∆t´s g “ 0.
Now let f satisfy the problem condition. We will show that f is pseudo-periodic. When this is
done, we will let T 1 be the minimal pseudo-period of f , and show that T 1 divides 2f pxq for every
integer x, using arguments similar to Step 2 of the solution. Then we will come back to Step 1 by
showing that T 1 is also a quasi-period of f .
Shortlisted problems – solutions 19

First, Lemma 1 yields that ∆2py´xq ∆lcmpf pxq,f pyqq`f “ 0 for every distinct
˘ integers x and y. Hence
f is pseudo-periodic with pseudo-period Lx,y “ lcm 2py ´ xq, f pxq, f pyq .
We now show that T 1 | 2f pxq for every integer x. Suppose, to the contrary, that there exists an
integer u, a prime p, and a positive integer α such that pα | T 1 and pα ∤ 2f puq. Choose v as in Step 2 and
employ Lemma 1 to obtain ∆2f puq ∆lcmpf puq,f pvqq f “ 0. However, this implies that ∆T 1 {p ∆T 1 {p f “ 0, a
contradiction with the minimality of T 1 .
We now claim that ∆T 1 ∆2 f “ 0. Indeed, Lemma 1 implies that there exists an integer s such that
∆s ∆2 f “ 0. Hence ∆T 1 s ∆2 f “ ∆T 1 ∆T 1 ∆2 f “ 0, which allows us to conclude that ∆T 1 ∆2 f “ 0 by
Lemma 2. (The last two paragraphs are similar to Step 2 of the solution.)
Now, it is not difficult to finish the solution, though more work is needed to eliminate the factors
of 2 from the subscripts of ∆T 1 ∆2 f “ 0. Once this is done, we will obtain an odd quasi-period of f
that divides f pxq for all integers x. Then we can complete the solution as in Step 3.
20 IMO 2015 Thailand

A6. Let n be a fixed integer with n ě 2. We say that two polynomials P and Q with real
coefficients are block-similar if for each i P t1, 2, . . . , nu the sequences

P p2015iq, P p2015i ´ 1q, . . . , P p2015i ´ 2014q and


Qp2015iq, Qp2015i ´ 1q, . . . , Qp2015i ´ 2014q

are permutations of each other.


paq Prove that there exist distinct block-similar polynomials of degree n ` 1.
pbq Prove that there do not exist distinct block-similar polynomials of degree n.
(Canada)
Solution 1. For convenience, we set k “ 2015 “ 2ℓ ` 1.

Part (a). Consider the following polynomials of degree n ` 1:


n
ź n
ź
P pxq “ px ´ ikq and Qpxq “ px ´ ik ´ 1q.
i“0 i“0

Since Qpxq “ P px ´ 1q and P p0q “ P pkq “ P p2kq “ ¨ ¨ ¨ “ P pnkq, these polynomials are
block-similar (and distinct).

řm (b). For every polynomial F pxq and every nonnegative integer m, define ΣF pmq “
Part
F piq; in particular, ΣF p0q “ 0. It is well-known that for every nonnegative integer d the
i“1 ř
sum m d
i“1 i is a polynomial in m of degree d ` 1. Thus ΣF may also be regarded as a real
polynomial of degree deg F ` 1 (with the exception that if F “ 0, then ΣF “ 0 as well). This
allows us to consider the values of ΣF at all real points (where the initial definition does not
apply).
Assume for the sake of contradiction that there exist two distinct block-similar polynomials
P pxq and Qpxq of degree n. Then both polynomials ΣP ´Q pxq and ΣP 2 ´Q2 pxq have roots at the
points 0, k, 2k, . . . , nk. This motivates the following lemma, where we use the special polynomial
n
ź
T pxq “ px ´ ikq.
i“0

Lemma. Assume that F pxq is a nonzero polynomial such that 0, k, 2k, . . . , nk are among the
roots of the polynomial ΣF pxq. Then deg F ě n, and there exists a polynomial Gpxq such that
deg G “ deg F ´ n and F pxq “ T pxqGpxq ´ T px ´ 1qGpx ´ 1q.
Proof. If deg F ă n, then ΣF pxq has at least n ` 1 roots, while its degree is less than n ` 1.
Therefore, ΣF pxq “ 0 and hence F pxq “ 0, which is impossible. Thus deg F ě n.
The lemma condition yields that ΣF pxq “ T pxqGpxq for some polynomial Gpxq such that
deg G “ deg ΣF ´ pn ` 1q “ deg F ´ n.
Now, let us define F1 pxq “ T pxqGpxq ´ T px ´ 1qGpx ´ 1q. Then for every positive integer n
we have
n
ÿ ` ˘
ΣF1 pnq “ T pxqGpxq ´ T px ´ 1qGpx ´ 1q “ T pnqGpnq ´ T p0qGp0q “ T pnqGpnq “ ΣF pnq,
i“1

so the polynomial ΣF ´F1 pxq “ ΣF pxq ´ ΣF1 pxq has infinitely many roots. This means that this
polynomial is zero, which in turn yields F pxq “ F1 pxq, as required. l
Shortlisted problems – solutions 21

First, we apply the lemma to the nonzero polynomial R1 pxq “ P pxq´Qpxq.` Since the degree˘
of R1 pxq is at most n, we conclude that it is exactly n. Moreover, R1 pxq “ α ¨ T pxq ´ T px ´ 1q
for some nonzero constant α.
Our next aim is to prove that the polynomial Spxq “ P pxq ` Qpxq is constant. Assume the
contrary. Then, notice that the polynomial R2 pxq “ P pxq2 ´Qpxq2 “ R1 pxqSpxq is also nonzero
and satisfies the lemma condition. Since n ă deg R1 ` deg S “ deg R2 ď 2n, the lemma yields

R2 pxq “ T pxqGpxq ´ T px ´ 1qGpx ´ 1q

with some polynomial Gpxq with 0 ă ` deg G ď n. ˘


Since the polynomial R1 pxq “ α T pxq ´ T px ´ 1q divides the polynomial
` ˘ ` ˘
R2 pxq “ T pxq Gpxq ´ Gpx ´ 1q ` Gpx ´ 1q T pxq ´ T px ´ 1q ,
` ˘
we get R1 pxq | T pxq Gpxq ´ Gpx ´ 1q . On the other hand,
` ˘ ` ˘ ` ˘
gcd T pxq, R1 pxq “ gcd T pxq, T pxq ´ T px ´ 1q “ gcd T pxq, T px ´ 1q “ 1,

since both T pxq and T px´1q are the products of linear polynomials, and their roots are distinct.
Thus R1 pxq | Gpxq ´ Gpx ´ 1q. However, this is impossible since Gpxq ´ Gpx ´ 1q is a nonzero
polynomial of degree less than n “ deg R1 .
Thus, our assumption` is wrong, ˘ and Spxq` is a constant polynomial, say Spxq “ β. Notice
that the polynomials 2P pxq ´ β {α and 2Qpxq ´ βq{α are also block-similar and distinct.
So we may replace the initial polynomials by these ones, thus obtaining two block-similar
polynomials P pxq and Qpxq with P pxq “ ´Qpxq “ T pxq ´ T px ´ 1q. It remains to show that
this is impossible.
For every i “ 1, 2 . . . , n, the values T pik ´ k ` 1q and T pik ´ 1q have the same sign. This
means that the values P pik ´ k ` 1q “ T pik ´ k ` 1q and P pikq “ ´T pik ´ 1q have opposite
signs, so P pxq has a root in each of the n segments rik ´ k ` 1, iks. Since deg P “ n, it must
have exactly one root in each of them.
Thus, the sequence P p1q, P p2q, . . . , P pkq should change sign exactly once. On the other
hand, since P pxq and ´P pxq are block-similar, this sequence must have as many positive terms
as negative ones. Since k “ 2ℓ ` 1 is odd, this shows that the middle term of the sequence
above must be zero, so P pℓ ` 1q “ 0, or T pℓ ` 1q “ T pℓq. However, this is not true since
n
ź n
ź
|T pℓ ` 1q| “ |ℓ ` 1| ¨ |ℓ| ¨ |ℓ ` 1 ´ ik| ă |ℓ| ¨ |ℓ ` 1| ¨ |ℓ ´ ik| “ |T pℓq| ,
i“2 i“2

where the strict inequality holds because n ě 2. We come to the final contradiction.

Comment 1. In the solution above, we used the fact that k ą 1 is odd. One can modify the
arguments of the last part in order to work for every (not necessarily odd) sufficiently large value of k;
namely, when k is even, one may show that the sequence P p1q, P p2q, . . . , P pkq has different numbers
of positive and negative terms.
On the other hand, the problem statement with k replaced by 2 is false, since the polynomials
P pxq “ T pxq ´ T px ´ 1q and Qpxq “ T px ´ 1q ´ T pxq are block-similar in this case, due to the fact that
P p2i ´ 1q “ ´P p2iq “ Qp2iq “ ´Qp2i ´ 1q “ T p2i ´ 1q for all i “ 1, 2, . . . , n. Thus, every complete
solution should use the relation k ą 2.
One may easily see that the condition n ě 2 is also substantial, since the polynomials x and
k ` 1 ´ x become block-similar if we set n “ 1.
It is easily seen from the solution that the result still holds if we assume that the polynomials have
degree at most n.
22 IMO 2015 Thailand

Solution 2. We provide an alternative argument for part pbq.


Assume again that there exist two distinct block-similar polynomials P pxq and Qpxq of
degree n.“ Let Rpxq “ P pxq
‰ ´ Qpxq and Spxq “ P pxq ` Qpxq. For brevity, we also ( denote the
segment pi ´ 1qk ` 1, ik by Ii , and the set pi ´ 1qk ` 1, pi ´ 1qk ` 2, . . . , ik of all integer
points in Ii by Zi .
Step 1. We prove that Rpxq has exactly one root in each segment Ii , i “ 1, 2, . . . , n, and all
these roots are simple.
Indeed, take any i P t1, 2, . . . , nu and choose some points p´ , p` P Zi so that
P pp´ q “ min P pxq and P pp` q “ max P pxq.
xPZi xPZi

Since the sequences of values of P and Q in Zi are permutations of each other, we have
Rpp´ q “ P pp´ q ´ Qpp´ q ď 0 and Rpp` q “ P pp` q ´ Qpp` q ě 0. Since Rpxq is continuous, there
exists at least one root of Rpxq between p´ and p` — thus in Ii .
So, Rpxq has at least one root in each of the n disjoint segments Ii with i “ 1, 2, . . . , n.
Since Rpxq is nonzero and its degree does not exceed n, it should have exactly one root in each
of these segments, and all these roots are simple, as required.
Step 2. We prove that Spxq is constant.
We start with the following claim.
` ˘ ` ˘
Claim. For every i “ 1, 2, . . . , n, the sequence of values S pi ´ 1qk ` 1 , S pi ´ 1qk ` 2 , . . . ,
Spikq cannot be strictly increasing.
`
Proof. Fix any i P t1, 2, . . . , nu. Due to the symmetry, we may assume that P ikq ď Qpikq.
Choose now p´ and p` as in Step 1. If we had P pp` q “ P pp´ q, then P would be constant
on Zi , so all the elements of Zi would be the roots of Rpxq, which is not the case. In particular,
we have p` ‰ p´ . If p´ ą p` , then Spp´ q “ P pp´ q ` Qpp´ q ď Qpp` q ` P pp` q “ Spp` q, so our
claim holds.
We now show that the remaining case p´ ă p` is impossible. Assume first that P pp` q ą
Qpp` q. Then, like in Step 1, we have Rpp´ q ď 0, Rpp` q ą 0, and Rpikq ď 0, so Rpxq has a root
in each of the intervals rp´ , p` q and pp` , iks. This contradicts the result of Step 1.
We are left only with the case p´ ă p` and P pp` q “ Qpp` q (thus p` is the unique root of
Rpxq in Ii ). If p` “ ik, then the values of Rpxq on Zi z tiku are all of the same sign, which
is absurd since their sum is zero. Finally, if p´ ă p` ă ik, then Rpp´ q and Rpikq are both
negative. This means that Rpxq should have an even number of roots in rp´ , iks, counted with
multiplicity. This also contradicts the result of Step 1. l
` ˘
` In a similar ˘ way, one may prove that for every i “ 1, 2, . . . , n, the sequence S pi ´ 1qk ` 1 ,
S pi ´ 1qk ` 2 , . . . , Spikq cannot be strictly decreasing. This means that the polynomial
∆Spxq “ Spxq ´ Spx ´ 1q attains at least one nonnegative (value, as well as at least one non-
positive value, on the set Zi (and even on Zi z pi ´ 1qk ` 1 ); so ∆S has a root in Ii .
Thus ∆S has at least n roots; however, its degree is less than n, so ∆S should be identically
zero. This shows that Spxq is a constant, say Spxq ” β.
Step 3. Notice that the polynomials P pxq ´ β{2 and Qpxq ´ β{2 are also block-similar and
distinct. So we may replace the initial polynomials by these ones, thus reaching P pxq “ ´Qpxq.
Then Rpxq “ 2P pxq, so P pxq has exactly one root in each of the segments Ii , i “ 1, 2, . . . , n.
On the other hand, P pxq and ´P pxq should attain the same number of positive values on Zi .
Since k is odd, this means that Zi contains exactly one root of P pxq; moreover, this root should
be at the center of Zi , because P pxq has the same number of positive and negative values on Zi .
Thus we have found all n roots of P pxq, so
n
ź
P pxq “ c px ´ ik ` ℓq for some c P R z t0u,
i“1
Shortlisted problems – solutions 23

where ℓ “ pk ´ 1q{2. It remains to notice that for every t P Z1 z t1u we have


n
ź n
ź
|P ptq| “ |c| ¨ |t ´ ℓ ´ 1| ¨ |t ´ ik ` ℓ| ă |c| ¨ ℓ ¨ |1 ´ ik ` ℓ| “ |P p1q|,
i“2 i“2

so P p1q ‰ ´P ptq for all t P Z1 . This shows that P pxq is not block-similar to ´P pxq. The final
contradiction.

Comment 2. One may merge Steps 1 and 2 in the following manner. As above, we set Rpxq “
P pxq ´ Qpxq and Spxq “ P pxq ` Qpxq.
We aim to prove that the polynomial Spxq “ 2P pxq ´ Rpxq “ 2Qpxq ` Rpxq is constant. Since the
degrees of Rpxq and Spxq do not exceed n, it suffices to show that the total number of roots of Rpxq
and ∆Spxq “ Spxq ´ Spx ´ 1q is at least 2n. For this purpose, we prove the following claim.
Claim. For every i “ 1, 2, . . . , n, either each of R and ∆S has a root in Ii , or R has at least two roots
in Ii .
Proof. Fix any i P t1, 2, . . . , nu. Let r P Zi be a point such that |Rprq| “ maxxPZi |Rpxq|; we may
assume that Rprq ą 0. Next, let p´ , q ` P Ii be some points such that P pp´ q “ minxPZi P pxq and
Qpq ` q “ maxxPZi Qpxq. Notice that P pp´ q ď Qprq ă P prq and Qpq ` q ě P prq ą Qprq, so r is different
from p´ and q ` .
Without loss of generality, we may assume that p´ ă r. Then we have Rpp´ q “ P pp´ q ´ Qpp´ q ď
0 ă Rprq, so Rpxq has a root in rp´ , rq. If q ` ą r, then, similarly, Rpq ` q ď 0 ă Rprq, and Rpxq also
has a root in pr, q ` s; so Rpxq has two roots in Ii , as required.
In the remaining case we have q ` ă r; it suffices now to show that in this case ∆S has a root in Ii .
Since P pp´ q ď Qprq and |Rpp´ q| ď Rprq, we have Spp´ q “ 2P pp´ q ´ Rpp´ q ď 2Qprq ` Rprq “ Sprq.
Similarly, we get Spq ` q “ 2Qpq ` q ` Rpq ` q ě 2P prq ´ Rprq “ Sprq. Therefore, the sequence of values
of S on Zi is neither strictly increasing nor strictly decreasing, which shows that ∆S has a root
in Ii . l
` ˘
Comment 3. After finding the relation P pxq ´ Qpxq “ α T pxq ´ T px ´ 1q from Solution 1, one
may also follow the approach presented in Solution 2. Knowledge of the difference of polynomials
may simplify some steps; e.g., it is clear now that P pxq ´ Qpxq has exactly one root in each of the
segments Ii .
24 IMO 2015 Thailand

Combinatorics
C1. In Lineland there are n ě 1 towns, arranged along a road running from left to right.
Each town has a left bulldozer (put to the left of the town and facing left) and a right bulldozer
(put to the right of the town and facing right). The sizes of the 2n bulldozers are distinct.
Every time when a right and a left bulldozer confront each other, the larger bulldozer pushes
the smaller one off the road. On the other hand, the bulldozers are quite unprotected at their
rears; so, if a bulldozer reaches the rear-end of another one, the first one pushes the second one
off the road, regardless of their sizes.
Let A and B be two towns, with B being to the right of A. We say that town A can sweep
town B away if the right bulldozer of A can move over to B pushing off all bulldozers it meets.
Similarly, B can sweep A away if the left bulldozer of B can move to A pushing off all bulldozers
of all towns on its way.
Prove that there is exactly one town which cannot be swept away by any other one.
(Estonia)
Solution 1. Let T1 , T2 , . . . , Tn be the towns enumerated from left to right. Observe first that,
if town Ti can sweep away town Tj , then Ti also can sweep away every town located between Ti
and Tj .

We prove the problem statement by strong induction on n. The base case n “ 1 is trivial.
For the induction step, we first observe that the left bulldozer in T1 and the right bulldozer
in Tn are completely useless, so we may forget them forever. Among the other 2n´2 bulldozers,
we choose the largest one. Without loss of generality, it is the right bulldozer of some town Tk
with k ă n.
Surely, with this large bulldozer Tk can sweep away all the towns to the right of it. Moreover,
none of these towns can sweep Tk away; so they also cannot sweep away any town to the left
of Tk . Thus, if we remove the towns Tk`1 , Tk`2, . . . , Tn , none of the remaining towns would
change its status of being (un)sweepable away by the others.
Applying the induction hypothesis to the remaining towns, we find a unique town among
T1 , T2 , . . . , Tk which cannot be swept away. By the above reasons, it is also the unique such
town in the initial situation. Thus the induction step is established.

Solution 2. We start with the same enumeration and the same observation as in Solution 1.
We also denote by ℓi and ri the sizes of the left and the right bulldozers belonging to Ti ,
respectively. One may easily see that no two towns Ti and Tj with i ă j can sweep each other
away, for this would yield ri ą ℓj ą ri .
Clearly, there is no town which can sweep Tn away from the right. Then we may choose the
leftmost town Tk which cannot be swept away from the right. One can observe now that no
town Ti with i ą k may sweep away some town Tj with j ă k, for otherwise Ti would be able
to sweep Tk away as well.
Now we prove two claims, showing together that Tk is the unique town which cannot be
swept away, and thus establishing the problem statement.
Claim 1. Tk also cannot be swept away from the left.
Proof. Let Tm be some town to the left of Tk . By the choice of Tk , town Tm can be swept
away from the right by some town Tp with p ą m. As we have already observed, p cannot be
greater than k. On the other hand, Tm cannot sweep Tp away, so a fortiori it cannot sweep Tk
away. l

Claim 2. Any town Tm with m ‰ k can be swept away by some other town.
Shortlisted problems – solutions 25

Proof. If m ă k, then Tm can be swept away from the right due to the choice of Tk . In the
remaining case we have m ą k.
Let Tp be a town among Tk , Tk`1, . . . , Tm´1 having the largest right bulldozer. We claim
that Tp can sweep Tm away. If this is not the case, then rp ă ℓq for some q with p ă q ď m. But
this means that ℓq is greater than all the numbers ri with k ď i ď m ´ 1, so Tq can sweep Tk
away. This contradicts the choice of Tk . l

Comment 1. One may employ the same ideas within the inductive approach. Here we sketch such
a solution.
Assume that the problem statement holds for the collection of towns T1 , T2 , . . . , Tn´1 , so that there
is a unique town Ti among them which cannot be swept away by any other of them. Thus we need
to prove that in the full collection T1 , T2 , . . . , Tn , exactly one of the towns Ti and Tn cannot be swept
away.
If Tn cannot sweep Ti away, then it remains to prove that Tn can be swept away by some other
town. This can be established as in the second paragraph of the proof of Claim 2.
If Tn can sweep Ti away, then it remains to show that Tn cannot be swept away by any other town.
Since Tn can sweep Ti away, it also can sweep all the towns Ti , Ti`1 , . . . , Tn´1 away, so Tn cannot be
swept away by any of those. On the other hand, none of the remaining towns T1 , T2 , . . . , Ti´1 can
sweep Ti away, so that they cannot sweep Tn away as well.

Comment 2. Here we sketch yet another inductive approach. Assume that n ą 1. Firstly, we find a
town which can be swept away by each of its neighbors (each town has two neighbors, except for the
bordering ones each of which has one); we call such town a loser. Such a town exists, because there
are n ´ 1 pairs of neighboring towns, and in each of them there is only one which can sweep the other
away; so there exists a town which is a winner in none of these pairs.
Notice that a loser can be swept away, but it cannot sweep any other town away (due to its
neighbors’ protection). Now we remove a loser, and suggest its left bulldozer to its right neighbor (if
it exists), and its right bulldozer to a left one (if it exists). Surely, a town accepts a suggestion if a
suggested bulldozer is larger than the town’s one of the same orientation.
Notice that suggested bulldozers are useless in attack (by the definition of a loser), but may serve
for defensive purposes. Moreover, each suggested bulldozer’s protection works for the same pairs of
remaining towns as before the removal.
By the induction hypothesis, the new configuration contains exactly one town which cannot be
swept away. The arguments above show that the initial one also satisfies this property.
Solution 3. We separately prove that piq there exists a town which cannot be swept away,
and that piiq there is at most one such town. We also make use of the two observations from
the previous solutions.
To prove piq, assume contrariwise that every town can be swept away. Let t1 be the leftmost
town; next, for every k “ 1, 2, . . . we inductively choose tk`1 to be some town which can sweep
tk away. Now we claim that for every k “ 1, 2, . . . , the town tk`1 is to the right of tk ; this leads
to the contradiction, since the number of towns is finite.
Induction on k. The base case k “ 1 is clear due to the choice of t1 . Assume now that for
all j with 1 ď j ă k, the town tj`1 is to the right of tj . Suppose that tk`1 is situated to the left
of tk ; then it lies between tj and tj`1 (possibly coinciding with tj ) for some j ă k. Therefore,
tk`1 can be swept away by tj`1 , which shows that it cannot sweep tj`1 away — so tk`1 also
cannot sweep tk away. This contradiction proves the induction step.
To prove piiq, we also argue indirectly and choose two towns A and B neither of which can
be swept away, with A being to the left of B. Consider the largest bulldozer b between them
(taking into consideration the right bulldozer of A and the left bulldozer of B). Without loss
of generality, b is a left bulldozer; then it is situated in some town to the right of A, and this
town may sweep A away since nothing prevents it from doing that. A contradiction.
26 IMO 2015 Thailand

Comment 3. The Problem Selection Committee decided to reformulate this problem. The original
formulation was as follows.

Let n be a positive integer. There are n cards in a deck, enumerated from bottom to top with
numbers 1, 2, . . . , n. For each i “ 1, 2, . . . , n, an even number ai is printed on the lower side and an
odd number bi is printed on the upper side of the ith card. We say that the ith card opens the j th card,
if i ă j and bi ă ak for every k “ i ` 1, i ` 2, . . . , j. Similarly, we say that the ith card closes the
j th card, if i ą j and ai ă bk for every k “ i ´ 1, i ´ 2, . . . , j. Prove that the deck contains exactly one
card which is neither opened nor closed by any other card.
Shortlisted problems – solutions 27

C2. Let V be a finite set of points in the plane. We say that V is balanced if for any two
distinct points A, B P V, there exists a point C P V such that AC “ BC. We say that V is
center-free if for any distinct points A, B, C P V, there does not exist a point P P V such that
P A “ P B “ P C.

(a) Show that for all n ě 3, there exists a balanced set consisting of n points.

(b) For which n ě 3 does there exist a balanced, center-free set consisting of n points?

(Netherlands)

Answer for part (b). All odd integers n ě 3.


Solution.
Part (a). Assume that n is odd. Consider a regular n-gon. Label the vertices of the n-gon
as A1 , A2 , . . . , An in counter-clockwise order, and set V “ tA1 , . . . , An u. We check that V is
balanced. For any two distinct vertices Ai and Aj , let k P t1, 2, . . . , nu be the solution of
2k ” i ` j pmod nq. Then, since k ´ i ” j ´ k pmod nq, we have Ai Ak “ Aj Ak , as required.
Now assume that n is even. Consider a regular p3n ´ 6q-gon, and let O be its circum-
center. Again, label its vertices as A1 , . . . , A3n´6 in counter-clockwise order, and choose V “
tO, A1 , A2 , . . . , An´1 u. We check that V is balanced. For any two distinct vertices Ai and Aj , we
always have OAi “ OAj . We now consider the vertices O and Ai . First note that the triangle
OAi An{2´1`i is equilateral for all i ď n2 . Hence, if i ď n2 , then we have OAn{2´1`i “ Ai An{2´1`i ;
otherwise, if i ą n2 , then we have OAi´n{2`1 “ Ai Ai´n{2`1 . This completes the proof.
An example of such a construction when n “ 10 is shown in Figure 1.

A3 B 2 B1

O A2

A1
B3
O
O
A1 A9
E
A2 A8 C
A3 A7
A4 A5 A6
D
Figure 1 Figure 2

Comment (a ). There are many ways to construct an example by placing equilateral triangles in a
circle. Here we present one general method.
Let O be the center of a circle and let A1 , B1 , . . . , Ak , Bk be distinct points on the circle such
that the triangle OAi Bi is equilateral for each i. Then V “ tO, A1 , B1 , . . . , Ak , Bk u is balanced. To
construct a set of even cardinality, put extra points C, D, E on the circle such that triangles OCD
and ODE are equilateral (see Figure 2). Then V “ tO, A1 , B1 , . . . , Ak , Bk , C, D, Eu is balanced.

Part (b). We now show that there exists a balanced, center-free set containing n points for
all odd n ě 3, and that one does not exist for any even n ě 3.
If n is odd, then let V be the set of vertices of a regular n-gon. We have shown in part (a)
that V is balanced. We claim that V is also center-free. Indeed, if P is a point such that
28 IMO 2015 Thailand

P A “ P B “ P C for some three distinct vertices A, B and C, then P is the circumcenter of


the n-gon, which is not contained in V.
Now suppose that V is a balanced, center-free set of even cardinality n. We will derive a
contradiction. For a pair of distinct points A, B P V, we say that a point C P V is associated
with the pair tA, Bu if AC “ BC. Since there are npn´1q pairs of points, there exists a point
P npn´1q L T n2
P P V which is associated with at least 2
n “ 2 pairs. Note that none of these n2 pairs
can contain P , so that the union of these n2 pairs consists of at most n ´ 1 points. Hence
there exist two such pairs that share a point. Let these two pairs be tA, Bu and tA, Cu. Then
P A “ P B “ P C, which is a contradiction.

Comment (b). We can rephrase the argument in graph theoretic terms as follows. Let V be a
balanced, center-free set consisting of n points. For any pair of distinct vertices A, B P V and for
any C P V such that AC “ BC, draw directed edges A Ñ C and B Ñ C. Then all pairs of vertices
generate altogether at least npn´1q directed edges; since the set is center-free, these edges are distinct.
So we must obtain a graph in which any two vertices are connected in both directions. Now, each
vertex has exactly n ´ 1 incoming edges, which means that n ´ 1 is even. Hence n is odd.
Shortlisted problems – solutions 29

C3. For a finite set A of positive integers, we call a partition of A into two disjoint nonempty
subsets A1 and A2 good if the least common multiple of the elements in A1 is equal to the
greatest common divisor of the elements in A2 . Determine the minimum value of n such that
there exists a set of n positive integers with exactly 2015 good partitions.
(Ukraine)

Answer. 3024.
Solution. Let A “ ta1 , a2 , . . . , an u, where a1 ă a2 ă ¨ ¨ ¨ ă an . For a finite nonempty set B
of positive integers, denote by lcm B and gcd B the least common multiple and the greatest
common divisor of the elements in B, respectively.
Consider any good partition pA1 , A2 q of A. By definition, lcm A1 “ d “ gcd A2 for some
positive integer d. For any ai P A1 and aj P A2 , we have ai ď d ď aj . Therefore, we have
A1 “ ta1 , a2 , . . . , ak u and A2 “ tak`1 , ak`2 , . . . , an u for some k with 1 ď k ă n. Hence, each
good partition is determined by an element ak , where 1 ď k ă n. We call such ak partitioning.
It is convenient now to define ℓk “ lcmpa1 , a2 , . . . , ak q and gk “ gcdpak`1 , ak`2 , . . . , an q for
1 ď k ď n ´ 1. So ak is partitioning exactly when ℓk “ gk .
We proceed by proving some properties of partitioning elements, using the following claim.
Claim. If ak´1 and ak are partitioning where 2 ď k ď n ´ 1, then gk´1 “ gk “ ak .
Proof. Assume that ak´1 and ak are partitioning. Since ℓk´1 “ gk´1 , we have ℓk´1 | ak .
Therefore, gk “ ℓk “ lcmpℓk´1 , ak q “ ak , and gk´1 “ gcdpak , gk q “ ak , as desired. l
Property 1. For every k “ 2, 3, . . . , n ´ 2, at least one of ak´1 , ak , and ak`1 is not partitioning.
Proof. Suppose, to the contrary, that all three numbers ak´1 , ak , and ak`1 are partitioning. The
claim yields that ak`1 “ gk “ ak , a contradiction. l
Property 2. The elements a1 and a2 cannot be simultaneously partitioning. Also, an´2 and
an´1 cannot be simultaneously partitioning
Proof. Assume that a1 and a2 are partitioning. By the claim, it follows that a2 “ g1 “ ℓ1 “
lcmpa1 q “ a1 , a contradiction.
Similarly, assume that an´2 and an´1 are partitioning. The claim yields that an´1 “ gn´1 “
gcdpan q “ an , a contradiction. l
Now let A be an n-element set with exactly 2015 good partitions. Clearly, we have
n ě 5. Using Property 2, we find that there is at most one partitioning
X n´5 \ element in each
of ta1 , a2 u and tan´2 , an´1 u. By Property 1, there are at least 3 non-partitioning elements
\ P 2pn´2q T
in ta3 , a4 , . . . , an´3 u. Therefore, there are at most pn ´ 1q ´ 2 ´ n´5
X
3
“ 3
partitioning
P 2pn´2q T
elements in A. Thus, 3
ě 2015, which implies that n ě 3024.
Finally, we show that there exists a set of 3024 positive integers with exactly 2015 parti-
tioning elements. Indeed, in the set A “ t2 ¨ 6i , 3 ¨ 6i , 6i`1 | 0 ď i ď 1007u, each element of the
form 3 ¨ 6i or 6i , except 61008 , is partitioning.
Therefore, the minimum possible value of n is 3024.

Comment. Here we will work out P theT general case when 2015 is replaced by an arbitrary positive
integer m. Note that the bound 2pn´2q 3 ě m obtained in the solution is, in fact, true for any positive
integers m and n. Using this bound, one can find that n ě 3m
P T
` 1.
P23m T
To show that the bound is sharp, one constructs a set of 2 ` 1 elements with exactly m good
partitions. Indeed, the minimum is attained on the set t6i , 2 ¨ 6i , 3 ¨ 6i | 0 ď i ď t ´ 1u Y t6t u for every
even m “ 2t, and t2 ¨ 6i , 3 ¨ 6i , 6i`1 | 0 ď i ď t ´ 1u for every odd m “ 2t ´ 1.
30 IMO 2015 Thailand

C4. Let n be a positive integer. Two players A and B play a game in which they take turns
choosing positive integers k ď n. The rules of the game are:

piq A player cannot choose a number that has been chosen by either player on any previous
turn.

piiq A player cannot choose a number consecutive to any of those the player has already chosen
on any previous turn.

piiiq The game is a draw if all numbers have been chosen; otherwise the player who cannot
choose a number anymore loses the game.

The player A takes the first turn. Determine the outcome of the game, assuming that both
players use optimal strategies.
(Finland)

Answer. The game ends in a draw when n “ 1, 2, 4, 6; otherwise B wins.


Solution. For brevity, we denote by rns the set t1, 2, . . . , nu.
Firstly, we show that B wins whenever n ‰ 1, 2, 4, 6. For this purpose, we provide a strategy
which guarantees that B can always make a move after A’s move, and also guarantees that the
game does not end in a draw.
We begin with an important observation.
Lemma. Suppose that B’s first pick is n and that A has made the k th move where k ě 2. Then
B can also make the k th move.
Proof. Let S be the set of the first k numbers chosen by A. Since S does not contain consecutive
integers, we see that the set rns z S consists of k “contiguous components” if 1 P S, and k ` 1
components otherwise. Since B has chosen only k ´ 1 numbers, there is at least one component
of rns z S consisting of numbers not yet picked by B. Hence, B can choose a number from this
component. l
We will now describe a winning strategy for B, when n ‰ 1, 2, 4, 6. By symmetry, we may
assume that A’s first choice is a number not exceeding n`1
2
. So B can pick the number n in
B’s first turn. We now consider two cases.
Case 1. n is odd and n ě 3. The only way the game ends in a draw is that A eventually picks
all the odd numbers from the set rns. However, B has already chosen n, so this cannot happen.
Thus B can continue to apply the lemma until A cannot make a move.
Case 2. n is even and n ě 8. Since B has picked n, the game is a draw only if A can
eventually choose all the odd numbers from the set rn ´ 1s. So B picks a number from the set
t1, 3, 5, . . . , n ´ 3u not already chosen by A, on B’s second move. This is possible since the set
consists of n´2 2
ě 3 numbers and A has chosen only 2 numbers. Hereafter B can apply the
lemma until A cannot make a move.
Hence, in both cases A loses.
We are left with the cases n “ 1, 2, 4, 6. The game is trivially a draw when n “ 1, 2. When
n “ 4, A has to first pick 1 to avoid losing. Similarly, B has to choose 4 as well. It then follows
that the game ends in a draw.
When n “ 6, B gets at least a draw by the lemma or by using a mirror strategy. On the
other hand, A may also get at least a draw in the following way. In the first turn, A chooses 1.
After B’s response by a number b, A finds a neighbor c of b which differs from 1 and 2, and
reserves c for A’s third move. Now, clearly A can make the second move by choosing a number
different from 1, 2, c ´ 1, c, c ` 1. Therefore A will not lose.
Shortlisted problems – solutions 31

Comment 1. We present some explicit winning strategies for B.


We start with the case n is odd and n ě 3. B starts by picking n in the first turn. On the kth move
for k ě 2, B chooses the number exactly 1 less than A’s kth pick. The only special case is when A’s
kth choice is 1. In this situation, A’s first pick was a number a ą 1 and B can respond by choosing
a ´ 1 on the kth move instead.
We now give an alternative winning strategy in the case n is even and n ě 8. We first present a
winning strategy for the case when A’s first pick is 1. We consider two cases depending on A’s second
move.
Case 1. A’s second pick is 3. Then B chooses n ´ 3 on the second move. On the kth move, B chooses
the number exactly 1 less than A’s kth pick except that B chooses 2 if A’s kth pick is n ´ 2 or n ´ 1.
Case 2. A’s second pick is a ą 3. Then B chooses a ´ 2 on the second move. Afterwards on the
kth move, B picks the number exactly 1 less than A’s kth pick.
One may easily see that this strategy guarantees B’s victory, when A’s first pick is 1.
The following claim shows how to extend the strategy to the general case.
Claim. Assume that B has an explicit strategy leading to a victory after A picks 1 on the first move.
Then B also has an explicit strategy leading to a victory after any first moves of A.
Proof. Let S be an optimal strategy of B after A picks 1 on the first move. Assume that A picks some
number a ą 1 on this move; we show how B can make use of S in order to win in this case.
In parallel to the real play, B starts an imaginary play. The positions in these plays differ by
flipping the segment r1, as; so, if a player chooses some number x in the real play, then the same player
chooses a number x or a ` 1 ´ x in the imaginary play, depending on whether x ą a or x ď a. Thus
A’s first pick in the imaginary play is 1.
Clearly, a number is chosen in the real play exactly if the corresponding number is chosen in the
imaginary one. Next, if an unchosen number is neighboring to one chosen by A in the imaginary play,
then the corresponding number also has this property in the real play, so A also cannot choose it.
One can easily see that a similar statement with real and imaginary plays interchanged holds for B
instead of A.
Thus, when A makes some move in the real play, B may imagine the corresponding legal move in
the imaginary one. Then B chooses the response according to S in the imaginary game and makes
the corresponding legal move in the real one. Acting so, B wins the imaginary game, thus B will also
win the real one. l

Hence, B has a winning strategy for all even n greater or equal to 8.


Notice that the claim can also be used to simplify the argument when n is odd.

Comment 2. One may also employ symmetry when n is odd. In particular, B could use a mirror
strategy. However, additional ideas are required to modify the strategy after A picks n`1
2 .
32 IMO 2015 Thailand

C5. Consider an infinite sequence a1 , a2 , . . . of positive integers with ai ď 2015 for all i ě 1.
Suppose that for any two distinct indices i and j we have i ` ai ‰ j ` aj .
Prove that there exist two positive integers b and N such that
ˇ ˇ
ˇ ÿn ˇ
pai ´ bqˇ ď 10072
ˇ ˇ
ˇ
ˇi“m`1 ˇ

whenever n ą m ě N.
(Australia)
Solution 1. We visualize the set of positive integers as a sequence of points. For each n we
draw an arrow emerging from n that points to n ` an ; so the length of this arrow is an . Due to
the condition that m ` am ‰ n ` an for m ‰ n, each positive integer receives at most one arrow.
There are some positive integers, such as 1, that receive no arrows; these will be referred to as
starting points in the sequel. When one starts at any of the starting points and keeps following
the arrows, one is led to an infinite path, called its ray, that visits a strictly increasing sequence
of positive integers. Since the length of any arrow is at most 2015, such a ray, say with starting
point s, meets every interval of the form rn, n ` 2014s with n ě s at least once.
Suppose for the sake of contradiction that there would be at least 2016 starting points.
Then we could take an integer n that is larger than the first 2016 starting points. But now the
interval rn, n ` 2014s must be met by at least 2016 rays in distinct points, which is absurd. We
have thereby shown that the number b of starting points satisfies 1 ď b ď 2015. Let N denote
any integer that is larger than all starting points. We contend that b and N are as required.
To see this, let any two integers m and n with n ą m ě N be given. The sum ni“m`1 ai
ř
gives the total length of the arrows emerging from m ` 1, . . . , n. Taken together, these arrows
form b subpaths of our rays, some of which may be empty. Now on each ray we look at
the first number that is larger than m; let x1 , . . . , xb denote these numbers, and let y1 , . . . , yb
enumerate in corresponding order the numbers defined similarly with respect to n. Then the
list of differences y1 ´ x1 , . . . , yb ´ xb consists of the lengths of these paths and possibly some
zeros corresponding to empty paths. Consequently, we obtain

n
ÿ b
ÿ
ai “ pyj ´ xj q ,
i“m`1 j“1

whence
n
ÿ b
ÿ b
ÿ
pai ´ bq “ pyj ´ nq ´ pxj ´ mq .
i“m`1 j“1 j“1

Now each of the b rays meets the interval rm ` 1, m ` 2015s at some point and thus x1 ´
m, . . . , xb ´ m are b distinct members of the set t1, 2, . . . , 2015u. Moreover, since m ` 1 is not a
starting point, it must belong to some ray; so 1 has to appear among these numbers, wherefore

b´1
ÿ b
ÿ b´1
ÿ
1` pj ` 1q ď pxj ´ mq ď 1 ` p2016 ´ b ` jq .
j“1 j“1 j“1

The same argument applied to n and y1 , . . . , yb yields

b´1
ÿ b
ÿ b´1
ÿ
1` pj ` 1q ď pyj ´ nq ď 1 ` p2016 ´ b ` jq .
j“1 j“1 j“1
Shortlisted problems – solutions 33

So altogether we get
ˇ ˇ
ˇ ÿn ˇ b´1
ˇ ÿ` ˘
pai ´ bqˇ ď p2016 ´ b ` jq ´ pj ` 1q “ pb ´ 1qp2015 ´ bq
ˇ
ˇ
ˇi“m`1 ˇ j“1
ˆ ˙2
pb ´ 1q ` p2015 ´ bq
ď “ 10072 ,
2

as desired.

Solution 2. Set sn “ n ` an for all positive integers n. By our assumptions, we have

n ` 1 ď sn ď n ` 2015

for all n P Zą0 . The members of the sequence s1 , s2 , . . . are distinct. We shall investigate the
set
M “ Zą0 z ts1 , s2 , . . .u .

Claim. At most 2015 numbers belong to M.


Proof. Otherwise let m1 ă m2 ă ¨ ¨ ¨ ă m2016 be any 2016 distinct elements from M. For
n “ m2016 we have

ts1 , . . . , sn u Y tm1 , . . . , m2016 u Ď t1, 2, . . . , n ` 2015u ,

where on the left-hand side we have a disjoint union containing altogether n ` 2016 elements.
But the set on the right-hand side has only n ` 2015 elements. This contradiction proves our
claim. l
Now we work towards proving that the positive integers b “ |M| and N “ maxpMq are as
required. Recall that we have just shown b ď 2015.
Let us consider any integer r ě N. As in the proof of the above claim, we see that

Br “ M Y ts1 , . . . , sr u (1)

is a subset of r1, r ` 2015s X Z with precisely b ` r elements. Due to the definitions of M and N,
we also know r1, r ` 1s X Z Ď Br . It follows that there is a set Cr Ď t1, 2, . . . , 2014u with
|Cr | “ b ´ 1 and ` ˘ ˇ (
Br “ r1, r ` 1s X Z Y r ` 1 ` x ˇ x P Cr . (2)
ř
For any finite set of integers J we denote theřsum of its elements by J. Now the equations (1)
and (2) give rise to two ways of computing Br and the comparison of both methods leads to

ÿ r
ÿ r
ÿ ÿ
M` si “ i ` bpr ` 1q ` Cr ,
i“1 i“1

or in other words to
ÿ r
ÿ ÿ
M` pai ´ bq “ b ` Cr . (3)
i“1

After this preparation, we consider any two integers m and n with n ą m ě N. Plugging
r “ n and r “ m into (3) and subtracting the estimates that result, we deduce
n
ÿ ÿ ÿ
pai ´ bq “ Cn ´ Cm .
i“m`1
34 IMO 2015 Thailand

Since Cn and Cm are subsets of t1, 2, . . . , 2014u with |Cn | “ |Cm | “ b ´ 1, it is clear that the
absolute value of the right-hand side of the above inequality attains its largest possible value if
either Cm “ t1, 2, . . . , b ´ 1u and Cn “ t2016 ´ b, . . . , 2014u, or the other way around. In these
two cases we have ˇÿ ÿ ˇ
ˇ Cn ´ Cm ˇ “ pb ´ 1qp2015 ´ bq ,
ˇ ˇ

so in the general case we find


ˇ ˇ
n ˆ ˙2
ˇ ÿ ˇ pb ´ 1q ` p2015 ´ bq
pai ´ bqˇ ď pb ´ 1qp2015 ´ bq ď “ 10072 ,
ˇ ˇ
2
ˇ
ˇi“m`1 ˇ

as desired.

Comment. The sets Cn may be visualized by means of the following process: Start with an empty
blackboard. For n ě 1, the following happens during the nth step. The number an gets written on
the blackboard, then all numbers currently on the blackboard are decreased by 1, and finally all zeros
that have arisen get swept away.
It is not hard to see that the numbers present on the blackboard after n steps are distinct and
form the set Cn . Moreover, it is possible to complete a solution based on this idea.
Shortlisted problems – solutions 35

C6. Let S be a nonempty set of positive integers. We say that a positive integer n is clean if
it has a unique representation as a sum of an odd number of distinct elements from S. Prove
that there exist infinitely many positive integers that are not clean.
(U.S.A.)
Solution 1. Define an odd (respectively, even) representation of n to be a representation of n
as a sum of an odd (respectively, even) number of distinct elements of S. Let Zą0 denote the
set of all positive integers.
Suppose, to the contrary, that there exist only finitely many positive integers that are not
clean. Therefore, there exists a positive integer N such that every integer n ą N has exactly
one odd representation.
Clearly, S is infinite. We now claim the following properties of odd and even representations.
Property 1. Any positive integer n has at most one odd and at most one even representation.
Proof. We first show that every integer n has at most one even representation. Since S is infinite,
there exists x P S such that x ą maxtn, Nu. Then, the number n ` x must be clean, and x does
not appear in any even representation of n. If n has more than one even representation, then
we obtain two distinct odd representations of n ` x by adding x to the even representations
of n, which is impossible. Therefore, n can have at most one even representation.
Similarly, there exist two distinct elements y, z P S such that y, z ą maxtn, Nu. If n has
more than one odd representation, then we obtain two distinct odd representations of n ` y ` z
by adding y and z to the odd representations of n. This is again a contradiction. l
Property 2. Fix s P S. Suppose that a number n ą N has no even representation. Then
n ` 2as has an even representation containing s for all integers a ě 1.
Proof. It is sufficient to prove the following statement: If n has no even representation without s,
then n`2s has an even representation containing s (and hence no even representation without s
by Property 1).
Notice that the odd representation of n ` s does not contain s; otherwise, we have an even
representation of n without s. Then, adding s to this odd representation of n ` s, we get that
n ` 2s has an even representation containing s, as desired. l
Property 3. Every sufficiently large integer has an even representation.
Proof. Fix any s P S, and let r be an arbitrary element in t1, 2, . . . , 2su. Then, Property 2
implies that the set Zr “ tr ` 2as : a ě 0u contains at most one number exceeding N with
no even representation. Therefore,ŤZr contains finitely many positive integers with no even
representation, and so does Zą0 “ 2s r“1 Zr . l
In view of Properties 1 and 3, we may assume that N is chosen such that every n ą N has
exactly one odd and exactly one even representation. In particular, each element s ą N of S
has an even representation.
Property 4. For any s, t P S with N ă s ă t, the even representation of t contains s.
Proof. Suppose the contrary. Then, s ` t has at least two odd representations: one obtained by
adding s to the even representation of t and one obtained by adding t to the even representation
of s. Since the latter does not contain s, these two odd representations of s ` t are distinct, a
contradiction. l
řn
Let s1 ă s2 ă ¨ ¨ ¨ be all the elements of S, and set σn “ i“1 si for each nonnegative
integer n. Fix an integer k such that sk ą N. Then, Property 4 implies that for every i ą k
the even representation of si contains all the numbers sk , sk`1, . . . , si´1 . Therefore,

si “ sk ` sk`1 ` ¨ ¨ ¨ ` si´1 ` Ri “ σi´1 ´ σk´1 ` Ri , (1)

where Ri is a sum of some of s1 , . . . , sk´1. In particular, 0 ď Ri ď s1 ` ¨ ¨ ¨ ` sk´1 “ σk´1 .


36 IMO 2015 Thailand

Let j0 be an integer satisfying j0 ą k and σj0 ą 2σk´1 . Then (1) shows that, for every j ą j0 ,
sj`1 ě σj ´ σk´1 ą σj {2. (2)
Next, let p ą j0 be an index such that Rp “ miniąj0 Ri . Then,
sp`1 “ sk ` sk`1 ` ¨ ¨ ¨ ` sp ` Rp`1 “ psp ´ Rp q ` sp ` Rp`1 ě 2sp .
Therefore, there is no element of S larger than sp but smaller than 2sp . It follows that the
even representation τ of 2sp does not contain any element larger than sp . On the other hand,
inequality (2) yields 2sp ą s1 ` ¨ ¨ ¨ ` sp´1, so τ must contain a term larger than sp´1 . Thus,
it must contain sp . After removing sp from τ , we have that sp has an odd representation not
containing sp , which contradicts Property 1 since sp itself also forms an odd representation
of sp .

Solution 2. We will also use Property 1 from Solution 1.


We first define some terminology and notations used in this solution. Let Zě0 denote the set
of all nonnegative integers. All sums mentioned are regarded as sums of distinct elements of S.
Moreover, a sum is called even or odd depending on the parity of the number of terms in it. All
closed or open intervals refer to sets of all integers inside them, e.g., ra,ř
bs “ tx P Z : a ď x ď bu.
Again, let s1 ă s2 ă ¨ ¨ ¨ be all elements of S, and denote σn “ ni“1 si for each positive
integer n. Let On (respectively, En ) be the set of numbers
Ť8 representable
Ť8 as an odd (respectively,
even) sum of elements of ts1 , . . . , sn u. Set E “ n“1 En and O “ n“1 On . We assume that
0 P En since 0 is representable as a sum of 0 terms.
We now proceed to our proof. Assume, to the contrary, that there exist only finitely
many positive integers that are not clean and denote the number of non-clean positive integers
by m ´ 1. Clearly, S is infinite. By Property 1 from Solution 1, every positive integer n has at
most one odd and at most one even representation.
Step 1. We estimate sn`1 and σn`1 .
ˇ ˇ
Upper bounds: Property 1 yields |On | “ |En | “ 2n´1 , so ˇr1, 2n´1 ` ms z On ˇ ě m. Hence,
there exists a clean integer xn P r1, 2n´1 ` ms z On . The definition of On then yields that the
odd representation of xn contains a term larger than sn . Therefore, sn`1 ď xn ď 2n´1 ` m for
every positive integer n. Moreover, since s1 is the smallest clean number, we get σ1 “ s1 ď m.
Then,
n`1
ÿ n`1
ÿ
σn`1 “ si ` s1 ď p2i´2 ` mq ` m “ 2n ´ 1 ` pn ` 1qm
i“2 i“2
for every positive integer n. Notice that this estimate also holds for n “ 0.
Lower bounds: Since On`1 Ď r1, σn`1s, we have σn`1 ě |On`1 | “ 2n for all positive integers n.
Then,
sn`1 “ σn`1 ´ σn ě 2n ´ p2n´1 ´ 1 ` nmq “ 2n´1 ` 1 ´ nm
for every positive integer n.
Combining the above inequalities, we have
2n´1 ` 1 ´ nm ď sn`1 ď 2n´1 ` m and 2n ď σn`1 ď 2n ´ 1 ` pn ` 1qm, (3)
for every positive integer n.
Step 2. We prove Property 3 from Solution 1.
For every integer x and set of integers Y , define x ˘ Y “ tx ˘ y : y P Y u.
In view of Property 1, we get
En`1 “ En \ psn`1 ` On q and On`1 “ On \ psn`1 ` En q,
where \ denotes the disjoint union operator. Notice also that sn`2 ě 2n ` 1 ´ pn ` 1qm ą
2n´1 ´ 1 ` nm ě σn for every sufficiently large n. We now claim the following.
Shortlisted problems – solutions 37

Claim 1. pσn ´ sn`1 , sn`2 ´ sn`1 q Ď En for every sufficiently large n.


Proof. For sufficiently large n, all elements of pσn , sn`2 q are clean. Clearly, the elements
of pσn , sn`2 q can be in neither On nor O z On`1 . So, pσn , sn`2q Ď On`1 z On “ sn`1 ` En ,
which yields the claim. l
Now, Claim 1 together with inequalities (3) implies that, for all sufficiently large n,

E Ě En Ě pσn ´ sn`1 , sn`2 ´ sn`1 q Ě 2nm, 2n´1 ´ pn ` 2qm .


` ˘

This easily yields that Zě0 z E is also finite. Since Zě0 z O is also finite, by Property 1, there
exists a positive integer N such that every integer n ą N has exactly one even and one odd
representation.
Step 3. We investigate the structures of En and On .
Suppose that z P E2n . Since z can be represented as an even sum using ts1 , s2 , . . . , s2n u, so
can its complement σ2n ´ z. Thus, we get E2n “ σ2n ´ E2n . Similarly, we have

E2n “ σ2n ´ E2n , O2n “ σ2n ´ O2n , E2n`1 “ σ2n`1 ´ O2n`1, O2n`1 “ σ2n`1 ´ E2n`1 . (4)

Claim 2. For every sufficiently large n, we have

r0, σn s Ě On Ě pN, σn ´ Nq and r0, σn s Ě En Ě pN, σn ´ Nq.

Proof. Clearly On , En Ď r0, σn s for every positive integer n. We now prove On , En Ě pN, σn ´Nq.
Taking n sufficiently large, we may assume that sn`1 ě 2n´1 `1´nm ą 21 p2n´1 ´1`nmq ě σn {2.
Therefore, the odd representation of every element of pN, σn {2s cannot contain a term larger
than sn . Thus, pN, σn {2s Ď On . Similarly, since sn`1 ` s1 ą σn {2, we also have pN, σn {2s Ď En .
Equations (4) then yield that, for sufficiently large n, the interval pN, σn ´ Nq is a subset of
both On and En , as desired. l
Step 4. We obtain a final contradiction.
Notice that 0 P Zě0 z O and 1 P Zě0 z E. Therefore, the sets Zě0 z O and Zě0 z E are
nonempty. Denote o “ maxpZě0 z Oq and e “ maxpZě0 z Eq. Observe also that e, o ď N.
Taking k sufficiently large, we may assume that σ2k ą 2N and that Claim 2 holds for
all n ě 2k. Due to (4) and Claim 2, we have that σ2k ´ e is the minimal number greater than N
which is not in E2k , i.e., σ2k ´ e “ s2k`1 ` s1 . Similarly,

σ2k ´ o “ s2k`1 , σ2k`1 ´ e “ s2k`2 , and σ2k`1 ´ o “ s2k`2 ` s1 .

Therefore, we have

s1 “ ps2k`1 ` s1 q ´ s2k`1 “ pσ2k ´ eq ´ pσ2k ´ oq “ o ´ e


“ pσ2k`1 ´ eq ´ pσ2k`1 ´ oq “ s2k`2 ´ ps2k`2 ` s1 q “ ´s1 ,

which is impossible since s1 ą 0.


38 IMO 2015 Thailand

C7. In a company of people some pairs are enemies. A group of people is called unsociable
if the number of members in the group is odd and at least 3, and it is possible to arrange all
its members around a round table so that every two neighbors are enemies. Given that there
are at most 2015 unsociable groups, prove that it is possible to partition the company into 11
parts so that no two enemies are in the same part.
(Russia)
Solution 1. Let G “ pV, Eq be a graph where V is the set of people in the company and E
is the set of the enemy pairs — the edges of the graph. In this language, partitioning into 11
disjoint enemy-free subsets means properly coloring the vertices of this graph with 11 colors.
We will prove the following more general statement.

Claim. Let G be a graph with chromatic number k ě 3. Then G contains at least 2k´1 ´ k
unsociable groups.
Recall that the chromatic number of G is the least k such that a proper coloring

V “ V1 \ ¨ ¨ ¨ \ Vk (1)

exists. In view of 211 ´ 12 ą 2015, the claim implies the problem statement.
Let G be a graph with chromatic number k. We say that a proper coloring (1) of G is
leximinimal, if the k-tuple p|V1 |, |V2 |, . . . , |Vk |q is lexicographically minimal; in other words, the
following conditions are satisfied: the number n1 “ |V1 | is minimal; the number n2 “ |V2 | is
minimal, subject to the previously chosen value of n1 ; . . . ; the number nk´1 “ |Vk´1 | is minimal,
subject to the previously chosen values of n1 , . . . , nk´2 .
The following lemma is the core of the proof.
Lemma 1. Suppose that G “ pV, Eq is a graph with odd chromatic number k ě 3, and let (1)
be one of its leximinimal colorings. Then G contains an odd cycle which visits all color classes
V1 , V2 , . . . , Vk .
Proof of Lemma 1. Let us call a cycle colorful if it visits all color classes.
Due to the definition of the chromatic number, V1 is nonempty. Choose an arbitrary vertex
v P V1 . We construct a colorful odd cycle that has only one vertex in V1 , and this vertex is v.
We draw a subgraph of G as follows. Place v in the center, and arrange the sets V2 , V3 , . . . , Vk
in counterclockwise circular order around it. For convenience, let Vk`1 “ V2 . We will draw
arrows to add direction to some edges of G, and mark the vertices these arrows point to. First
we draw arrows from v to all its neighbors in V2 , and mark all those neighbors. If some vertex
u P Vi with i P t2, 3, . . . , ku is already marked, we draw arrows from u to all its neighbors
in Vi`1 which are not marked yet, and we mark all of them. We proceed doing this as long as
it is possible. The process of marking is exemplified in Figure 1.
Notice that by the rules of our process, in the final state, marked vertices in Vi cannot have
unmarked neighbors in Vi`1 . Moreover, v is connected to all marked vertices by directed paths.
Now move each marked vertex to the next color class in circular order (see an example in
Figure 3). In view of the arguments above, the obtained coloring V1 \ W2 \ ¨ ¨ ¨ \ Wk is proper.
Notice that v has a neighbor w P W2 , because otherwise
` ˘ ` ˘
V1 z tvu \ W2 Y tvu \ W3 \ ¨ ¨ ¨ \ Wk

would be a proper coloring lexicographically smaller than (1). If w was unmarked, i.e., w was
an element of V2 , then it would be marked at the beginning of the process and thus moved
to V3 , which did not happen. Therefore, w is marked and w P Vk .
Shortlisted problems – solutions 39

V5 V4 W5 W4

w
w

v −→ v

w
w

V2 V3 W2 W3

Figure 1 Figure 2

Since w is marked, there exists a directed path from v to w. This path moves through the
sets V2 , . . . , Vk in circular order, so the number of edges in it is divisible by k ´ 1 and thus even.
Closing this path by the edge w Ñ v, we get a colorful odd cycle, as required. l
Proof of the claim. Let us choose a leximinimal coloring (1) of G. For every set C Ď t1, 2, . . . , ku
such that |C| is odd and greater than 1, we will provide an odd cycle visiting exactly those
color classes whose indices are listed in the set C. This property ensures that we have different
cycles for different choices of C, and it proves the claim because there are 2k´1 ´ k choices for
the set C. Ť
Let VC “ cPC Vc , and let GC be the induced subgraph of G on the vertex set VC . We
also have the induced coloring of VC with |C| colors; this coloring is of course proper. Notice
further that the induced coloring is leximinimal: if we had a lexicographically smaller coloring
pWc qcPC of GC , then these classes, together the original color classes Vi for i R C, would provide
a proper coloring which is lexicographically smaller than (1). Hence Lemma 1, applied to the
subgraph GC and its leximinimal coloring pVc qcPC , provides an odd cycle that visits exactly
those color classes that are listed in the set C. l

Solution 2. We provide a different proof of the claim from the previous solution.
We say that a graph is critical if deleting any vertex from the graph decreases the graph’s
chromatic number. Obviously every graph contains a critical induced subgraph with the same
chromatic number.
Lemma 2. Suppose that G “ pV, Eq is a critical graph with chromatic number k ě 3. Then
every vertex v of G is contained in at least 2k´2 ´ 1 unsociable groups.
Proof. For every set X Ď V , denote by npXq the number of neighbors of v in the set X.
Since G is critical, there exists a proper coloring of G z tvu with k ´ 1 colors, so there exists
a proper coloring V “ V1 \ V2 `\ ¨ ¨ ¨ \ Vk of G such that ˘ V1 “ tvu. Among such colorings,
take one for which the sequence npV2 q, npV3 q, . . . , npVk q is lexicographically minimal. Clearly,
npVi q ą 0 for every i “ 2, 3, . . . , k; otherwise V2 \ . . . \ Vi´1 \ pVi Y V1 q \ Vi`1 \ . . . Vk would
be a proper coloring of G with k ´ 1 colors.
We claim that for every C Ď t2, 3, . . . , ku with |C| ě 2 being even, G contains an unsociable
group so that the set of its members’ colors is precisely C Y t1u. Since the number of such
sets C is 2k´2 ´ 1, this proves the lemma. Denote the elements of C by c1 , . . . , c2ℓ in increasing
order. For brevity, let Ui “ Vci . Denote by Ni the set of neighbors of v in Ui .
40 IMO 2015 Thailand

We show that for every i “ 1, . . . , 2ℓ ´ 1 and x P Ni , the subgraph induced by Ui Y Ui`1


contains a path that connects x with another point in Ni`1 . For the sake of contradiction,
suppose that no such path exists. Let S be the set of vertices that lie in the connected component
of x in the subgraph induced by Ui Y Ui`1 , and let P “ Ui X S, and Q “ Ui`1 X S (see Figure 3).
Since x is separated from Ni`1 , the sets Q and Ni`1 are disjoint. So, if we re-color G by
replacing Ui and Ui`1 by pUi Y Qq z P and pUi`1 Y P q z Q, respectively, we obtain a proper
coloring such that npUi q “ npVci q is decreased` and only npUi`1 q “ npV ˘ ci`1 q is increased. That
contradicts the lexicographical minimality of npV2 q, npV3 q, . . . , npVk q .

Ui Ui+1

P Q

x Ni+1
Ni S

v
Figure 3

Next, we build a path through U1 , U2 , . . . , U2ℓ as follows. Let the starting point of the path
be an arbitrary vertex v1 in the set N1 . For i ď 2ℓ ´ 1, if the vertex vi P Ni is already defined,
connect vi to some vertex in Ni`1 in the subgraph induced by Ui Y Ui`1 , and add these edges to
the path. Denote the new endpoint of the path by vi`1 ; by the construction we have vi`1 P Ni`1
again, so the process can be continued. At the end we have a path that starts at v1 P N1 and
ends at some v2ℓ P N2ℓ . Moreover, all edges in this path connect vertices in neighboring classes:
if a vertex of the path lies in Ui , then the next vertex lies in Ui`1 or Ui´1 . Notice that the path
is not necessary simple, so take a minimal subpath of it. The minimal subpath is simple and
connects the same endpoints v1 and v2ℓ . The property that every edge steps to a neighboring
color class (i.e., from Ui to Ui`1 or Ui´1 ) is preserved. So the resulting path also visits all of
U1 , . . . , U2ℓ , and its length must be odd. Closing the path with the edges vv1 and v2ℓ v we obtain
the desired odd cycle (see Figure 4). l

U1 U2 U3 U2ℓ−1 U2ℓ

...
N1 N2 N3 N2ℓ−1 N2ℓ
v1 v2 v3 v2ℓ
v2ℓ−1

v
Figure 4

Now we prove the claim by induction on k ě 3. The base case k “ 3 holds by applying
Lemma 2 to a critical subgraph. For the induction step, let G0 be a critical k-chromatic sub-
graph of G, and let v be an arbitrary vertex of G0 . By Lemma 2, G0 has at least 2k´2 ´ 1
unsociable groups containing v. On the other hand, the graph G0 z tvu has chromatic num-
ber k ´ 1, so it contains at least 2k´2 ´ pk ´ 1q unsociable groups by the induction hypothesis.
Altogether, this gives 2k´2 ´ 1 ` 2k´2 ´ pk ´ 1q “ 2k´1 ´ k distinct unsociable groups in G0 (and
thus in G).
Shortlisted problems – solutions 41

Comment 1. The claim we proved is sharp. The complete graph with k vertices has chromatic
number k and contains exactly 2k´1 ´ k unsociable groups.

Comment 2. The proof of Lemma 2 works for odd values of |C| ě 3 as well. Hence, the second
solution shows the analogous statement that the number of even sized unsociable groups is at least
2k ´ 1 ´ k2 .
` ˘
42 IMO 2015 Thailand

This page is intentionally left blank


Shortlisted problems – solutions 43

Geometry
G1. Let ABC be an acute triangle with orthocenter H. Let G be the point such that the
quadrilateral ABGH is a parallelogram. Let I be the point on the line GH such that AC
bisects HI. Suppose that the line AC intersects the circumcircle of the triangle GCI at C
and J. Prove that IJ “ AH.
(Australia)
Solution 1. Since HG k AB and BG k AH, we have BG K BC and CH K GH. There-
fore, the quadrilateral BGCH is cyclic. Since H is the orthocenter of the triangle ABC, we
have =HAC “ 900 ´=ACB “ =CBH. Using that BGCH and CGJI are cyclic quadrilaterals,
we get
=CJI “ =CGH “ =CBH “ =HAC.
Let M be the intersection of AC and GH, and let D ‰ A be the point on the line AC such
that AH “ HD. Then =MJI “ =HAC “ =MDH.
Since =MJI “ =MDH, =IMJ “ =HMD, and IM “ MH, the triangles IMJ and
HMD are congruent, and thus IJ “ HD “ AH.

I M
G
H

A B
J

Comment. Instead of introducing the point D, one can complete the solution by using the law of
sines in the triangles IJM and AM H, yielding
IJ sin =IM J sin =AM H AH AH
“ “ “ “ .
IM sin =M JI sin =HAM MH IM

Solution 2. Obtain =CGH “ =HAC as in the previous solution. In the parallelogram


ABGH we have =BAH “ =HGB. It follows that
=HMC “ =BAC “ =BAH ` =HAC “ =HGB ` =CGH “ =CGB.
So the right triangles CMH and CGB are similar. Also, in the circumcircle of triangle GCI
we have similar triangles MIJ and MCG. Therefore,
IJ MI MH GB AH
“ “ “ “ .
CG MC MC GC CG
Hence IJ “ AH.
44 IMO 2015 Thailand

G2. Let ABC be a triangle inscribed into a circle Ω with center O. A circle Γ with center A
meets the side BC at points D and E such that D lies between B and E. Moreover, let F and
G be the common points of Γ and Ω. We assume that F lies on the arc AB of Ω not containing
C, and G lies on the arc AC of Ω not containing B. The circumcircles of the triangles BDF
and CEG meet the sides AB and AC again at K and L, respectively. Suppose that the lines
F K and GL are distinct and intersect at X. Prove that the points A, X, and O are collinear.
(Greece)
Solution 1. It suffices to prove that the lines F K and GL are symmetric about AO. Now
the segments AF and AG, being chords of Ω with the same length, are clearly symmetric with
respect to AO. Hence it is enough to show

=KF A “ =AGL . (1)

Let us denote the circumcircles of BDF and CEG by ωB and ωC , respectively. To prove (1),
we start from
=KF A “ =DF G ` =GF A ´ =DF K .
In view of the circles ωB , Γ, and Ω, this may be rewritten as

=KF A “ =CEG ` =GBA ´ =DBK “ =CEG ´ =CBG .

Due to the circles ωC and Ω, we obtain =KF A “ =CLG ´ =CAG “ =AGL. Thereby the
problem is solved.

A

X L
L
G
G

K
K
Γ ωC
F
F
O
B C
D
D E
E
ωB
Figure 1

Solution 2. Again, we denote the circumcircle of BDKF by ωB . In addition, we set α “


=BAC, ϕ “ =ABF , and ψ “ =EDA “ =AED (see Figure 2). Notice that AF “ AG entails
ϕ “ =GCA, so all three of α, ϕ, and ψ respect the “symmetry” between B and C of our
configuration. Again, we reduce our task to proving (1).
This time, we start from

2 =KF A “ 2p=DF A ´ =DF Kq .

Since the triangle AF D is isosceles, we have

=DF A “ =ADF “ =EDF ´ ψ “ =BF D ` =EBF ´ ψ .


Shortlisted problems – solutions 45

Moreover, because of the circle ωB we have =DF K “ =CBA. Altogether, this yields
` ˘
2 =KF A “ =DF A ` =BF D ` =EBF ´ ψ ´ 2=CBA ,

which simplifies to
2 =KF A “ =BF A ` ϕ ´ ψ ´ =CBA .
Now the quadrilateral AF BC is cyclic, so this entails 2 =KF A “ α ` ϕ ´ ψ.
Due to the “symmetry” between B and C alluded to above, this argument also shows that
2 =AGL “ α ` ϕ ´ ψ. This concludes the proof of (1).

A

Γ
K
K
F
F

ωB G
G
ϕ ϕ
ψ ψ
B C
DD EE
Figure 2

Comment 1. As the first solution shows, the assumption that A be the center of Γ may be weakened
to the following one: The center of Γ lies on the line OA. The second solution may be modified to
yield the same result.

Comment 2. It might be interesting to remark that =GDK “ 900 . To prove this, let G1 denote
the point on Γ diametrically opposite to G. Because of =KDF “ =KBF “ =AGF “ =G1 DF , the
points D, K, and G1 are collinear, which leads to the desired result. Notice that due to symmetry we
also have =LEF “ 900 .
Moreover, a standard argument shows that the triangles AGL and BGE are similar. By symmetry
again, also the triangles AF K and CDF are similar.
There are several ways to derive a solution from these facts. For instance, one may argue that

=KF A “ =BF A ´ =BF K “ =BF A ´ =EDG1 “ p1800 ´ =AGBq ´ p1800 ´ =G1 GEq
“ =AGE ´ =AGB “ =BGE “ =AGL .

Comment 3. The original proposal did not contain the point X in the assumption and asked instead
to prove that the lines F K, GL, and AO are concurrent. This differs from the version given above only
insofar as it also requires to show that these lines cannot be parallel. The Problem Selection Committee
removed this part from the problem intending to make it thus more suitable for the Olympiad.
For the sake of completeness, we would still like to sketch one possibility for proving F K ∦ AO here.
As the points K and O lie in the angular region =F AG, it suffices to check =KF A ` =F AO ă 1800 .
Multiplying by 2 and making use of the formulae from the second solution, we see that this is equivalent
to pα ` ϕ ´ ψq ` p1800 ´ 2ϕq ă 3600 , which in turn is an easy consequence of α ă 1800 .
46 IMO 2015 Thailand

G3. Let ABC be a triangle with =C “ 900, and let H be the foot of the altitude from C.
A point D is chosen inside the triangle CBH so that CH bisects AD. Let P be the intersection
point of the lines BD and CH. Let ω be the semicircle with diameter BD that meets the
segment CB at an interior point. A line through P is tangent to ω at Q. Prove that the
lines CQ and AD meet on ω.
(Georgia)
Solution 1. Let K be the projection of D onto AB; then AH “ HK (see Figure 1). Since
P H k DK, we have
PD HK AH
“ “ . (1)
PB HB HB
Let L be the projection of Q onto DB. Since P Q is tangent to ω and =DQB “ =BLQ “
900 , we have =P QD “ =QBP “ =DQL. Therefore, QD and QB are respectively the internal
and the external bisectors of =P QL. By the angle bisector theorem, we obtain
PD PQ PB
“ “ . (2)
DL QL BL
AH PD DL
The relations (1) and (2) yield“ “ . So, the spiral similarity τ centered at B
HB PB LB
and sending A to D maps H to L. Moreover, τ sends the semicircle with diameter AB passing
through C to ω. Due to CH K AB and QL K DB, it follows that τ pCq “ Q.
Hence, the triangles ABD and CBQ are similar, so =ADB “ =CQB. This means that the
lines AD and CQ meet at some point T , and this point satisfies =BDT “ =BQT . Therefore,
T lies on ω, as needed.
Γ
C C
Q Q′
T T

P ω P ω
D L D

A H K B A H K B
Figure 1 Figure 2

Comment 1. Since =BAD “ =BCQ, the point T lies also on the circumcircle of the triangle ABC.
Solution 2. Let Γ be the circumcircle of ABC, and let AD meet ω at T . Then =AT B “
=ACB “ 900 , so T lies on Γ as well. As in the previous solution, let K be the projection of D
onto AB; then AH “ HK (see Figure 2).
Our goal now is to prove that the points C, Q, and T are collinear. Let CT meet ω again
at Q1 . Then, it suffices to show that P Q1 is tangent to ω, or that =P Q1 D “ =Q1 BD.
Since the quadrilateral BDQ1 T is cyclic and the triangles AHC and KHC are congruent, we
have =Q1 BD “ =Q1 T D “ =CT A “ =CBA “ =ACH “ =HCK. Hence, the right triangles
1 HK Q1 D
CHK and BQ D are similar. This implies that “ , and thus HK ¨ BD “ CK ¨ Q1 D.
CK BD
PD HK
Notice that P H k DK; therefore, we have “ , and so P D ¨ BK “ HK ¨ BD.
BD BK
PD CK
Consequently, P D ¨ BK “ HK ¨ BD “ CK ¨ Q1 D, which yields 1 “ .
QD BK
Since =CKA “ =KAC “ =BDQ1 , the triangles CKB and P DQ1 are similar, so =P Q1 D “
=CBA “ =Q1 BD, as required.
Shortlisted problems – solutions 47

Comment 2. There exist several other ways to prove that P Q1 is tangent to ω. For instance, one
PD P Q1
may compute and in terms of AH and HB to verify that P Q12 “ P D ¨ P B, concluding that
PB PB
P Q1 is tangent to ω.
Another possible approach is the following. As in Solution 2, we introduce the points T and Q1
and mention that the triangles ABC and DBQ1 are similar (see Figure 3).
Let M be the midpoint of AD, and let L be the projection of Q1 onto AB. Construct E on the
line AB so that EP is parallel to AD. Projecting from P , we get pA, B; H, Eq “ pA, D; M, 8q “ ´1.
EA PD
Since “ , the point P is the image of E under the similarity transform mapping ABC
AB DB
to DBQ1 . Therefore, we have pD, B; L, P q “ pA, B; H, Eq “ ´1, which means that Q1 D and Q1 B are
respectively the internal and the external bisectors of =P Q1 L. This implies that P Q1 is tangent to ω,
as required.

C
Q′
T
P ω
M D L
E A H K B
Figure 3

Solution 3. Introduce the points T and Q1 as in the previous solution. Note that T lies on
the circumcircle of ABC. Here we present yet another proof that P Q1 is tangent to ω.
Let Ω be the circle completing the semicircle ω. Construct a point F symmetric to C with
respect to AB. Let S ‰ T be the second intersection point of F T and Ω (see Figure 4).

C
Q′
T

P D

A K B
H
S

Figure 4
Since AC “ AF , we have =DKC “ =HCK “ =CBA “ =CT A “ =DT S “ 1800 ´
=SKD. Thus, the points C, K, and S are collinear. Notice also that =Q1 KD “ =Q1 T D “
=HCK “ =KF H “ 1800 ´ =DKF . This implies that the points F, K, and Q1 are collinear.
Applying Pascal’s theorem to the degenerate hexagon KQ1 Q1 T SS, we get that the tan-
gents to Ω passing through Q1 and S intersect on CF . The relation =Q1 T D “ =DT S yields
that Q1 and S are symmetric with respect to BD. Therefore, the two tangents also intersect
on BD. Thus, the two tangents pass through P . Hence, P Q1 is tangent to ω, as needed.
48 IMO 2015 Thailand

G4. Let ABC be an acute triangle, and let M be the midpoint of AC. A circle ω passing
through B and M meets the sides AB and BC again at P and Q, respectively. Let T be
the point such that the quadrilateral BP T Q is a parallelogram. Suppose that T lies on the
circumcircle of the triangle ABC. Determine all possible values of BT {BM.
(Russia)
?
Answer. 2.
Solution 1. Let S be the center of the parallelogram BP T Q, and let B 1 ‰ B be the point on
the ray BM such that BM “ MB 1 (see Figure 1). It follows that ABCB 1 is a parallelogram.
Then, =ABB 1 “ =P QM and =BB 1 A “ =B 1 BC “ =MP Q, and so the triangles ABB 1 and
MQP are similar. It follows that AM and MS are corresponding medians in these triangles.
Hence,
=SMP “ =B 1 AM “ =BCA “ =BT A. (1)
Since =ACT “ =P BT and =T AC “ =T BC “ =BT P , the triangles T CA and P BT are
similar. Again, as T M and P S are corresponding medians in these triangles, we have
=MT A “ =T P S “ =BQP “ =BMP. (2)
Now we deal separately with two cases.
Case 1. S does not lie on BM. Since the configuration is symmetric between A and C, we
may assume that S and A lie on the same side with respect to the line BM.
Applying (1) and (2), we get
=BMS “ =BMP ´ =SMP “ =MT A ´ =BT A “ =MT B,
the triangles BSM and BMT are similar. We now have BM 2 “ BS ¨ BT “ BT 2 {2, so
and so ?
BT “ 2BM.
Case 2. S lies on BM. It follows from (2) that =BCA “ =MT A “ =BQP “ =BMP
(see Figure 2). Thus, P Q?k AC and P M k AT . Hence, BS{BM “ BP {BA “ BM{BT , so
BT 2 “ 2BM 2 and BT “ 2BM.

B
Q
S
S
P
P
A M
M C
S Q
P

T A C
M

B′ T
Figure 1 Figure 2
Shortlisted problems – solutions 49

Comment 1. Here is another way to show that the triangles BSM and BM T are similar. Denote
by Ω the circumcircle of the triangle ABC. Let R be the second point of intersection of ω and Ω, and
let τ be the spiral similarity centered at R mapping ω to Ω. Then, one may show that τ maps each
point X on ω to a point Y on Ω such that B, X, and Y are collinear (see Figure 3). If we let K and L
be the second points of intersection of BM with Ω and of BT with ω, respectively, then it follows that
the triangle M KT is the image of SM L under τ . We now obtain =BSM “ =T M B, which implies
the desired result.

B
Ω ω

Ω X ω P

Q
Y M
M
A C
P
S R X
Q
Q
M
M T
A C
L
Y

K T B′
Figure 3 Figure 4

Solution 2. Again, we denote by Ω the circumcircle of the triangle ABC.


Choose the points X and Y on the rays BA and BC respectively, so that =MXB “ =MBC
and =BY M “ =ABM (see Figure 4). Then the triangles BMX and Y MB are similar. Since
=XP M “ =BQM, the points P and Q correspond to each other in these triangles. So, if
ÝÝÑ ÝÝÑ ÝÝÑ ÝÝÑ
BP “ µ ¨ BX, then BQ “ p1 ´ µq ¨ BY . Thus
Ý
ÝÑ ÝÝÑ ÝÝÑ ÝÝÑ ÝÝÑ ÝÝÑ ÝÝÑ ÝÝÑ
BT “ BP ` BQ “ BY ` µ ¨ pBX ´ BY q “ BY ` µ ¨ Y X,

which means that T lies on the line XY .


Let B 1 ‰ B be the point on the ray BM such that BM “ MB 1 . Then =MB 1 A “
=MBC “ =MXB and =CB 1 M “ =ABM “ =BY M. This means that the triangles BMX,
BAB 1 , Y MB, and B 1 CB are all similar; hence BA ¨ BX “ BM ¨ BB 1 “ BC ¨ BY . Thus
there exists an inversion centered at B which swaps A with X, M with B 1 , and C with Y .
This inversion then swaps Ω with the line
? XY , and hence it preserves T . Therefore, we have
BT 2 “ BM ¨ BB 1 “ 2BM 2 , and BT “ 2BM.

Solution 3. We begin with the following lemma.


Lemma. Let ABCT be a cyclic quadrilateral. Let P and Q be points on the sides BA and BC
respectively, such that BP T Q is a parallelogram. Then BP ¨ BA ` BQ ¨ BC “ BT 2 .
Proof. Let the circumcircle of the triangle QT C meet the line BT again at J (see Figure 5).
The power of B with respect to this circle yields

BQ ¨ BC “ BJ ¨ BT. (3)
50 IMO 2015 Thailand

We also have =T JQ “ 1800 ´ =QCT “ =T AB and =QT J “ =ABT , and so the triangles
T JQ and BAT are similar. We now have T J{T Q “ BA{BT . Therefore,

T J ¨ BT “ T Q ¨ BA “ BP ¨ BA. (4)

Combining (3) and (4) now yields the desired result. l


Let X and Y be the midpoints of BA and BC respectively (see Figure 6). Applying the
lemma to the cyclic quadrilaterals P BQM and ABCT , we obtain

BX ¨ BP ` BY ¨ BQ “ BM 2

and
BP ¨ BA ` BQ ¨ BC “ BT 2 .
?
Since BA “ 2BX and BC “ 2BY , we have BT 2 “ 2BM 2 , and so BT “ 2BM.

B
B

Y
X
Q Q

P J P
P
A C A M
M C

T T
Figure 5 Figure 6

Comment 2. Here we give another proof of the lemma using Ptolemy’s theorem. We readily have

T C ¨ BA ` T A ¨ BC “ AC ¨ BT.

The lemma now follows from


BP BQ BT sin =BCT
“ “ “ .
TC TA AC sin =ABC
Shortlisted problems – solutions 51

G5. Let ABC be a triangle with CA ‰ CB. Let D, F , and G be the midpoints of the
sides AB, AC, and BC, respectively. A circle Γ passing through C and tangent to AB at D
meets the segments AF and BG at H and I, respectively. The points H 1 and I 1 are symmetric
to H and I about F and G, respectively. The line H 1 I 1 meets CD and F G at Q and M,
respectively. The line CM meets Γ again at P . Prove that CQ “ QP .
(El Salvador)
Solution 1. We may assume that CA ą CB. Observe that H 1 and I 1 lie inside the segments
CF and CG, respectively. Therefore, M lies outside △ABC (see Figure 1).
Due to the powers of points A and B with respect to the circle Γ, we have

CH 1 ¨ CA “ AH ¨ AC “ AD 2 “ BD 2 “ BI ¨ BC “ CI 1 ¨ CB.

Therefore, CH 1 ¨CF “ CI 1 ¨CG. Hence, the quadrilateral H 1 I 1 GF is cyclic, and so =I 1 H 1 C “


=CGF .
Let DF and DG meet Γ again at R and S, respectively. We claim that the points R and S
lie on the line H 1 I 1 .
Observe that F H 1 ¨F A “ F H ¨F C “ F R¨F D. Thus, the quadrilateral ADH 1 R is cyclic, and
hence =RH 1 F “ =F DA “ =CGF “ =I 1 H 1 C. Therefore, the points R, H 1 , and I 1 are collinear.
Similarly, the points S, H 1 , and I 1 are also collinear, and so all the points R, H 1 , Q, I 1, S, and M
are all collinear.

R C C
R
ω
H′′′′
H
H
H H′′′′
H P
P
Q
Q Q
Q
II′′′′ S S
Γ II′′′′ S
F
F G Γ
G M F
F G
G M
II
II
H
H

A D B
A D B
Figure 1 Figure 2

Then, =RSD “ =RDA “ =DF G. Hence, the quadrilateral RSGF is cyclic (see Figure 2).
Therefore, MH 1 ¨ MI 1 “ MF ¨ MG “ MR ¨ MS “ MP ¨ MC. Thus, the quadrilateral CP I 1H 1
is also cyclic. Let ω be its circumcircle.
Notice that =H 1 CQ “ =SDC “ =SRC and =QCI 1 “ =CDR “ =CSR. Hence,
△CH 1 Q „ △RCQ and △CI 1 Q „ △SCQ, and therefore QH 1 ¨ QR “ QC 2 “ QI 1 ¨ QS.
We apply the inversion with center Q and radius QC. Observe that the points R, C, and S
are mapped to H 1 , C, and I 1 , respectively. Therefore, the circumcircle Γ of △RCS is mapped
to the circumcircle ω of △H 1CI 1 . Since P and C belong to both circles and the point C is
preserved by the inversion, we have that P is also mapped to itself. We then get QP 2 “ QC 2 .
Hence, QP “ QC.

Comment 1. The problem statement still holds when Γ intersects the sides CA and CB outside
segments AF and BG, respectively.
52 IMO 2015 Thailand

Solution 2. Let X “ HI X AB, and let the tangent to Γ at C meet AB at Y . Let XC


meet Γ again at X 1 (see Figure 3). Projecting from C, X, and C again, we have pX, A; D, Bq “
pX 1 , H; D, Iq “ pC, I; D, Hq “ pY, B; D, Aq. Since A and B are symmetric about D, it follows
that X and Y are also symmetric about D.
Now, Menelaus’ theorem applied to △ABC with the line HIX yields
CH BI AX AH 1 CI 1 BY
1“ ¨ ¨ “ 1 ¨ 1 ¨ .
HA IC XB H C I B YA
By the converse of Menelaus’ theorem applied to △ABC with points H 1 , I 1 , Y , we get that
the points H 1 , I 1 , Y are collinear.

C
H′′′′
H

II′′′′
X′′′′
X F
F
G
G M
M
H
H II

X A D B Y
Figure 3

Let T be the midpoint of CD, and let O be the center of Γ. Let CM meet T Y at N. To
avoid confusion, we clean some superfluous details out of the picture (see Figure 4).
Let V “ MT X CY . Since MT k Y D and DT “ T C, we get CV “ V Y . Then Ceva’s
theorem applied to △CT Y with the point M yields
T Q CV Y N TQ Y N
1“ ¨ ¨ “ ¨ .
QC V Y NT QC NT
TQ TN
Therefore, QC “N Y
. So, NQ k CY , and thus NQ K OC.
Note that the points O, N, T , and Y are collinear. Therefore, CQ K ON. So, Q is the
orthocenter of △OCN, and hence OQ K CP . Thus, Q lies on the perpendicular bisector
of CP , and therefore CQ “ QP , as required.

Q
Q P
P
O
TT M
M V

N
Γ

D Y
Figure 4
Shortlisted problems – solutions 53

Comment 2. The second part of Solution 2 provides a proof of the following more general statement,
which does not involve a specific choice of Q on CD.
Let Y C and Y D be two tangents to a circle Γ with center O (see Figure 4). Let ℓ be the midline
of △Y CD parallel to Y D. Let Q and M be two points on CD and ℓ, respectively, such that the
line QM passes through Y . Then OQ K CM .
54 IMO 2015 Thailand

G6. Let ABC be an acute triangle with AB ą AC, and let Γ be its circumcircle. Let H,
M, and F be the orthocenter of the triangle, the midpoint of BC, and the foot of the altitude
from A, respectively. Let Q and K be the two points on Γ that satisfy =AQH “ 900 and
=QKH “ 900 . Prove that the circumcircles of the triangles KQH and KF M are tangent to
each other.
(Ukraine)
Solution 1. Let A1 be the point diametrically opposite to A on Γ. Since =AQA1 “ 900 and
=AQH “ 900 , the points Q, H, and A1 are collinear. Similarly, if Q1 denotes the point on Γ
diametrically opposite to Q, then K, H, and Q1 are collinear. Let the line AHF intersect Γ
again at E; it is known that M is the midpoint of the segment HA1 and that F is the midpoint
of HE. Let J be the midpoint of HQ1 .
Consider any point T such that T K is tangent to the circle KQH at K with Q and T
lying on different sides of KH (see Figure 1). Then =HKT “ =HQK and we are to prove
that =MKT “ =CF K. Thus it remains to show that =HQK “ =CF K ` =HKM . Due
to =HQK “ 900 ´ =Q1 HA1 and =CF K “ 900 ´ =KF A, this means the same as =Q1 HA1 “
=KF A ´ =HKM . Now, since the triangles KHE and AHQ1 are similar with F and J being
the midpoints of corresponding sides, we have =KF A “ =HJA, and analogously one may
obtain =HKM “ =JQH. Thereby our task is reduced to verifying

=Q1 HA1 “ =HJA ´ =JQH .

A
Q A

Γ
Γ
K Q

H T O

J H
Q′ J
B M F C
Q′
A′ E A′
Figure 1 Figure 2
To avoid confusion, let us draw a new picture at this moment (see Figure 2). Owing to
=Q1 HA1 “ =JQH ` =HJQ and =HJA “ =QJA ` =HJQ, we just have to show that
2 =JQH “ =QJA. To this end, it suffices to remark that AQA1 Q1 is a rectangle and that J,
being defined to be the midpoint of HQ1 , has to lie on the mid parallel of QA1 and Q1 A.

Solution 2. We define the points A1 and E and prove that the ray MH passes through Q
in the same way as in the first solution. Notice that the points A1 and E can play analogous
roles to the points Q and K, respectively: point A1 is the second intersection of the line MH
with Γ, and E is the point on Γ with the property =HEA1 “ 900 (see Figure 3).
In the circles KQH and EA1 H, the line segments HQ and HA1 are diameters, respectively;
so, these circles have a common tangent t at H, perpendicular to MH. Let R be the radical
center of the circles ABC, KQH and EA1 H. Their pairwise radical axes are the lines QK,
A1 E and the line t; they all pass through R. Let S be the midpoint of HR; by =QKH “
Shortlisted problems – solutions 55

Γ Q

C S
B M F t

A′ E R
Figure 3

=HEA1 “ 900 , the quadrilateral HERK is cyclic and its circumcenter is S; hence we have
SK “ SE “ SH. The line BC, being the perpendicular bisector of HE, passes through S.
The circle HMF also is tangent to t at H; from the power of S with respect to the circle
HMF we have
SM ¨ SF “ SH 2 “ SK 2 .
So, the power of S with respect to the circles KQH and KF M is SK 2 . Therefore, the line
segment SK is tangent to both circles at K.
56 IMO 2015 Thailand

G7. Let ABCD be a convex quadrilateral, and let P , Q, R, and S be points on the sides
AB, BC, CD, and DA, respectively. Let the line segments P R and QS meet at O. Suppose
that each of the quadrilaterals AP OS, BQOP , CROQ, and DSOR has an incircle. Prove that
the lines AC, P Q, and RS are either concurrent or parallel to each other.
(Bulgaria)
Solution 1. Denote by γA , γB , γC , and γD the incircles of the quadrilaterals AP OS, BQOP ,
CROQ, and DSOR, respectively.
We start with proving that the quadrilateral ABCD also has an incircle which will be
referred to as Ω. Denote the points of tangency as in Figure 1. It is well-known that QQ1 “ OO1
(if BC k P R, this is obvious; otherwise, one may regard the two circles involved as the incircle
and an excircle of the triangle formed by the lines OQ, P R, and BC). Similarly, OO1 “ P P1 .
Hence we have QQ1 “ P P1 . The other equalities of segment lengths marked in Figure 1 can
be proved analogously. These equalities, together with AP1 “ AS1 and similar ones, yield
AB ` CD “ AD ` BC, as required.

B Q Q1
P γB C
P1
O1
A γA γC
O
O
S1

S γD
R

D
Figure 1

Next, let us draw the lines parallel to QS through P and R, and also draw the lines parallel
to P R through Q and S. These lines form a parallelogram; denote its vertices by A1 , B 1 , C 1 ,
and D 1 as shown in Figure 2.
Since the quadrilateral AP OS has an incircle, we have AP ´ AS “ OP ´ OS “ A1 S ´ A1 P .
It is well-known that in this case there also exists a circle ωA tangent to the four rays AP ,
AS, A1 P , and A1 S. It is worth mentioning here that in case when, say, the lines AB and A1 B 1
coincide, the circle ωA is just tangent to AB at P . We introduce the circles ωB , ωC , and ωD in
a similar manner.
Assume that the radii of the circles ωA and ωC are different. Let X be the center of the
homothety having a positive scale factor and mapping ωA to ωC .
Now, Monge’s theorem applied to the circles ωA , Ω, and ωC shows that the points A, C,
and X are collinear. Applying the same theorem to the circles ωA , ωB , and ωC , we see that
the points P , Q, and X are also collinear. Similarly, the points R, S, and X are collinear, as
required.
If the radii of ωA and ωC are equal but these circles do not coincide, then the degenerate
version of the same theorem yields that the three lines AC, P Q, and RS are parallel to the
line of centers of ωA and ωC .
Finally, we need to say a few words about the case when ωA and ωC coincide (and thus they
also coincide with Ω, ωB , and ωD ). It may be regarded as the limit case in the following manner.
Shortlisted problems – solutions 57

ωC B′
B
P
P
Q
Q

A
A
C
C
O
O X
A′′′′
A C′′′′
C
ωB ωA

Ω R
R
S

D′
DD
Figure 2

Let us fix the positions of A, P , O, and S (thus we also fix the circles ωA , γA , γB , and γD ). Now
we vary the circle γC inscribed into =QOR; for each of its positions, one may reconstruct the
lines BC and CD as the external common tangents to γB , γC and γC , γD different from P R
and QS, respectively. After such variation, the circle Ω changes, so the result obtained above
may be applied.

Solution 2. Applying Menelaus’ theorem to △ABC with the line P Q and to △ACD with
the line RS, we see that the line AC meets P Q and RS at the same point (possibly at infinity)
if and only if

AP BQ CR DS
¨ ¨ ¨ “ 1. (1)
P B QC RD SA

So, it suffices to prove (1).

We start with the following result.


Lemma 1. Let EF GH be a circumscribed quadrilateral, and let M be its incenter. Then

EF ¨ F G F M2
“ .
GH ¨ HE HM 2

Proof. Notice that =EMH ` =GMF “ =F ME ` =HMG “ 1800 , =F GM “ =MGH, and


=HEM “ =MEF (see Figure 3). By the law of sines, we get

EF F G sin =F ME ¨ sin =GMF sin =HMG ¨ sin =EMH GH HE


¨ “ “ “ ¨ . l
FM FM sin =MEF ¨ sin =F GM sin =MGH ¨ sin =HEM HM HM
58 IMO 2015 Thailand

P J
F
G Q

II K C
K
A O
O
M
R
L
H S

E D
Figure 3 Figure 4

We denote by I, J, K, and L the incenters of the quadrilaterals AP OS, BQOP , CROQ,


and DSOR, respectively. Applying Lemma 1 to these four quadrilaterals we get
AP ¨ P O BQ ¨ QO CR ¨ RO DS ¨ SO P I 2 QJ 2 RK 2 SL2
¨ ¨ ¨ “ ¨ ¨ ¨ ,
OS ¨ SA OP ¨ P B OQ ¨ QC OR ¨ RD SI 2 P J 2 QK 2 RL2
which reduces to
AP BQ CR DS P I 2 QJ 2 RK 2 SL2
¨ ¨ ¨ “ ¨ ¨ ¨ . (2)
P B QC RD SA P J 2 QK 2 RL2 SI 2
Next, we have =IP J “ =JOI “ 900 , and the line OP separates I and J (see Figure 4).
This means that the quadrilateral IP JO is cyclic. Similarly, we get that the quadrilateral
JQKO is cyclic with =JQK “ 900 . Thus, =QKJ “ =QOJ “ =JOP “ =JIP . Hence,
PI QK
the right triangles IP J and KQJ are similar. Therefore, “ . Likewise, we obtain
PJ QJ
RK SI
“ . These two equations together with (2) yield (1).
RL SL
Comment. Instead of using the sine law, one may prove Lemma 1 by the following approach.

F
G
N

E
Figure 5

Let N be the point such that △N HG „ △M EF and such that N and M lie on different sides
of the line GH, as shown in Figure 5. Then =GN H ` =HM G “ =F M E ` =HM G “ 1800 . So,
Shortlisted problems – solutions 59

the quadrilateral GN HM is cyclic. Thus, =M N H “ =M GH “ =F GM and =HM N “ =HGN “


HM HM HN M F EM
=EF M “ =M F G. Hence, △HM N „ △M F G. Therefore, “ ¨ “ ¨ .
HG HN HG M G EF
HM M F GM
Similarly, we obtain “ ¨ . By multiplying these two equations, we complete the proof.
HE M E GF
Solution 3. We present another approach for showing (1) from Solution 2.
Lemma 2. Let EF GH and E 1 F 1 G1 H 1 be circumscribed quadrilaterals such that =E ` =E 1 “
=F ` =F 1 “ =G ` =G1 “ =H ` =H 1 “ 1800 . Then
EF ¨ GH E 1 F 1 ¨ G1 H 1
“ 1 1 .
F G ¨ HE F G ¨ H 1E 1

Proof. Let M and M 1 be the incenters of EF GH and E 1 F 1 G1 H 1 , respectively. We use the


notation rXY Zs for the area of a triangle XY Z.
Taking into account the relation =F ME ` =F 1 M 1 E 1 “ 1800 together with the analogous
ones, we get

EF ¨ GH rMEF s ¨ rMGHs ME ¨ MF ¨ sin =F ME ¨ MG ¨ MH ¨ sin =HMG


“ “
F G ¨ HE rMF Gs ¨ rMHEs MF ¨ MG ¨ sin =GMF ¨ MH ¨ ME ¨ sin =EMH
M E ¨ M F ¨ sin =F 1 M 1 E 1 ¨ M 1 G1 ¨ M 1 H 1 ¨ sin =H 1 M 1 G1
1 1 1 1
E 1 F 1 ¨ G1 H 1
“ 1 1 “ . l
M F ¨ M 1 G1 ¨ sin =G1 M 1 F 1 ¨ M 1 H 1 ¨ M 1 E 1 ¨ sin =E 1 M 1 H 1 F 1 G1 ¨ H 1 E 1

R′
P ′′′′ =
P =PP

Q
Q
B′′′′
B
C′′′
C
A′′′′ =
A
A =
A =AA =AA O′′′′ =
O =OO

D′′′′
D
S′′′′ =
S =SS

Q′
Figure 6

Denote by h the homothety centered at O that maps the incircle of CROQ to the incircle
of AP OS. Let Q1 “ hpQq, C 1 “ hpCq, R1 “ hpRq, O 1 “ O, S 1 “ S, A1 “ A, and P 1 “ P .
Furthermore, define B 1 “ A1 P 1 X C 1 Q1 and D 1 “ A1 S 1 X C 1 R1 as shown in Figure 6. Then

AP ¨ OS A1 P 1 ¨ O 1S 1
“ 1 1 1 1
P O ¨ SA P O ¨S A
holds trivially. We also have
CR ¨ OQ C 1 R1 ¨ O 1 Q1
“ 1 1
RO ¨ QC R O ¨ Q1 C 1
by the similarity of the quadrilaterals CROQ and C 1 R1 O 1 Q1 .
60 IMO 2015 Thailand

Next, consider the circumscribed quadrilaterals BQOP and B 1 Q1 O 1P 1 whose incenters lie
on different sides of the quadrilaterals’ shared side line OP “ O 1 P 1. Observe that BQ k B 1 Q1
and that B 1 and Q1 lie on the lines BP and QO, respectively. It is now easy to see that the
two quadrilaterals satisfy the hypotheses of Lemma 2. Thus, we deduce

BQ ¨ OP B 1 Q1 ¨ O 1 P 1
“ 1 1 .
QO ¨ P B Q O ¨ P 1B 1
Similarly, we get
DS ¨ OR D 1 S 1 ¨ O 1 R1
“ 1 1 .
SO ¨ RD S O ¨ R1 D 1
Multiplying these four equations, we obtain

AP BQ CR DS A1 P 1 B 1 Q1 C 1 R1 D 1 S 1
¨ ¨ ¨ “ 1 1 ¨ 1 1 ¨ 1 1 ¨ 1 1. (3)
P B QC RD SA P B QC RD SA

Finally, we apply Brianchon’s theorem to the circumscribed hexagon A1 P 1 R1 C 1 Q1 S 1 and


deduce that the lines A1 C 1 , P 1 Q1 , and R1 S 1 are either concurrent or parallel to each other. So,
by Menelaus’ theorem, we obtain

A1 P 1 B 1 Q1 C 1 R1 D 1 S 1
¨ ¨ ¨ “ 1.
P 1 B 1 Q1 C 1 R1 D 1 S 1 A1

This equation together with (3) yield (1).


Shortlisted problems – solutions 61

G8. A triangulation of a convex polygon Π is a partitioning of Π into triangles by diagonals


having no common points other than the vertices of the polygon. We say that a triangulation
is a Thaiangulation if all triangles in it have the same area.
Prove that any two different Thaiangulations of a convex polygon Π differ by exactly two
triangles. (In other words, prove that it is possible to replace one pair of triangles in the first
Thaiangulation with a different pair of triangles so as to obtain the second Thaiangulation.)
(Bulgaria)
Solution 1. We denote by rSs the area of a polygon S.
Recall that each triangulation of a convex n-gon has exactly n ´ 2 triangles. This means
that all triangles in any two Thaiangulations of a convex polygon Π have the same area.
Let T be a triangulation of a convex polygon Π. If four vertices A, B, C, and D of Π
form a parallelogram, and T contains two triangles whose union is this parallelogram, then we
say that T contains parallelogram ABCD. Notice here that if two Thaiangulations T1 and T2
of Π differ by two triangles, then the union of these triangles is a quadrilateral each of whose
diagonals bisects its area, i.e., a parallelogram.
We start with proving two properties of triangulations.
Lemma 1. A triangulation of a convex polygon Π cannot contain two parallelograms.
Proof. Arguing indirectly, assume that P1 and P2 are two parallelograms contained in some
triangulation T . If they have a common triangle in T , then we may assume that P1 consists of
triangles ABC and ADC of T , while P2 consists of triangles ADC and CDE (see Figure 1).
But then BC k AD k CE, so the three vertices B, C, and E of Π are collinear, which is absurd.
Assume now that P1 and P2 contain no common triangle. Let P1 “ ABCD. The sides AB,
BC, CD, and DA partition Π into several parts, and P2 is contained in one of them; we may
assume that this part is cut off from P1 by AD. Then one may label the vertices of P2 by X,
Y , Z, and T so that the polygon ABCDXY ZT is convex (see Figure 2; it may happen that
D “ X and/or T “ A, but still this polygon has at least six vertices). But the sum of the
external angles of this polygon at B, C, Y , and Z is already 3600 , which is impossible. A final
contradiction. l

E
Z B′
D X
D X Y
C H
C

A′ C′
A
B B A T Z
Y
Figure 1 Figure 2 Figure 3
Lemma 2. Every triangle in a Thaiangulation T of Π contains a side of Π.
Proof. Let ABC be a triangle in T . Apply an affine transform such that ABC maps to an
equilateral triangle; let A1 B 1 C 1 be the image of this triangle, and Π1 be the image of Π. Clearly,
T maps into a Thaiangulation T 1 of Π1 .
Assume that none of the sides of △A1 B 1 C 1 is a side of Π1 . Then T 1 contains some other
triangles with these sides, say, A1 B 1 Z, C 1 A1 Y , and B 1 C 1 X; notice that A1 ZB 1 XC 1 Y is a convex
hexagon (see Figure 3). The sum of its external angles at X, Y , and Z is less than 3600 . So one
of these angles (say, at Z) is less than 1200 , hence =A1 ZB 1 ą 600 . Then Z lies on a circular arc
subtended by A1 B 1 and ? having angular measure less than 2400 ; consequently, the altitude ZH
1 1
of △A B Z is less than 3 A1 B 1 {2. Thus rA1 B 1 Zs ă rA1 B 1 C 1 s, and T 1 is not a Thaiangulation.
A contradiction. l
62 IMO 2015 Thailand

Now we pass to the solution. We say that a triangle in a triangulation of Π is an ear if it


contains two sides of Π. Note that each triangulation of a polygon contains some ear.
Arguing indirectly, we choose a convex polygon Π with the least possible number of sides
such that some two Thaiangulations T1 and T2 of Π violate the problem statement (thus Π has
at least five sides). Consider now any ear ABC in T1 , with AC being a diagonal of Π. If T2
also contains △ABC, then one may cut △ABC off from Π, getting a polygon with a smaller
number of sides which also violates the problem statement. This is impossible; thus T2 does
not contain △ABC.
Next, T1 contains also another triangle with side AC, say △ACD. By Lemma 2, this
triangle contains a side of Π, so D is adjacent to either A or C on the boundary of Π. We may
assume that D is adjacent to C.
Assume that T2 does not contain the triangle BCD. Then it contains two different trian-
gles BCX and CDY (possibly, with X “ Y ); since these triangles have no common interior
points, the polygon ABCDY X is convex (see Figure 4). But, since rABCs “ rBCXs “
rACDs “ rCDY s, we get AX k BC and AY k CD which is impossible. Thus T2 con-
tains △BCD.
Therefore, rABDs “ rABCs ` rACDs ´ rBCDs “ rABCs, and ABCD is a parallelogram
contained in T1 . Let T 1 be the Thaiangulation of Π obtained from T1 by replacing the diago-
nal AC with BD; then T 1 is distinct from T2 (otherwise T1 and T2 would differ by two triangles).
Moreover, T 1 shares a common ear BCD with T2 . As above, cutting this ear away we obtain
that T2 and T 1 differ by two triangles forming a parallelogram different from ABCD. Thus T 1
contains two parallelograms, which contradicts Lemma 1.

A A X
Y′
Y
YY
A

C
D D
B C B C X
X Z
Z
Z′
T1 T2 X ′
B
Figure 4 Figure 5

Comment 1. Lemma 2 is equivalent to the well-known Erdős–Debrunner inequality stating that


for any triangle P QR and any points A, B, C lying on the sides QR, RP , and P Q, respectively, we
have (
rABCs ě min rABRs, rBCP s, rCAQs . (1)
To derive this inequality from Lemma 2, one may assume that (1) does not hold, and choose
some points X, Y , and Z inside the triangles BCP , CAQ, and ABR, respectively, so that rABCs “
rABZs “ rBCXs “ rCAY s. Then a convex hexagon AZBXCY has a Thaiangulation contain-
ing △ABC, which contradicts Lemma 2.
Conversely, assume that a Thaiangulation T of Π contains a triangle ABC none of whose sides
is a side of Π, and let ABZ, AY C, and XBC be other triangles in T containing the corresponding
sides. Then AZBXCY is a convex hexagon.
Consider the lines through A, B, and C parallel to Y Z, ZX, and XY , respectively. They form a
triangle X 1 Y 1 Z 1 similar to △XY Z (see Figure 5). By (1) we have

rABCs ě min rABZ 1 s, rBCX 1 s, rCAY 1 s ą min rABZs, rBCXs, rCAY s ,


( (

so T is not a Thaiangulation.
Shortlisted problems – solutions 63

Solution 2. We will make use of the preliminary observations from Solution 1, together with
Lemma 1.
Arguing indirectly, we choose a convex polygon Π with the least possible number of sides
such that some two Thaiangulations T1 and T2 of Π violate the statement (thus Π has at least
five sides). Assume that T1 and T2 share a diagonal d splitting Π into two smaller polygons Π1
and Π2 . Since the problem statement holds for any of them, the induced Thaiangulations of
each of Πi differ by two triangles forming a parallelogram (the Thaiangulations induced on Πi
by T1 and T2 may not coincide, otherwise T1 and T2 would differ by at most two triangles). But
both these parallelograms are contained in T1 ; this contradicts Lemma 1. Therefore, T1 and T2
share no diagonal. Hence they also share no triangle.
We consider two cases.
Case 1. Assume that some vertex B of Π is an endpoint of some diagonal in T1 , as well as an
endpoint of some diagonal in T2 .
Let A and C be the vertices of Π adjacent to B. Then T1 contains some triangles ABX
and BCY , while T2 contains some triangles ABX 1 and BCY 1 . Here, some of the points X,
X 1 , Y , and Y 1 may coincide; however, in view of our assumption together with the fact that T1
and T2 share no triangle, all four triangles ABX, BCY , ABX 1 , and BCY 1 are distinct.
Since rABXs “ rBCY s “ rABX 1 s “ rBCY 1 s, we have XX 1 k AB and Y Y 1 k BC. Now,
if X “ Y , then X 1 and Y 1 lie on different lines passing through X and are distinct from that
point, so that X 1 ‰ Y 1 . In this case, we may switch the two Thaiangulations. So, hereafter we
assume that X ‰ Y .
In the convex pentagon ABCY X we have either =BAX ` =AXY ą 1800 or =XY C `
=Y CB ą 1800 (or both); due to the symmetry, we may assume that the first inequality holds.
ÝÝÑ
Let r be the ray emerging from X and co-directed with AB; our inequality shows that r points
to the interior of the pentagon (and thus to the interior of Π). Therefore, the ray opposite to r
points outside Π, so X 1 lies on r; moreover, X 1 lies on the “arc” CY of Π not containing X.
So the segments XX 1 and Y B intersect (see Figure 6).
Let O be the intersection point of the rays r and BC. Since the triangles ABX 1 and BCY 1
have no common interior points, Y 1 must lie on the “arc” CX 1 which is situated inside the
triangle XBO. Therefore, the line Y Y 1 meets two sides of △XBO, none of which may be XB
(otherwise the diagonals XB and Y Y 1 would share a common point). Thus Y Y 1 intersects BO,
which contradicts Y Y 1 k BC.

X
Y

X′
r

YY ′′′ O
A
C
B
Figure 6

Case 2. In the remaining case, each vertex of Π is an endpoint of a diagonal in at most one
of T1 and T2 . On the other hand, a triangulation cannot contain two consecutive vertices with
no diagonals from each. Therefore, the vertices of Π alternatingly emerge diagonals in T1 and
in T2 . In particular, Π has an even number of sides.
64 IMO 2015 Thailand

Next, we may choose five consecutive vertices A, B, C, D, and E of Π in such a way that

=ABC ` =BCD ą 1800 and =BCD ` =CDE ą 1800 . (2)

In order to do this, it suffices to choose three consecutive vertices B, C, and D of Π such that
the sum of their external angles is at most 1800 . This is possible, since Π has at least six sides.

E
A

B X Y D

C
Figure 7

We may assume that T1 has no diagonals from B and D (and thus contains the trian-
gles ABC and CDE), while T2 has no diagonals from A, C, and E (and thus contains the
triangle BCD). Now, since rABCs “ rBCDs “ rCDEs, we have AD k BC and BE k CD
(see Figure 7). By (2) this yields that AD ą BC and BE ą CD. Let X “ AC X BD and
Y “ CE X BD; then the inequalities above imply that AX ą CX and EY ą CY .
Finally, T2 must also contain some triangle BDZ with Z ‰ C; then the ray CZ lies in
the angle ACE. Since rBCDs “ rBDZs, the diagonal BD bisects CZ. Together with the
inequalities above, this yields that Z lies inside the triangle ACE (but Z is distinct from A
and E), which is impossible. The final contradiction.

Comment 2. Case 2 may also be accomplished with the use of Lemma 2. Indeed, since each
triangulation of an n-gon contains n ´ 2 triangles neither of which may contain three sides of Π,
Lemma 2 yields that each Thaiangulation contains exactly two ears. But each vertex of Π is a vertex
of an ear either in T1 or in T2 , so Π cannot have more than four vertices.
Shortlisted problems – solutions 65

Number Theory
N1. Determine all positive integers M for which the sequence a0 , a1 , a2 , . . ., defined by
2M `1
a0 “ 2
and ak`1 “ ak tak u for k “ 0, 1, 2, . . ., contains at least one integer term.
(Luxembourg)

Answer. All integers M ě 2.


Solution 1. Define bk “ 2ak for all k ě 0. Then
Z ^
bk
bk`1 “ 2ak`1 “ 2ak tak u “ bk .
2

Since b0 is an integer, it follows that bk is an integer for all k ě 0.


Suppose that the sequence a0 , a1 , a2 , . . . does not contain any integer term. Then bk must
be an odd integer for all k ě 0, so that
Z ^
bk bk pbk ´ 1q
bk`1 “ bk “ . (1)
2 2

Hence
bk pbk ´ 1q pbk ´ 3qpbk ` 2q
bk`1 ´ 3 “ ´3“ (2)
2 2
for all k ě 0.
Suppose that b0 ´ 3 ą 0. Then equation (2) yields bk ´ 3 ą 0 for all k ě 0. For each k ě 0,
define ck to be the highest power of 2 that divides bk ´ 3. Since bk ´ 3 is even for all k ě 0, the
number ck is positive for every k ě 0.
Note that bk ` 2 is an odd integer. Therefore, from equation (2), we have that ck`1 “ ck ´ 1.
Thus, the sequence c0 , c1 , c2 , . . . of positive integers is strictly decreasing, a contradiction. So,
b0 ´ 3 ď 0, which implies M “ 1.
For M “ 1, we can check that the sequence is constant with ak “ 23 for all k ě 0. Therefore,
the answer is M ě 2.

Solution 2. We provide an alternative way to show M “ 1 once equation (1) has been
reached. We claim that bk ” 3 pmod 2m q for all k ě 0 and m ě 1. If this is true, then we
would have bk “ 3 for all k ě 0 and hence M “ 1.
To establish our claim, we proceed by induction on m. The base case bk ” 3 pmod 2q is
true for all k ě 0 since bk is odd. Now suppose that bk ” 3 pmod 2m q for all k ě 0. Hence
bk “ 2m dk ` 3 for some integer dk . We have

3 ” bk`1 ” p2m dk ` 3qp2m´1 dk ` 1q ” 3 ¨ 2m´1 dk ` 3 pmod 2m q,

so that dk must be even. This implies that bk ” 3 pmod 2m`1 q, as required.

Comment. The reason the number 3 which appears in both solutions is important, is that it is a
nontrivial fixed point of the recurrence relation for bk .
66 IMO 2015 Thailand

N2. Let a and b be positive integers such that a!b! is a multiple of a! ` b!. Prove that
3a ě 2b ` 2.
(United Kingdom)
Solution 1. If a ą b, we immediately get 3a ě 2b ` 2. In the case a “ b, the required
inequality is equivalent to a ě 2, which can be checked easily since pa, bq “ p1, 1q does not
satisfy a! ` b! | a!b!. We now assume a ă b and denote c “ b ´ a. The required inequality
becomes a ě 2c ` 2.
b!
Suppose, to the contrary, that a ď 2c ` 1. Define M “ a! “ pa ` 1qpa ` 2q ¨ ¨ ¨ pa ` cq. Since
a! ` b! | a!b! implies 1 ` M | a!M, we obtain 1 ` M | a!. Note that we must have c ă a; otherwise
1 ` M ą a!, which is impossible. We observe that c! | M since M is a product of c consecutive
integers. Thus gcdp1 ` M, c!q “ 1, which implies
ˇ
ˇ a!
1 ` M ˇˇ “ pc ` 1qpc ` 2q ¨ ¨ ¨ a. (1)
c!

If a ď 2c, then a!
c!
is a product of a ´ c ď c integers not exceeding a whereas M is a product of
c integers exceeding a. Therefore, 1 ` M ą a! c!
, which is a contradiction.
It remains to exclude the case a “ 2c ` 1. Since a ` 1 “ 2pc ` 1q, we have c ` 1 | M. Hence,
we can deduce from (1) that 1 ` M | pc ` 2qpc ` 3q ¨ ¨ ¨ a. Now pc ` 2qpc ` 3q ¨ ¨ ¨ a is a product
of a ´ c ´ 1 “ c integers not exceeding a; thus it is smaller than 1 ` M. Again, we arrive at a
contradiction.

Comment 1. One may derive X a \ a weakerX a \version of (1) and finish the problem as follows. After
assuming a ď 2c ` 1, we have 2 ď c, so 2 ! | M . Therefore,
ˇ ´Y ]
ˇ a ¯ ´Y a ] ¯
1 ` M ˇˇ `1 ` 2 ¨ ¨ ¨ a.
2 2

Observe that a2 ` 1
`X \ ˘ `X a \ ˘ PaT
2 ` 2 ¨ ¨P¨ aT is a product of 2 integers not exceeding a. This leads to a
contradiction when a is even since a2 “ a2 ď c and M is` a product ˘ ` a`5 ˘of c integersX aexceeding a. ˇ
a`3 a`1 ˇ
\
When a is odd, we can further deduce that 1 ` M | 2 2 ¨ ¨ ¨ a since 2 ` 1 “ 2 a ` 1.
Now a`3
` ˘ ` a`5 ˘ a´1
2 2 ¨ ¨ ¨ a is a product of 2 ď c numbers not exceeding a, and we get a contradiction.

Solution 2. As in Solution 1, we may assume that a ă b and let c “ b ´ a. Suppose, to the


contrary, that a ď 2c ` 1. From a! ` b! | a!b!, we have
ˇ
N “ 1 ` pa ` 1qpa ` 2q ¨ ¨ ¨ pa ` cq ˇ pa ` cq!,

which implies that all prime factors of N are at most a ` c.


Let p be a prime factor of N. If p ď c or p ě a ` 1, then p divides one of a ` 1, . . . , a ` c
which is impossible. Hence a ě p ě c ` 1. Furthermore, we must have 2p ą a ` `c; otherwise,
a ` 1 ď 2c ` 2 ď 2p ď a ` c so p | N ´ 1, again impossible. Thus, we have p P a`c

2
, a , and
p2 ∤ pa ` cq! since 2p ą a ` c. Therefore, 2
` a`c ‰p ∤ N as well.
If a ď c ` 2, then the interval 2 , a contains at most one integer and hence at most one
prime number, which has to be a. Since p2 ∤ N, we must have N “ p “ a or N “ 1, which is
absurd since N ą a ě 1. Thus, we have a ě c ` 3, and so a`c`1 2
ě c ` 2. It follows that p lies
in the interval rc ` 2, as.
Thus, every prime appearing in the prime factorization of N lies in the interval rc`2, as, and
its exponent is exactly 1. So we must have N | pc ` 2qpc ` 3q ¨ ¨ ¨ a. However, pc ` 2qpc ` 3q ¨ ¨ ¨ a is
a product of a ´ c ´ 1 ď c numbers not exceeding a, so it is less than N. This is a contradiction.

Comment 2. The original problem statement also asks to determine when the equality 3a “ 2b ` 2
holds. It can be checked that the answer is pa, bq “ p2, 2q, p4, 5q.
Shortlisted problems – solutions 67

N3. Let m and n be positive integers such that m ą n. Define xk “ pm ` kq{pn ` kq for k “
1, 2, . . . , n ` 1. Prove that if all the numbers x1 , x2 , . . . , xn`1 are integers, then x1 x2 ¨ ¨ ¨ xn`1 ´ 1
is divisible by an odd prime.
(Austria)
Solution. Assume that x1 , x2 , . . . , xn`1 are integers. Define the integers
m`k m´n
ak “ xk ´ 1 “ ´1“ ą0
n`k n`k
for k “ 1, 2, . . . , n ` 1.
Let P “ x1 x2 ¨ ¨ ¨ xn`1 ´ 1. We need to prove that P is divisible by an odd prime, or in
other words, that P is not a power of 2. To this end, we investigate the powers of 2 dividing
the numbers ak .
Let 2d be the largest power of 2 dividing m ´ n, and let 2c be the largest power of 2 not
exceeding 2n ` 1. Then 2n ` 1 ď 2c`1 ´ 1, and so n ` 1 ď 2c . We conclude that 2c is one of the
numbers n ` 1, n ` 2, . . . , 2n ` 1, and that it is the only multiple of 2c appearing among these
numbers. Let ℓ be such that n ` ℓ “ 2c . Since m´n n`ℓ
is an integer, we have d ě c. Therefore,
d´c`1 m´n d´c`1
2 ∤ aℓ “ n`ℓ , while 2 | ak for all k P t1, . . . , n ` 1u z tℓu.
d´c`1
Computing modulo 2 , we get

P “ pa1 ` 1qpa2 ` 1q ¨ ¨ ¨ pan`1 ` 1q ´ 1 ” paℓ ` 1q ¨ 1n ´ 1 ” aℓ ı 0 pmod 2d´c`1 q.

Therefore, 2d´c`1 ∤ P .
On the other hand, for any k P t1, . . . , n ` 1u z tℓu, we have 2d´c`1 | ak . So P ě ak ě 2d´c`1 ,
and it follows that P is not a power of 2.

Comment. Instead of attempting to show that P is not a power of 2, one may try to find an odd
factor of P (greater than 1) as follows:
From ak “ m´n n`k P Zą0 , we get that m ´ n is divisible by n ` 1, n ` 2, . . . , 2n ` 1, and thus
it is also divisible by their least common multiple L. So m ´ n “ qL for some positive integer q;
L
hence xk “ q ¨ n`k ` 1.
L
Then, since n ` 1 ď 2c “ n ` ℓ ď 2n ` 1 ď 2c`1 ´ 1, we have 2c | L, but 2c`1 ∤ L. So n`ℓ is odd,
L
while n`k is even for k ‰ ℓ. Computing modulo 2q yields

x1 x2 ¨ ¨ ¨ xn`1 ´ 1 ” pq ` 1q ¨ 1n ´ 1 ” q pmod 2qq.

Thus, x1 x2 ¨ ¨ ¨ xn`1 ´ 1 “ 2qr ` q “ qp2r ` 1q for some integer r.


Since x1 x2 ¨ ¨ ¨ xn`1 ´ 1 ě x1 x2 ´ 1 ě pq ` 1q2 ´ 1 ą q, we have r ě 1. This implies that
x1 x2 ¨ ¨ ¨ xn`1 ´ 1 is divisible by an odd prime.
68 IMO 2015 Thailand

N4. Suppose that a0 , a1 , . . . and b0 , b1 , . . . are two sequences of positive integers satisfying
a0 , b0 ě 2 and
an`1 “ gcdpan , bn q ` 1, bn`1 “ lcmpan , bn q ´ 1
for all n ě 0. Prove that the sequence (an ) is eventually periodic; in other words, there exist
integers N ě 0 and t ą 0 such that an`t “ an for all n ě N.
(France)
Solution 1. Let sn “ an ` bn . Notice that if an | bn , then an`1 “ an ` 1, bn`1 “ bn ´ 1 and
sn`1 “ sn . So, an increases by 1 and sn does not change until the first index is reached with
an ∤ sn . Define
(
Wn “ m P Zą0 : m ě an and m ∤ sn and wn “ min Wn .

Claim 1. The sequence pwn q is non-increasing.


Proof. If an | bn then an`1 “ an ` 1. Due to an | sn , we have an R Wn . Moreover sn`1 “ sn ;
therefore, Wn`1 “ Wn and wn`1 “ wn .
Otherwise, if an ∤ bn , then an ∤ sn , so an P Wn and thus wn “ an . We show that an P Wn`1 ;
this implies wn`1 ď an “ wn . By the definition of Wn`1 , we need that an ě an`1 and an ∤ sn`1 .
The first relation holds because of gcdpan , bn q ă an . For the second relation, observe that in
sn`1 “ gcdpan , bn q ` lcmpan , bn q, the second term is divisible by an , but the first term is not.
So an ∤ sn`1 ; that completes the proof of the claim. l
Let w “ min wn and let N be an index with w “ wN . Due to Claim 1, we have wn “ w for
n
all n ě N.
Let gn “ gcdpw, sn q. As we have seen, starting from an arbitrary index n ě N, the sequence
an , an`1 , . . . increases by 1 until it reaches w, which is the first value not dividing sn ; then it
drops to gcdpw, sn q ` 1 “ gn ` 1.
Claim 2. The sequence pgn q is constant for n ě N.
Proof. If an | bn , then sn`1 “ sn and hence gn`1 “ gn . Otherwise we have an “ w,

gcdpan , bn q “ gcdpan , sn q “ gcdpw, sn q “ gn ,


an bn wpsn ´ wq
sn`1 “ gcdpan , bn q ` lcmpan , bn q “ gn ` “ gn ` , (1)
gn gn
ˆ ˙
sn ´ w
and gn`1 “ gcdpw, sn`1q “ gcd w, gn ` w “ gcdpw, gn q “ gn . l
gn

Let g “ gN . We have proved that the sequence pan q eventually repeats the following cycle:

g ` 1 ÞÑ g ` 2 ÞÑ . . . ÞÑ w ÞÑ g ` 1.

Solution 2. By Claim 1 in the first solution, we have an ď wn ď w0 , so the sequence pan q is


bounded, and hence it has only finitely many values.
Let M “ lcmpa1 , a2 , . . .q, and consider the sequence bn modulo M. Let rn be the remainder
of bn , divided by M. For every index n, since an | M | bn ´rn , we have gcdpan , bn q “ gcdpan , rn q,
and therefore
an`1 “ gcdpan , rn q ` 1.
Moreover,
an
rn`1 ” bn`1 “ lcmpan , bn q ´ 1 “ bn ´ 1
gcdpan , bn q
an an
“ bn ´ 1 ” rn ´ 1 pmod Mq.
gcdpan , rn q gcdpan , rn q
Shortlisted problems – solutions 69

Hence, the pair pan , rn q uniquely determines the pair pan`1 , rn`1 q. Since there are finitely many
possible pairs, the sequence of pairs pan , rn q is eventually periodic; in particular, the sequence
pan q is eventually periodic.

Comment. We show that there are only four possibilities for g and w (as defined in Solution 1),
namely (
pw, gq P p2, 1q, p3, 1q, p4, 2q, p5, 1q . (2)
This means that the sequence pan q eventually repeats one of the following cycles:

p2q, p2, 3q, p3, 4q, or p2, 3, 4, 5q. (3)

Using the notation of Solution 1, for n ě N the sequence pan q has a cycle pg ` 1, g ` 2, . . . , wq
such that g “ gcdpw, sn q. By the observations in the proof of Claim 2, the numbers g ` 1, . . . , w ´ 1 all
divide sn ; so the number L “ lcmpg ` 1, g ` 2, . . . , w ´ 1q also divides sn . Moreover, g also divides w.
Now choose any n ě N such that an “ w. By (1), we have

wpsn ´ wq w w2 ´ g 2
sn`1 “ g ` “ sn ¨ ´ .
g g g
2 2
Since L divides both sn and sn`1 , it also divides the number T “ w ´g
g .
Suppose first that w ě 6, which yields g ` 1 ď w2 ` 1 ď w ´ 2. Then pw ´ 2qpw ´ 1q | L | T , so we
have either w2 ´ g2 ě 2pw ´ 1qpw ´ 2q, or g “ 1 and w2 ´ g2 “ pw ´ 1qpw ´ 2q. In the former case we
get pw ´ 1qpw ´ 5q ` pg 2 ´ 1q ď 0 which is false by our assumption. The latter equation rewrites as
3w “ 3, so w “ 1, which is also impossible.
Now we are left with the cases when w ď 5 and g | w. The case pw, gq “ p4, 1q violates the
2 2
condition L | w ´g
g ; all other such pairs are listed in (2).
In the table below, for each pair pw, gq, we provide possible sequences pan q and pbn q. That shows
that the cycles shown in (3) are indeed possible.

w “2 g “1 an “ 2 bn “ 2 ¨ 2n ` 1
w “3 g “1 pa2k , a2k`1 q “ p2, 3q pb2k , b2k`1 q “ p6 ¨ 3k ` 2, 6 ¨ 3k ` 1q
w “4 g “2 pa2k , a2k`1 q “ p3, 4q pb2k , b2k`1 q “ p12 ¨ 2k ` 3, 12 ¨ 2k ` 2q
w “5 g “1 pa4k , . . . , a4k`3 q “ p2, 3, 4, 5q pb4k , . . . , b4k`3 q “ p6 ¨ 5k ` 4, . . . , 6 ¨ 5k ` 1q
70 IMO 2015 Thailand

N5. Determine all triples pa, b, cq of positive integers for which ab ´ c, bc ´ a, and ca ´ b are
powers of 2.
Explanation: A power of 2 is an integer of the form 2n , where n denotes some nonnegative
integer.
(Serbia)

Answer. There are sixteen such triples, namely p2, 2, 2q, the three permutations of p2, 2, 3q,
and the six permutations of each of p2, 6, 11q and p3, 5, 7q.
Solution 1. It can easily be verified that these sixteen triples are as required. Now let pa, b, cq
be any triple with the desired property. If we would have a “ 1, then both b ´ c and c ´ b were
powers of 2, which is impossible since their sum is zero; because of symmetry, this argument
shows a, b, c ě 2.
Case 1. Among a, b, and c there are at least two equal numbers.
Without loss of generality we may suppose that a “ b. Then a2 ´ c and apc ´ 1q are powers
of 2. The latter tells us that actually a and c ´ 1 are powers of 2. So there are nonnegative
integers α and γ with a “ 2α and c “ 2γ ` 1. Since a2 ´ c “ 22α ´ 2γ ´ 1 is a power of 2 and
thus incongruent to ´1 modulo 4, we must have γ ď 1. Moreover, each of the terms 22α ´ 2
and 22α ´ 3 can only be a power of 2 if α “ 1. It follows that the triple pa, b, cq is either p2, 2, 2q
or p2, 2, 3q.
Case 2. The numbers a, b, and c are distinct.
Due to symmetry we may suppose that

2 ď a ă b ă c. (1)

We are to prove that the triple pa, b, cq is either p2, 6, 11q or p3, 5, 7q. By our hypothesis, there
exist three nonnegative integers α, β, and γ such that

bc ´ a “ 2α , (2)
ac ´ b “ 2β , (3)
and ab ´ c “ 2γ . (4)

Evidently we have
αąβ ąγ. (5)
Depending on how large a is, we divide the argument into two further cases.
Case 2.1. a “ 2.
We first prove that γ “ 0. Assume for the sake of contradiction that γ ą 0. Then c is even
by (4) and, similarly, b is even by (5) and (3). So the left-hand side of (2) is congruent to 2
modulo 4, which is only possible if bc “ 4. As this contradicts (1), we have thereby shown that
γ “ 0, i.e., that c “ 2b ´ 1.
Now (3) yields 3b ´ 2 “ 2β . Due to b ą 2 this is only possible if β ě 4. If β “ 4, then we
get b “ 6 and c “ 2 ¨ 6 ´ 1 “ 11, which is a solution. It remains to deal with the case β ě 5.
Now (2) implies

9 ¨ 2α “ 9bp2b ´ 1q ´ 18 “ p3b ´ 2qp6b ` 1q ´ 16 “ 2β p2β`1 ` 5q ´ 16 ,

and by β ě 5 the right-hand side is not divisible by 32. Thus α ď 4 and we get a contradiction
to (5).
Shortlisted problems – solutions 71

Case 2.2. a ě 3.
Pick an integer ϑ P t´1, `1u such that c ´ ϑ is not divisible by 4. Now

2α ` ϑ ¨ 2β “ pbc ´ aϑ2 q ` ϑpca ´ bq “ pb ` aϑqpc ´ ϑq

is divisible by 2β and, consequently, b`aϑ is divisible by 2β´1 . On the other hand, 2β “ ac´b ą
pa ´ 1qc ě 2c implies in view of (1) that a and b are smaller than 2β´1 . All this is only possible
if ϑ “ 1 and a ` b “ 2β´1 . Now (3) yields

ac ´ b “ 2pa ` bq , (6)

whence 4b ą a ` 3b “ apc ´ 1q ě ab, which in turn yields a “ 3.


So (6) simplifies to c “ b ` 2 and (2) tells us that bpb ` 2q ´ 3 “ pb ´ 1qpb ` 3q is a power
of 2. Consequently, the factors b ´ 1 and b ` 3 are powers of 2 themselves. Since their difference
is 4, this is only possible if b “ 5 and thus c “ 7. Thereby the solution is complete.

Solution 2. As in the beginning of the first solution, we observe that a, b, c ě 2. Depending


on the parities of a, b, and c we distinguish three cases.
Case 1. The numbers a, b, and c are even.
Let 2A , 2B , and 2C be the largest powers of 2 dividing a, b, and c respectively. We may assume
without loss of generality that 1 ď A ď B ď C. Now 2B is the highest power of 2 dividing
ac ´ b, whence ac ´ b “ 2B ď b. Similarly, we deduce bc ´ a “ 2A ď a. Adding both estimates
we get pa ` bqc ď 2pa ` bq, whence c ď 2. So c “ 2 and thus A “ B “ C “ 1; moreover, we
must have had equality throughout, i.e., a “ 2A “ 2 and b “ 2B “ 2. We have thereby found
the solution pa, b, cq “ p2, 2, 2q.
Case 2. The numbers a, b, and c are odd.
If any two of these numbers are equal, say a “ b, then ac ´ b “ apc ´ 1q has a nontrivial odd
divisor and cannot be a power of 2. Hence a, b, and c are distinct. So we may assume without
loss of generality that a ă b ă c.
Let α and β denote the nonnegative integers for which bc ´ a “ 2α and ac ´ b “ 2β hold.
Clearly, we have α ą β, and thus 2β divides

a ¨ 2α ´ b ¨ 2β “ apbc ´ aq ´ bpac ´ bq “ b2 ´ a2 “ pb ` aqpb ´ aq .

Since a is odd, it is not possible that both factors b`a and b´a are divisible by 4. Consequently,
one of them has to be a multiple of 2β´1 . Hence one of the numbers 2pb ` aq and 2pb ´ aq is
divisible by 2β and in either case we have

ac ´ b “ 2β ď 2pa ` bq . (7)

This in turn yields pa ´ 1qb ă ac ´ b ă 4b and thus a “ 3 (recall that a is odd and larger
than 1). Substituting this back into (7) we learn c ď b ` 2. But due to the parity b ă c entails
that b ` 2 ď c holds as well. So we get c “ b ` 2 and from bc ´ a “ pb ´ 1qpb ` 3q being a power
of 2 it follows that b “ 5 and c “ 7.
Case 3. Among a, b, and c both parities occur.
Without loss of generality, we suppose that c is odd and that a ď b. We are to show that
pa, b, cq is either p2, 2, 3q or p2, 6, 11q. As at least one of a and b is even, the expression ab ´ c
is odd; since it is also a power of 2, we obtain

ab ´ c “ 1 . (8)

If a “ b, then c “ a2 ´ 1, and from ac ´ b “ apa2 ´ 2q being a power of 2 it follows that both a


and a2 ´ 2 are powers of 2, whence a “ 2. This gives rise to the solution p2, 2, 3q.
72 IMO 2015 Thailand

We may suppose a ă b from now on. As usual, we let α ą β denote the integers satisfying

2α “ bc ´ a and 2β “ ac ´ b . (9)

If β “ 0 it would follow that ac ´ b “ ab ´ c “ 1 and hence that b “ c “ 1, which is absurd. So


β and α are positive and consequently a and b are even. Substituting c “ ab ´ 1 into (9) we
obtain

2α “ ab2 ´ pa ` bq , (10)
and 2β “ a2 b ´ pa ` bq . (11)

The addition of both equation yields 2α ` 2β “ pab ´ 2qpa ` bq. Now ab ´ 2 is even but not
divisible by 4, so the highest power of 2 dividing a ` b is 2β´1 . For this reason, the equations
(10) and (11) show that the highest powers of 2 dividing either of the numbers ab2 and a2 b is
likewise 2β´1 . Thus there is an integer τ ě 1 together with odd integers A, B, and C such that
a “ 2τ A, b “ 2τ B, a ` b “ 23τ C, and β “ 1 ` 3τ .
Notice that A ` B “ 22τ C ě 4C. Moreover, (11) entails A2 B ´ C “ 2. Thus 8 “
4A B ´ 4C ě 4A2 B ´ A ´ B ě A2 p3B ´ 1q. Since A and B are odd with A ă B, this is only
2

possible if A “ 1 and B “ 3. Finally, one may conclude C “ 1, τ “ 1, a “ 2, b “ 6, and


c “ 11. We have thereby found the triple p2, 6, 11q. This completes the discussion of the third
case, and hence the solution.

Comment. In both solutions, there are many alternative ways to proceed in each of its cases. Here
we present a different treatment of the part “a ă b” of Case 3 in Solution 2, assuming that (8) and (9)
have already been written down:
Put d “ gcdpa, bq and define the integers p and q by a “ dp and b “ dq; notice that p ă q and
gcdpp, qq “ 1. Now (8) implies c “ d2 pq ´ 1 and thus we have

2α “ dpd2 pq 2 ´ p ´ qq
and 2β “ dpd2 p2 q ´ p ´ qq . (12)

Now 2β divides 2α ´ 2β “ d3 pqpq ´ pq and, as p and q are easily seen to be coprime to d2 p2 q ´ p ´ q,


it follows that
pd2 p2 q ´ p ´ qq | d2 pq ´ pq . (13)
In particular, we have d2 p2 q ´ p ´ q ď d2 pq ´ pq, i.e., d2 pp2 q ` p ´ qq ď p ` q. As p2 q ` p ´ q ą 0, this
may be weakened to p2 q ` p ´ q ď p ` q. Hence p2 q ď 2q, which is only possible if p “ 1.
Going back to (13), we get
pd2 q ´ q ´ 1q | d2 pq ´ 1q . (14)
Now 2pd2 q ´ q ´ 1q ď d2 pq ´ 1q would entail d2 pq ` 1q ď 2pq ` 1q and thus d “ 1. But this would
tell us that a “ dp “ 1, which is absurd. This argument proves 2pd2 q ´ q ´ 1q ą d2 pq ´ 1q and in the
light of (14) it follows that d2 q ´ q ´ 1 “ d2 pq ´ 1q, i.e., q “ d2 ´ 1. Plugging this together with p “ 1
into (12) we infer 2β “ d3 pd2 ´ 2q. Hence d and d2 ´ 2 are powers of 2. Consequently, d “ 2, q “ 3,
a “ 2, b “ 6, and c “ 11, as desired.
Shortlisted problems – solutions 73

N6. Let Zą0 denote the set of positive integers. Consider a function f : Zą0 Ñ Zą0 . For
any m, n P Zą0 we write f n pmq “ looomooon
f pf p. . . f pmq . . .qq. Suppose that f has the following two
n
properties:
f n pmq ´ m
piq If m, n P Zą0 , then P Zą0 ;
n
piiq The set Zą0 z tf pnq | n P Zą0 u is finite.

Prove that the sequence f p1q ´ 1, f p2q ´ 2, f p3q ´ 3, . . . is periodic.


(Singapore)
Solution. We split the solution into three steps. In the first of them, we show that the function
f is injective and explain how this leads to a useful visualization of f . Then comes the second
step, in which most of the work happens: its goal is to show that for any n P Zą0 the sequence
n, f pnq, f 2 pnq, . . . is an arithmetic progression. Finally, in the third step we put everything
together, thus solving the problem.

Step 1. We commence by checking that f is injective. For this purpose, we consider any
m, k P Zą0 with f pmq “ f pkq. By piq, every positive integer n has the property that

k´m f n pmq ´ m f n pkq ´ k


“ ´
n n n
is a difference of two integers and thus integral as well. But for n “ |k ´ m| ` 1 this is only
possible if k “ m. Thereby, the injectivity of f is established.
Now recall that due to condition piiq there are finitely many positive integers a1 , . . . , ak
such that Zą0 is the disjoint union of ta1 , . . . , ak u and tf pnq | n P Zą0 u. Notice that by plugging
n “ 1 into condition piq we get f pmq ą m for all m P Zą0 .
We contend that every positive integer n may be expressed uniquely in the form n “ f j pai q
for some j ě 0 and i P t1, . . . , ku. The uniqueness follows from the injectivity of f . The
existence can be proved by induction on n in the following way. If n P ta1 , . . . , ak u, then
we may take j “ 0; otherwise there is some n1 ă n with f pn1 q “ n to which the induction
hypothesis may be applied.
The result of the previous paragraph means that every positive integer appears exactly once
in the following infinite picture, henceforth referred to as “the Table”:

a1 f pa1 q f 2 pa1 q f 3 pa1 q ...


a2 f pa2 q f 2 pa2 q f 3 pa2 q ...
.. .. .. ..
. . . .
ak f pak q f 2 pak q f 3 pak q . . .
The Table

Step 2. Our next goal is to prove that each row of the Table is an arithmetic progression.
Assume contrariwise that the number t of rows which are arithmetic progressions would satisfy
0 ď t ă k. By permuting the rows if necessary we may suppose that precisely the first t rows
are arithmetic progressions, say with steps T1 , . . . , Tt . Our plan is to find a further row that
is “not too sparse” in an asymptotic sense, and then to prove that such a row has to be an
arithmetic progression as well.
Let us write T “ lcmpT1 , T2 , . . . , Tt q and A “ maxta1 , a2 , . . . , at u if t ą 0; and T “ 1 and
A “ 0 if t “ 0. For every integer n ě A, the interval ∆n “ rn ` 1, n ` T s contains exactly T {Ti
74 IMO 2015 Thailand

elements of the ith row (1 ď i ď t). Therefore, the number of elements from the last pk ´ tq
rows of the Table contained in ∆n does not depend on n ě A. It is not possible that none
of these intervals ∆n contains an element from the k ´ t last rows, because infinitely many
numbers appear in these rows. It follows that for each n ě A the interval ∆n contains at least
one member from these rows. “
This yields that for every positive integer d, the interval A ` 1, A ` pd ` 1qpk ´ tqT s contains
at least pd ` 1qpk ´ tq elements from the last k ´ t rows; therefore, there exists an index x with
t ` 1 ď x ď k, possibly depending on d, such that our interval contains at least d ` 1 elements
from the xth row. In this situation we have

f d pax q ď A ` pd ` 1qpk ´ tqT .

Finally, since there are finitely many possibilities for x, there exists an index x ě t ` 1 such
that the set
X “ d P Zą0 ˇ f d pax q ď A ` pd ` 1qpk ´ tqT
ˇ (

is infinite. Thereby we have found the “dense row” promised above.


By assumption piq, for every d P X the number

f d pax q ´ ax
βd “
d
is a positive integer not exceeding
A ` pd ` 1qpk ´ tqT Ad ` 2dpk ´ tqT
ď “ A ` 2pk ´ tqT .
d d
This leaves us with finitely many choices for βd , which means that there exists a number Tx
such that the set ˇ (
Y “ d P X ˇ βd “ Tx
is infinite. Notice that we have f d pax q “ ax ` d ¨ Tx for all d P Y .
Now we are prepared to prove that the numbers in the xth row form an arithmetic progres-
sion, thus coming to a contradiction with our assumption. Let us fix any ˇ jpositive integer j.
ˇ
Since the set Y is infinite, we can choose a number y P Y such that y ´ j ą ˇf pax q ´ pax ` jTx qˇ.
Notice that both numbers

f y pax q ´ f j pax q “ f y´j f j pax q ´ f j pax q and f y pax q ´ pax ` jTx q “ py ´ jqTx
` ˘

are divisible by y ´ j. Thus, the difference between these numbers is also divisible by y ´ j.
Since the absolute value of this difference is less than y ´ j, it has to vanish, so we get f j pax q “
ax ` j ¨ Tx .
Hence, it is indeed true that all rows of the Table are arithmetic progressions.

Step 3. Keeping the above notation in force, we denote the step of the ith row of the table by Ti .
Now we claim that we have f pnq ´ n “ f pn ` T q ´ pn ` T q for all n P Zą0 , where

T “ lcmpT1 , . . . , Tk q .

To see this, let any n P Zą0 be given and denote the index of the row in which it appears in
the Table by i. Then we have f j pnq “ n ` j ¨ Ti for all j P Zą0 , and thus indeed

f pn ` T q ´ f pnq “ f 1`T {Ti pnq ´ f pnq “ pn ` T ` Ti q ´ pn ` Ti q “ T .

This concludes the solution.


Shortlisted problems – solutions 75

Comment 1. There are some alternative ways to complete the second part once the index x
corresponding to a “dense row” is found. For instance, one may show that for some integer Tx˚ the set

Y ˚ “ j P Zą0 ˇ f j`1 pax q ´ f j pax q “ Tx˚


ˇ (

is infinite, and then one may conclude with a similar divisibility argument.

Comment 2. It may be checked that, conversely, any way to fill out the Table with finitely many
arithmetic progressions so that each positive integer appears exactly once, gives rise to a function f
satisfying the two conditions mentioned in the problem. For example, we may arrange the positive
integers as follows:

2 4 6 8 10 ...
1 5 9 13 17 ...
3 7 11 15 19 ...

This corresponds to the function


#
n ` 2 if n is even;
f pnq “
n ` 4 if n is odd.

As this example shows, it is not true that the function n ÞÑ f pnq ´ n has to be constant.
76 IMO 2015 Thailand

N7. Let Zą0 denote the set of positive


` integers. For˘ any positive integer k, a function
f : Zą0 Ñ Zą0 is called k-good if gcd f pmq ` n, f pnq ` m ď k for all m ‰ n. Find all k such
that there exists a k-good function.
(Canada)

Answer. k ě 2.
` ˘
Solution 1. For any function f : Zą0 Ñ Zą0 , let Gf pm, nq “ gcd f pmq ` n, f pnq ` m . Note
that a k-good function is also pk ` 1q-good for any positive integer k. Hence, it suffices to show
that there does not exist a 1-good function and that there exists a 2-good function.
We first show that there is no 1-good function. Suppose that there exists a function f such
that Gf pm, nq “ 1 for all m ‰ n. Now, if there are two distinct even numbers m and n such
that f pmq and f pnq are both even, then 2 | Gf pm, nq, a contradiction. A similar argument
holds if there are two distinct odd numbers m and n such that f pmq and f pnq are both odd.
Hence we can choose an even m and an odd n such that f pmq is odd and f pnq is even. This
also implies that 2 | Gf pm, nq, a contradiction.
We now construct a 2-good function. Define f pnq “ 2gpnq`1 ´ n ´ 1, where g is defined
recursively by gp1q “ 1 and gpn ` 1q “ p2gpnq`1 q!.
For any positive integers m ą n, set

A “ f pmq ` n “ 2gpmq`1 ´ m ` n ´ 1, B “ f pnq ` m “ 2gpnq`1 ´ n ` m ´ 1.

We need to show that gcdpA, Bq ď 2. First, note that A ` B “ 2gpmq`1 ` 2gpnq`1 ´ 2 is not
divisible by 4, so that 4 ∤ gcdpA, Bq. Now we suppose that there is an odd prime p for which
p | gcdpA, Bq and derive a contradiction.
We first claim that 2gpm´1q`1 ě B. This is a rather weak bound; one way to prove it is as fol-
lows. Observe that gpk `1q ą gpkq and hence 2gpk`1q`1 ě 2gpkq`1 `1 for every positive integer k.
By repeatedly applying this inequality, we obtain 2gpm´1q`1 ě 2gpnq`1 ` pm ´ 1q ´ n “ B.
Now, since p | B, we have p ´ 1 ă B ď 2gpm´1q`1 , so that p ´ 1 | p2gpm´1q`1 q! “ gpmq.
Hence 2gpmq ” 1 pmod pq, which yields A ` B ” 2gpnq`1 pmod pq. However, since p | A ` B,
this implies that p “ 2, a contradiction.

Solution 2. We provide an alternative construction of a 2-good function f .


Let P be the set consisting of 4 and all odd primes. For every p P P, we say that a number
a P t0, 1, . . . , p ´ 1u is p-useful if a ı ´a pmod pq. Note that a residue modulo p which is
neither 0 nor 2 is p-useful (the latter is needed only when p “ 4).
We will construct f recursively; in some steps, we will also define a p-useful number ap .
After the mth step, the construction will satisfy the following conditions:

(i ) The values of f pnq have already been defined for all n ď m, and p-useful numbers ap have
already been defined for all p ď m ` 2;

(ii ) If n ď m and p ď m ` 2, then f pnq ` n ı ap pmod pq;


` ˘
(iii ) gcd f pn1 q ` n2 , f pn2 q ` n1 ď 2 for all n1 ă n2 ď m.

If these conditions are satisfied, then f will be a 2-good function.


Step 1. Set f p1q “ 1 and a3 “ 1. Clearly, all the conditions are satisfied.
Step m, for m ě 2. We need to determine f pmq and, if m ` 2 P P, the number am`2 .
Defining f pmq. Let Xm “ tp P P : p | f pnq ` m for some n ă mu. We will determine
f pmq mod p for all p P Xm and then choose f pmq using the Chinese Remainder Theorem.
Shortlisted problems – solutions 77

Take any p P Xm . If p ď m ` 1, then we define f pmq ” ´ap ´ m pmod pq. Otherwise, if


p ě m ` 2, then we define f pmq ” 0 pmod pq.
Defining am`2 . Now let p “ m ` 2 and suppose that p P P. We choose ap to be a residue
modulo p that is not congruent to 0, 2, or f pnq ` n for any n ď m. Since f p1q ` 1 “ 2, there
are at most m ` 1 ă p residues to avoid, so we can always choose a remaining residue.
We first check that (ii) is satisfied. We only need to check it if p “ m ` 2 or n “ m. In the
former case, we have f pnq ` n ı ap pmod pq by construction. In the latter case, if n “ m and
p ď m ` 1, then we have f pmq ` m ” ´ap ı ap pmod pq, where we make use of the fact that
ap is p-useful.
` ˘
Now we check that (iii) holds. Suppose, to the contrary, that p | gcd f pnq ` m, f pmq ` n
for some n ă m. Then p P Xm and p | f pmq ` n. If p ě m ` 2, then 0 ” f pmq ` n ” n pmod pq,
which is impossible since n ă m ă p.
Otherwise, if p ď m ` 1, then
` ˘ ` ˘ ` ˘ ` ˘ ` ˘
0 ” f pmq ` n ` f pnq ` m ” f pnq ` n ` f pmq ` m ” f pnq ` n ´ ap pmod pq.

This implies that f pnq ` n ” ap pmod pq, a contradiction with (ii).

Comment 1. For any p P P, we may also define ap at step m for an arbitrary m ď p ´ 2. The
construction will work as long as we define a finite number of ap at each step.

Comment 2. When attempting to construct a 2-good function f recursively, the following way
seems natural. Start with setting f p1q “ 1. Next, for each integer m ą 1, introduce the set Xm like
in Solution 2 and define f pmq so as to satisfy

f pmq ” f pm ´ pq pmod pq for all p P Xm with p ă m, and


f pmq ” 0 pmod pq for all p P Xm with p ě m.

This construction
` might seem˘ to work. Indeed, consider a fixed p P P, and suppose that p
divides gcd f pnq ` m, f pmq ` n for some n ă m. Choose such m and n so that maxpm, nq is
minimal. ` Then p P Xm . We can check ˘ that p ă m, so that the construction implies that p di-
vides gcd f pnq ` pm ´ pq, f pm ´ pq ` n . Since maxpn, m ´ pq ă maxpm, nq, this almost leads to a
contradiction—the only trouble is the possibility that n “ m ´ p. However, this flaw may happen to
be not so easy to fix.
We will present one possible way to repair this argument in the next comment.

Comment 3. There are many recursive constructions for a 2-good function f . Here we sketch one
general approach which may be specified in different ways. For convenience, we denote by Zp the set
of residues modulo p; all operations on elements of Zp are also performed modulo p.
The general structure is the same as in Solution 2, i.e. using the Chinese Remainder Theorem to
successively determine f pmq. But instead of designating a common “safe” residue ap for future steps,
we act as follows.
p1q p2q ppq
For every p P P, in some step of the process we define p subsets Bp , Bp , . . . , Bp Ă Zp . The
meaning of these sets is that

f pmq ` m should be congruent to some element in Bppiq whenever m ” i pmod pq for i P Zp . (1)

piq piq
Moreover, in every such subset we specify a safe element bp P Bp . The meaning now is that in
piq
future steps, it is safe to set f pmq ` m ” bp pmod pq whenever m ” i pmod pq. In view of (1), this
` piq
safety will follow from the condition that p ∤ gcd bp ` pj ´ iq, cpjq ´ pj ´ iq for all j P Zp and all
˘
pjq
cpjq P Bp . In turn, this condition can be rewritten as

´ bpiq pjq
p R Bp , where j ” i ´ bpiq
p pmod pq. (2)
78 IMO 2015 Thailand

piq piq
The construction in Solution 2 is equivalent to setting bp “ ´ap and Bp “ Zp z tap u for all i.
However, there are different, more technical specifications of our approach.
piq piq
One may view the (incomplete) construction in Comment 2 as defining Bp and bp at step p ´ 1
p0q p0q ( piq piq (
by setting Bp “ bp “ t0u and Bp “ bp “ tf piq ` i mod pu for every i “ 1, 2, . . . , p ´ 1.
However, this construction violates (2) as soon as some number of the form f piq ` i is divisible by
piq piq piq
some p with i ` 2 ď p P P, since then ´bp “ bp P Bp .
piq
Here is one possible way to repair this construction. For all p P P, we define the sets Bp and the
piq p1q p1q ( p´1q p0q p´1q ( p0q (
elements bp at step pp ´ 2q as follows. Set Bp “ bp “ t2u and Bp “ B p “ bp “ bp “
piq piq
t´1u. Next, for all i “ 2, . . . , p ´ 2, define Bp “ ti, f piq ` i mod pu and bp “ i. One may see that
these definitions agree with both (1) and (2).
Shortlisted problems – solutions 79

śk
N8. For every positive integer n with prime factorization n “ i“1 pαi i , define
ÿ
℧pnq “ αi .
i : pi ą10100

That is, ℧pnq is the number of prime factors of n greater than 10100 , counted with multiplicity.
Find all strictly increasing functions f : Z Ñ Z such that
` ˘
℧ f paq ´ f pbq ď ℧pa ´ bq for all integers a and b with a ą b. (1)

(Brazil)

Answer. f pxq “ ax ` b, where b is an arbitrary integer, and a is an arbitrary positive integer


with ℧paq “ 0.
Solution. A straightforward check shows that all the functions listed in the answer satisfy the
problem condition. It remains to show the converse.
Assume that f is a function satisfying the problem condition. Notice that the function
gpxq “ f pxq ´ f p0q also satisfies this condition. Replacing f by g, we assume from now on that
f p0q “ 0; then f pnq ą 0 for any positive integer n. Thus, we aim to prove that there exists a
positive integer a with ℧paq “ 0 such that f pnq “ an for all n P Z.
We start by introducing some notation. Set N “ 10100 . We say that a prime p is large
if p ą N, and p is small otherwise; let S be the set of all small primes. Next, we say that
a positive integer is large or small if all its prime factors are such (thus, the number 1 is the
unique number which is both large and small). For a positive integer k, we denote the greatest
large divisor of k and the greatest small divisor of k by Lpkq and Spkq, respectively; thus,
k “ LpkqSpkq.
We split the proof into three steps.
Step 1. We prove that for every large k, we have k | f paq ´ f pbq ðñ k | a ´ b. In other
` ˘
words, L f paq ´ f pbq “ Lpa ´ bq for all integers a and b with a ą b.
We use induction on k. The base case k “ 1 is trivial. For the induction step, assume that
k0 is a large number, and that the statement holds for all large numbers k with k ă k0 .
Claim 1. For any integers x and y with 0 ă x ´ y ă k0 , the number k0 does not divide
f pxq ´ f pyq.
Proof. Assume, to the contrary, that k0 | f pxq ´ f pyq. Let ℓ “ Lpx ´ yq; then ℓ ď x ´ y ă k0 .
By the induction hypothesis, ℓ | f pxq ´ f pyq, and thus lcmpk0 , ℓq | f pxq ´ f pyq. Notice that
lcmpk0 , ℓq is large, and lcmpk0 , ℓq ě k0 ą ℓ. But then
` ˘ ` ˘
℧ f pxq ´ f pyq ě ℧ lcmpk0 , ℓq ą ℧pℓq “ ℧px ´ yq,

which is impossible. l
Now we complete the induction step. By Claim 1, for every integer a each of the sequences

f paq, f pa ` 1q, . . . , f pa ` k0 ´ 1q and f pa ` 1q, f pa ` 2q, . . . , f pa ` k0 q

forms a complete residue system modulo k0 . This yields f paq ” f pa ` k0 q pmod k0 q. Thus,
f paq ” f pbq pmod k0 q whenever a ” b pmod k0 q.
Finally, if a ı b pmod k0 q then there exists an integer b1 such that b1 ” b pmod k0 q and
|a ´ b1 | ă k0 . Then f pbq ” f pb1 q ı f paq pmod k0 q. The induction step is proved.
Step 2. We prove that for some small integer a there exist infinitely many integers n such that
f pnq “ an. In other words, f is linear on some infinite set.
We start with the following general statement.
80 IMO 2015 Thailand

Claim 2. There exists a constant c such that f ptq ă ct for every positive integer t ą N.
Proof. Let d be the product of all small primes, and let α be a positive integer such that
2α ą f pNq. Then, for every p P S the numbers f p0q, f p1q, . . . , f pNq are distinct modulo pα .
Set P “ dα and c “ P ` f pNq.
Choose any integer t ą N. Due to the choice of α, for every p P S there exists at most one
nonnegative integer i ď N with pα | f ptq ´ f piq. Since |S| ă N, we` can choose˘ a nonnegative
integer j ď N such that pα ∤ f ptq ´ f pjq for `all p P S. Therefore,
˘ S f ptq ´ f pjq ă P .
On the other hand, Step 1 shows that L f ptq ´ f pjq “ Lpt ´ jq ď t ´ j. Since 0 ď j ď N,
this yields
` ˘ ` ˘ ` ˘
f ptq “ f pjq ` L f ptq ´ f pjq ¨ S f ptq ´ f pjq ă f pNq ` pt ´ jqP ď P ` f pNq t “ ct. l
` ˘
Now let T be the set of large primes. For every t P T , Step 1 implies L f ptq “ t, so the
ratio f ptq{t is an integer. Now Claim 2 leaves us with only finitely many choices for this ratio,
which means that there exists an infinite subset T 1 Ď T and a positive integer a such that
f ptq “ at for all t P T 1 , as required.
Since Lptq “ L f ptq “ LpaqLptq for all t P T 1 , we get Lpaq “ 1, so the number a is small.
` ˘

Step 3. We show that f pxq “ ax for all x P Z.


(
Let Ri “ x P Z : x ” i pmod N!q denote the residue class of i modulo N!.
Claim 3. Assume that for some r, there are infinitely many n P Rr such that f pnq “ an. Then
f pxq “ ax for all x P Rr`1 .
Proof. Choose ˇany x P Rˇr`1 . By our assumption, we can select n P Rr such that f pnq “ an
and |n ´ x| ą ˇf pxq ´ axˇ. Since n ´ x ” r ´ pr ` 1q “ ´1 pmod N!q, the number |n ´ x| is
large. Therefore, by Step 1 we have f pxq ” f pnq “ an ” ax pmod n ´ xq, so n ´ x | f pxq ´ ax.
Due to the choice of n, this yields f pxq “ ax. l
1
To complete Step 3, notice that the set T found in Step 2 contains infinitely many elements
of some residue class Ri . Applying Claim 3, we successively obtain that f pxq “ ax for all
x P Ri`1 , Ri`2 , . . . , Ri`N ! “ Ri . This finishes the solution.

Comment 1. As the proposer also mentions, one may ` also consider


˘ the version of the problem where
the condition (1) is replaced by the condition that L f paq ´ f pbq “ Lpa ´ bq for all integers a and b
with a ą b. This allows to remove of Step 1 from the solution.

Comment 2. Step 2 is the main step of the solution. We sketch several different approaches allowing
to perform this step using statements which are weaker than Claim 2.
Approach 1. Let us again denote the ` product of all
˘ smalli primes by d. We focus on the values f pdi q,
i ě 0. In view of Step 1, we have L f pd q ´ f pd q “ Lpd ´ d q “ di´k ´ 1 for all i ą k ě 0.
i k k

Acting similarly to the beginning of the proof of Claim 2, one may choose a number α ě 0 such
that the residues of the numbers f pdi q, i “ 0, 1, . . . , N , are distinct `modulo pα for˘each p P S. Then,
for every i ą N , there exists an exponent k “ kpiq ď N such that S f pdi q ´ f pdk q ă P “ dα .
` Since there ˘are only finitely many options for kpiq, as well as for the corresponding numbers
S f pdi q ´ f pdk q , there exists an infinite set I of `exponents i ą N ˘ such that kpiq attains the same
value k0 for all i P I, and such that, moreover, S f pdi q ´ f pdk0 q attains the same value s0 for all
i P I. Therefore, for all such i we have

f pdi q “ f pdk0 q ` L f pdi q ´ f pdk0 q ¨ S f pdi q ´ f pdk0 q “ f pdk0 q ` di´k0 ´ 1 s0 ,


` ˘ ` ˘ ` ˘

which means that f is linear on the infinite set tdi : i P Iu (although with rational coefficients).
Finally, one may implement the relation f pdi q ” f p1q pmod di ´ 1q in order to establish that in
fact f pdi q{di is a (small and fixed) integer for all i P I.
Shortlisted problems – solutions 81

Approach 2. Alternatively, one may start with the following lemma.


Lemma. There exists a positive constant c such that
˜ ¸
3N 3N
ź ` ˘ ź ` ˘ ` ˘2N
L f pkq ´ f piq “ L f pkq ´ f piq ě c f pkq
i“1 i“1

for all k ą 3N .
Proof. Let k be an integer with k ą 3N . Set Π “ 3N
ś ` ˘
i“1 f pkq ´ f piq .
Notice that for every prime p P S, at most one of the numbers in the set
(
H “ f pkq ´ f piq : 1 ď i ď 3N

is divisible by a power of p which is greater than f p3N q; we say that such elements of H are bad.
Now, for each element h P H which is not bad we have Sphq ď f p3N qN , while the bad elements do
not exceed f pkq. Moreover, there are less than N bad elements in H. Therefore,
ź ` ˘3N 2 ` ˘N
SpΠq “ S phq ď f p3N q ¨ f pkq .
hPH
` ˘3N
This easily yields the lemma statement in view of the fact that LpΠqSpΠq “ Π ě µ f pkq for some
absolute constant µ. l
As a corollary of the lemma, one may get a weaker version of Claim 2 stating that there exists a
positive constant C such that f pkq ď Ck 3{2 for all k ą 3N . Indeed, from Step 1 we have
3N 3N
ź ź ˘2N
k3N ě
` ˘ `
Lpk ´ iq “ L f pkq ´ f piq ě c f pkq ,
i“1 i“1

so f pkq ď c´1{p2N q k3{2 .


To complete Step 2 now, set a “ f p1q. Due to the estimates above, we may choose a positive
integer n0 such that ˇf pnq ´ anˇ ă npn´1q
ˇ ˇ
2 for all n ě
` n0 . ˘ ` ˘
Take any n ě n0 with n ” 2 pmod N !q. Then L f pnq ´ f p0q “ Lpnq “ n{2 and L f pnq ´ f p1q “
Lpn ´ 1q “ n ´ 1; these relations yield f pnq ” f p0q “ 0 ” an pmod n{2q and f pnq ” f p1q “ a ” an
pmod n ´ 1q, respectively. Thus, npn´1q
ˇ
ˇ f pnq ´ an, which shows that f pnq “ an in view of the
2
estimate above.

Comment 3. In order to perform Step 3, it suffices to establish the equality f pnq “ an for any
infinite set of values of n. However, if this set has some good structure, then one may find easier ways
to complete this step.
For instance, after showing, as in Approach 2, that f pnq “ an for all n ě n0 with n ” 2 pmod N !q,
one may proceed as follows. Pick an arbitrary integer x and take any large prime p which is greater
than |f pxq ´ ax|. By the Chinese Remainder Theorem, there exists a positive integer n ą maxpx, n0 q
such that n ” 2 pmod N !q and n ” x pmod pq. By Step 1, we have f pxq ” f pnq “ an ” ax pmod pq.
Due to the choice of p, this is possible only if f pxq “ ax.
Shortlisted Problems with Solutions
57th International Mathematical Olympiad
Hong Kong, 2016
Note of Confidentiality

The shortlisted problems should be kept


strictly confidential until IMO 2017.

Contributing Countries
The Organising Committee and the Problem Selection Committee of IMO 2016 thank the
following 40 countries for contributing 121 problem proposals:

Albania, Algeria, Armenia, Australia, Austria, Belarus,


Belgium, Bulgaria, Colombia, Cyprus, Czech Republic,
Denmark, Estonia, France, Georgia, Greece, Iceland,
India, Iran, Ireland, Israel, Japan, Latvia, Luxembourg,
Malaysia, Mexico, Mongolia, Netherlands, Philippines,
Russia, Serbia, Slovakia, Slovenia, South Africa, Taiwan,
Tanzania, Thailand, Trinidad and Tobago, Turkey, Ukraine.

Problem Selection Committee

Front row from left: Yong-Gao Chen, Andy Liu, Tat Wing Leung (Chairman).
Back row from left: Yi-Jun Yao, Yun-Hao Fu, Yi-Jie He,
Zhongtao Wu, Heung Wing Joseph Lee, Chi Hong Chow,
Ka Ho Law, Tak Wing Ching.
Shortlisted problems 3

Problems
Algebra

A1. Let a, b and c be positive real numbers such that min {ab, bc, ca} > 1. Prove that
Ç å2
»
3
a+b+c
(a2 + 1)(b2 + 1)(c2 + 1) 6 + 1.
3

A2. Find the smallest real constant C such that for any positive real numbers a1 , a2 , a3 , a4
and a5 (not necessarily distinct), one can always choose distinct subscripts i, j, k and l such
that
ai ak
− 6 C.
aj al

A3. Find all integers n > 3 with the following property: for all real numbers a1 , a2 , . . . , an
and b1 , b2 , . . . , bn satisfying |ak | + |bk | = 1 for 1 6 k 6 n, there exist x1 , x2 , . . . , xn , each of
which is either −1 or 1, such that

n
X n
X
x k ak + xk bk 6 1.
k=1 k=1

A4. Denote by R+ the set of all positive real numbers. Find all functions f : R+ → R+ such
that Ä ä
xf (x2 )f (f (y)) + f (yf (x)) = f (xy) f (f (x2 )) + f (f (y 2 ))
for all positive real numbers x and y.

A5.
a
(a) Prove that for every positive integer n, there exists a fraction where a and b are integers
√ √ √ b
satisfying 0 < b 6 n + 1 and n 6 ab 6 n + 1.
a
(b) Prove that there are infinitely many positive integers n such that there is no fraction
√ √ √ b
where a and b are integers satisfying 0 < b 6 n and n 6 ab 6 n + 1.
4 IMO 2016 Hong Kong

A6. The equation


(x − 1)(x − 2) · · · (x − 2016) = (x − 1)(x − 2) · · · (x − 2016)

is written on the board. One tries to erase some linear factors from both sides so that each
side still has at least one factor, and the resulting equation has no real roots. Find the least
number of linear factors one needs to erase to achieve this.

A7. Denote by R the set of all real numbers. Find all functions f : R → R such that
f (0) 6= 0 and
f (x + y)2 = 2f (x)f (y) + max {f (x2 ) + f (y 2 ), f (x2 + y 2 )}
for all real numbers x and y.

A8. Determine the largest real number a such that for all n > 1 and for all real numbers
x0 , x1 , . . . , xn satisfying 0 = x0 < x1 < x2 < · · · < xn , we have
Ç å
1 1 1 2 3 n+1
+ + ··· + >a + + ··· + .
x1 − x0 x2 − x1 xn − xn−1 x1 x2 xn
Shortlisted problems 5

Combinatorics

C1. The leader of an IMO team chooses positive integers n and k with n > k, and announces
them to the deputy leader and a contestant. The leader then secretly tells the deputy leader
an n-digit binary string, and the deputy leader writes down all n-digit binary strings which
differ from the leader’s in exactly k positions. (For example, if n = 3 and k = 1, and if the
leader chooses 101, the deputy leader would write down 001, 111 and 100.) The contestant
is allowed to look at the strings written by the deputy leader and guess the leader’s string.
What is the minimum number of guesses (in terms of n and k) needed to guarantee the correct
answer?

C2. Find all positive integers n for which all positive divisors of n can be put into the cells
of a rectangular table under the following constraints:

• each cell contains a distinct divisor;

• the sums of all rows are equal; and

• the sums of all columns are equal.

C3. Let n be a positive integer relatively prime to 6. We paint the vertices of a regular
n-gon with three colours so that there is an odd number of vertices of each colour. Show that
there exists an isosceles triangle whose three vertices are of different colours.

C4. Find all positive integers n for which we can fill in the entries of an n × n table with
the following properties:

• each entry can be one of I, M and O;

• in each row and each column, the letters I, M and O occur the same number of times;
and

• in any diagonal whose number of entries is a multiple of three, the letters I, M and O
occur the same number of times.

C5. Let n > 3 be a positive integer. Find the maximum number of diagonals of a regular
n-gon one can select, so that any two of them do not intersect in the interior or they are
perpendicular to each other.
6 IMO 2016 Hong Kong

C6. There are n > 3 islands in a city. Initially, the ferry company offers some routes between
some pairs of islands so that it is impossible to divide the islands into two groups such that
no two islands in different groups are connected by a ferry route.
After each year, the ferry company will close a ferry route between some two islands X
and Y . At the same time, in order to maintain its service, the company will open new routes
according to the following rule: for any island which is connected by a ferry route to exactly
one of X and Y , a new route between this island and the other of X and Y is added.
Suppose at any moment, if we partition all islands into two nonempty groups in any way,
then it is known that the ferry company will close a certain route connecting two islands from
the two groups after some years. Prove that after some years there will be an island which is
connected to all other islands by ferry routes.

C7. Let n > 2 be an integer. In the plane, there are n segments given in such a way that
any two segments have an intersection point in the interior, and no three segments intersect
at a single point. Jeff places a snail at one of the endpoints of each of the segments and claps
his hands n − 1 times. Each time when he claps his hands, all the snails move along their own
segments and stay at the next intersection points until the next clap. Since there are n − 1
intersection points on each segment, all snails will reach the furthest intersection points from
their starting points after n − 1 claps.

(a) Prove that if n is odd then Jeff can always place the snails so that no two of them ever
occupy the same intersection point.

(b) Prove that if n is even then there must be a moment when some two snails occupy the
same intersection point no matter how Jeff places the snails.

C8. Let n be a positive integer. Determine the smallest positive integer k with the following
property: it is possible to mark k cells on a 2n × 2n board so that there exists a unique
partition of the board into 1 × 2 and 2 × 1 dominoes, none of which contains two marked
cells.
Shortlisted problems 7

Geometry
G1. In a convex pentagon ABCDE, let F be a point on AC such that ∠F BC = 90◦ .
Suppose triangles ABF , ACD and ADE are similar isosceles triangles with

∠F AB = ∠F BA = ∠DAC = ∠DCA = ∠EAD = ∠EDA.

Let M be the midpoint of CF . Point X is chosen such that AM XE is a parallelogram. Show


that BD, EM and F X are concurrent.

G2. Let ABC be a triangle with circumcircle Γ and incentre I. Let M be the midpoint of
side BC. Denote by D the foot of perpendicular from I to side BC. The line through I per-
pendicular to AI meets sides AB and AC at F and E respectively. Suppose the circumcircle
of triangle AEF intersects Γ at a point X other than A. Prove that lines XD and AM meet
on Γ.

G3. Let B = (−1, 0) and C = (1, 0) be fixed points on the coordinate plane. A nonempty,
bounded subset S of the plane is said to be nice if

(i) there is a point T in S such that for every point Q in S, the segment T Q lies entirely
in S; and

(ii) for any triangle P1 P2 P3 , there exists a unique point A in S and a permutation σ of the
indices {1, 2, 3} for which triangles ABC and Pσ(1) Pσ(2) Pσ(3) are similar.

Prove that there exist two distinct nice subsets S and S 0 of the set {(x, y) : x > 0, y > 0}
such that if A ∈ S and A0 ∈ S 0 are the unique choices of points in (ii), then the product
BA · BA0 is a constant independent of the triangle P1 P2 P3 .

G4. Let ABC be a triangle with AB = AC 6= BC and let I be its incentre. The line BI
meets AC at D, and the line through D perpendicular to AC meets AI at E. Prove that the
reflection of I in AC lies on the circumcircle of triangle BDE.

G5. Let D be the foot of perpendicular from A to the Euler line (the line passing through the
circumcentre and the orthocentre) of an acute scalene triangle ABC. A circle ω with centre
S passes through A and D, and it intersects sides AB and AC at X and Y respectively. Let
P be the foot of altitude from A to BC, and let M be the midpoint of BC. Prove that the
circumcentre of triangle XSY is equidistant from P and M .
8 IMO 2016 Hong Kong

G6. Let ABCD be a convex quadrilateral with ∠ABC = ∠ADC < 90◦ . The internal
angle bisectors of ∠ABC and ∠ADC meet AC at E and F respectively, and meet each
other at point P . Let M be the midpoint of AC and let ω be the circumcircle of triangle
BP D. Segments BM and DM intersect ω again at X and Y respectively. Denote by Q the
intersection point of lines XE and Y F . Prove that P Q ⊥ AC.

G7. Let I be the incentre of a non-equilateral triangle ABC, IA be the A-excentre, IA0 be
the reflection of IA in BC, and lA be the reflection of line AIA0 in AI. Define points IB , IB0
and line lB analogously. Let P be the intersection point of lA and lB .

(a) Prove that P lies on line OI where O is the circumcentre of triangle ABC.

(b) Let one of the tangents from P to the incircle of triangle ABC meet the circumcircle at
points X and Y . Show that ∠XIY = 120◦ .

G8. Let A1 , B1 and C1 be points on sides BC, CA and AB of an acute triangle ABC
respectively, such that AA1 , BB1 and CC1 are the internal angle bisectors of triangle ABC.
Let I be the incentre of triangle ABC, and H be the orthocentre of triangle A1 B1 C1 . Show
that
AH + BH + CH > AI + BI + CI.
Shortlisted problems 9

Number Theory
N1. For any positive integer k, denote the sum of digits of k in its decimal representation by
S(k). Find all polynomials P (x) with integer coefficients such that for any positive integer
n > 2016, the integer P (n) is positive and

S(P (n)) = P (S(n)).

N2. Let τ (n) be the number of positive divisors of n. Let τ1 (n) be the number of positive
divisors of n which have remainders 1 when divided by 3. Find all possible integral values of
the fraction ττ1(10n)
(10n)
.

N3. Define P (n) = n2 + n + 1. For any positive integers a and b, the set
{P (a), P (a + 1), P (a + 2), . . . , P (a + b)}

is said to be fragrant if none of its elements is relatively prime to the product of the other
elements. Determine the smallest size of a fragrant set.

N4. Let n, m, k and l be positive integers with n 6= 1 such that nk + mnl + 1 divides nk+l − 1.
Prove that

• m = 1 and l = 2k; or
nk−l −1
• l|k and m = nl −1
.

N5. Let a be a positive integer which is not a square number. Denote by A the set of all
positive integers k such that
x2 − a
k= 2 (1)
x − y2

for some integers x and y with x > a. Denote by B the set √ of all positive integers k such
that (1) is satisfied for some integers x and y with 0 6 x < a. Prove that A = B.

N6. Denote by N the set of all positive integers. Find all functions f : N → N such that
for all positive integers m and n, the integer f (m) + f (n) − mn is nonzero and divides
mf (m) + nf (n).
10 IMO 2016 Hong Kong

N7. Let n be an odd positive integer. In the Cartesian plane, a cyclic polygon P with area
S is chosen. All its vertices have integral coordinates, and all squares of its side lengths are
divisible by n. Prove that 2S is an integer divisible by n.

N8. Find all polynomials P (x) of odd degree d and with integer coefficients satisfying the
following property: for each positive integer n, there exist n positive integers x1 , x2 , . . . , xn
such that 21 < PP (x
(xi )
j)
< 2 and PP (x
(xi )
j)
is the d-th power of a rational number for every pair of
indices i and j with 1 6 i, j 6 n.
Shortlisted problems 11

Solutions
Algebra

A1. Let a, b and c be positive real numbers such that min {ab, bc, ca} > 1. Prove that
Ç å2
»
3
a+b+c
(a2 + 1)(b2 + 1)(c2 + 1) 6 + 1. (1)
3

Solution 1. We first show the following.

• Claim. For any positive real numbers x, y with xy > 1, we have


å2
x + y ã2
ÇÅ
2 2
(x + 1)(y + 1) 6 +1 . (2)
2

Proof. Note that xy > 1 implies ( x+y


2
)2 − 1 > xy − 1 > 0. We find that
å2 å2
x + y ã2 x + y ã2
ÇÅ ÇÅ
2 2 2 2 2
(x + 1)(y + 1) = (xy − 1) + (x + y) 6 −1 + (x + y) = +1 .
2 2

a+b+c
Without loss of generality, assume a > b > c. This implies a > 1. Let d = 3
. Note
that
a(a + b + c) 1+1+1
ad = > = 1.
3 3
Then we can apply (2) to the pair (a, d) and the pair (b, c). We get
Ç å2 !2 Ç å2 !2
2 2 2 2 a+d b+c
(a + 1)(d + 1)(b + 1)(c + 1) 6 +1 +1 . (3)
2 2

Next, from
a+d b+c √ √
· > ad · bc > 1,
2 2
we can apply (2) again to the pair ( a+d
2
, b+c
2
). Together with (3), we have
Ç å2 !4
2 2 2 2 a+b+c+d
(a + 1)(d + 1)(b + 1)(c + 1) 6 +1 = (d2 + 1)4 .
4

Therefore, (a2 + 1)(b2 + 1)(c2 + 1) 6 (d2 + 1)3 , and (1) follows by taking cube root of both
sides.
12 IMO 2016 Hong Kong

Comment. After justifying the Claim, one may also obtain (1) by mixing variables. Indeed,
the function involved is clearly continuous, and hence it suffices to check that the condition
xy > 1 is preserved under each mixing step. This is true since whenever ab, bc, ca > 1, we
have
a+b a+b a+b 1+1
· > ab > 1 and ·c> = 1.
2 2 2 2
Solution 2. Let f (x) = ln (1 + x2 ). Then the inequality (1) to be shown is equivalent to
Ç å
f (a) + f (b) + f (c) a+b+c
6f ,
3 3

while (2) becomes


f (x) + f (y) Å
x + yã
6f
2 2
for xy > 1.
Without loss of generality, assume a > b > c. From the Claim in Solution 1, we have

f (a) + f (b) + f (c) f (a) + 2f ( b+c


2
)
6 .
3 3
b+c

Note that a > 1 and 2
> bc > 1. Since

2(1 − x2 )
f 00 (x) = ,
(1 + x2 )2

we know that f is concave on [1, ∞). Then we can apply Jensen’s Theorem to get

f (a) + 2f ( b+c b+c


!
) a+2·
Ç å
2 2 a+b+c
6f =f .
3 3 3

This completes the proof.


Shortlisted problems 13

A2. Find the smallest real constant C such that for any positive real numbers a1 , a2 , a3 , a4
and a5 (not necessarily distinct), one can always choose distinct subscripts i, j, k and l such
that
ai ak
− 6 C. (1)
aj al

Answer. The smallest C is 12 .

Solution. We first show that C 6 12 . For any positive real numbers a1 6 a2 6 a3 6 a4 6 a5 ,


consider the five fractions
a1 a3 a1 a2 a4
, , , , . (2)
a2 a4 a5 a3 a5
Each of them lies in the interval (0, 1]. Therefore, by the Pigeonhole Principle, at least three
of them must lie in (0, 21 ] or lie in ( 12 , 1] simultaneously. In particular, there must be two
consecutive terms in (2) which belong to an interval of length 12 (here, we regard aa21 and aa45
as consecutive). In other words, the difference of these two fractions is less than 12 . As the
indices involved in these two fractions are distinct, we can choose them to be i, j, k, l and
conclude that C 6 21 .
Next, we show that C = 12 is best possible. Consider the numbers 1, 2, 2, 2, n where n is
a large real number. The fractions formed by two of these numbers in ascending order are
1 2 1 2 2 n n
, , , , , , . Since the indices i, j, k, l are distinct, n1 and n2 cannot be chosen simultane-
n n 2 2 1 2 1
ously. Therefore the minimum value of the left-hand side of (1) is 21 − n2 . When n tends to
infinity, this value approaches 12 , and so C cannot be less than 21 .
These conclude that C = 21 is the smallest possible choice.

Comment. The conclusion still holds if a1 , a2 , . . . , a5 are pairwise distinct, since in the con-
struction, we may replace the 2’s by real numbers sufficiently close to 2.
There are two possible simplifications for this problem:
1
(i) the answer C = 2
is given to the contestants; or

(ii) simply ask the contestants to prove the inequality (1) for C = 12 .
14 IMO 2016 Hong Kong

A3. Find all integers n > 3 with the following property: for all real numbers a1 , a2 , . . . , an
and b1 , b2 , . . . , bn satisfying |ak | + |bk | = 1 for 1 6 k 6 n, there exist x1 , x2 , . . . , xn , each of
which is either −1 or 1, such that
n
X n
X
xk ak + xk bk 6 1. (1)
k=1 k=1

Answer. n can be any odd integer greater than or equal to 3.


Solution 1. For any even integer n > 4, we consider the case
a1 = a2 = · · · = an−1 = bn = 0 and b1 = b2 = · · · = bn−1 = an = 1.
The condition |ak | + |bk | = 1 is satisfied for each 1 6 k 6 n. No matter how we choose each
xk , both sums nk=1 xk ak and nk=1 xk bk are odd integers. This implies | nk=1 xk ak | > 1 and
P P P

| nk=1 xk bk | > 1, which shows (1) cannot hold.


P

For any odd integer n > 3, we may assume without loss of generality bk > 0 for 1 6 k 6 n
(this can be done by flipping the pair (ak , bk ) to (−ak , −bk ) and xk to −xk if necessary) and
a1 > a2 > · · · > am > 0 > am+1 > · · · > an . We claim that the choice xk = (−1)k+1 for
1 6 k 6 n will work. Define
m
X n
X
s= x k ak and t = − x k ak .
k=1 k=m+1

Note that
s = (a1 − a2 ) + (a3 − a4 ) + · · · > 0
by the assumption a1 > a2 > · · · > am (when m is odd, there is a single term am at the end,
which is also positive). Next, we have
s = a1 − (a2 − a3 ) − (a4 − a5 ) − · · · 6 a1 6 1.
Similarly,
t = (−an + an−1 ) + (−an−2 + an−3 ) + · · · > 0
and
t = −an + (an−1 − an−2 ) + (an−3 − an−4 ) + · · · 6 −an 6 1.
From the condition, we have ak +bk = 1 for 1 6 k 6 m and −ak +bk = 1 for m+1 6 k 6 n.
It follows that nk=1 xk ak = s − t and nk=1 xk bk = 1 − s − t. Hence it remains to prove
P P

|s − t| + |1 − s − t| 6 1
under the constraint 0 6 s, t 6 1. By symmetry, we may assume s > t. If 1 − s − t > 0, then
we have
|s − t| + |1 − s − t| = s − t + 1 − s − t = 1 − 2t 6 1.
If 1 − s − t 6 0, then we have
|s − t| + |1 − s − t| = s − t − 1 + s + t = 2s − 1 6 1.
Hence, the inequality is true in both cases.
These show n can be any odd integer greater than or equal to 3.
Shortlisted problems 15

Solution 2. The even case can be handled in the same way as Solution 1. For the odd case,
we prove by induction on n.
Firstly, for n = 3, we may assume without loss of generality a1 > a2 > a3 > 0 and
b1 = a1 − 1 (if b1 = 1 − a1 , we may replace each bk by −bk ).

• Case 1. b2 = a2 − 1 and b3 = a3 − 1, in which case we take (x1 , x2 , x3 ) = (1, −1, 1).


Let c = a1 − a2 + a3 so that 0 6 c 6 1. Then |b1 − b2 + b3 | = |a1 − a2 + a3 − 1| = 1 − c
and hence |c| + |b1 − b2 + b3 | = 1.

• Case 2. b2 = 1 − a2 and b3 = 1 − a3 , in which case we take (x1 , x2 , x3 ) = (1, −1, 1).


Let c = a1 − a2 + a3 so that 0 6 c 6 1. Since a3 6 a2 and a1 6 1, we have

c − 1 6 b1 − b2 + b3 = a1 + a2 − a3 − 1 6 1 − c.

This gives |b1 − b2 + b3 | 6 1 − c and hence |c| + |b1 − b2 + b3 | 6 1.

• Case 3. b2 = a2 − 1 and b3 = 1 − a3 , in which case we take (x1 , x2 , x3 ) = (−1, 1, 1).


Let c = −a1 + a2 + a3 . If c > 0, then a3 6 1 and a2 6 a1 imply

c − 1 6 −b1 + b2 + b3 = −a1 + a2 − a3 + 1 6 1 − c.

If c < 0, then a1 6 a2 + 1 and a3 > 0 imply

−c − 1 6 −b1 + b2 + b3 = −a1 + a2 − a3 + 1 6 1 + c.

In both cases, we get | − b1 + b2 + b3 | 6 1 − |c| and hence |c| + | − b1 + b2 + b3 | 6 1.

• Case 4. b2 = 1 − a2 and b3 = a3 − 1, in which case we take (x1 , x2 , x3 ) = (−1, 1, 1).


Let c = −a1 + a2 + a3 . If c > 0, then a2 6 1 and a3 6 a1 imply

c − 1 6 −b1 + b2 + b3 = −a1 − a2 + a3 + 1 6 1 − c.

If c < 0, then a1 6 a3 + 1 and a2 > 0 imply

−c − 1 6 −b1 + b2 + b3 = −a1 − a2 + a3 + 1 6 1 + c.

In both cases, we get | − b1 + b2 + b3 | 6 1 − |c| and hence |c| + | − b1 + b2 + b3 | 6 1.

We have found x1 , x2 , x3 satisfying (1) in each case for n = 3.


Now, let n > 5 be odd and suppose the result holds for any smaller odd cases. Again
we may assume ak > 0 for each 1 6 k 6 n. By the Pigeonhole Principle, there are at least
three indices k for which bk = ak − 1 or bk = 1 − ak . Without loss of generality, suppose
bk = ak − 1 for k = 1, 2, 3. Again by the Pigeonhole Principle, as a1 , a2 , a3 lies between 0
and 1, the difference of two of them is at most 21 . By changing indices if necessary, we may
assume 0 6 d = a1 − a2 6 21 .
By the inductive hypothesis, we can choose x3 , x4 , . . . , xn such that a0 = nk=3 xk ak and
P

b0 = nk=3 xk bk satisfy |a0 | + |b0 | 6 1. We may further assume a0 > 0.


P
16 IMO 2016 Hong Kong

• Case 1. b0 > 0, in which case we take (x1 , x2 ) = (−1, 1).


We have | − a1 + a2 + a0 | + | − (a1 − 1) + (a2 − 1) + b0 | = | − d + a0 | + | − d + b0 | 6
max {a0 + b0 − 2d, a0 − b0 , b0 − a0 , 2d − a0 − b0 } 6 1 since 0 6 a0 , b0 , a0 + b0 6 1 and 0 6 d 6 12 .

• Case 2. 0 > b0 > −a0 , in which case we take (x1 , x2 ) = (−1, 1).
We have | − a1 + a2 + a0 | + | − (a1 − 1) + (a2 − 1) + b0 | = | − d + a0 | + | − d + b0 |. If −d + a0 > 0,
this equals a0 − b0 = |a0 | + |b0 | 6 1. If −d + a0 < 0, this equals 2d − a0 − b0 6 2d 6 1.

• Case 3. b0 < −a0 , in which case we take (x1 , x2 ) = (1, −1).


We have |a1 − a2 + a0 | + |(a1 − 1) − (a2 − 1) + b0 | = |d + a0 | + |d + b0 |. If d + b0 > 0, this
equals 2d + a0 + b0 < 2d 6 1. If d + b0 < 0, this equals a0 − b0 = |a0 | + |b0 | 6 1.

Therefore, we have found x1 , x2 , . . . , xn satisfying (1) in each case. By induction, the


property holds for all odd integers n > 3.
Shortlisted problems 17

A4. Denote by R+ the set of all positive real numbers. Find all functions f : R+ → R+ such
that Ä ä
xf (x2 )f (f (y)) + f (yf (x)) = f (xy) f (f (x2 )) + f (f (y 2 )) (1)
for all positive real numbers x and y.
1
Answer. f (x) = x
for any x ∈ R+ .
Solution 1. Taking x = y = 1 in (1), we get f (1)f (f (1)) + f (f (1)) = 2f (1)f (f (1)) and
hence f (1) = 1. Swapping x and y in (1) and comparing with (1) again, we find
xf (x2 )f (f (y)) + f (yf (x)) = yf (y 2 )f (f (x)) + f (xf (y)). (2)
Taking y = 1 in (2), we have xf (x2 ) + f (f (x)) = f (f (x)) + f (x), that is,
f (x)
f (x2 ) = . (3)
x
Take y = 1 in (1) and apply (3) to xf (x2 ). We get f (x) + f (f (x)) = f (x)(f (f (x2 )) + 1),
which implies
f (f (x))
f (f (x2 )) = . (4)
f (x)
For any x ∈ R+ , we find that
Ç å
2 f (f (x)) (4)
(3) (3) f (x)
f (f (x) ) = = f (f (x2 )) = f . (5)
f (x) x
It remains to show the following key step.
• Claim. The function f is injective.
Proof. Using (3) and (4), we rewrite (1) as
Ç å
f (f (x)) f (f (y))
f (x)f (f (y)) + f (yf (x)) = f (xy) + . (6)
f (x) f (y)
Take x = y in (6) and apply (3). This gives f (x)f (f (x)) + f (xf (x)) = 2 f (fx(x)) , which means
Ç å
2
f (xf (x)) = f (f (x)) − f (x) . (7)
x
Using (3), equation (2) can be rewritten as
f (x)f (f (y)) + f (yf (x)) = f (y)f (f (x)) + f (xf (y)). (8)
Suppose f (x) = f (y) for some x, y ∈ R+ . Then (8) implies
f (yf (y)) = f (yf (x)) = f (xf (y)) = f (xf (x)).
Using (7), this gives
Ç å Ç å
2 2
f (f (y)) − f (y) = f (f (x)) − f (x) .
y x
Noting f (x) = f (y), we find x = y. This establishes the injectivity.
18 IMO 2016 Hong Kong

By the Claim and (5), we get the only possible solution f (x) = x1 . It suffices to check that
this is a solution. Indeed, the left-hand side of (1) becomes
1 x y x
x· 2 ·y+ = + ,
x y x y
while the right-hand side becomes
1 2 x y
(x + y 2 ) = + .
xy y x
The two sides agree with each other.
Solution 2. Taking x = y = 1 in (1), we get f (1)f (f (1)) + f (f (1)) = 2f (1)f (f (1)) and
hence f (1) = 1. Putting x = 1 in (1), we have f (f (y)) + f (y) = f (y)(1 + f (f (y 2 ))) so that
f (f (y)) = f (y)f (f (y 2 )). (9)
Putting y = 1 in (1), we get xf (x2 ) + f (f (x)) = f (x)(f (f (x2 )) + 1). Using (9), this gives
xf (x2 ) = f (x). (10)
1
Replace y by x
in (1). Then we have
Ç Ç åå Ç å Ç Ç åå
2 1 f (x) 2 1
xf (x )f f +f = f (f (x )) + f f .
x x x2
The relation (10) shows f ( f (x)
x
) = f (f (x2 )). Also, using (9) with y = 1
x
and using (10) again,
the last equation reduces to Ç å
1
f (x)f = 1. (11)
x
Replace x by x1 and y by y1 in (1) and apply (11). We get
Ç å
1 1 1 1 1
2
+ = + .
xf (x )f (f (y)) f (yf (x)) f (xy) f (f (x )) f (f (y 2 ))
2

Clearing denominators, we can use (1) to simplify the numerators and obtain
f (xy)2 f (f (x2 ))f (f (y 2 )) = xf (x2 )f (f (y))f (yf (x)).
Using (9) and (10), this is the same as
f (xy)2 f (f (x)) = f (x)2 f (y)f (yf (x)). (12)
Substitute y = f (x) in (12) and apply (10) (with x replaced by f (x)). We have
f (xf (x))2 = f (x)f (f (x)). (13)
Taking y = x in (12), squaring both sides, and using (10) and (13), we find that
f (f (x)) = x4 f (x)3 . (14)
Finally, we combine (9), (10) and (14) to get
(14) (9) (14) (10)
y 4 f (y)3 = f (f (y)) = f (y)f (f (y 2 )) = f (y)y 8 f (y 2 )3 = y 5 f (y)4 ,
which implies f (y) = y1 . This is a solution by the checking in Solution 1.
Shortlisted problems 19

A5.
a
(a) Prove that for every positive integer n, there exists a fraction where a and b are integers
√ √ √ b
satisfying 0 < b 6 n + 1 and n 6 ab 6 n + 1.
a
(b) Prove that there are infinitely many positive integers n such that there is no fraction
√ √ √ b
where a and b are integers satisfying 0 < b 6 n and n 6 ab 6 n + 1.
Solution.
(a) Let r be the unique positive integer for which r2 6 n < (r + 1)2 . Write n = r2 + s. Then
we have 0 6 s 6 2r. We discuss in two cases according to the parity of s.
• Case 1. s is even.
s 2
Consider the number (r + 2r
) = r2 + s + ( 2rs )2 . We find that

2 s ã2 2
Å
n=r +s6r +s+ 6 r2 + s + 1 = n + 1.
2r
It follows that √ √
s
n6r+ 6 n + 1.
2r
s r2 +(s/2) √
Since s is even, we can choose the fraction r + 2r
= r
since r 6 n.
• Case 2. s is odd.
Consider the number (r + 1 − 2r+1−s
2(r+1)
)2 = (r + 1)2 − (2r + 1 − s) + ( 2r+1−s
2(r+1)
)2 . We find that
å2
2r + 1 − s
Ç
2 2 2
n = r + s = (r + 1) − (2r + 1 − s) 6 (r + 1) − (2r + 1 − s) +
2(r + 1)
2
6 (r + 1) − (2r + 1 − s) + 1 = n + 1.

It follows that
√ 2r + 1 − s √
n6r+1− 6 n + 1.
2(r + 1)
2r+1−s (r+1)2 −r+((s−1)/2)
Since s is odd, we can choose the fraction (r + 1) − 2(r+1)
= r+1
since

r + 1 6 n + 1.

(b) We show that for every positive integer r, there is no fraction ab with b 6 r2 + 1 such
√ √
that r2 + 1 6 ab 6 r2 + 2. Suppose on the contrary that such a fraction exists. Since

b 6 r2 + 1 < r + 1 and b is an integer, we have b 6 r. Hence,

(br)2 < b2 (r2 + 1) 6 a2 6 b2 (r2 + 2) 6 b2 r2 + 2br < (br + 1)2 .

This shows the square number a2 is strictly bounded between the two consecutive squares
(br)2 and (br + 1)2 , which is impossible. Hence, we have found infinitely many n = r2 + 1
for which there is no fraction of the desired form.
20 IMO 2016 Hong Kong

A6. The equation


(x − 1)(x − 2) · · · (x − 2016) = (x − 1)(x − 2) · · · (x − 2016)
is written on the board. One tries to erase some linear factors from both sides so that each
side still has at least one factor, and the resulting equation has no real roots. Find the least
number of linear factors one needs to erase to achieve this.
Answer. 2016.
Solution. Since there are 2016 common linear factors on both sides, we need to erase at least
2016 factors. We claim that the equation has no real roots if we erase all factors (x − k) on
the left-hand side with k ≡ 2, 3 (mod 4), and all factors (x − m) on the right-hand side with
m ≡ 0, 1 (mod 4). Therefore, it suffices to show that no real number x satisfies
503
Y 503
Y
(x − 4j − 1)(x − 4j − 4) = (x − 4j − 2)(x − 4j − 3). (1)
j=0 j=0

• Case 1. x = 1, 2, . . . , 2016.
In this case, one side of (1) is zero while the other side is not. This shows x cannot satisfy
(1).
• Case 2. 4k + 1 < x < 4k + 2 or 4k + 3 < x < 4k + 4 for some k = 0, 1, . . . , 503.
For j = 0, 1, . . . , 503 with j 6= k, the product (x − 4j − 1)(x − 4j − 4) is positive. For
j = k, the product (x − 4k − 1)(x − 4k − 4) is negative. This shows the left-hand side of (1)
is negative. On the other hand, each product (x − 4j − 2)(x − 4j − 3) on the right-hand side
of (1) is positive. This yields a contradiction.
• Case 3. x < 1 or x > 2016 or 4k < x < 4k + 1 for some k = 1, 2, . . . , 503.
The equation (1) can be rewritten as
503 503
(x − 4j − 1)(x − 4j − 4) Y
Ç å
Y 2
1= = 1− .
j=0 (x − 4j − 2)(x − 4j − 3) j=0 (x − 4j − 2)(x − 4j − 3)
Note that (x − 4j − 2)(x − 4j − 3) > 2 for 0 6 j 6 503 in this case. So each term in the
product lies strictly between 0 and 1, and the whole product must be less than 1, which is
impossible.
• Case 4. 4k + 2 < x < 4k + 3 for some k = 0, 1, . . . , 503.
This time we rewrite (1) as
503
x − 1 x − 2016 Y (x − 4j)(x − 4j − 1)
1= ·
x − 2 x − 2015 j=1 (x − 4j + 1)(x − 4j − 2)
503
x − 1 x − 2016 Y
Ç å
2
= · 1+ .
x − 2 x − 2015 j=1 (x − 4j + 1)(x − 4j − 2)

Clearly, x−1
x−2
and x−2016
x−2015
are both greater than 1. For the range of x in this case, each term
in the product is also greater than 1. Then the right-hand side must be greater than 1 and
hence a contradiction arises.
Shortlisted problems 21

From the four cases, we conclude that (1) has no real roots. Hence, the minimum number
of linear factors to be erased is 2016.

Comment. We discuss the general case when 2016 is replaced by a positive integer n. The
above solution works equally well when n is divisible by 4.
If n ≡ 2 (mod 4), one may leave l(x) = (x − 1)(x − 2) · · · (x − n2 ) on the left-hand side
and r(x) = (x − n2 − 1)(x − n2 − 2) · · · (x − n) on the right-hand side. One checks that for
x < n+12
, we have |l(x)| < |r(x)|, while for x > n+1
2
, we have |l(x)| > |r(x)|.
If n ≡ 3 (mod 4), one may leave l(x) = (x − 1)(x − 2) · · · (x − n+12
) on the left-hand side
and r(x) = (x − 2 )(x − 2 ) · · · (x − n) on the right-hand side. For x < 1 or n+1
n+3 x+5
2
< x < n+3
2
,
n+1 n+3
we have l(x) > 0 > r(x). For 1 < x < 2 , we have |l(x)| < |r(x)|. For x > 2 , we have
|l(x)| > |r(x)|.
If n ≡ 1 (mod 4), as the proposer mentioned, the situation is a bit more out of control.
Since the construction for n − 1 ≡ 0 (mod 4) works, the answer can be either n or n − 1. For
n = 5, we can leave the products (x − 1)(x − 2)(x − 3)(x − 4) and (x − 5). For n = 9, the
only example that works is l(x) = (x − 1)(x − 2)(x − 9) and r(x) = (x − 3)(x − 4) · · · (x − 8),
while there seems to be no such partition for n = 13.
22 IMO 2016 Hong Kong

A7. Denote by R the set of all real numbers. Find all functions f : R → R such that
f (0) 6= 0 and
f (x + y)2 = 2f (x)f (y) + max {f (x2 ) + f (y 2 ), f (x2 + y 2 )} (1)
for all real numbers x and y.
Answer.
• f (x) = −1 for any x ∈ R; or
• f (x) = x − 1 for any x ∈ R.
Solution 1. Taking x = y = 0 in (1), we get f (0)2 = 2f (0)2 +max {2f (0), f (0)}. If f (0) > 0,
then f (0)2 + 2f (0) = 0 gives no positive solution. If f (0) < 0, then f (0)2 + f (0) = 0 gives
f (0) = −1. Putting y = 0 in (1), we have f (x)2 = −2f (x) + f (x2 ), which is the same as
(f (x) + 1)2 = f (x2 ) + 1. Let g(x) = f (x) + 1. Then for any x ∈ R, we have
g(x2 ) = g(x)2 > 0. (2)
From (1), we find that f (x + y)2 > 2f (x)f (y) + f (x2 ) + f (y 2 ). In terms of g, this becomes
(g(x + y) − 1)2 > 2(g(x) − 1)(g(y) − 1) + g(x2 ) + g(y 2 ) − 2. Using (2), this means
(g(x + y) − 1)2 > (g(x) + g(y) − 1)2 − 1. (3)
Putting x = 1 in (2), we get g(1) = 0 or 1. The two cases are handled separately.
• Case 1. g(1) = 0, which is the same as f (1) = −1.
We put x = −1 and y = 0 in (1). This gives f (−1)2 = −2f (−1) − 1, which forces
f (−1) = −1. Next, we take x = −1 and y = 1 in (1) to get 1 = 2 + max {−2, f (2)}. This
clearly implies 1 = 2 + f (2) and hence f (2) = −1, that is, g(2) = 0. From (2), we can prove
n n n
inductively that g(22 ) = g(2)2 = 0 for any n ∈ N. Substitute y = 22 − x in (3). We obtain
n n
(g(x) + g(22 − x) − 1)2 6 (g(22 ) − 1)2 + 1 = 2.
n
For any fixed x > 0, we consider n to be sufficiently
√ large so that 22 − x > 0. From (2), this
2n
implies g(2 − x) > 0 so that g(x) 6 1 + 2. Using (2) again, we get
n n √
g(x)2 = g(x2 ) 6 1 + 2
for any n ∈ N. Therefore, |g(x)| 6 1 for any x > 0.
If there exists a ∈ R for which g(a) 6= 0, then for sufficiently large n we must have
1 1 1
g((a2 ) 2n ) = g(a2 ) 2n > 12 . By taking x = −y = −(a2 ) 2n in (1), we obtain
1 = 2f (x)f (−x) + max {2f (x2 ), f (2x2 )}
= 2(g(x) − 1)(g(−x) − 1) + max {2(g(x2 ) − 1), g(2x2 ) − 1}
Ç åÇ å
1 1 1
62 − − +0=
2 2 2
since |g(−x)| = |g(x)| ∈ ( 12 , 1] by (2) and the choice of x, and since g(z) 6 1 for z > 0. This
yields a contradiction and hence g(x) = 0 must hold for any x. This means f (x) = −1 for
any x ∈ R, which clearly satisfies (1).
Shortlisted problems 23

• Case 2. g(1) = 1, which is the same as f (1) = 0.


We put x = −1 and y = 1 in (1) to get 1 = max {0, f (2)}. This clearly implies f (2) = 1
and hence g(2) = 2. Setting x = 2n and y = 2 in (3), we have

(g(2n + 2) − 1)2 > (g(2n) + 1)2 − 1.

By induction on n, it is easy to prove that g(2n) > n + 1 for all n ∈ N. For any real
number a > 1, we choose a large n ∈ N and take k to be the positive integer such that
n
2k 6 a2 < 2k + 2. From (2) and (3), we have

n n n 1 n
(g(a)2 − 1)2 + 1 = (g(a2 ) − 1)2 + 1 > (g(2k) + g(a2 − 2k) − 1)2 > k 2 > (a2 − 2)2
4
n n
since g(a2 − 2k) > 0. For large n, this clearly implies g(a)2 > 1. Thus,

n n 1 n
(g(a)2 )2 > (g(a)2 − 1)2 + 1 > (a2 − 2)2 .
4
This yields
n 1 n
g(a)2 > (a2 − 2). (4)
2
Note that n å2n
a2
Ç
2 2
n = 1 + n 6 1 +
a2 − 2 a2 − 2 2n (a2n − 2)
by binomial expansion. This can be rewritten as
n 1 a
(a2 − 2) 2n > 2 .
1+ 2n (a2n −2)

Together with (4), we conclude g(a) > a by taking n sufficiently large.


Consider x = na and y = a > 1 in (3). This gives (g((n+1)a)−1)2 > (g(na)+g(a)−1)2 −1.
By induction on n, it is easy to show g(na) > (n − 1)(g(a) − 1) + a for any n ∈ N. We choose
n
a large n ∈ N and take k to be the positive integer such that ka 6 22 < (k + 1)a. Using (2)
and (3), we have
n+1 n n n
22 > (22 −1)2 +1 = (g(22 )−1)2 +1 > (g(22 −ka)+g(ka)−1)2 > ((k−1)(g(a)−1)+a−1)2 ,

from which it follows that


n
n 22
22 > (k − 1)(g(a) − 1) + a − 1 > (g(a) − 1) − 2(g(a) − 1) + a − 1
a

holds for sufficiently large n. Hence, we must have g(a)−1


a
6 1, which implies g(a) 6 a + 1 for
any a > 1. Then for large n ∈ N, from (3) and (2) we have
n+1 n n n n
4a2 = (2a2 )2 > (g(2a2 ) − 1)2 > (2g(a2 ) − 1)2 − 1 = (2g(a)2 − 1)2 − 1.
24 IMO 2016 Hong Kong

This implies
n 1 » n
2a2 > (1 + 4a2n+1 + 1) > g(a)2 .
2
When n tends to infinity, this forces g(a) 6 a. Together with g(a) > a, we get g(a) = a for
all real numbers a > 1, that is, f (a) = a − 1 for all a > 1.
Finally, for any x ∈ R, we choose y sufficiently large in (1) so that y, x + y > 1. This gives
(x + y − 1)2 = 2f (x)(y − 1) + max {f (x2 ) + y 2 − 1, x2 + y 2 − 1}, which can be rewritten as

2(x − 1 − f (x))y = −x2 + 2x − 2 − 2f (x) + max {f (x2 ), x2 }.

As the right-hand side is fixed, this can only hold for all large y when f (x) = x − 1. We now
check that this function satisfies (1). Indeed, we have

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


= 2f (x)f (y) + max {f (x2 ) + f (y 2 ), f (x2 + y 2 )}.

Solution 2. Taking x = y = 0 in (1), we get f (0)2 = 2f (0)2 +max {2f (0), f (0)}. If f (0) > 0,
then f (0)2 + 2f (0) = 0 gives no positive solution. If f (0) < 0, then f (0)2 + f (0) = 0 gives
f (0) = −1. Putting y = 0 in (1), we have

f (x)2 = −2f (x) + f (x2 ). (5)

Replace x by −x in (5) and compare with (5) again. We get f (x)2 +2f (x) = f (−x)2 +2f (−x),
which implies
f (x) = f (−x) or f (x) + f (−x) = −2. (6)
Taking x = y and x = −y respectively in (1) and comparing the two equations obtained,
we have
f (2x)2 − 2f (x)2 = 1 − 2f (x)f (−x). (7)
Combining (6) and (7) to eliminate f (−x), we find that f (2x) can be ±1 (when f (x) = f (−x))
or ±(2f (x) + 1) (when f (x) + f (−x) = −2).
We prove the following.
• Claim. f (x) + f (−x) = −2 for any x ∈ R.
Proof. Suppose there exists a ∈ R such that f (a) + f (−a) 6= −2. Then f (a) = f (−a) 6= −1
and we may assume a > 0. We first show that f (a) 6= 1. Suppose f (a) = 1. Consider y = a
in (7). We get f (2a)2 = 1. Taking x = y = a in (1), we have 1 = 2 + max {2f (a2 ), f (2a2 )}.
From (5), f (a2 ) = 3 so that 1 > 2 + 6. This is impossible, and thus f (a) 6= 1.
As f (a) 6= ±1, we have f (a) = ±(2f ( a2 ) + 1). Similarly, f (−a) = ±(2f (− a2 ) + 1). These
two expressions are equal since f (a) = f (−a). If f ( a2 ) = f (− a2 ), then the above argument
works when we replace a by a2 . In particular, we have f (a)2 = f (2 · a2 )2 = 1, which is a
contradiction. Therefore, (6) forces f ( a2 ) + f (− a2 ) = −2. Then we get
Å
a Å ã
ã Å
a
Å ã ã
± 2f + 1 = ± −2f −3 .
2 2
Shortlisted problems 25

For any choices of the two signs, we either get a contradiction or f ( a2 ) = −1, in which case
f ( a2 ) = f (− a2 ) and hence f (a) = ±1 again. Therefore, there is no such real number a and the
Claim follows.
Replace x and y by −x and −y in (1) respectively and compare with (1). We get

f (x + y)2 − 2f (x)f (y) = f (−x − y)2 − 2f (−x)f (−y).

Using the Claim, this simplifies to f (x+y) = f (x)+f (y)+1. In addition, (5) can be rewritten
as (f (x) + 1)2 = f (x2 ) + 1. Therefore, the function g defined by g(x) = f (x) + 1 satisfies
g(x + y) = g(x) + g(y) and g(x)2 = g(x2 ). The latter relation shows g(y) is nonnegative for
y > 0. For such a function satisfying the Cauchy Equation g(x + y) = g(x) + g(y), it must
be monotonic increasing and hence g(x) = cx for some constant c.
From (cx)2 = g(x)2 = g(x2 ) = cx2 , we get c = 0 or 1, which corresponds to the two
functions f (x) = −1 and f (x) = x − 1 respectively, both of which are solutions to (1) as
checked in Solution 1.

Solution 3. As in Solution 2, we find that f (0) = −1,

(f (x) + 1)2 = f (x2 ) + 1 (8)

and
f (x) = f (−x) or f (x) + f (−x) = −2 (9)
for any x ∈ R. We shall show that one of the statements in (9) holds for all x ∈ R. Suppose
f (a) = f (−a) but f (a) + f (−a) 6= −2, while f (b) 6= f (−b) but f (b) + f (−b) = −2. Clearly,
a, b 6= 0 and f (a), f (b) 6= −1.
Taking y = a and y = −a in (1) respectively and comparing the two equations obtained,
we have f (x + a)2 = f (x − a)2 , that is, f (x + a) = ±f (x − a). This implies f (x + 2a) = ±f (x)
for all x ∈ R. Putting x = b and x = −2a − b respectively, we find f (2a + b) = ±f (b)
and f (−2a − b) = ±f (−b) = ±(−2 − f (b)). Since f (b) 6= −1, the term ±(−2 − f (b)) is
distinct from ±f (b) in any case. So f (2a + b) 6= f (−2a − b). From (9), we must have
f (2a + b) + f (−2a − b) = −2. Note that we also have f (b) + f (−b) = −2 where |f (b)|, |f (−b)|
are equal to |f (2a + b)|, |f (−2a − b)| respectively. The only possible case is f (2a + b) = f (b)
and f (−2a − b) = f (−b).
Applying the argument to −a instead of a and using induction, we have f (2ka + b) = f (b)
and f (2ka − b) = f (−b) for any integer k. Note that f (b) + f (−b) = −2 and f (b) 6= −1
imply one of √ f (b), f (−b) is less than −1. Without loss of generality, assume f (b) < −1. We
consider x = 2ka + b in (8) for sufficiently large k so that

(f (x) + 1)2 = f (2ka + b) + 1 = f (b) + 1 < 0

yields a contradiction. Therefore, one of the statements in (9) must hold for all x ∈ R.
26 IMO 2016 Hong Kong

• Case 1. f (x) = f (−x) for any x ∈ R.


For any a ∈ R, setting x = y = a2 and x = −y = a2 in (1) respectively and comparing
these, we obtain f (a)2 = f (0)2 = 1, which means f (a) = ±1 for all√a ∈ R. If f (a) = 1 for
some a, we may assume a > 0 since f (a) = f (−a). Taking x = y = a in (1), we get
√ √ √
f (2 a)2 = 2f ( a)2 + max {2, f (2a)} = 2f ( a)2 + 2.

Note that the left-hand side is ±1 while the right-hand side is an even integer. This is a
contradiction. Therefore, f (x) = −1 for all x ∈ R, which is clearly a solution.

• Case 2. f (x) + f (−x) = −2 for any x ∈ R.


This case can be handled in the same way as in Solution 2, which yields another solution
f (x) = x − 1.
Shortlisted problems 27

A8. Determine the largest real number a such that for all n > 1 and for all real numbers
x0 , x1 , . . . , xn satisfying 0 = x0 < x1 < x2 < · · · < xn , we have
Ç å
1 1 1 2 3 n+1
+ + ··· + >a + + ··· + . (1)
x1 − x0 x2 − x1 xn − xn−1 x1 x2 xn

Answer. The largest a is 49 .


4
Solution 1. We first show that a = 9
is admissible. For each 2 6 k 6 n, by the Cauchy-
Schwarz Inequality, we have

(k − 1)2 32
Ç å
(xk−1 + (xk − xk−1 )) + > (k − 1 + 3)2 ,
xk−1 xk − xk−1

which can be rewritten as


9 (k + 2)2 (k − 1)2
> − . (2)
xk − xk−1 xk xk−1
9
Summing (2) over k = 2, 3, . . . , n and adding x1
to both sides, we have
n n n
X 1 X k + 1 n2 X k+1
9 >4 + >4 .
k=1 xk − xk−1 k=1 xk xn k=1 xk

This shows (1) holds for a = 94 .


Next, we show that a = 94 is the optimal choice. Consider the sequence defined by x0 = 0
and xk = xk−1 + k(k + 1) for k > 1, that is, xk = 13 k(k + 1)(k + 2). Then the left-hand side
of (1) equals
n n Ç å
X 1 X 1 1 1
= − =1− ,
k=1 k(k + 1) k=1 k k+1 n+1
while the right-hand side equals
n n n Ç å Ç å
X k+1 X 1 3 X 1 1 3 1 1 1
a = 3a = a − = 1+ − − a.
k=1 xk k=1 k(k + 2) 2 k=1 k k + 2 2 2 n+1 n+2

When n tends to infinity, the left-hand side tends to 1 while the right-hand side tends to
9
4
a. Therefore a has to be at most 49 .
Hence the largest value of a is 94 .

Solution 2. We shall give an alternative method to establish (1) with a = 94 . We define


yk = xk − xk−1 > 0 for 1 6 k 6 n. By the Cauchy-Schwarz Inequality, for 1 6 k 6 n, we have
Ñ !2 é !!2 !2
k
! !
1 j+1
X 2 3 k+1 k+2
(y1 + y2 + · · · + yk ) > + + ··· + = .
j=1 yj 2 2 2 2 3
28 IMO 2016 Hong Kong

This can be rewritten as


Ñ !2 é
k
k+1 36 X 1 j+1
6 2 . (3)
y1 + y2 + · · · + yk k (k + 1)(k + 2)2 j=1 yj 2

Summing (3) over k = 1, 2, . . . , n, we get


2 3 n+1 c1 c2 cn
+ + ··· + 6 + + ··· + (4)
y1 y1 + y2 y1 + y2 + · · · + yn y1 y2 yn
where for 1 6 m 6 n,
!2 n
m+1 X 1
cm = 36
2 k=m k 2 (k + 1)(k + 2)2
n
9m2 (m + 1)2 X
Ç å
1 1
= 2 2

4 k=m k (k + 1) (k + 1)2 (k + 2)2
9m2 (m + 1)2
Ç å
1 1 9
= 2 2
− < .
4 m (m + 1) (n + 1) (n + 2)2
2 4

From (4), the inequality (1) holds for a = 49 . This is also the upper bound as can be
verified in the same way as Solution 1.
Shortlisted problems 29

Combinatorics
C1. The leader of an IMO team chooses positive integers n and k with n > k, and announces
them to the deputy leader and a contestant. The leader then secretly tells the deputy leader
an n-digit binary string, and the deputy leader writes down all n-digit binary strings which
differ from the leader’s in exactly k positions. (For example, if n = 3 and k = 1, and if the
leader chooses 101, the deputy leader would write down 001, 111 and 100.) The contestant
is allowed to look at the strings written by the deputy leader and guess the leader’s string.
What is the minimum number of guesses (in terms of n and k) needed to guarantee the correct
answer?
Answer. The minimum number of guesses is 2 if n = 2k and 1 if n 6= 2k.
Solution 1. Let X be the binary string chosen by the leader and let X 0 be the binary string
of length n every digit of which is different from that of X. The strings written by the deputy
leader are the same as those in the case when the leader’s string is X 0 and k is changed to
n − k. In view of this, we may assume k > n2 . Also, for the particular case k = n2 , this
argument shows that the strings X and X 0 cannot be distinguished, and hence in that case
the contestant has to guess at least twice.
It remains to show that the number of guesses claimed suffices. Consider any string Y
which differs from X in m digits where 0 < m < 2k. Without loss of generality, assume
the first m digits of X and Y are distinct. Let Z be the binary string obtained from X by
changing its first k digits. Then Z is written by the deputy leader. Note that Z differs from Y
by |m − k| digits where |m − k| < k since 0 < m < 2k. From this observation, the contestant
must know that Y is not the desired string.
As we have assumed k > n2 , when n < 2k, every string Y 6= X differs from X in fewer
than 2k digits. When n = 2k, every string except X and X 0 differs from X in fewer than 2k
digits. Hence, the answer is as claimed.
Solution 2. Firstly, assume n 6= 2k. Without loss of generality suppose the firstÄ digitä of
the leader’s string is 1. Then among the nk strings written by the deputy leader, n−1
Ä ä
k
will
Än−1ä
begin with 1 and k−1 will begin with 0. Since n 6= 2k, we have k + (k − 1) 6= n − 1 and
so n−1
Ä ä Än−1ä
k
6
= k−1
. Thus, by counting the number of strings written by the deputy leader that
start with 0 and 1, the contestant can tell the first digit of the leader’s string. The same can
be done on the other digits, so 1 guess suffices when n 6= 2k.
Secondly, for the case n = 2 and k = 1, the answer is clearly 2. For the remaining cases
where n = 2k > 2, the deputy leader would write down the same strings if the leader’s string
X is replaced by X 0 obtained by changing each digit of X. This shows at least 2 guesses
are needed. We shall show that 2 guesses suffice in this case. Suppose the first two digits of
the leader’s string are the same. Then among the strings written by the deputy leader, theä
prefices 01 and 10 will occur 2k−2
Ä ä Ä2k−2
k−1
times each, while the prefices 00 and 11 will occur k
times each. The two numbers are interchanged if the first two digits of the leader’s string
are different. Since 2k−2
Ä ä Ä2k−2ä
k−1
6
= k
, the contestant can tell whether the first two digits of the
leader’s string are the same or not. He can work out the relation of the first digit and the
30 IMO 2016 Hong Kong

other digits in the same way and reduce the leader’s string to only 2 possibilities. The proof
is complete.
Shortlisted problems 31

C2. Find all positive integers n for which all positive divisors of n can be put into the cells
of a rectangular table under the following constraints:

• each cell contains a distinct divisor;

• the sums of all rows are equal; and

• the sums of all columns are equal.

Answer. 1.

Solution 1. Suppose all positive divisors of n can be arranged into a rectangular table of
size k × l where the number of rows k does not exceed the number of columns l. Let the
sum of numbers in each column be s. Since n belongs to one of the columns, we have s > n,
where equality holds only when n = 1.
For j = 1, 2, . . . , l, let dj be the largest number in the j-th column. Without loss of
generality, assume d1 > d2 > · · · > dl . Since these are divisors of n, we have
n
dl 6 . (1)
l
As dl is the maximum entry of the l-th column, we must have
s n
dl > > . (2)
k k
The relations (1) and (2) combine to give nl > nk , that is, k > l. Together with k 6 l, we
conclude that k = l. Then all inequalities in (1) and (2) are equalities. In particular, s = n
and so n = 1, in which case the conditions are clearly satisfied.

Solution 2. Clearly n = 1 works. Then we assume n > 1 and let its prime factorization be
n = pr11 pr22 · · · prt t . Suppose the table has k rows and l columns with 1 < k 6 l. Note that kl is
the number of positive divisors of n and the sum of all entries is the sum of positive divisors
of n, which we denote by σ(n). Consider the column containing n. Since the column sum is
σ(n)
l
, we must have σ(n) l
> n. Therefore, we have
Ç å2
2 σ(n)
(r1 + 1)(r2 + 1) · · · (rt + 1) = kl 6 l <
n
Ç å2 Ç å2
1 1 1 1
= 1+ + · · · + r1 · · · 1 + + · · · + rt .
p1 p1 pt pt
This can be rewritten as
f (p1 , r1 )f (p2 , r2 ) · · · f (pt , rt ) < 1 (3)
where  2
1
r+1 (r + 1) 1 − p
f (p, r) =  2 =  2 .
1 1 1
1+ p
+ ··· + pr
1− pr+1
32 IMO 2016 Hong Kong

Direct computation yields


8 48 9
f (2, 1) = , f (2, 2) = , f (3, 1) = .
9 49 8
Also, we find that
Ç å−2
1
f (2, r) > 1 − > 1 for r > 3,
2r+1
1 −2 4
Ç å
4 9
f (3, r) > 1 − r+1 > > for r > 2, and
3 3 3 8
1 −2 32
Ç å
32 9
f (p, r) > 1 − r+1 > > for p > 5.
25 p 25 8

From these values and bounds, it is clear that (3) holds only when n = 2 or 4. In both cases,
it is easy to see that the conditions are not satisfied. Hence, the only possible n is 1.
Shortlisted problems 33

C3. Let n be a positive integer relatively prime to 6. We paint the vertices of a regular
n-gon with three colours so that there is an odd number of vertices of each colour. Show that
there exists an isosceles triangle whose three vertices are of different colours.

Solution. For k = 1, 2, 3, let ak be the number of isosceles triangles whose vertices contain
exactly k colours. Suppose on the contrary that a3 = 0. Let b, c, d be the number of vertices
of the three different colours respectively. We now count the number of pairs (4, E) where
4 is an isosceles triangle and E is a side of 4 whose endpoints are of different colours.
On the one hand, since we have assumed a3 = 0, each triangle in the pair must contain
exactly two colours, and hence each triangle contributes twice. Thus the number of pairs is
2a2 .
On the other hand, if we pick any two vertices A, B of distinct colours, then there are
three isosceles triangles having these as vertices, two when AB is not the base and one when
AB is the base since n is odd. Note that the three triangles are all distinct as (n, 3) = 1. In
this way, we count the number of pairs to be 3(bc + cd + db). However, note that 2a2 is even
while 3(bc + cd + db) is odd, as each of b, c, d is. This yields a contradiction and hence a3 > 1.

Comment. A slightly stronger version of this problem is to replace the condition (n, 6) = 1
by n being odd (where equilateral triangles are regarded as isosceles triangles). In that case,
the only difference in the proof is that by fixing any two vertices A, B, one can find exactly
one or three isosceles triangles having these as vertices. But since only parity is concerned in
the solution, the proof goes the same way.
The condition that there is an odd number of vertices of each colour is necessary, as can be
seen from the following example. Consider n = 25 and we label the vertices A0 , A1 , . . . , A24 .
Suppose colour 1 is used for A0 , colour 2 is used for A5 , A10 , A15 , A20 , while colour 3 is used
for the remaining vertices. Then any isosceles triangle having colours 1 and 2 must contain
A0 and one of A5 , A10 , A15 , A20 . Clearly, the third vertex must have index which is a multiple
of 5 so it is not of colour 3.
34 IMO 2016 Hong Kong

C4. Find all positive integers n for which we can fill in the entries of an n × n table with
the following properties:
• each entry can be one of I, M and O;

• in each row and each column, the letters I, M and O occur the same number of times;
and

• in any diagonal whose number of entries is a multiple of three, the letters I, M and O
occur the same number of times.
Answer. n can be any multiple of 9.
Solution. We first show that such a table exists when n is a multiple of 9. Consider the
following 9 × 9 table.
 
I I I M M M O O O
M M M O O O I I I


 
O O O I I I M M M 
 
I I I M M M O O O
 

 
M M M O O O I I I  (1)
 
O O O I I I M M M
 

 
I I I M M M O O O
 
M M M O O O I I I


O O O I I I M M M

It is a direct checking that the table (1) satisfies the requirements. For n = 9k where k is
a positive integer, we form an n × n table using k × k copies of (1). For each row and each
column of the table of size n, since there are three I’s, three M ’s and three O’s for any nine
consecutive entries, the numbers of I, M and O are equal. In addition, every diagonal of the
large table whose number of entries is divisible by 3 intersects each copy of (1) at a diagonal
with number of entries divisible by 3 (possibly zero). Therefore, every such diagonal also
contains the same number of I, M and O.
Next, consider any n × n table for which the requirements can be met. As the number of
entries of each row should be a multiple of 3, we let n = 3k where k is a positive integer. We
divide the whole table into k × k copies of 3 × 3 blocks. We call the entry at the centre of
such a 3 × 3 square a vital entry. We also call any row, column or diagonal that contains at
least one vital entry a vital line. We compute the number of pairs (l, c) where l is a vital line
and c is an entry belonging to l that contains the letter M . We let this number be N .
On the one hand, since each vital line contains the same number of I, M and O, it is
obvious that each vital row and each vital column contain k occurrences of M . For vital
diagonals in either direction, we count there are exactly

1 + 2 + · · · + (k − 1) + k + (k − 1) + · · · + 2 + 1 = k 2

occurrences of M . Therefore, we have N = 4k 2 .


Shortlisted problems 35

On the other hand, there are 3k 2 occurrences of M in the whole table. Note that each
entry belongs to exactly 1 or 4 vital lines. Therefore, N must be congruent to 3k 2 mod 3.
From the double counting, we get 4k 2 ≡ 3k 2 (mod 3), which forces k to be a multiple of
3. Therefore, n has to be a multiple of 9 and the proof is complete.
36 IMO 2016 Hong Kong

C5. Let n > 3 be a positive integer. Find the maximum number of diagonals of a regular
n-gon one can select, so that any two of them do not intersect in the interior or they are
perpendicular to each other.

Answer. n − 2 if n is even and n − 3 if n is odd.

Solution 1. We consider two cases according to the parity of n.

• Case 1. n is odd.
We first claim that no pair of diagonals is perpendicular. Suppose A, B, C, D are vertices
where AB and CD are perpendicular, and let E be the vertex lying on the perpendicular
bisector of AB. Let E 0 be the opposite point of E on the circumcircle of the regular polygon.
Since EC = E 0 D and C, D, E are vertices of the regular polygon, E 0 should also belong to
the polygon. This contradicts the fact that a regular polygon with an odd number of vertices
does not contain opposite points on the circumcircle.

E
C

A B
D
E0

Therefore in the odd case we can only select diagonals which do not intersect. In the
maximal case these diagonals should divide the regular n-gon into n − 2 triangles, so we can
select at most n − 3 diagonals. This can be done, for example, by selecting all diagonals
emanated from a particular vertex.

• Case 2. n is even.
If there is no intersection, then the proof in the odd case works. Suppose there are two
perpendicular diagonals selected. We consider the set S of all selected diagonals parallel to
one of them which intersect with some selected diagonals. Suppose S contains k diagonals
and the number of distinct endpoints of the k diagonals is l.
Firstly, consider the longest diagonal in one of the two directions in S. No other diagonal
in S can start from either endpoint of that diagonal, since otherwise it has to meet another
longer diagonal in S. The same holds true for the other direction. Ignoring these two longest
diagonals and their four endpoints, the remaining k − 2 diagonals share l − 4 endpoints where
each endpoint can belong to at most two diagonals. This gives 2(l − 4) > 2(k − 2), so that
k 6 l − 2.
Shortlisted problems 37

d2
d d2
d1 d d1

Consider a group of consecutive vertices of the regular n-gon so that each of the two
outermost vertices is an endpoint of a diagonal in S, while the interior points are not. There
are l such groups. We label these groups P1 , P2 , . . . , Pl in this order. We claim that each
selected diagonal outside S must connect vertices of the same group Pi . Consider any diagonal
d joining vertices from distinct groups Pi and Pj . Let d1 and d2 be two diagonals in S each
having one of the outermost points of Pi as endpoint. Then d must meet either d1 , d2 or a
diagonal in S which is perpendicular to both d1 and d2 . In any case d should belong to S by
definition, which is a contradiction.
Within the same group Pi , there are no perpendicular diagonals since the vertices belong
to the same side of a diameter of the circumcircle. Hence there can be at most |Pi |−2 selected
diagonals within Pi , including the one joining the two outermost points of Pi when |Pi | > 2.
Therefore, the maximum number of diagonals selected is
l
X l
X
(|Pi | − 2) + k = |Pi | − 2l + k = (n + l) − 2l + k = n − l + k 6 n − 2.
i=1 i=1

This upper bound can be attained as follows. We take any vertex A and let A0 be the
vertex for which AA0 is a diameter of the circumcircle. If we select all diagonals emanated
from A together with the diagonal d0 joining the two neighbouring vertices of A0 , then the
only pair of diagonals that meet each other is AA0 and d0 , which are perpendicular to each
other. In total we can take n − 2 diagonals.
A0

d0

A
Solution 2. The constructions and the odd case are the same as Solution 1. Instead of
dealing separately with the case where n is even, we shall prove by induction more generally
that we can select at most n − 2 diagonals for any cyclic n-gon with circumcircle Γ.
38 IMO 2016 Hong Kong

The base case n = 3 is trivial since there is no diagonal at all. Suppose the upper bound
holds for any cyclic polygon with fewer than n sides. For a cyclic n-gon, if there is a selected
diagonal which does not intersect any other selected diagonal, then this diagonal divides the
n-gon into an m-gon and an l-gon (with m + l = n + 2) so that each selected diagonal belongs
to one of them. Without loss of generality, we may assume the m-gon lies on the same side
of a diameter of Γ. Then no two selected diagonals of the m-gon can intersect, and hence we
can select at most m − 3 diagonals. Also, we can apply the inductive hypothesis to the l-gon.
This shows the maximum number of selected diagonals is (m − 3) + (l − 2) + 1 = n − 2.
It remains to consider the case when all selected diagonals meet at least one other selected
diagonal. Consider a pair of selected perpendicular diagonals d1 , d2 . They divide the circum-
ference of Γ into four arcs, each of which lies on the same side of a diameter of Γ. If there
are two selected diagonals intersecting each other and neither is parallel to d1 or d2 , then
their endpoints must belong to the same arc determined by d1 , d2 , and hence they cannot be
perpendicular. This violates the condition, and hence all selected diagonals must have the
same direction as one of d1 , d2 .

d2

d1

Take the longest selected diagonal in one of the two directions. We argue as in Solution
1 that its endpoints do not belong to any other selected diagonal. The same holds true for
the longest diagonal in the other direction. Apart from these four endpoints, each of the
remaining n − 4 vertices can belong to at most two selected diagonals. Thus we can select at
most 12 (2(n − 4) + 4) = n − 2 diagonals. Then the proof follows by induction.
Shortlisted problems 39

C6. There are n > 3 islands in a city. Initially, the ferry company offers some routes between
some pairs of islands so that it is impossible to divide the islands into two groups such that
no two islands in different groups are connected by a ferry route.
After each year, the ferry company will close a ferry route between some two islands X
and Y . At the same time, in order to maintain its service, the company will open new routes
according to the following rule: for any island which is connected by a ferry route to exactly
one of X and Y , a new route between this island and the other of X and Y is added.
Suppose at any moment, if we partition all islands into two nonempty groups in any way,
then it is known that the ferry company will close a certain route connecting two islands from
the two groups after some years. Prove that after some years there will be an island which is
connected to all other islands by ferry routes.

Solution. Initially, we pick any pair of islands A and B which are connected by a ferry route
and put A in set A and B in set B. From the condition, without loss of generality there must
be another island which is connected to A. We put such an island C in set B. We say that
two sets of islands form a network if each island in one set is connected to each island in the
other set.
Next, we shall included all islands to A ∪ B one by one. Suppose we have two sets A and
B which form a network where 3 6 |A ∪ B| < n. This relation no longer holds only when a
ferry route between islands A ∈ A and B ∈ B is closed. In that case, we define A0 = {A, B},
and B 0 = (A ∪ B) − {A, B}. Note that B 0 is nonempty. Consider any island C ∈ A − {A}.
From the relation of A and B, we know that C is connected to B. If C was not connected to
A before the route between A and B closes, then there will be a route added between C and
A afterwards. Hence, C must now be connected to both A and B. The same holds true for
any island in B − {B}. Therefore, A0 and B 0 form a network, and A0 ∪ B 0 = A ∪ B. Hence
these islands can always be partitioned into sets A and B which form a network.
As |A ∪ B| < n, there are some islands which are not included in A ∪ B. From the
condition, after some years there must be a ferry route between an island A in A ∪ B and an
island D outside A ∪ B which closes. Without loss of generality assume A ∈ A. Then each
island in B must then be connected to D, no matter it was or not before. Hence, we can
put D in set A so that the new sets A and B still form a network and the size of A ∪ B is
increased by 1. The same process can be done to increase the size of A ∪ B. Eventually, all
islands are included in this way so we may now assume |A ∪ B| = n.
Suppose a ferry route between A ∈ A and B ∈ B is closed after some years. We put A
and B in set A0 and all remaining islands in set B 0 . Then A0 and B 0 form a network. This
relation no longer holds only when a route between A, without loss of generality, and C ∈ B 0
is closed. Since this must eventually occur, at that time island B will be connected to all
other islands and the result follows.
40 IMO 2016 Hong Kong

C7. Let n > 2 be an integer. In the plane, there are n segments given in such a way that
any two segments have an intersection point in the interior, and no three segments intersect
at a single point. Jeff places a snail at one of the endpoints of each of the segments and claps
his hands n − 1 times. Each time when he claps his hands, all the snails move along their own
segments and stay at the next intersection points until the next clap. Since there are n − 1
intersection points on each segment, all snails will reach the furthest intersection points from
their starting points after n − 1 claps.

(a) Prove that if n is odd then Jeff can always place the snails so that no two of them ever
occupy the same intersection point.

(b) Prove that if n is even then there must be a moment when some two snails occupy the
same intersection point no matter how Jeff places the snails.

Solution. We consider a big disk which contains all the segments. We extend each segment
to a line li so that each of them cuts the disk at two distinct points Ai , Bi .

(a) For odd n, we travel along the circumference of the disk and mark each of the points Ai
or Bi ‘in’ and ‘out’ alternately. Since every pair of lines intersect in the disk, there are
exactly n − 1 points between Ai and Bi for any fixed 1 6 i 6 n. As n is odd, this means
one of Ai and Bi is marked ‘in’ and the other is marked ‘out’. Then Jeff can put a snail
on the endpoint of each segment which is closer to the ‘in’ side of the corresponding line.
We claim that the snails on li and lj do not meet for any pairs i, j, hence proving part
(a).

Ai Ai Aj
Aj

P P

Without loss of generality, we may assume the snails start at Ai and Aj respectively.
Let li intersect lj at P . Note that there is an odd number of points between arc Ai Aj .
Each of these points belongs to a line lk . Such a line lk must intersect exactly one of
Shortlisted problems 41

the segments Ai P and Aj P , making an odd number of intersections. For the other lines,
they may intersect both segments Ai P and Aj P , or meet none of them. Therefore, the
total number of intersection points on segments Ai P and Aj P (not counting P ) is odd.
However, if the snails arrive at P at the same time, then there should be the same number
of intersections on Ai P and Aj P , which gives an even number of intersections. This is a
contradiction so the snails do not meet each other.

(b) For even n, we consider any way that Jeff places the snails and mark each of the points
Ai or Bi ‘in’ and ‘out’ according to the directions travelled by the snails. In this case
there must be two neighbouring points Ai and Aj both of which are marked ‘in’. Let
P be the intersection of the segments Ai Bi and Aj Bj . Then any other segment meeting
one of the segments Ai P and Aj P must also meet the other one, and so the number of
intersections on Ai P and Aj P are the same. This shows the snails starting from Ai and
Aj will meet at P .

Comment. The conclusions do not hold for pseudosegments, as can be seen from the follow-
ing examples.
42 IMO 2016 Hong Kong

C8. Let n be a positive integer. Determine the smallest positive integer k with the following
property: it is possible to mark k cells on a 2n × 2n board so that there exists a unique
partition of the board into 1 × 2 and 2 × 1 dominoes, none of which contains two marked
cells.
Answer. 2n.
Solution. We first construct an example of marking 2n cells satisfying the requirement.
Label the rows and columns 1, 2, . . . , 2n and label the cell in the i-th row and the j-th column
(i, j).
For i = 1, 2, . . . , n, we mark the cells (i, i) and (i, i + 1). We claim that the required
partition exists and is unique. The two diagonals of the board divide the board into four
regions. Note that the domino covering cell (1, 1) must be vertical. This in turn shows that
each domino covering (2, 2), (3, 3), . . . , (n, n) is vertical. By induction, the dominoes in the
left region are all vertical. By rotational symmetry, the dominoes in the bottom region are
horizontal, and so on. This shows that the partition exists and is unique.

It remains to show that this value of k is the smallest possible. Assume that only k < 2n
cells are marked, and there exists a partition P satisfying the requirement. It suffices to show
there exists another desirable partition distinct from P . Let d be the main diagonal of the
board.
Construct the following graph with edges of two colours. Its vertices are the cells of the
board. Connect two vertices with a red edge if they belong to the same domino of P . Connect
two vertices with a blue edge if their reflections in d are connected by a red edge. It is possible
that two vertices are connected by edges of both colours. Clearly, each vertex has both red
and blue degrees equal to 1. Thus the graph splits into cycles where the colours of edges in
each cycle alternate (a cycle may have length 2).
Consider any cell c lying on the diagonal d. Its two edges are symmetrical with respect
to d. Thus they connect c to different cells. This shows c belongs to a cycle C(c) of length at
least 4. Consider a part of this cycle c0 , c1 , . . . , cm where c0 = c and m is the least positive
integer such that cm lies on d. Clearly, cm is distinct from c. From the construction, the path
symmetrical to this with respect to d also lies in the graph, and so these paths together form
C(c). Hence, C(c) contains exactly two cells from d. Then all 2n cells in d belong to n cycles
C1 , C2 , . . . , Cn , each has length at least 4.
By the Pigeonhole Principle, there exists a cycle Ci containing at most one of the k marked
cells. We modify P as follows. We remove all dominoes containing the vertices of Ci , which
Shortlisted problems 43

correspond to the red edges of Ci . Then we put the dominoes corresponding to the blue edges
of Ci . Since Ci has at least 4 vertices, the resultant partition P 0 is different from P . Clearly,
no domino in P 0 contains two marked cells as Ci contains at most one marked cell. This
shows the partition is not unique and hence k cannot be less than 2n.
44 IMO 2016 Hong Kong

Geometry
G1. In a convex pentagon ABCDE, let F be a point on AC such that ∠F BC = 90◦ .
Suppose triangles ABF , ACD and ADE are similar isosceles triangles with

∠F AB = ∠F BA = ∠DAC = ∠DCA = ∠EAD = ∠EDA. (1)

Let M be the midpoint of CF . Point X is chosen such that AM XE is a parallelogram. Show


that BD, EM and F X are concurrent.
AB AF
Solution 1. Denote the common angle in (1) by θ. As 4ABF ∼ 4ACD, we have AC
= AD
so that 4ABC ∼ 4AF D. From EA = ED, we get
1
∠AF D = ∠ABC = 90◦ + θ = 180◦ − ∠AED.
2
Hence, F lies on the circle with centre E and radius EA. In particular, EF = EA = ED.
As ∠EF A = ∠EAF = 2θ = ∠BF C, points B, F, E are collinear.
As ∠EDA = ∠M AD, we have ED//AM and hence E, D, X are collinear. As M is the
midpoint of CF and ∠CBF = 90◦ , we get M F = M B. In the isosceles triangles EF A and
M F B, we have ∠EF A = ∠M F B and AF = BF . Therefore, they are congruent to each
other. Then we have BM = AE = XM and BE = BF + F E = AF + F M = AM = EX.
This shows 4EM B ∼ = 4EM X. As F and D lie on EB and EX respectively and EF = ED,
we know that lines BD and XF are symmetric with respect to EM . It follows that the three
lines are concurrent.

D C

E M

A B
Shortlisted problems 45

Solution 2. From ∠CAD = ∠EDA, we have AC//ED. Together with AC//EX, we know
that E, D, X are collinear. Denote the common angle in (1) by θ. From 4ABF ∼ 4ACD,
we get AB
AC
AF
= AD so that 4ABC ∼ 4AF D. This yields ∠AF D = ∠ABC = 90◦ + θ and
hence ∠F DC = 90◦ , implying that BCDF is cyclic. Let Γ1 be its circumcircle.
AB AF
Next, from 4ABF ∼ 4ADE, we have AD = AE so that 4ABD ∼ 4AF E. Therefore,
∠AF E = ∠ABD = θ + ∠F BD = θ + ∠F CD = 2θ = 180◦ − ∠BF A.
This implies B, F, E are collinear. Note that F is the incentre of triangle DAB. Point E
lies on the internal angle bisector of ∠DBA and lies on the perpendicular bisector of AD. It
follows that E lies on the circumcircle Γ2 of triangle ABD, and EA = EF = ED.
Also, since CF is a diameter of Γ1 and M is the midpoint of CF , M is the centre of Γ1 and
hence ∠AM D = 2θ = ∠ABD. This shows M lies on Γ2 . Next, ∠M DX = ∠M AE = ∠DXM
since AM XE is a parallelogram. Hence M D = M X and X lies on Γ1 .

D C

E M

A B

We now have two ways to complete the solution.


• Method 1. From EF = EA = XM and EX//F M , EF M X is an isosceles trapezoid and
is cyclic. Denote its circumcircle by Γ3 . Since BD, EM, F X are the three radical axes of
Γ1 , Γ2 , Γ3 , they must be concurrent.
• Method 2. As ∠DM F = 2θ = ∠BF M , we have DM//EB. Also,
∠BF D + ∠XBF = ∠BF C + ∠CF D + 90◦ − ∠CBX = 2θ + (90◦ − θ) + 90◦ − θ = 180◦
implies DF//XB. These show the corresponding sides of triangles DM F and BEX are
parallel. By Desargues’ Theorem, the two triangles are perspective and hence DB, M E, F X
meet at a point.
46 IMO 2016 Hong Kong

Comment. In Solution 2, both the Radical Axis Theorem and Desargues’ Theorem could
imply DB, M E, F X are parallel. However, this is impossible as can be seen from the config-
uration. For example, it is obvious that DB and M E meet each other.
Solution 3. Let the common angle in (1) be θ. From 4ABF ∼ 4ACD, we have AB AC
AF
= AD
so that 4ABC ∼ 4AF D. Then ∠ADF = ∠ACB = 90◦ − 2θ = 90◦ − ∠BAD and hence
DF ⊥ AB. As F A = F B, this implies 4DAB is isosceles with DA = DB. Then F is the
incentre of 4DAB.
Next, from ∠AED = 180◦ − 2θ = 180◦ − ∠DBA, points A, B, D, E are concyclic. Since
we also have EA = ED, this shows E, F, B are collinear and EA = EF = ED.

D C

P
E M

A B

Note that C lies on the internal angle bisector of ∠BAD and lies on the external angle
bisector of ∠DBA. It follows that it is the A-excentre of triangle DAB. As M is the midpoint
of CF , M lies on the circumcircle of triangle DAB and it is the centre of the circle passing
through D, F, B, C. By symmetry, DEF M is a rhombus. Then the midpoints of AX, EM
and DF coincide, and it follows that DAF X is a parallelogram.
Let P be the intersection of BD and EM , and Q be the intersection of AD and BE. From
∠BAC = ∠DCA, we know that DC, AB, EM are parallel. Thus we have DP PB
= CM
MA
. This is
AE
further equal to BE since CM = DM = DE = AE and M A = BE. From 4AEQ ∼ 4BEA,
we find that
DP AE AQ QF
= = =
PB BE BA FB
by the Angle Bisector Theorem. This implies QD//F P and hence F, P, X are collinear, as
desired.
Shortlisted problems 47

G2. Let ABC be a triangle with circumcircle Γ and incentre I. Let M be the midpoint of
side BC. Denote by D the foot of perpendicular from I to side BC. The line through I per-
pendicular to AI meets sides AB and AC at F and E respectively. Suppose the circumcircle
of triangle AEF intersects Γ at a point X other than A. Prove that lines XD and AM meet
on Γ.

Solution 1. Let AM meet Γ again at Y and XY meet BC at D0 . It suffices to show D0 = D.


We shall apply the following fact.

• Claim. For any cyclic quadrilateral P QRS whose diagonals meet at T , we have

QT P Q · QR
= .
TS P S · SR

Proof. We use [W1 W2 W3 ] to denote the area of W1 W2 W3 . Then

1
QT [P QR] P Q · QR sin ∠P QR P Q · QR
= = 21 = .
TS [P SR] 2
P S · SR sin ∠P SR P S · SR

BM AB·BY
Applying the Claim to ABY C and XBY C respectively, we have 1 = MC
= AC·CY
and
BD0
D0 C
= XB·BY
XC·CY
. These combine to give

BD0 XB BY XB AC
0
= · = · . (1)
CD XC CY XC AB

Next, we use directed angles to find that ]XBF = ]XBA = ]XCA = ]XCE and
]XF B = ]XF A = ]XEA = ]XEC. This shows triangles XBF and XCE are directly
similar. In particular, we have
XB BF
= . (2)
XC CE
In the following, we give two ways to continue the proof.

• Method 1. Here is a geometrical method. As ∠F IB = ∠AIB − 90◦ = 12 ∠ACB = ∠ICB


and ∠F BI = ∠IBC, the triangles F BI and IBC are similar. Analogously, triangles EIC
and IBC are also similar. Hence, we get

FB BI EC IC
= and = . (3)
IB BC IC BC
48 IMO 2016 Hong Kong

X B1 C1
C2

B2
E

F I

B D M C

Next, construct a line parallel to BC and tangent to the incircle. Suppose it meets sides
AB and AC at B1 and C1 respectively. Let the incircle touch AB and AC at B2 and C2
respectively. By homothety, the line B1 I is parallel to the external angle bisector of ∠ABC,
and hence ∠B1 IB = 90◦ . Since ∠BB2 I = 90◦ , we get BB2 · BB1 = BI 2 , and similarly
CC2 · CC1 = CI 2 . Hence,

BI 2 BB2 · BB1 BB1 BD AB BD


= = · = · . (4)
CI 2 CC2 · CC1 CC1 CD AC CD

Combining (1), (2), (3) and (4), we conclude

BD0 XB AC BF AC BI 2 AC BD
0
= · = · = 2
· =
CD XC AB CE AB CI AB CD
so that D0 = D. The result then follows.

• Method 2. We continue the proof of Solution 1 using trigonometry. Let β = 12 ∠ABC


sin γ
and γ = 12 ∠ACB. Observe that ∠F IB = ∠AIB − 90◦ = γ. Hence, BF FI
= sin ∠F IB
sin ∠IBF
= sin β
.
CE sin β
Similarly, EI = sin γ . As F I = EI, we get
Ç å2
BF BF EI sin γ
= · = . (5)
CE F I CE sin β
Shortlisted problems 49

Together with (1) and (2), we find that


å2 å2
BD0
Ç Ç
AC sin γ sin 2β sin γ tan γ ID/CD BD
0
= · = · = = = .
CD AB sin β sin 2γ sin β tan β ID/BD CD

This shows D0 = D and the result follows.

Solution 2. Let ωA be the A-mixtilinear incircle of triangle ABC. From the properties of
mixtilinear incircles, ωA touches sides AB and AC at F and E respectively. Suppose ωA
is tangent to Γ at T . Let AM meet Γ again at Y , and let D1 , T1 be the reflections of D
and T with respect to the perpendicular bisector of BC respectively. It is well-known that
∠BAT = ∠D1 AC so that A, D1 , T1 are collinear.

X
S
E

F I
P
R
D
B C
M D1

T T1

We then show that X, M, T1 are collinear. Let R be the radical centre of ωA , Γ and the
circumcircle of triangle AEF . Then R lies on AX, EF and the tangent at T to Γ. Let AT
meet ωA again at S and meet EF at P . Obviously, SF T E is a harmonic quadrilateral.
Projecting from T , the pencil (R, P ; F, E) is harmonic. We further project the pencil onto
Γ from A, so that XBT C is a harmonic quadrilateral. As T T1 //BC, the projection from T1
onto BC maps T to a point at infinity, and hence maps X to the midpoint of BC, which is
M . This shows X, M, T1 are collinear.
We have two ways to finish the proof.

• Method 1. Note that both AY and XT1 are chords of Γ passing through the midpoint M
of the chord BC. By the Butterfly Theorem, XY and AT1 cut BC at a pair of symmetric
points with respect to M , and hence X, D, Y are collinear. The proof is thus complete.
50 IMO 2016 Hong Kong

• Method 2. Here, we finish the proof without using the Butterfly Theorem. As DT T1 D1
is an isosceles trapezoid, we have

]Y T D = ]Y T T1 + ]T1 T D = ]Y AT1 + ]AD1 D = ]Y M D

so that D, T, Y, M are concyclic. As X, M, T1 are collinear, we have

]AY D = ]M T D = ]D1 T1 M = ]AT1 X = ]AY X.

This shows X, D, Y are collinear.


Shortlisted problems 51

G3. Let B = (−1, 0) and C = (1, 0) be fixed points on the coordinate plane. A nonempty,
bounded subset S of the plane is said to be nice if

(i) there is a point T in S such that for every point Q in S, the segment T Q lies entirely
in S; and

(ii) for any triangle P1 P2 P3 , there exists a unique point A in S and a permutation σ of the
indices {1, 2, 3} for which triangles ABC and Pσ(1) Pσ(2) Pσ(3) are similar.

Prove that there exist two distinct nice subsets S and S 0 of the set {(x, y) : x > 0, y > 0}
such that if A ∈ S and A0 ∈ S 0 are the unique choices of points in (ii), then the product
BA · BA0 is a constant independent of the triangle P1 P2 P3 .

Solution. If in the similarity of 4ABC and 4Pσ(1) Pσ(2) Pσ(3) , BC corresponds to the longest
side of 4P1 P2 P3 , then we have BC > AB > AC. The condition BC > AB is equivalent to
(x + 1)2 + y 2 6 4, while AB > AC is trivially satisfied for any point in the first quadrant.
Then we first define

S = {(x, y) : (x + 1)2 + y 2 6 4, x > 0, y > 0}.

Note that S is the intersection of a disk and the first quadrant, so it is bounded and convex,
and we can choose any T ∈ S to meet condition (i). For any point A in S, the relation
BC > AB > AC always holds. Therefore, the point A in (ii) is uniquely determined, while
its existence is guaranteed by the above construction.

T0

S0
S
x
B O C

Next, if in the similarity of 4A0 BC and 4Pσ(1) Pσ(2) Pσ(3) , BC corresponds to the second
longest side of 4P1 P2 P3 , then we have A0 B > BC > A0 C. The two inequalities are equivalent
to (x + 1)2 + y 2 > 4 and (x − 1)2 + y 2 6 4 respectively. Then we define

S 0 = {(x, y) : (x + 1)2 + y 2 > 4, (x − 1)2 + y 2 6 4, x > 0, y > 0}.


52 IMO 2016 Hong Kong

The boundedness condition is satisfied while (ii) can be argued as in the previous case. For
(i), note that S 0 contains points inside the disk (x − 1)2 + y 2 6 4 and outside the disk
(x + 1)2 + y 2 > 4. This shows we can take T 0 = (1, 2) in (i), which is the topmost point of
the circle (x − 1)2 + y 2 = 4.
It remains to check that the product BA · BA0 is a constant. Suppose we are given a
triangle P1 P2 P3 with P1 P2 > P2 P3 > P3 P1 . By the similarity, we have
P2 P3 P 1 P2
BA = BC · and BA0 = BC · .
P1 P2 P 2 P3

Thus BA · BA0 = BC 2 = 4, which is certainly independent of the triangle P1 P2 P3 .

Comment. The original version of this problem includes the condition that the interiors of
S and S 0 are disjoint. We remove this condition since it is hard to define the interior of a
point set rigorously.
Shortlisted problems 53

G4. Let ABC be a triangle with AB = AC 6= BC and let I be its incentre. The line BI
meets AC at D, and the line through D perpendicular to AC meets AI at E. Prove that the
reflection of I in AC lies on the circumcircle of triangle BDE.
Solution 1.
I0
J
C
D
F

A I
E

Let Γ be the circle with centre E passing through B and C. Since ED ⊥ AC, the point
F symmetric to C with respect to D lies on Γ. From ∠DCI = ∠ICB = ∠CBI, the line
DC is a tangent to the circumcircle of triangle IBC. Let J be the symmetric point of I with
respect to D. Using directed lengths, from

DC · DF = −DC 2 = −DI · DB = DJ · DB,

the point J also lies on Γ. Let I 0 be the reflection of I in AC. Since IJ and CF bisect each
other, CJF I is a parallelogram. From ∠F I 0 C = ∠CIF = ∠F JC, we find that I 0 lies on Γ.
This gives EI 0 = EB.
Note that AC is the internal angle bisector of ∠BDI 0 . This shows DE is the external
angle bisector of ∠BDI 0 as DE ⊥ AC. Together with EI 0 = EB, it is well-known that E
lies on the circumcircle of triangle BDI 0 .
Solution 2. Let I 0 be the reflection of I in AC and let S be the intersection of I 0 C and AI.
Using directed angles, we let θ = ]ACI = ]ICB = ]CBI. We have
Å
π ã
π
]I 0 SE = ]I 0 CA + ]CAI = θ + + 2θ = 3θ +
2 2
and
π π π π
]I 0 DE = ]I 0 DC + = ]CDI + = ]DCB + ]CBD + = 3θ + .
2 2 2 2
0
This shows I , D, E, S are concyclic.
Next, we find ]I 0 SB = 2]I 0 SE = 6θ and ]I 0 DB = 2]CDI = 6θ. Therefore, I 0 , D, B, S
are concyclic so that I 0 , D, E, B, S lie on the same circle. The result then follows.
54 IMO 2016 Hong Kong

I0
C
D

A S
E I

B
Comment. The point S constructed in Solution 2 may lie on the same side as A of BC.
Also, since S lies on the circumcircle of the non-degenerate triangle BDE, we implicitly know
that S is not an ideal point. Indeed, one can verify that I 0 C and AI are parallel if and only
if triangle ABC is equilateral.
Solution 3. Let I 0 be the reflection of I in AC, and let D0 be the second intersection of AI
and the circumcircle of triangle ABD. Since AD0 bisects ∠BAD, point D0 is the midpoint of
the arc BD and DD0 = BD0 = CD0 . Obviously, A, E, D0 lie on AI in this order.

I0

D C

A D0
E I

We find that ∠ED0 D = ∠AD0 D = ∠ABD = ∠IBC = ∠ICB. Next, since D0 is the
circumcentre of triangle BCD, we have ∠EDD0 = 90◦ − ∠D0 DC = ∠CBD = ∠IBC. The
two relations show that triangles ED0 D and ICB are similar. Therefore, we have
BC BC DD0 BD0
= = = .
CI 0 CI D0 E D0 E
Also, we get
∠BCI 0 = ∠BCA + ∠ACI 0 = ∠BCA + ∠ICA = ∠BCA + ∠DBC = ∠BDA = ∠BD0 E.
These show triangles BCI 0 and BD0 E are similar, and hence triangles BCD0 and BI 0 E are
similar. As BCD0 is isosceles, we obtain BE = I 0 E.
As DE is the external angle bisector of ∠BDI 0 and EI 0 = EB, we know that E lies on
the circumcircle of triangle BDI 0 .
Shortlisted problems 55

Solution 4. Let AI and BI meet the circumcircle of triangle ABC again at A0 and B 0
respectively, and let E 0 be the reflection of E in AC. From
∠ABC ∠BAC ∠ABC
∠B 0 AE 0 = ∠B 0 AD − ∠E 0 AD = − = 90◦ − ∠BAC −
2 2 2
= 90◦ − ∠B 0 DA = ∠B 0 DE 0 ,
points B 0 , A, D, E 0 are concyclic. Then
∠BAC
∠DB 0 E 0 = ∠DAE 0 = = ∠BAA0 = ∠DB 0 A0
2
and hence B 0 , E 0 , A0 are collinear. It is well-known that A0 B 0 is the perpendicular bisector of
CI, so that CE 0 = IE 0 . Let I 0 be the reflection of I in AC. This implies BE = CE = I 0 E.
As DE is the external angle bisector of ∠BDI 0 and EI 0 = EB, we know that E lies on the
circumcircle of triangle BDI 0 .

B0

E0 I 0
C

D
A A0
E I

Solution 5. Let F be the intersection of CI and AB. Clearly, F and D are symmetric with
respect to AI. Let O be the circumcentre of triangle BIF , and let I 0 be the reflection of I in
AC.

I0
C
D

A E I

O
F
B
56 IMO 2016 Hong Kong

From ∠BF O = 90◦ − ∠F IB = 12 ∠BAC = ∠BAI, we get EI//F O. Also, from the
relation ∠OIB = 90◦ − ∠BF I = 90◦ − ∠CDI = ∠I 0 ID, we know that O, I, I 0 are collinear.
Note that ED//OI since both are perpendicular to AC. Then ∠F EI = ∠DEI = ∠OIE.
Together with EI//F O, the quadrilateral EF OI is an isosceles trapezoid. Therefore, we find
that ∠DIE = ∠F IE = ∠OEI so OE//ID. Then DEOI is a parallelogram. Hence, we have
DI 0 = DI = EO, which shows DEOI 0 is an isosceles trapezoid. In addition, ED = OI = OB
and OE//BD imply EOBD is another isosceles trapezoid. In particular, both DEOI 0 and
EOBD are cyclic. This shows B, D, E, I 0 are concyclic.

Solution 6. Let I 0 be the reflection of I in AC. Denote by T and M the projections from I
to sides AB and BC respectively. Since BI is the perpendicular bisector of T M , we have

DT = DM. (1)

Since ∠ADE = ∠AT I = 90◦ and ∠DAE = ∠T AI, we have 4ADE ∼ 4AT I. This shows
AD 0 0
AE
= AT
AI
AT
= AI 0 . Together with ∠DAT = 2∠DAE = ∠EAI , this yields 4DAT ∼ 4EAI .

In particular, we have
DT AT AT
0
= 0
= . (2)
EI AI AI
Obviously, the right-angled triangles AM B and AT I are similar. Then we get

AM AT
= . (3)
AB AI

Next, from 4AM B ∼ 4AT I ∼ 4ADE, we have AM AB


= AD
AE
so that 4ADM ∼ 4AEB.
It follows that
DM AM
= . (4)
EB AB
Combining (1), (2), (3) and (4), we get EB = EI 0 . As DE is the external angle bisector
of ∠BDI 0 , we know that E lies on the circumcircle of triangle BDI 0 .

I0
C

E I
A M

T
B
Shortlisted problems 57

Comment. A stronger version of this problem is to ask the contestants to prove the reflection
of I in AC lies on the circumcircle of triangle BDE if and only if AB = AC. Some of the
above solutions can be modified to prove the converse statement to the original problem. For
example, we borrow some ideas from Solution 2 to establish the converse as follows.

I0
C
D

A S
E I

Let I 0 be the reflection of I in AC and suppose B, E, D, I 0 lie on a circle Γ. Let AI meet


Γ again at S. As DE is the external angle bisector of ∠BDI 0 , we have EB = EI 0 . Using
directed angles, we get

]CI 0 S = ]CI 0 D + ]DI 0 S = ]DIC + ]DES = ]DIC + ]DEA = ]DIC + ]DCB = 0.

This means I 0 , C, S are collinear. From this we get ]BSE = ]ESI 0 = ]ESC and hence
AS bisects both ∠BAC and ∠BSC. Clearly, S and A are distinct points. It follows that
4BAS ∼ = 4CAS and thus AB = AC.
As in some of the above solutions, an obvious way to prove the stronger version is to
establish the following equivalence: BE = EI 0 if and only if AB = AC. In addition to the
ideas used in those solutions, one can use trigonometry to express the lengths of BE and EI 0
in terms of the side lengths of triangle ABC and to establish the equivalence.
58 IMO 2016 Hong Kong

G5. Let D be the foot of perpendicular from A to the Euler line (the line passing through the
circumcentre and the orthocentre) of an acute scalene triangle ABC. A circle ω with centre
S passes through A and D, and it intersects sides AB and AC at X and Y respectively. Let
P be the foot of altitude from A to BC, and let M be the midpoint of BC. Prove that the
circumcentre of triangle XSY is equidistant from P and M .
Solution 1. Denote the orthocentre and circumcentre of triangle ABC by H and O respec-
tively. Let Q be the midpoint of AH and N be the nine-point centre of triangle ABC. It is
known that Q lies on the nine-point circle of triangle ABC, N is the midpoint of QM and
that QM is parallel to AO.
Let the perpendicular from S to XY meet line QM at S 0 . Let E be the foot of altitude
from B to side AC. Since Q and S lie on the perpendicular bisector of AD, using directed
angles, we have
π ã Å
]SDQ = ]QAS = ]XAS − ]XAQ = − ]AY X − ]BAP = ]CBA − ]AY X
2
= (]CBA − ]ACB) − ]BCA − ]AY X = ]P EM − (]BCA + ]AY X)
π
= ]P QM − ∠(BC, XY ) = − ∠(S 0 Q, BC) − ∠(BC, XY ) = ]SS 0 Q.
2
This shows D, S 0 , S, Q are concyclic.

E
Q
S
X
Y
D H O
N S 0

B P M C
O1

Let the perpendicular from N to BC intersect line SS 0 at O1 . (Note that the two lines
coincide when S is the midpoint of AO, in which case the result is true since the circumcentre
of triangle XSY must lie on this line.) It suffices to show that O1 is the circumcentre of
triangle XSY since N lies on the perpendicular bisector of P M . From

]DS 0 O1 = ]DQS = ]SQA = ∠(SQ, QA) = ∠(OD, O1 N ) = ]DN O1


Shortlisted problems 59

since SQ//OD and QA//O1 N , we know that D, O1 , S 0 , N are concyclic. Therefore, we get

]SDS 0 = ]SQS 0 = ∠(SQ, QS 0 ) = ∠(N D, N S 0 ) = ]DN S 0 ,

so that SD is a tangent to the circle through D, O1 , S 0 , N . Then we have

SS 0 · SO1 = SD2 = SX 2 . (1)

Next, we show that S and S 0 are symmetric with respect to XY . By the Sine Law, we
have
SS 0 SQ SQ SQ SA
0
= 0
= = = .
sin ∠SQS sin ∠SS Q sin ∠SDQ sin ∠SAQ sin ∠SQA

It follows that

sin ∠SQS 0 sin ∠HOA AH


SS 0 = SA · = SA · = SA · = SA · 2 cos A,
sin ∠SQA sin ∠OHA AO

which is twice the distance from S to XY . Note that S and C lie on the same side of the
perpendicular bisector of P M if and only if ∠SAC < ∠OAC if and only if ∠Y XA > ∠CBA.
This shows S and O1 lie on different sides of XY . As S 0 lies on ray SO1 , it follows that S
and S 0 cannot lie on the same side of XY . Therefore, S and S 0 are symmetric with respect
to XY .
Let d be the diameter of the circumcircle of triangle XSY . As SS 0 is twice the distance
2
from S to XY and SX = SY , we have SS 0 = 2 SX d
. It follows from (1) that d = 2SO1 . As
SO1 is the perpendicular bisector of XY , point O1 is the circumcentre of triangle XSY .

Solution 2. Denote the orthocentre and circumcentre of triangle ABC by H and O respec-
tively. Let O1 be the circumcentre of triangle XSY . Consider two other possible positions of
S. We name them S 0 and S 00 and define the analogous points X 0 , Y 0 , O10 , X 00 , Y 00 O100 accordingly.
Note that S, S 0 , S 00 lie on the perpendicular bisector of AD.
As XX 0 and Y Y 0 meet at A and the circumcircles of triangles AXY and AX 0 Y 0 meet at
D, there is a spiral similarity with centre D mapping XY to X 0 Y 0 . We find that

π π
]SXY = − ]Y AX = − ]Y 0 AX 0 = ]S 0 X 0 Y 0
2 2

and similarly ]SY X = ]S 0 Y 0 X 0 . This shows triangles SXY and S 0 X 0 Y 0 are directly similar.
Then the spiral similarity with centre D takes points S, X, Y, O1 to S 0 , X 0 , Y 0 , O10 . Similarly,
there is a spiral similarity with centre D mapping S, X, Y, O1 to S 00 , X 00 , Y 00 , O100 . From these,
we see that there is a spiral similarity taking the corresponding points S, S 0 , S 00 to points
O1 , O10 , O100 . In particular, O1 , O10 , O100 are collinear.
60 IMO 2016 Hong Kong

A
Y 00

S 00 S0 Y0
O100
X S
X0 H Y
X 00 D O
O10

B P M C
O1

It now suffices to show that O1 lies on the perpendicular bisector of P M for two special
cases.
Firstly, we take S to be the midpoint of AH. Then X and Y are the feet of altitudes from
C and B respectively. It is well-known that the circumcircle of triangle XSY is the nine-point
circle of triangle ABC. Then O1 is the nine-point centre and O1 P = O1 M . Indeed, P and
M also lies on the nine-point circle.
Secondly, we take S 0 to be the midpoint of AO. Then X 0 and Y 0 are the midpoints of
AB and AC respectively. Then X 0 Y 0 //BC. Clearly, S 0 lies on the perpendicular bisector
of P M . This shows the perpendicular bisectors of X 0 Y 0 and P M coincide. Hence, we must
have O10 P = O10 M .

A
A

S S0
Y
X0 Y0
O10
X O
H O1 O
H

B P M C B P M C
Shortlisted problems 61

G6. Let ABCD be a convex quadrilateral with ∠ABC = ∠ADC < 90◦ . The internal
angle bisectors of ∠ABC and ∠ADC meet AC at E and F respectively, and meet each
other at point P . Let M be the midpoint of AC and let ω be the circumcircle of triangle
BP D. Segments BM and DM intersect ω again at X and Y respectively. Denote by Q the
intersection point of lines XE and Y F . Prove that P Q ⊥ AC.
Solution 1.

B0
Y

S
Q

P
A E

F
X M
C
Z B

Let ω1 be the circumcircle of triangle ABC. We first prove that Y lies on ω1 . Let Y 0 be
the point on ray M D such that M Y 0 · M D = M A2 . Then triangles M AY 0 and M DA are
oppositely similar. Since M C 2 = M A2 = M Y 0 · M D, triangles M CY 0 and M DC are also
oppositely similar. Therefore, using directed angles, we have
]AY 0 C = ]AY 0 M + ]M Y 0 C = ]M AD + ]DCM = ]CDA = ]ABC
so that Y 0 lies on ω1 .
Let Z be the intersection point of lines BC and AD. Since ]P DZ = ]P BC = ]P BZ,
point Z lies on ω. In addition, from ]Y 0 BZ = ]Y 0 BC = ]Y 0 AC = ]Y 0 AM = ]Y 0 DZ, we
also know that Y 0 lies on ω. Note that ∠ADC is acute implies M A 6= M D so M Y 0 6= M D.
Therefore, Y 0 is the second intersection of DM and ω. Then Y 0 = Y and hence Y lies on ω1 .
Next, by the Angle Bisector Theorem and the similar triangles, we have
FA AD AD CM YA YM YA
= = · = · = .
FC CD AM CD YM YC YC
Hence, F Y is the internal angle bisector of ∠AY C.
Let B 0 be the second intersection of the internal angle bisector of ∠CBA and ω1 . Then
B 0 is the midpoint of arc AC not containing B. Therefore, Y B 0 is the external angle bisector
of ∠AY C, so that B 0 Y ⊥ F Y .
62 IMO 2016 Hong Kong

Denote by l the line through P parallel to AC. Suppose l meets line B 0 Y at S. From

]P SY = ∠(AC, B 0 Y ) = ]ACY + ]CY B 0 = ]ACY + ]CAB 0 = ]ACY + ]B 0 CA


= ]B 0 CY = ]B 0 BY = ]P BY,

the point S lies on ω. Similarly, the line through X perpendicular to XE also passes through
the second intersection of l and ω, which is the point S. From QY ⊥ Y S and QX ⊥ XS,
point Q lies on ω and QS is a diameter of ω. Therefore, P Q ⊥ P S so that P Q ⊥ AC.

Solution 2. Denote by ω1 and ω2 the circumcircles of triangles ABC and ADC respectively.
Since ∠ABC = ∠ADC, we know that ω1 and ω2 are symmetric with respect to the midpoint
M of AC.
Firstly, we show that X lies on ω2 . Let X1 be the second intersection of ray M B and
ω2 and X 0 be its symmetric point with respect to M . Then X 0 lies on ω1 and X 0 AX1 C is a
parallelogram. Hence, we have

]DX1 B = ]DX1 A + ]AX1 B = ]DCA + ]AX1 X 0 = ]DCA + ]CX 0 X1


= ]DCA + ]CAB = ∠(CD, AB).

X0

M2 B0 M D0 M1
F
Y
Q P
E X
D

B
A

Also, we have

]DP B = ]P DC + ∠(CD, AB) + ]ABP = ∠(CD, AB).

These yield ]DX1 B = ]DP B and hence X1 lies on ω. It follows that X1 = X and X lies
on ω2 . Similarly, Y lies on ω1 .
Shortlisted problems 63

Next, we prove that Q lies on ω. Suppose the perpendicular bisector of AC meet ω1 at B 0


and M1 and meet ω2 at D0 and M2 , so that B, M1 and D0 lie on the same side of AC. Note
that B 0 lies on the angle bisector of ∠ABC and similarly D0 lies on DP .
If we denote the area of W1 W2 W3 by [W1 W2 W3 ], then
BA · X 0 A 1
2
BA · X 0 A sin ∠BAX 0 [BAX 0 ] MA
0
= 1 0 0
= 0
= = 1.
BC · X C 2
BC · X C sin ∠BCX [BCX ] MC
As BE is the angle bisector of ∠ABC, we have
EA BA X 0C XA
= = 0 = .
EC BC XA XC
Therefore, XE is the angle bisector of ∠AXC, so that M2 lies on the line joining X, E, Q.
Analogously, M1 , F, Q, Y are collinear. Thus,
]XQY = ]M2 QM1 = ]QM2 M1 + ]M2 M1 Q = ]XM2 D0 + ]B 0 M1 Y
= ]XDD0 + ]B 0 BY = ]XDP + ]P BY = ]XBP + ]P BY = ]XBY,
which implies Q lies on ω.
Finally, as M1 and M2 are symmetric with respect to M , the quadrilateral X 0 M2 XM1 is
a parallelogram. Consequently,
]XQP = ]XBP = ]X 0 BB 0 = ]X 0 M1 B 0 = ]XM2 M1 .
This shows QP//M2 M1 . As M2 M1 ⊥ AC, we get QP ⊥ AC.
Solution 3. We first state two results which will be needed in our proof.
• Claim 1. In 4X 0 Y 0 Z 0 with X 0 Y 0 6= X 0 Z 0 , let N 0 be the midpoint of Y 0 Z 0 and W 0 be the
foot of internal angle bisector from X 0 . Then tan2 ]W 0 X 0 Z 0 = tan ]N 0 X 0 W 0 tan ]Z 0 W 0 X 0 .
Proof.
X0

Y0 N0 W 0 Z0

Without loss of generality, assume X 0 Y 0 > X 0 Z 0 . Then W 0 lies between N 0 and Z 0 .


The signs of both sides agree so it suffices to establish the relation for ordinary angles. Let
∠W 0 X 0 Z 0 = α, ∠N 0 X 0 W 0 = β and ∠Z 0 W 0 X 0 = γ. We have
sin (γ − α) N 0X 0 N 0X 0 sin (γ + α)
= 0 0 = 0 0 = .
sin (α − β) NY NZ sin (α + β)
64 IMO 2016 Hong Kong

This implies

tan γ − tan α sin γ cos α − cos γ sin α sin α cos β − cos α sin β tan α − tan β
= = = .
tan γ + tan α sin γ cos α + cos γ sin α sin α cos β + cos α sin β tan α + tan β

Expanding and simplifying, we get the desired result tan2 α = tan β tan γ.

• Claim 2. Let A0 B 0 C 0 D0 be a quadrilateral inscribed in circle Γ. Let diagonals A0 C 0 and


B 0 D0 meet at E 0 , and F 0 be the intersection of lines A0 B 0 and C 0 D0 . Let M 0 be the midpoint
of E 0 F 0 . Then the power of M 0 with respect to Γ is equal to (M 0 E 0 )2 .

Proof.

B0
A0
E0
M0 F0

O0 F1
D0

C0

Let O0 be the centre of Γ and let Γ0 be the circle with centre M 0 passing through E 0 . Let
F1 be the inversion image of F 0 with respect to Γ. It is well-known that E 0 lies on the polar
of F 0 with respect to Γ. This shows E 0 F1 ⊥ O0 F 0 and hence F1 lies on Γ0 . It follows that the
inversion image of Γ0 with respect to Γ is Γ0 itself. This shows Γ0 is orthogonal to Γ, and thus
the power of M 0 with respect to Γ is the square of radius of Γ0 , which is (M 0 E 0 )2 .

We return to the main problem. Let Z be the intersection of lines AD and BC, and W
be the intersection of lines AB and CD. Since ]P DZ = ]P BC = ]P BZ, point Z lies on
ω. Similarly, W lies on ω. Applying Claim 2 to the cyclic quadrilateral ZBDW , we know
that the power of M with respect to ω is M A2 . Hence, M X · M B = M A2 .
Suppose the line through B perpendicular to BE meets line AC at T . Then BE and
BT are the angle bisectors of ∠CBA. This shows (T, E; A, C) is harmonic. Thus, we have
M E · M T = M A2 = M X · M B. It follows that E, T, B, X are concyclic.
Shortlisted problems 65

Q
P
T
A
E
F
0 0 M
P ,Q
X
Z B C

The result is trivial for the special case AD = CD since P, Q lie on the perpendicular
bisector of AC in that case. Similarly, the case AB = CB is trivial. It remains to consider
the general cases where we can apply Claim 1 in the latter part of the proof.
Let the projections from P and Q to AC be P 0 and Q0 respectively. Then P Q ⊥ AC if
0 0
and only if P 0 = Q0 if and only if EP
FP0
= EQ
F Q0
in terms of directed lengths. Note that

EP 0 tan ]EF P tan ]AF D


0
= = .
FP tan ]F EP tan ]AEB
0
Next, we have EQ
F Q0
= tan ]EF Q
tan ]F EQ
where ]F EQ = ]T EX = ]T BX = π2 + ]EBM and by
symmetry ]EF Q = π2 + ]F DM . Combining all these, it suffices to show

tan ]AF D tan ]M BE


= .
tan ]AEB tan ]M DF
We now apply Claim 1 twice to get

tan ]AF D tan ]M DF = tan2 ]F DC = tan2 ]EBA = tan ]M BE tan ]AEB.

The result then follows.


66 IMO 2016 Hong Kong

G7. Let I be the incentre of a non-equilateral triangle ABC, IA be the A-excentre, IA0 be
the reflection of IA in BC, and lA be the reflection of line AIA0 in AI. Define points IB , IB0
and line lB analogously. Let P be the intersection point of lA and lB .
(a) Prove that P lies on line OI where O is the circumcentre of triangle ABC.

(b) Let one of the tangents from P to the incircle of triangle ABC meet the circumcircle at
points X and Y . Show that ∠XIY = 120◦ .
Solution 1.
(a) Let A0 be the reflection of A in BC and let M be the second intersection of line AI
and the circumcircle Γ of triangle ABC. As triangles ABA0 and AOC are isosceles with
∠ABA0 = 2∠ABC = ∠AOC, they are similar to each other. Also, triangles ABIA and
AIC are similar. Therefore we have
AA0 AA0 AB AC AI AI
= · = · = .
AIA AB AIA AO AC AO
Together with ∠A0 AIA = ∠IAO, we find that triangles AA0 IA and AIO are similar.

IA0
A Y
D

X T
O
I
P
B C

Z
M

A0

IA

Denote by P 0 the intersection of line AP and line OI. Using directed angles, we have

]M AP 0 = ]IA0 AIA = ]IA0 AA0 − ]IA AA0 = ]AA0 IA − ∠(AM, OM )


= ]AIO − ]AM O = ]M OP 0 .

This shows M, O, A, P 0 are concyclic.


Shortlisted problems 67

Denote by R and r the circumradius and inradius of triangle ABC. Then


IA · IM IO2 − R2
IP 0 = =
IO IO
is independent of A. Hence, BP also meets line OI at the same point P 0 so that P 0 = P ,
and P lies on OI.
(b) By Poncelet’s Porism, the other tangents to the incircle of triangle ABC from X and Y
meet at a point Z on Γ. Let T be the touching point of the incircle to XY , and let D be
the midpoint of XY . We have
OI 2 R2 − 2Rr
Ç å Ç å Ç å
OP OI
OD = IT · =r 1+ =r 1+ =r 1+ 2
IP IP OI · IP R − IO2
R2 − 2Rr
Ç å
R OX
=r 1+ = = .
2Rr 2 2
This shows ∠XZY = 60◦ and hence ∠XIY = 120◦ .
Solution 2.
(a) Note that triangles AIB C and IA BC are similar since their corresponding interior angles
are equal. Therefore, the four triangles AIB0 C, AIB C, IA BC and IA0 BC are all similar.
From 4AIB0 C ∼ 4IA0 BC, we get 4AIA0 C ∼ 4IB0 BC. From ]ABP = ]IB0 BC = ]AIA0 C
and ]BAP = ]IA0 AC, the triangles ABP and AIA0 C are directly similar.

IA0 IB

A
P X T D
Y

I O

B C

IB0
A0

IA


Consider the inversion with centre A and radius AB · AC followed by the reflection
in AI. Then B and C are mapped to each other, and I and IA are mapped to each other.
68 IMO 2016 Hong Kong

From the similar triangles obtained, we have AP · AIA0 = AB · AC so that P is mapped


to IA0 under the transformation. In addition, line AO is mapped to the altitude from A,
and hence O is mapped to the reflection of A in BC, which we call point A0 . Note that
AA0 IA IA0 is an isosceles trapezoid, which shows it is inscribed in a circle. The preimage
of this circle is a straight line, meaning that O, I, P are collinear.

(b) Denote by R and r the circumradius and inradius of triangle ABC. Note that by the
above transformation, we have 4AP O ∼ 4AA0 IA0 and 4AA0 IA ∼ 4AIO. Therefore, we
find that
AO AO AIA AO
P O = A0 IA0 · 0
= AIA · 0 = 0 · AO = · AO.
AIA A IA A IA IO
This shows P O · IO = R2 , and it follows that P and I are mapped to each other under
the inversion with respect to the circumcircle Γ of triangle ABC. Then P X · P Y , which
is the power of P with respect to Γ, equals P I · P O. This yields X, I, O, Y are concyclic.
Let T be the touching point of the incircle to XY , and let D be the midpoint of XY .
Then
PO PO R2 R2 R
OD = IT · =r· =r· 2 2
= r · = .
PI P O − IO R − IO 2Rr 2
◦ ◦
This shows ∠DOX = 60 and hence ∠XIY = ∠XOY = 120 .

Comment. A simplification of this problem is to ask part (a) only. Note that the question in
part (b) implicitly requires P to lie on OI, or otherwise the angle is not uniquely determined
as we can find another tangent from P to the incircle.
Shortlisted problems 69

G8. Let A1 , B1 and C1 be points on sides BC, CA and AB of an acute triangle ABC
respectively, such that AA1 , BB1 and CC1 are the internal angle bisectors of triangle ABC.
Let I be the incentre of triangle ABC, and H be the orthocentre of triangle A1 B1 C1 . Show
that
AH + BH + CH > AI + BI + CI.
Solution. Without loss of generality, assume α = ∠BAC 6 β = ∠CBA 6 γ = ∠ACB.
Denote by a, b, c the lengths of BC, CA, AB respectively. We first show that triangle A1 B1 C1
is acute.
Choose points D and E on side BC such that B1 D//AB and B1 E is the internal angle
bisector of ∠BB1 C. As ∠B1 DB = 180◦ − β is obtuse, we have BB1 > B1 D. Thus,
BE BB1 DB1 BA BA1
= > = = .
EC B1 C B1 C AC A1 C
Therefore, BE > BA1 and 21 ∠BB1 C = ∠BB1 E > ∠BB1 A1 . Similarly, 21 ∠BB1 A > ∠BB1 C1 .
It follows that
1
∠A1 B1 C1 = ∠BB1 A1 + ∠BB1 C1 < (∠BB1 C + ∠BB1 A) = 90◦
2
is acute. By symmetry, triangle A1 B1 C1 is acute.
Let BB1 meet A1 C1 at F . From α 6 γ, we get a 6 c, which implies
ca ac
BA1 = 6 = BC1
b+c a+b
and hence ∠BC1 A1 6 ∠BA1 C1 . As BF is the internal angle bisector of ∠A1 BC1 , this shows
∠B1 F C1 = ∠BF A1 6 90◦ . Hence, H lies on the same side of BB1 as C1 . This shows H lies
inside triangle BB1 C1 . Similarly, from α 6 β and β 6 γ, we know that H lies inside triangles
CC1 B1 and AA1 C1 .

B0 60◦

H0
I0

C1 B1
H

I
F

B A1 DE C
70 IMO 2016 Hong Kong

As α 6 β 6 γ, we have α 6 60◦ 6 γ. Then ∠BIC 6 120◦ 6 ∠AIB. Firstly, suppose


∠AIC > 120◦ .
Rotate points B, I, H through 60◦ about A to B 0 , I 0 , H 0 so that B 0 and C lie on different
sides of AB. Since triangle AI 0 I is equilateral, we have

AI + BI + CI = I 0 I + B 0 I 0 + IC = B 0 I 0 + I 0 I + IC. (1)

Similarly,
AH + BH + CH = H 0 H + B 0 H 0 + HC = B 0 H 0 + H 0 H + HC. (2)
As ∠AII 0 = ∠AI 0 I = 60◦ , ∠AI 0 B 0 = ∠AIB > 120◦ and ∠AIC > 120◦ , the quadrilateral
B 0 I 0 IC is convex and lies on the same side of B 0 C as A.
Next, since H lies inside triangle ACC1 , H lies outside B 0 I 0 IC. Also, H lying inside
triangle ABI implies H 0 lies inside triangle AB 0 I 0 . This shows H 0 lies outside B 0 I 0 IC and
hence the convex quadrilateral B 0 I 0 IC is contained inside the quadrilateral B 0 H 0 HC. It
follows that the perimeter of B 0 I 0 IC cannot exceed the perimeter of B 0 H 0 HC. From (1) and
(2), we conclude that
AH + BH + CH > AI + BI + CI.
For the case ∠AIC < 120◦ , we can rotate B, I, H through 60◦ about C to B 0 , I 0 , H 0 so
that B 0 and A lie on different sides of BC. The proof is analogous to the previous case and
we still get the desired inequality.
Shortlisted problems 71

Number Theory
N1. For any positive integer k, denote the sum of digits of k in its decimal representation by
S(k). Find all polynomials P (x) with integer coefficients such that for any positive integer
n > 2016, the integer P (n) is positive and

S(P (n)) = P (S(n)). (1)

Answer.
• P (x) = c where 1 6 c 6 9 is an integer; or

• P (x) = x.
Solution 1. We consider three cases according to the degree of P .
• Case 1. P (x) is a constant polynomial.
Let P (x) = c where c is an integer constant. Then (1) becomes S(c) = c. This holds if
and only if 1 6 c 6 9.
• Case 2. deg P = 1.
We have the following observation. For any positive integers m, n, we have

S(m + n) 6 S(m) + S(n), (2)

and equality holds if and only if there is no carry in the addition m + n.


Let P (x) = ax + b for some integers a, b where a 6= 0. As P (n) is positive for large n, we
must have a > 1. The condition (1) becomes S(an + b) = aS(n) + b for all n > 2016. Setting
n = 2025 and n = 2020 respectively, we get

S(2025a + b) − S(2020a + b) = (aS(2025) + b) − (aS(2020) + b) = 5a.

On the other hand, (2) implies

S(2025a + b) = S((2020a + b) + 5a) 6 S(2020a + b) + S(5a).

These give 5a 6 S(5a). As a > 1, this holds only when a = 1, in which case (1) reduces to
S(n + b) = S(n) + b for all n > 2016. Then we find that

S(n + 1 + b) − S(n + b) = (S(n + 1) + b) − (S(n) + b) = S(n + 1) − S(n). (3)

If b > 0, we choose n such that n + 1 + b = 10k for some sufficiently large k. Note that all
the digits of n + b are 9’s, so that the left-hand side of (3) equals 1 − 9k. As n is a positive
integer less than 10k − 1, we have S(n) < 9k. Therefore, the right-hand side of (3) is at least
1 − (9k − 1) = 2 − 9k, which is a contradiction.
The case b < 0 can be handled similarly by considering n + 1 to be a large power of 10.
Therefore, we conclude that P (x) = x, in which case (1) is trivially satisfied.
72 IMO 2016 Hong Kong

• Case 3. deg P > 2.


Suppose the leading term of P is ad nd where ad 6= 0. Clearly, we have ad > 0. Consider
n = 10k − 1 in (1). We get S(P (n)) = P (9k). Note that P (n) grows asymptotically as fast
as nd , so S(P (n)) grows asymptotically as no faster than a constant multiple of k. On the
other hand, P (9k) grows asymptotically as fast as k d . This shows the two sides of the last
equation cannot be equal for sufficiently large k since d > 2.

Therefore, we conclude that P (x) = c where 1 6 c 6 9 is an integer, or P (x) = x.

Solution 2. Let P (x) = ad xd + ad−1 xd−1 + · · · + a0 . Clearly ad > 0. There exists an integer
m > 1 such that |ai | < 10m for all 0 6 i 6 d. Consider n = 9 × 10k for a sufficiently large
integer k in (1). If there exists an index 0 6 i 6 d − 1 such that ai < 0, then all digits of P (n)
in positions from 10ik+m+1 to 10(i+1)k−1 are all 9’s. Hence, we have S(P (n)) > 9(k − m − 1).
On the other hand, P (S(n)) = P (9) is a fixed constant. Therefore, (1) cannot hold for large
k. This shows ai > 0 for all 0 6 i 6 d − 1.
Hence, P (n) is an integer formed by the nonnegative integers ad × 9d , ad−1 × 9d−1 , . . . , a0
by inserting some zeros in between. This yields

S(P (n)) = S(ad × 9d ) + S(ad−1 × 9d−1 ) + · · · + S(a0 ).

Combining with (1), we have

S(ad × 9d ) + S(ad−1 × 9d−1 ) + · · · + S(a0 ) = P (9) = ad × 9d + ad−1 × 9d−1 + · · · + a0 .

As S(m) 6 m for any positive integer m, with equality when 1 6 m 6 9, this forces each
ai × 9i to be a positive integer between 1 and 9. In particular, this shows ai = 0 for i > 2
and hence d 6 1. Also, we have a1 6 1 and a0 6 9. If a1 = 1 and 1 6 a0 6 9, we take
n = 10k + (10 − a0 ) for sufficiently large k in (1). This yields a contradiction since

S(P (n)) = S(10k + 10) = 2 6= 11 = P (11 − a0 ) = P (S(n)).

The zero polynomial is also rejected since P (n) is positive for large n. The remaining candi-
dates are P (x) = x or P (x) = a0 where 1 6 a0 6 9, all of which satisfy (1), and hence are
the only solutions.
Shortlisted problems 73

N2. Let τ (n) be the number of positive divisors of n. Let τ1 (n) be the number of positive
divisors of n which have remainders 1 when divided by 3. Find all possible integral values of
the fraction ττ1(10n)
(10n)
.

Answer. All composite numbers together with 2.

Solution. In this solution, we always use pi to denote primes congruent to 1 mod 3, and use
qj to denote primes congruent to 2 mod 3. When we express a positive integer m using its
prime factorization, we also include the special case m = 1 by allowing the exponents to be
zeros. We first compute τ1 (m) for a positive integer m.

• Claim. Let m = 3x pa11 pa22 · · · pas s q1b1 q2b2 · · · qtbt be the prime factorization of m. Then
 
s t
Y 1Y
τ1 (m) = (ai + 1)  (bj + 1)
. (1)
i=1

 2 j=1 

Proof. To choose a divisor of m congruent to 1 mod 3, it cannot have the prime divisor 3,
while there is no restriction on choosing prime factors congruent to 1 mod 3. Also, we have
to choose an even number of prime factors (counted with multiplicity) congruent to 2 mod 3.
If tj=1 (bj + 1) is even, then we may assume without loss of generality b1 + 1 is even. We
Q

can choose the prime factors q2 , q3 , . . . , qt freely in tj=2 (bj + 1) ways. Then the parity of
Q

the number of q1 is uniquely determined, and hence there are 12 (b1 + 1) ways to choose the
exponent of q1 . Hence (1) is verified in this case.
If tj=1 (bj + 1) is odd, we use induction on t to count the number of choices. When
Q

t = 1, there are d b12+1 e choices for which the exponent is even and b b12+1 c choices for which
the exponent is odd. For the inductive step, we find that there are
  ¢   ú  
1 t−1  1 t−1 t
• ü
bt + 1 bt + 1 1Y
 
Y Y 
 (bj + 1) ·
 +  (bj + 1) ·
 =
 (bj + 1)
 2 j=1 2 2 j=1 2  2 j=1
 
 

choices with an even number of prime factors and hence b 12 tj=1 (bj + 1)c choices with an odd
Q

number of prime factors. Hence (1) is also true in this case.

Let n = 3x 2y 5z pa11 pa22 · · · pas s q1b1 q2b2 · · · qtbt . Using the well-known formula for computing the
divisor function, we get
s
Y t
Y
τ (10n) = (x + 1)(y + 2)(z + 2) (ai + 1) (bj + 1). (2)
i=1 j=1

By the Claim, we have


 
s t
Y 1 Y
τ1 (10n) = (ai + 1)  (y + 2)(z + 2) (bj + 1)
. (3)
i=1

 2 j=1 
74 IMO 2016 Hong Kong

Qt
If c = (y + 2)(z + 2) j=1 (bj + 1) is even, then (2) and (3) imply

τ (10n)
= 2(x + 1).
τ1 (10n)

In this case ττ1(10n)


(10n)
can be any even positive integer as x runs through all nonnegative integers.
If c is odd, which means y, z are odd and each bj is even, then (2) and (3) imply

τ (10n) 2(x + 1)c


= . (4)
τ1 (10n) c+1

For this to be an integer, we need c + 1 divides 2(x + 1) since c and c + 1 are relatively prime.
Let 2(x + 1) = k(c + 1). Then (4) reduces to
t
τ (10n) Y
= kc = k(y + 2)(z + 2) (bj + 1). (5)
τ1 (10n) j=1

Noting that y, z are odd, the integers y + 2 and z + 2 are at least 3. This shows the integer
in this case must be composite. On the other hand, for any odd composite number ab with
ab−1
a, b > 3, we may simply take n = 3 2 · 2a−2 · 5b−2 so that ττ1(10n)
(10n)
= ab from (5).
We conclude that the fraction can be any even integer or any odd composite number.
Equivalently, it can be 2 or any composite number.
Shortlisted problems 75

N3. Define P (n) = n2 + n + 1. For any positive integers a and b, the set
{P (a), P (a + 1), P (a + 2), . . . , P (a + b)}

is said to be fragrant if none of its elements is relatively prime to the product of the other
elements. Determine the smallest size of a fragrant set.
Answer. 6.
Solution. We have the following observations.
(i) (P (n), P (n + 1)) = 1 for any n.
We have (P (n), P (n + 1)) = (n2 + n + 1, n2 + 3n + 3) = (n2 + n + 1, 2n + 2). Noting
that n2 + n + 1 is odd and (n2 + n + 1, n + 1) = (1, n + 1) = 1, the claim follows.

(ii) (P (n), P (n + 2)) = 1 for n 6≡ 2 (mod 7) and (P (n), P (n + 2)) = 7 for n ≡ 2 (mod 7).
From (2n+7)P (n)−(2n−1)P (n+2) = 14 and the fact that P (n) is odd, (P (n), P (n+2))
must be a divisor of 7. The claim follows by checking n ≡ 0, 1, . . . , 6 (mod 7) directly.

(iii) (P (n), P (n + 3)) = 1 for n 6≡ 1 (mod 3) and 3|(P (n), P (n + 3)) for n ≡ 1 (mod 3).
From (n + 5)P (n) − (n − 1)P (n + 3) = 18 and the fact that P (n) is odd, (P (n), P (n + 3))
must be a divisor of 9. The claim follows by checking n ≡ 0, 1, 2 (mod 3) directly.
Suppose there exists a fragrant set with at most 5 elements. We may assume it contains
exactly 5 elements P (a), P (a + 1), . . . , P (a + 4) since the following argument also works with
fewer elements. Consider P (a + 2). From (i), it is relatively prime to P (a + 1) and P (a + 3).
Without loss of generality, assume (P (a), P (a + 2)) > 1. From (ii), we have a ≡ 2 (mod 7).
The same observation implies (P (a + 1), P (a + 3)) = 1. In order that the set is fragrant,
(P (a), P (a + 3)) and (P (a + 1), P (a + 4)) must both be greater than 1. From (iii), this holds
only when both a and a + 1 are congruent to 1 mod 3, which is a contradiction.
It now suffices to construct a fragrant set of size 6. By the Chinese Remainder Theorem,
we can take a positive integer a such that

a≡7 (mod 19), a+1≡2 (mod 7), a+2≡1 (mod 3).

For example, we may take a = 197. From (ii), both P (a + 1) and P (a + 3) are divisible
by 7. From (iii), both P (a + 2) and P (a + 5) are divisible by 3. One also checks from
19|P (7) = 57 and 19|P (11) = 133 that P (a) and P (a + 4) are divisible by 19. Therefore, the
set {P (a), P (a + 1), . . . , P (a + 5)} is fragrant.
Therefore, the smallest size of a fragrant set is 6.
Comment. “Fragrant Harbour” is the English translation of “Hong Kong”.
A stronger version of this problem is to show that there exists a fragrant set of size k for
any k > 6. We present a proof here.
For each even positive integer m which is not divisible by 3, since m2 + 3 ≡ 3 (mod 4),
we can find a prime pm ≡ 3 (mod 4) such that pm |m2 + 3. Clearly, pm > 3.
76 IMO 2016 Hong Kong

If b = 2t > 6, we choose a such that 3|2(a + t) + 1 and pm |2(a + t) + 1 for each 1 6 m 6 b


with m ≡ 2, 4 (mod 6). For 0 6 r 6 t and 3|r, we have a + t ± r ≡ 1 (mod 3) so that
3|P (a + t ± r). For 0 6 r 6 t and (r, 3) = 1, we have

4P (a + t ± r) ≡ (−1 ± 2r)2 + 2(−1 ± 2r) + 4 = 4r2 + 3 ≡ 0 (mod p2r ).

Hence, {P (a), P (a + 1), . . . , P (a + b)} is fragrant.


If b = 2t + 1 > 7 (the case b = 5 has been done in the original problem), we choose a
such that 3|2(a + t) + 1 and pm |2(a + t) + 1 for 1 6 m 6 b with m ≡ 2, 4 (mod 6), and that
a + b ≡ 9 (mod 13). Note that a exists by the Chinese Remainder Theorem since pm 6= 13
for all m. The even case shows that {P (a), P (a + 1), . . . , P (a + b − 1)} is fragrant. Also, one
checks from 13|P (9) = 91 and 13|P (3) = 13 that P (a + b) and P (a + b − 6) are divisible by
13. The proof is thus complete.
Shortlisted problems 77

N4. Let n, m, k and l be positive integers with n 6= 1 such that nk + mnl + 1 divides nk+l − 1.
Prove that

• m = 1 and l = 2k; or
nk−l −1
• l|k and m = nl −1
.

Solution 1. It is given that


nk + mnl + 1|nk+l − 1. (1)
This implies

nk + mnl + 1|(nk+l − 1) + (nk + mnl + 1) = nk+l + nk + mnl . (2)

We have two cases to discuss.

• Case 1. l > k.
Since (nk + mnl + 1, n) = 1, (2) yields

nk + mnl + 1|nl + mnl−k + 1.

In particular, we get nk + mnl + 1 6 nl + mnl−k + 1. As n > 2 and k > 1, (m − 1)nl is at


least 2(m − 1)nl−k . It follows that the inequality cannot hold when m > 2. For m = 1, the
above divisibility becomes
nk + nl + 1|nl + nl−k + 1.
Note that nl +nl−k +1 < nl +nl +1 < 2(nk +nl +1). Thus we must have nl +nl−k +1 = nk +nl +1
so that l = 2k, which gives the first result.

• Case 2. l < k.
This time (2) yields
nk + mnl + 1|nk + nk−l + m.
In particular, we get nk + mnl + 1 6 nk + nk−l + m, which implies

nk−l − 1
m6 . (3)
nl − 1
On the other hand, from (1) we may let nk+l − 1 = (nk + mnl + 1)t for some positive
integer t. Obviously, t is less than nl , which means t 6 nl − 1 as it is an integer. Then we
have nk+l − 1 6 (nk + mnl + 1)(nl − 1), which is the same as

nk−l − 1
m> . (4)
nl − 1
k−l
Equations (3) and (4) combine to give m = nnl −1−1 . As this is an integer, we have l|k − l.
This means l|k and it corresponds to the second result.
78 IMO 2016 Hong Kong

Solution 2. As in Solution 1, we begin with equation (2).

• Case 1. l > k.
Then (2) yields
nk + mnl + 1|nl + mnl−k + 1.
Since 2(nk +mnl +1) > 2mnl +1 > nl +mnl−k +1, it follows that nk +mnl +1 = nl +mnl−k +1,
that is,
m(nl − nl−k ) = nl − nk .
If m > 2, then m(nl − nl−k ) > 2nl − 2nl−k > 2nl − nl > nl − nk gives a contradiction. Hence
m = 1 and l − k = k, which means m = 1 and l = 2k.

• Case 2. l < k.
Then (2) yields
nk + mnl + 1|nk + nk−l + m.
Since 2(nk + mnl + 1) > 2nk + m > nk + nk−l + m, it follows that nk + mnl + 1 = nk + nk−l + m.
k−l
This gives m = nnl −1−1 . Note that nl − 1|nk−l − 1 implies l|k − l and hence l|k. The proof is
thus complete.

Comment. Another version of this problem is as follows: let n, m, k and l be positive integers
with n 6= 1 such that k and l do not divide each other. Show that nk + mnl + 1 does not
divide nk+l − 1.
Shortlisted problems 79

N5. Let a be a positive integer which is not a square number. Denote by A the set of all
positive integers k such that
x2 − a
k= (1)
x2 − y 2

for some integers x and y with x > a. Denote by B the set √ of all positive integers k such
that (1) is satisfied for some integers x and y with 0 6 x < a. Prove that A = B.

Solution 1. We first prove the following preliminary result.

• Claim. For fixed k, let x, y be integers satisfying (1). Then the numbers x1 , y1 defined by

(x − y)2 − 4a (x − y)2 − 4a
Ç å Ç å
1 1
x1 = x−y+ , y1 = x−y−
2 x+y 2 x+y

are integers and satisfy (1) (with x, y replaced by x1 , y1 respectively).

Proof. Since x1 + y1 = x − y and

x2 − xy − 2a 2(x2 − a)
x1 = = −x + = −x + 2k(x − y),
x+y x+y

both x1 and y1 are integers. Let u = x + y and v = x − y. The relation (1) can be rewritten
as
u2 − (4k − 2)uv + (v 2 − 4a) = 0.
v 2 −4a
By Vieta’s Theorem, the number z = u
satisfies

v 2 − (4k − 2)vz + (z 2 − 4a) = 0.

Since x1 and y1 are defined so that v = x1 + y1 and z = x1 − y1 , we can reverse the process
and verify (1) for x1 , y1 .

√ that B ⊂ A. Take any k ∈ B so that (1) is satisfied for some integers x, y


We first show
with 0 6 x < a. Clearly, y 6= 0 and we may
√ assume y is positive. Since a is not a square,
we have k > 1. Hence, we get 0 6 x < y < a. Define

(x − y)2 − 4a (x − y)2 − 4a
Ç å
1 1
x1 = x − y + , y1 = x−y− .
2 x+y 2 x+y

By the Claim, x1 , y1 are integers satisfying (1). Also, we have

(x − y)2 − 4a 2a + x(y − x) √
Ç å
1 2a
x1 > − x−y+ = > > a.
2 x+y x+y x+y

This implies k ∈ A and hence B ⊂ A.


80 IMO 2016 Hong Kong

√ show that A ⊂ B. Take any k ∈ A so that (1) is satisfied for some integers
Next, we shall
x, y with x > a. Again, we may assume y is positive. Among all such representations of k,
we choose the one with smallest x + y. Define
(x − y)2 − 4a (x − y)2 − 4a
Ç å
1 1
x1 = x − y + , y1 = x−y− .
2 x+y 2 x+y

By the Claim, x1 , y1 are integers satisfying (1). Since k > 1, we get x > y > a. Therefore,
4a 4a
we have y1 > x+y > 0 and x+y < x + y. It follows that

4a − (x − y)2
® ´
x1 + y1 6 max x − y, < x + y.
x+y

If x1 > √a, we get a contradiction due to the minimality of x + y. Therefore, we must have
0 6 x1 < a, which means k ∈ B so that A ⊂ B.
The two subset relations combine to give A = B.
Solution 2. The relation (1) is equivalent to

ky 2 − (k − 1)x2 = a. (2)

Motivated by Pell’s Equation, we prove the following, which is essentially the same as the
Claim in Solution 1.
• Claim. If (x0 , y0 ) is a solution to (2), then ((2k − 1)x0 ± 2ky0 , (2k − 1)y0 ± 2(k − 1)x0 ) is
also a solution to (2).
Proof. We check directly that

k((2k − 1)y0 ± 2(k − 1)x0 )2 − (k − 1)((2k − 1)x0 ± 2ky0 )2


= (k(2k − 1)2 − (k − 1)(2k)2 )y02 + (k(2(k − 1))2 − (k − 1)(2k − 1)2 )x20
= ky02 − (k − 1)x20 = a.


If (2) is satisfied for some 0 6 x < a and nonnegative integer y, then clearly (1) implies
y > x. Also, we have k > 1 since a is not a square number. By the Claim, consider another
solution to (2) defined by

x1 = (2k − 1)x + 2ky, y1 = (2k − 1)y + 2(k − 1)x.

It satisfies x1 > (2k − 1)x + 2k(x + 1) = (4k − 1)x + 2k > x. Then we can replace the old
solution by a new one which has √ a larger value in x. After a finite number of replacements,
we must get a solution with x > √ a. This shows B ⊂ A.
If (2) is satisfied for some x > a and nonnegative integer y, by the Claim we consider
another solution to (2) defined by

x1 = |(2k − 1)x − 2ky|, y1 = (2k − 1)y − 2(k − 1)x.


Shortlisted problems 81

√ √ »
From (2), we get ky > k − 1x. This implies ky > k(k − 1)x > (k − 1)x and hence
(2k − 1)x − 2ky < x. On the other hand, the relation (1) implies x > y. Then it is clear that
(2k − 1)x − 2ky > −x. These combine to give x1 < x, which means we have found a solution
to (2) with x having a smaller
√ absolute value. After a finite number of steps, we shall obtain
a solution with 0 6 x < a. This shows A ⊂ B.
The desired result follows from B ⊂ A and A ⊂ B.

Solution 3. It suffices to show A ∪ B is a subset of A ∩ B. We take any k ∈ A ∪ B, which


means there exist integers x, y satisfying (1). Since a is not a square, it follows that k 6= 1.
As in Solution 2, the result follows readily once √we have proved the existence of a solution
(x1 , y1 ) to (1) with |x1 | > |x|, and, in case of x > a, another solution (x2 , y2 ) with |x2 | < |x|.
Without loss of generality, assume x, y > 0. Let u = x + y and v = x − y. Then u > v
and (1) becomes
(u + v)2 − 4a
k= . (3)
4uv
This is the same as
v 2 + (2u − 4ku)v + u2 − 4a = 0.
Let v1 = 4ku − 2u − v. Then u + v1 = 4ku − u − v > 8u − u − v > u + v. By Vieta’s Theorem,
v1 satisfies
v12 + (2u − 4ku)v1 + u2 − 4a = 0.
2
1 ) −4a
This gives k = (u+v4uv 1
. As k is an integer, u + v1 must be even. Therefore, x1 = u+v
2
1
and
v1 −u
y1 = 2 are integers. By reversing the process, we can see that (x1 , y1 ) is a solution to (1),
with x1 = u+v
2
1
>√u+v
2
= x > 0. This completes
√ the first half of the proof.
Suppose x > a. Then u + v > 2 a and (3) can be rewritten as

u2 + (2v − 4kv)u + v 2 − 4a = 0.

Let u2 = 4kv − 2v − u. By Vieta’s Theorem, we have uu2 = v 2 − 4a and

u22 + (2v − 4kv)u2 + v 2 − 4a = 0. (4)



By u > 0, u + v > 2 a and (3), we have v > 0. If u2 > 0, then vu2 6 uu2 = v 2 − 4a < v 2 .
This shows u2 < v 6 u and 0 < u2 + v < u + v. If u2 < 0, then (u2 + v) + (u + v) = 4kv > 0
and u2 + v < u + v imply |u2 + v| < u + v. In any case, since u2 + v is even from (4), we can
define x2 = u22+v and y2 = u22−v so that (1) is satisfied with |x2 | < x, as desired. The proof is
thus complete.
82 IMO 2016 Hong Kong

N6. Denote by N the set of all positive integers. Find all functions f : N → N such that
for all positive integers m and n, the integer f (m) + f (n) − mn is nonzero and divides
mf (m) + nf (n).
Answer. f (n) = n2 for any n ∈ N.
Solution. It is given that
f (m) + f (n) − mn|mf (m) + nf (n). (1)
Taking m = n = 1 in (1), we have 2f (1) − 1|2f (1). Then 2f (1) − 1|2f (1) − (2f (1) − 1) = 1
and hence f (1) = 1.
Let p > 7 be a prime. Taking m = p and n = 1 in (1), we have f (p) − p + 1|pf (p) + 1 and
hence
f (p) − p + 1|pf (p) + 1 − p(f (p) − p + 1) = p2 − p + 1.
If f (p) − p + 1 = p2 − p + 1, then f (p) = p2 . If f (p) − p + 1 6= p2 − p + 1, as p2 − p + 1 is an
odd positive integer, we have p2 − p + 1 > 3(f (p) − p + 1), that is,
1
f (p) 6 (p2 + 2p − 2). (2)
3
Taking m = n = p in (1), we have 2f (p) − p2 |2pf (p). This implies
2f (p) − p2 |2pf (p) − p(2f (p) − p2 ) = p3 .
By (2) and f (p) > 1, we get
2
−p2 < 2f (p) − p2 6 (p2 + 2p − 2) − p2 < −p
3
since p > 7. This contradicts the fact that 2f (p) − p2 is a factor of p3 . Thus we have proved
that f (p) = p2 for all primes p > 7.
Let n be a fixed positive integer. Choose a sufficiently large prime p. Consider m = p in
(1). We obtain
f (p) + f (n) − pn|pf (p) + nf (n) − n(f (p) + f (n) − pn) = pf (p) − nf (p) + pn2 .
As f (p) = p2 , this implies p2 −pn+f (n)|p(p2 −pn+n2 ). As p is sufficiently large and n is fixed,
p cannot divide f (n), and so (p, p2 − pn + f (n)) = 1. It follows that p2 − pn + f (n)|p2 − pn + n2
and hence
p2 − pn + f (n)|(p2 − pn + n2 ) − (p2 − pn + f (n)) = n2 − f (n).
Note that n2 − f (n) is fixed while p2 − pn + f (n) is chosen to be sufficiently large. Therefore,
we must have n2 − f (n) = 0 so that f (n) = n2 for any positive integer n.
Finally, we check that when f (n) = n2 for any positive integer n, then
f (m) + f (n) − mn = m2 + n2 − mn
and
mf (m) + nf (n) = m3 + n3 = (m + n)(m2 + n2 − mn).
The latter expression is divisible by the former for any positive integers m, n. This shows
f (n) = n2 is the only solution.
Shortlisted problems 83

N7. Let n be an odd positive integer. In the Cartesian plane, a cyclic polygon P with area
S is chosen. All its vertices have integral coordinates, and the squares of its side lengths are
all divisible by n. Prove that 2S is an integer divisible by n.
Solution. Let P = A1 A2 . . . Ak and let Ak+i = Ai for i > 1. By the Shoelace Formula, the
area of any convex polygon with integral coordinates is half an integer. Therefore, 2S is an
integer. We shall prove by induction on k > 3 that 2S is divisible by n. Clearly, it suffices to
consider n = pt where p is an odd prime and t > 1. √ √ √
For the base case k = 3, let the side lengths of P be na, nb, nc where a, b, c are
positive integers. By Heron’s Formula,
16S 2 = n2 (2ab + 2bc + 2ca − a2 − b2 − c2 ).
This shows 16S 2 is divisible by n2 . Since n is odd, 2S is divisible by n.
Assume k > 4. If the square of length of one of the diagonals is divisible by n, then
that diagonal divides P into two smaller polygons, to which the induction hypothesis applies.
Hence we may assume that none of the squares of diagonal lengths is divisible by n. As
usual, we denote by νp (r) the exponent of p in the prime decomposition of r. We claim the
following.
• Claim. νp (A1 A2m ) > νp (A1 A2m+1 ) for 2 6 m 6 k − 1.
Proof. The case m = 2 is obvious since νp (A1 A22 ) > pt > νp (A1 A23 ) by the condition and the
above assumption.
Suppose νp (A1 A22 ) > νp (A1 A23 ) > · · · > νp (A1 A2m ) where 3 6 m 6 k − 1. For the induction
step, we apply Ptolemy’s Theorem to the cyclic quadrilateral A1 Am−1 Am Am+1 to get
A1 Am+1 × Am−1 Am + A1 Am−1 × Am Am+1 = A1 Am × Am−1 Am+1 ,
which can be rewritten as
A1 A2m+1 × Am−1 A2m = A1 A2m−1 × Am A2m+1 + A1 A2m × Am−1 A2m+1
− 2A1 Am−1 × Am Am+1 × A1 Am × Am−1 Am+1 . (1)
From this, 2A1 Am−1 ×Am Am+1 ×A1 Am ×Am−1 Am+1 is an integer. We consider the component
of p of each term in (1). By the inductive hypothesis, we have νp (A1 A2m−1 ) > νp (A1 A2m ). Also,
we have νp (Am A2m+1 ) > pt > νp (Am−1 A2m+1 ). These give
νp (A1 A2m−1 × Am A2m+1 ) > νp (A1 A2m × Am−1 A2m+1 ). (2)
Next, we have νp (4A1 A2m−1 × Am A2m+1 × A1 A2m × Am−1 A2m+1 ) = νp (A1 A2m−1 × Am A2m+1 ) +
νp (A1 A2m × Am−1 A2m+1 ) > 2νp (A1 A2m × Am−1 A2m+1 ) from (2). This implies
νp (2A1 Am−1 × Am Am+1 × A1 Am × Am−1 Am+1 ) > νp (A1 A2m × Am−1 A2m+1 ). (3)
Combining (1), (2) and (3), we conclude that
νp (A1 A2m+1 × Am−1 A2m ) = νp (A1 A2m × Am−1 A2m+1 ).
By νp (Am−1 A2m ) > pt > νp (Am−1 A2m+1 ), we get νp (A1 A2m+1 ) < νp (A1 A2m ). The Claim follows
by induction.
84 IMO 2016 Hong Kong

From the Claim, we get a chain of inequalities

pt > νp (A1 A23 ) > νp (A1 A24 ) > · · · > νp (A1 A2k ) > pt ,

which yields a contradiction. Therefore, we can show by induction that 2S is divisible by n.

Comment. The condition that P is cyclic is crucial. As a counterexample, consider the


rhombus with vertices (0, 3), (4, 0), (0, −3), (−4, 0). Each of its squares of side lengths is
divisible by 5, while 2S = 48 is not.
The proposer also gives a proof for the case n is even. One just needs an extra technical
step for the case p = 2.
Shortlisted problems 85

N8. Find all polynomials P (x) of odd degree d and with integer coefficients satisfying the
following property: for each positive integer n, there exist n positive integers x1 , x2 , . . . , xn
such that 21 < PP (x
(xi )
j)
< 2 and PP (x
(xi )
j)
is the d-th power of a rational number for every pair of
indices i and j with 1 6 i, j 6 n.
Answer. P (x) = a(rx + s)d where a, r, s are integers with a 6= 0, r > 1 and (r, s) = 1.
Solution. Let P (x) = ad xd + ad−1 xd−1 + · · · + a0 . Consider the substitution y = dad x + ad−1 .
By defining Q(y) = P (x), we find that Q is a polynomial with rational coefficients without
the term y d−1 . Let Q(y) = bd y d + bd−2 y d−2 + bd−3 y d−3 + · · · + b0 and B = max06i6d {|bi |}
(where bd−1 = 0).
The condition shows that for each n > 1, there exist integers y1 , y2 , . . . , yn such that
1 Q(yi ) Q(yi )
2
< Q(yj )
< 2 and Q(y j)
is the d-th power of a rational number for 1 6 i, j 6 n. Since n
can be arbitrarily large, we may assume all xi ’s and hence yi ’s are integers larger than some
absolute constant in the following.
By Dirichlet’s Theorem, since d is odd, we can find a sufficiently large prime p such that
p ≡ 2 (mod d). In particular, we have (p − 1, d) = 1. For this fixed p, we choose n to be
sufficiently large. Then by the Pigeonhole Principle, there must be d+1 of y1 , y2 , . . . , yn which
are congruent mod p. Without loss of generality, assume yi ≡ yj (mod p) for 1 6 i, j 6 d + 1.
We shall establish the following.
Q(yi ) yid
• Claim. Q(y1 )
= y1d
for 2 6 i 6 d + 1.
Q(yi ) ld
Proof. Let Q(y1 )
= md
where (l, m) = 1 and l, m > 0. This can be rewritten in the expanded
form
d−2
bd (md yid ld y1d ) bj (md yij − ld y1j ).
X
− =− (1)
j=0

Let c be the common denominator of Q, so that cQ(k) is an integer for any integer k.
Note that c depends only on P and so we may assume (p, c) = 1. Then y1 ≡ yi (mod p)
implies cQ(y1 ) ≡ cQ(yi ) (mod p).
• Case 1. p|cQ(y1 ).
cQ(yi )
In this case, there is a cancellation of p in the numerator and denominator of cQ(y1 )
, so
that md 6 p−1 |cQ(y1 )|. Noting |Q(y1 )| < 2By1d as y1 is large, we get
1 1
m 6 p− d (2cB) d y1 . (2)
1 Q(yi )
For large y1 and yi , the relation 2
< Q(y1 )
< 2 implies

1 yd
< id < 3. (3)
3 y1
We also have
1 ld
< d < 2. (4)
2 m
86 IMO 2016 Hong Kong

Now, the left-hand side of (1) is

bd (myi − ly1 )(md−1 yid−1 + md−2 yid−2 ly1 + · · · + ld−1 y1d−1 ).

Suppose on the contrary that myi − ly1 6= 0. Then the absolute value of the above expression
is at least |bd |md−1 yid−1 . On the other hand, the absolute value of the right-hand side of (1)
is at most
d−2
B(md yij + ld y1j ) 6 (d − 1)B(md yid−2 + ld y1d−2 )
X

j=0

6 (d − 1)B(7md yid−2 )
1 1
6 7(d − 1)B(p− d (2cB) d y1 )md−1 yid−2
1 1
6 21(d − 1)Bp− d (2cB) d md−1 yid−1

by using successively (3), (4), (2) and again (3). This shows
1 1
|bd |md−1 yid−1 6 21(d − 1)Bp− d (2cB) d md−1 yid−1 ,

which is a contradiction for large p as bd , B, c, d depend only on the polynomial P . Therefore,


we have myi − ly1 = 0 in this case.
• Case 2. (p, cQ(y1 )) = 1.
From cQ(y1 ) ≡ cQ(yi ) (mod p), we have ld ≡ md (mod p). Since (p − 1, d) = 1, we
use Fermat Little Theorem to conclude l ≡ m (mod p). Then p|myi − ly1 . Suppose on
the contrary that myi − ly1 6= 0. Then the left-hand side of (1) has absolute value at least
|bd |pmd−1 yid−1 . Similar to Case 1, the right-hand side of (1) has absolute value at most
1
21(d − 1)B(2cB) d md−1 yid−1 ,

which must be smaller than |bd |pmd−1 yid−1 for large p. Again this yields a contradiction and
hence myi − ly1 = 0.
Q(yi ) ld yid
In both cases, we find that Q(y1 )
= md
= y1d
.

From the Claim, the polynomial Q(y1 )y d − y1d Q(y) has roots y = y1 , y2 , . . . , yd+1 . Since
its degree is at most d, this must be the zero polynomial. Hence, Q(y) = bd y d . This implies
P (x) = ad (x + ada ) . Let ada
d−1 d
d
d−1
d
= rs with integers r, s where r > 1 and (r, s) = 1. Since P has
integer coefficients, we need rd |ad . Let ad = rd a. Then P (x) = a(rx + s)d . It is obvious that
such a polynomial satisfies the conditions.

Comment. In the proof, the use of prime and Dirichlet’s Theorem can be avoided. One can
easily show that each P (xi ) can be expressed in the form uvid where u, vi are integers and u
cannot be divisible by the d-th power of a prime (note that u depends only on P ). By fixing a
large integer q and by choosing a large n, we can apply the Pigeonhole Principle and assume
Shortlisted problems 87

x1 ≡ x2 ≡ · · · ≡ xd+1 (mod q) and v1 ≡ v2 ≡ · · · ≡ vd+1 (mod q). Then the remaining proof
is similar to Case 2 of the Solution.
Alternatively, we give another modification of the proof as follows.
We take a sufficiently large n and consider the corresponding positive integers y1 , y2 , . . . , yn .
Q(yi ) lid
For each 2 6 i 6 n, let Q(y 1 )
= m d.
i

As in Case 1, if there are d indices i such that the integers c|Q(y


mdi
1 )|
are bounded below by
a constant depending only on P , we can establish the Claim using those yi ’s and complete
the proof. Similarly, as in Case 2, if there are d indices i such that the integers |mi yi − li y1 |
are bounded below, then the proof goes the same. So it suffices to consider the case where
c|Q(y1 )|
mdi
6 M and |mi yi − li y1 | 6 N for all 2 6 i 6 n0 where M, N are fixed constants
and n0 is large. Since there are only finitely many choices for mi and mi yi − li y1 , by the
Pigeonhole Principle, we can assume without loss of generality mi = m and mi yi − li y1 = t
for 2 6 i 6 d + 2. Then
Q(yi ) ld (myi − t)d
= id =
Q(y1 ) m md y1d
so that Q(y1 )(my − t)d − md y1d Q(y) has roots y = y2 , y3 , . . . , yd+2 . Its degree is at most d and
hence it is the zero polynomial. Therefore, Q(y) = mbdd (my − t)d . Indeed, Q does not have
the term y d−1 , which means t should be 0. This gives the corresponding P (x) of the desired
form.
The two modifications of the Solution work equally well when the degree d is even.
Shortlisted
Problems
(with solutions)

58th International Mathematical Olympiad


Rio de Janeiro, 12–23 July 2017
Note of Condentiality

The Shortlist has to be kept stri tly ondential


until the on lusion of the following
International Mathemati al Olympiad.
IMO General Regulations Ÿ6.6

Contributing Countries
The Organizing Committee and the Problem Sele tion Committee of IMO 2017 thank the
following 51 ountries for ontributing 150 problem proposals:

Albania, Algeria, Armenia, Australia, Austria, Azerbaijan, Belarus,

Belgium, Bulgaria, Cuba, Cyprus, Cze h Republi , Denmark, Estonia,

Fran e, Georgia, Germany, Gree e, Hong Kong, India, Iran, Ireland,

Israel, Italy, Japan, Kazakhstan, Latvia, Lithuania, Luxembourg,

Mexi o, Montenegro, Moro o, Netherlands, Romania, Russia, Serbia,

Singapore, Slovakia, Slovenia, South Afri a, Sweden, Switzerland,

Taiwan, Tajikistan, Tanzania, Thailand, Trinidad and Tobago, Turkey,

Ukraine, United Kingdom, U.S.A.

Problem Sele tion Committee

Carlos Gustavo Tamm de Araújo Moreira (Gugu) ( hairman),


Lu iano Monteiro de Castro, Ilya I. Bogdanov, Géza Kós, Carlos Yuzo Shine,
Zhuo Qun (Alex) Song, Ralph Costa Teixeira, Eduardo Tengan
4 IMO 2017, Rio de Janeiro

Problems
Algebra
A1. Let a1 , a2 , . . . , an , k , and M be positive integers su h that

1 1 1
` ` ¨¨¨` “k and a1 a2 . . . an “ M.
a1 a2 an
If M ą 1, prove that the polynomial

P pxq “ Mpx ` 1qk ´ px ` a1 qpx ` a2 q ¨ ¨ ¨ px ` an q

has no positive roots.


(Trinidad and Tobago)
A2. Let q be a real number. Gugu has a napkin with ten distin t real numbers written
on it, and he writes the following three lines of real numbers on the bla kboard:

• In the rst line, Gugu writes down every number of the form a ´ b, where a and b are two
(not ne essarily distin t) numbers on his napkin.

• In the se ond line, Gugu writes down every number of the form qab, where a and b are
two (not ne essarily distin t) numbers from the rst line.
• In the third line, Gugu writes down every number of the form a2 ` b2 ´ c2 ´ d2 , where
a, b, c, d are four (not ne essarily distin t) numbers from the rst line.
Determine all values of q su h that, regardless of the numbers on Gugu's napkin, every
number in the se ond line is also a number in the third line.
(Austria)
A3. Let S be a nite set, and let A be the set of all fun tions from S to S . Let f be an
element of A, and let T “ f pSq be the image of S under f . Suppose that f ˝ g ˝ f ‰ g ˝ f ˝ g
for every g in A with g ‰ f . Show that f pT q “ T .
(India)
A4. A sequen e of real numbers a1 , a2 , . . . satises the relation

an “ ´ max pai ` aj q for all n ą 2017.


i`j“n

Prove that this sequen e is bounded, i.e., there is a onstant M su h that |an | ď M for all
positive integers n.
(Russia)
Shortlisted problems 5

A5. An integer n ě 3 is given. We all an n-tuple of real numbers px1 , x2 , . . . , xn q Shiny


if for ea h permutation y1 , y2 , . . . , yn of these numbers we have

n´1
ÿ
yi yi`1 “ y1 y2 ` y2 y3 ` y3 y4 ` ¨ ¨ ¨ ` yn´1 yn ě ´1.
i“1

Find the largest onstant K “ Kpnq su h that

ÿ
xi xj ě K
1ďiăjďn

holds for every Shiny n-tuple px1 , x2 , . . . , xn q.


(Serbia)
A6. Find all fun tions f: RÑR su h that

f pf pxqf pyqq ` f px ` yq “ f pxyq

for all x, y P R.
(Albania)
A7. Let a0 , a1 , a2 , . . . be a sequen e of integers and b0 , b1 , b2 , . . . be a sequen e of positive
integers su h that a0 “ 0, a1 “ 1, and
#
an bn ` an´1 , if bn´1 “ 1
an`1 “ for n “ 1, 2, . . ..
an bn ´ an´1 , if bn´1 ą 1

Prove that at least one of the two numbers a2017 and a2018 must be greater than or equal to 2017.
(Australia)
A8. f : R Ñ R satises the following ondition:
Assume that a fun tion

` ˘` ˘
For every x, y P R su h that f pxq ` y f pyq ` x ą 0, we have f pxq ` y “ f pyq ` x.

Prove that f pxq ` y ď f pyq ` x whenever x ą y.


(Netherlands)
6 IMO 2017, Rio de Janeiro

Combinatori s
C1. A re tangle R with odd integer side lengths is divided into small re tangles with integer
side lengths. Prove that there is at least one among the small re tangles whose distan es from
the four sides of R are either all odd or all even.
(Singapore)
C2. Let n be a positive integer. Dene a hameleon to be any sequen e of 3n letters, with
exa tly no urren es of ea h of the letters a, b, and c. Dene a swap to be the transposition of
two adja ent letters in a hameleon. Prove that for any hameleon X , there exists a hameleon Y
2
su h that X annot be hanged to Y using fewer than 3n {2 swaps.
(Australia)
C3. Sir Alex plays the following game on a row of 9 ells. Initially, all ells are empty. In
ea h move, Sir Alex is allowed to perform exa tly one of the following two operations:

(1) Choose any number of the form 2j , where j is a non-negative integer, and put it into an
empty ell.

(2) Choose two (not ne essarily adja ent) ells with the same number in them; denote that
j j`1
number by 2 . Repla e the number in one of the ells with 2 and erase the number in
the other ell.

At the end of the game, one ell ontains the number 2n , where n is a given positive integer,
while the other ells are empty. Determine the maximum number of moves that Sir Alex ould
have made, in terms of n.
(Thailand)
C4. Let N ě2 be an integer. NpN ` 1q so er players, no two of the same height, stand
in a row in some order. Coa h Ralph wants to remove NpN ´ 1q people from this row so that
in the remaining row of 2N players, no one stands between the two tallest ones, no one stands
between the third and the fourth tallest ones, . . . , and nally no one stands between the two
shortest ones. Show that this is always possible.
(Russia)
C5. A hunter and an invisible rabbit play a game in the Eu lidean plane. The hunter's
starting point H0 oin ides with the rabbit's starting point R0 . In the nth round of the game
(n ě 1), the following happens.
(1) First the invisible rabbit moves se retly and unobserved from its urrent point Rn´1 to
some new point Rn with Rn´1 Rn “ 1.
1
(2) The hunter has a tra king devi e (e.g. dog) that returns an approximate position Rn of
1
the rabbit, so that Rn Rn ď 1.
(3) The hunter then visibly moves from point Hn´1 to a new point Hn with Hn´1 Hn “ 1.
9
Is there a strategy for the hunter that guarantees that after 10 su h rounds the distan e
between the hunter and the rabbit is below 100?
(Austria)
Shortlisted problems 7

C6. Let ną1 be an integer. An n ˆ n ˆ n ube is omposed of n3 unit ubes. Ea h


unit ube is painted with one olor. For ea h n ˆ n ˆ 1 box onsisting of n2 unit ubes (of any
of the three possible orientations), we onsider the set of the olors present in that box (ea h
olor is listed only on e). This way, we get 3n sets of olors, split into three groups a ording
to the orientation. It happens that for every set in any group, the same set appears in both
of the other groups. Determine, in terms of n, the maximal possible number of olors that are
present.
(Russia)
C7. For any nite sets X and Y of positive integers, denote by fX pkq the k th smallest
positive integer not in X, and let

X ˚ Y “ X Y tfX pyq : y P Y u.

Let A a ą 0 positive
be a set of integers, and let B be a set of bą0 positive integers. Prove
that if A ˚ B “ B ˚ A, then

A ˚ pA ˚ ¨ ¨ ¨ ˚ pA ˚ pA ˚ Aqq . . . q “ looooooooooooooooooomooooooooooooooooooon
looooooooooooooooooomooooooooooooooooooon B ˚ pB ˚ ¨ ¨ ¨ ˚ pB ˚ pB ˚ Bqq . . . q .
A appears b times B appears a times

(U.S.A.)
C8. Let n be a given positive integer. In the Cartesian plane, ea h latti e point
with nonnegative oordinates initially ontains a buttery, and there are no other butter-
ies. The neighborhood of a latti e point c onsists of all latti e points within the axis-aligned
p2n ` 1q ˆ p2n ` 1q square entered at c, apart from c itself. We all a buttery lonely, rowded,
or omfortable, depending on whether the number of butteries in its neighborhood N is re-
spe tively less than, greater than, or equal to half of the number of latti e points in N.
Every minute, all lonely butteries y away simultaneously. This pro ess goes on for as
long as there are any lonely butteries. Assuming that the pro ess eventually stops, determine
the number of omfortable butteries at the nal state.
(Bulgaria)
8 IMO 2017, Rio de Janeiro

Geometry
G1. Let ABCDE be a onvex pentagon su h that AB “ BC “ CD , =EAB “ =BCD ,
and =EDC “ =CBA. Prove that the perpendi ular line from E to BC and the line seg-
ments AC and BD are on urrent.
(Italy)
G2. Let R and S be distin t points on ir le Ω, and let t denote the tangent line to Ω
at R. Point R1 is the ree tion of R with respe t to S . A point I is hosen on the smaller ar
RS of Ω so that the ir um ir le Γ of triangle ISR1 interse ts t at two dierent points. Denote
by A the ommon point of Γ and t that is losest to R. Line AI meets Ω again at J . Show
1
that JR is tangent to Γ.
(Luxembourg)
G3. Let O be the ir um enter of an a ute s alene triangle ABC . Line OA interse ts the
altitudes of ABC through B and C at P and Q, respe tively. The altitudes meet at H . Prove
that the ir um enter of triangle P QH lies on a median of triangle ABC .
(Ukraine)
G4. In triangle ABC , let ω be the ex ir le opposite A. Let D , E , and F be the points
where ω is tangent to lines BC , CA, and AB , respe tively. The ir le AEF interse ts line BC
at P and Q. Let M be the midpoint of AD . Prove that the ir le MP Q is tangent to ω .
(Denmark)
G5. ABCC1 B1 A1 be a onvex hexagon su h that AB “ BC , and suppose that the
Let
line segmentsAA1 , BB1 , and CC1 have the same perpendi ular bise tor. Let the diagonals
AC1 and A1 C meet at D , and denote by ω the ir le ABC . Let ω interse t the ir le A1 BC1
again at E ‰ B . Prove that the lines BB1 and DE interse t on ω .
(Ukraine)
G6. Let ně3 be an integer. Two regular n-gons A and B are given in the plane. Prove
that the verti es of A that lie inside B or on its boundary are onse utive.
(That is, prove that there exists a line separating those verti es of A that lie inside B or on
its boundary from the other verti es of A.)
(Cze h Republi )
G7. A ABCD has an ins ribed ir le with enter I . Let Ia , Ib , Ic ,
onvex quadrilateral
and Id be the in enters of the triangles DAB , ABC , BCD , and CDA, respe tively. Suppose
that the ommon external tangents of the ir les AIb Id and CIb Id meet at X , and the ommon
0
external tangents of the ir les BIa Ic and DIa Ic meet at Y . Prove that =XIY “ 90 .
(Kazakhstan)
G8. There are 2017 mutually external ir les drawn on a bla kboard, su h that no two
are tangent and no three share a ommon tangent. A tangent segment is a line segment that
is a ommon tangent to two ir les, starting at one tangent point and ending at the other one.
Lu iano is drawing tangent segments on the bla kboard, one at a time, so that no tangent
segment interse ts any other ir les or previously drawn tangent segments. Lu iano keeps
drawing tangent segments until no more an be drawn. Find all possible numbers of tangent
segments when he stops drawing.
(Australia)
Shortlisted problems 9

This page is intentionally left blank


10 IMO 2017, Rio de Janeiro

Number Theory
N1. The sequen e a0 , a1 , a2 , . . . of positive integers satises
#? ?
an , if an is an integer
an`1 “ for every n ě 0.
an ` 3, otherwise

Determine all values of a0 ą 1 for whi h there is at least one number a su h that an “ a for
innitely many values of n.
(South Afri a)
N2. Let p ě 2 be a prime number. Eduardo and Fernando play the following game making
moves alternately: in ea h move, the urrent player hooses an index i in the set t0, 1, . . . , p´1u
that was not hosen before by either of the two players and then hooses an element ai of the
set t0, 1, 2, 3, 4, 5, 6, 7, 8, 9u. Eduardo has the rst move. The game ends after all the indi es
i P t0, 1, . . . , p ´ 1u have been hosen. Then the following number is omputed:

p´1
ÿ
p´1
M “ a0 ` 10 ¨ a1 ` ¨ ¨ ¨ ` 10 ¨ ap´1 “ aj ¨ 10j .
j“0

The goal of Eduardo is to make the number M divisible by p, and the goal of Fernando is to
prevent this.
Prove that Eduardo has a winning strategy.
(Moro o)
N3. Determine all integers n ě 2 with the following property: for any integers a1 , a2 , . . . , an
whose sum is not divisible by n, there exists an index 1 ď i ď n su h that none of the numbers

ai , ai ` ai`1 , . . . , ai ` ai`1 ` ¨ ¨ ¨ ` ai`n´1

is divisible by n. (We let ai “ ai´n when i ą n.)


(Thailand)
N4. Call a rational number short if it has nitely many digits in its de imal expansion.
For a positive integer m, we say that a positive integerm-tasti if there exists a number
t is
t
10 ´ 1 10k ´ 1
c P t1, 2, 3, . . . , 2017u su h that is short, and su h that is not short for any
c¨m c¨m
1 ď k ă t. Let Spmq be the set of m-tasti numbers. Consider Spmq for m “ 1, 2, . . .. What is
the maximum number of elements in Spmq?
(Turkey)
N5. Find all pairs pp, qq of prime numbers with pąq for whi h the number

pp ` qqp`q pp ´ qqp´q ´ 1
pp ` qqp´q pp ´ qqp`q ´ 1
is an integer.
(Japan)
Shortlisted problems 11

N6. Find the smallest positive integer n, or show that no su h n exists, with the following
property: there are innitely many distin t n-tuples of positive rational numbers pa1 , a2 , . . . , an q
su h that both
1 1 1
a1 ` a2 ` ¨ ¨ ¨ ` an and ` ` ¨¨¨`
a1 a2 an
are integers.
(Singapore)
N7. Say that an ordered pair px, yq of integers is an irredu ible latti e point if x and
y are relatively prime. For any nite set S of irredu ible latti e points, show that there is a
homogenous polynomial in two variables, f px, yq, with integer oe ients, of degree at least 1,
su h that f px, yq “ 1 for ea h px, yq in the set S .
Note: A homogenous polynomial of degree n is any nonzero polynomial of the form

f px, yq “ a0 xn ` a1 xn´1 y ` a2 xn´2 y 2 ` ¨ ¨ ¨ ` an´1 xy n´1 ` an y n .

(U.S.A.)
N8. Let p be an odd prime number and Zą0 be the set of positive integers. Suppose that
a fun tion f : Zą0 ˆ Zą0 Ñ t0, 1u satises the following properties:

• f p1, 1q “ 0;

• f pa, bq ` f pb, aq “ 1 for any pair of relatively prime positive integers pa, bq not both equal
to 1;

• f pa ` b, bq “ f pa, bq for any pair of relatively prime positive integers pa, bq.

Prove that
p´1
ÿ a
f pn2 , pq ě 2p ´ 2.
n“1

(Italy)
12 IMO 2017, Rio de Janeiro

Solutions
Algebra
A1. Let a1 , a2 , . . . , an , k , and M be positive integers su h that

1 1 1
` ` ¨¨¨` “k and a1 a2 . . . an “ M.
a1 a2 an
If M ą 1, prove that the polynomial

P pxq “ Mpx ` 1qk ´ px ` a1 qpx ` a2 q ¨ ¨ ¨ px ` an q

has no positive roots.


(Trinidad and Tobago)
Solution 1. We rst prove that, for x ą 0,

ai px ` 1q1{ai ď x ` ai , (1)

with equality if and only if ai “ 1. It is lear that equality o urs if ai “ 1.


If ai ą 1, the AMGM inequality applied to a single opy of x ` 1 and ai ´ 1 opies of 1
yields
ai ´1 ones
hkkkkkkkikkkkkkkj
px ` 1q ` 1 ` 1 ` ¨ ¨ ¨ ` 1 a
ě ai px ` 1q ¨ 1ai ´1 ùñ ai px ` 1q1{ai ď x ` ai .
ai
Sin e x ` 1 ą 1, the inequality is stri t for ai ą 1.
Multiplying the inequalities (1) for i “ 1, 2, . . . , n yields

n
ź n
ź řn n
ź
ai px ` 1q1{ai ď px ` ai q ðñ Mpx ` 1q i“1 1{ai ´ px ` ai q ď 0 ðñ P pxq ď 0
i“1 i“1 i“1

with equality i ai “ 1 for all i P t1, 2, . . . , nu. But this implies M “ 1, whi h is not possible.
`
Hen e P pxq ă 0 for all x P R , and P has no positive roots.

Comment 1. Inequality (1) an be obtained in several ways. For instan e, we may also use the
binomial theorem: sin e ai ě 1,
ˆ ˙ ai ˆ ˙ ˆ ˙j ˆ ˙ ˆ ˙
x ai ÿ ai x ai ai x
1` “ ě ` ¨ “ 1 ` x.
ai j“0
j ai 0 1 ai

Both proofs of (1) mimi proofs to Bernoulli's inequality for a positive integer exponent ai ; we an
use this inequality dire tly: ˆ ˙
x ai x
1` ě 1 ` ai ¨ “ 1 ` x,
ai ai
and so ˆ ˙
x
x ` ai “ ai 1` ě ai p1 ` xq1{ai ,
ai
or its (reversed) formulation, with exponent 1{ai ď 1:
1 x ` ai
p1 ` xq1{ai ď 1 ` ¨x“ ùñ ai p1 ` xq1{ai ď x ` ai .
ai ai
Shortlisted problems  solutions 13

Solution 2. We will prove that, in fa t, all oe ients of the polynomial P pxq are non-positive,
and at least one of them is negative, whi h implies that P pxq ă 0 for x ą 0.
Indeed, sin e aj ě 1 for all j and aj ą 1 for some j (sin e a1 a2 . . . an “ M ą 1), we have
k “ a11 ` a12 ` ¨ ¨ ¨ ` a1n ă n, so the oe ient of xn in P pxq is ´1 ă 0. Moreover, the oe ient
r
of x in P pxq is negative for k ă r ď n “ degpP q.
r
For 0 ď r ď k , the oe ient of x in P pxq is

ˆ ˙ ÿ ˆ ˙ ÿ
k k
M¨ ´ ai1 ai2 ¨ ¨ ¨ ain´r “ a1 a2 ¨ ¨ ¨ an ¨ ´ ai1 ai2 ¨ ¨ ¨ ain´r ,
r 1ďi ăi 㨨¨ăi ďn
r 1ďi ăi 㨨¨ăi ďn
1 2 n´r 1 2 n´r

whi h is non-positive i ˆ ˙
k ÿ 1
ď . (2)
r a a ¨ ¨ ¨ ajr
ďn j1 j2
1ďj 1 ăj2 㨨¨ăjr

We will prove (2) by indu tion on r . For r “ 0 it is an equality be ause the onstant term of
ř
P pxq is P p0q “ 0, and if r “ 1, (2) be omes k “ ni“1 a1i . For r ą 1, if (2) is true for a given
r ă k , we have
ˆ ˙ ˆ ˙ ÿ
k k´r k k´r 1
“ ¨ ď ¨ ,
r`1 r`1 r r ` 1 1ďj ăj 㨨¨ăj ďn aj1 aj2 ¨ ¨ ¨ ajr
1 2 r

and it su es to prove that

k´r ÿ 1 ÿ 1
¨ ď ,
r ` 1 1ďj aj 1 aj 2 ¨ ¨ ¨ aj r aj 1 aj 2 ¨ ¨ ¨ aj r aj r`1
1 ăj2 㨨¨ăjr ďn 1ďj 1 㨨¨ăjr ăjr`1 ďn

whi h is equivalent to
ˆ ˙ ÿ ÿ
1 1 1 1 1
` `¨¨¨` ´r ď pr ` 1q .
a1 a2 an 1ďj1 ăj2 㨨¨ăjr
a a ¨ ¨ ¨ ajr
ďn j1 j2
a a ¨ ¨ ¨ ajr ajr`1
ďn j1 j2
1ďj 1 㨨¨ăjr ăjr`1

1 1
Sin e there are r`1 ways to hoose a fra tion
aji
from
aj1 aj2 ¨¨¨ajr ajr`1
to fa tor out, every
1
term
aj1 aj2 ¨¨¨ajr ajr`1
in the right hand side appears exa tly r`1 times in the produ t

ˆ ˙ ÿ
1 1 1 1
` ` ¨¨¨` .
a1 a2 an 1ďj1 ăj2 㨨¨ăjr
a a ¨ ¨ ¨ ajr
ďn j1 j2

Hen e all terms in the right hand side an el out.


The remaining terms in the left hand side an be grouped in sums of the type

1 1 1 r
` ` ¨¨¨` ´
a2j1 aj2¨ ¨ ¨ ajr 2
aj1 aj2 ¨ ¨ ¨ ajr 2
aj1 aj2 ¨ ¨ ¨ ajr aj1 aj2 ¨ ¨ ¨ ajr
ˆ ˙
1 1 1 1
“ ` ` ¨¨¨` ´r ,
aj1 aj2 ¨ ¨ ¨ ajr aj1 aj2 ajr
1
whi h are all non-positive be ause ai ě 1 ùñ ai
ď 1, i “ 1, 2, . . . , n.

Comment 2. The result is valid for any real numbers ai , i “ 1, 2, . . . , n with ai ě 1 and produ t M
greater than 1. A variation of Solution 1, namely using weighted AMGM (or the Bernoulli inequality
for real exponents), a tually proves that P pxq ă 0 for x ą ´1 and x ‰ 0.
14 IMO 2017, Rio de Janeiro

A2. Let q be a real number. Gugu has a napkin with ten distin t real numbers written on
it, and he writes the following three lines of real numbers on the bla kboard:

• In the rst line, Gugu writes down every number of the form a ´ b, where a and b are two
(not ne essarily distin t) numbers on his napkin.

• In the se ond line, Gugu writes down every number of the form qab, where a and b are
two (not ne essarily distin t) numbers from the rst line.
• In the third line, Gugu writes down every number of the form a2 ` b2 ´ c2 ´ d2 , where
a, b, c, d are four (not ne essarily distin t) numbers from the rst line.
Determine all values of q su h that, regardless of the numbers on Gugu's napkin, every
number in the se ond line is also a number in the third line.
(Austria)
Answer: ´2, 0, 2.
Solution 1. Call a number q good if every number in the se ond line appears in the third line
un onditionally. We rst show that the numbers 0 and ˘2 are good. The third line ne essarily
ontains 0, so 0 is good. For any two numbers a, b in the rst line, write a “ x´y and b “ u´v ,
where x, y, u, v are (not ne essarily distin t) numbers on the napkin. We may now write

2ab “ 2px ´ yqpu ´ vq “ px ´ vq2 ` py ´ uq2 ´ px ´ uq2 ´ py ´ vq2 ,

whi h shows that 2 is good. By negating both sides of the above equation, we also see that ´2
is good.

We now show that ´2, 0, and 2 are the only good numbers. Assume for sake of ontradi tion
that q is a good number, where q R t´2, 0, 2u. We now onsider some parti ular hoi es of
numbers on Gugu's napkin to arrive at a ontradi tion.
Assume that the napkin ontains the integers 1, 2, . . . , 10. Then, the rst line ontains
the integers ´9, ´8, . . . , 9. The se ond line then ontains q and 81q , so the third line must
also ontain both of them. But the third line only ontains integers, so q must be an integer.
Furthermore, the third line ontains no number greater than 162 “ 9 ` 92 ´ 02 ´ 02 or less
2

than ´162, so we must have ´162 ď 81q ď 162. This shows that the only possibilities for q
are ˘1.
Now assume that q “ ˘1. Let the napkin ontain 0, 1, 4, 8, 12, 16, 20, 24, 28, 32. The rst
line ontains ˘1 and ˘4, so the se ond line ontains ˘4. However, for every number a in the
2
rst line, a ı 2 pmod 4q, so we may on lude that a ” 0, 1 pmod 8q. Consequently, every
number in the third line must be ongruent to ´2, ´1, 0, 1, 2 pmod 8q; in parti ular, ˘4 annot
be in the third line, whi h is a ontradi tion.

Solution 2. Let q be a good number, as dened in the rst solution, and dene the polynomial
P px1 , . . . , x10 q as
ź ź` ˘
pxi ´ xj q qpx1 ´ x2 qpx3 ´ x4 q ´ pa1 ´ a2 q2 ´ pa3 ´ a4 q2 ` pa5 ´ a6 q2 ` pa7 ´ a8 q2 ,
iăj ai PS

where S “ tx1 , . . . , x10 u.


We laim that P px1 , . . . , x10 q “ 0 for every hoi e of real numbers px1 , . . . , x10 q. If any two
of the xi are equal, then P px1 , . . . , x10 q “ 0 trivially. If no two are equal, assume that Gugu
has those ten numbers x1 , . . . , x10 on his napkin. Then, the number qpx1 ´ x2 qpx3 ´ x4 q is in
the se ond line, so we must have some a1 , . . . , a8 so that

qpx1 ´ x2 qpx3 ´ x4 q ´ pa1 ´ a2 q2 ´ pa3 ´ a4 q2 ` pa5 ´ a6 q2 ` pa7 ´ a8 q2 “ 0,


Shortlisted problems  solutions 15

and hen e P px1 , . . . , x10 q “ 0.


Sin e every polynomial that evaluates to zero everywhere is the zero polynomial, and the
produ t of two nonzero polynomials is ne essarily nonzero, we may dene F su h that

F px1 , . . . , x10 q ” qpx1 ´ x2 qpx3 ´ x4 q ´ pa1 ´ a2 q2 ´ pa3 ´ a4 q2 ` pa5 ´ a6 q2 ` pa7 ´ a8 q2 ” 0 (1)

for some parti ular hoi e ai P S .


Ea h of the sets ta1 , a2 u, ta3 , a4 u, ta5 , a6 u, and ta7 , a8 u is equal to at most one of the four
sets tx1 , x3 u, tx2 , x3 u, tx1 , x4 u, and tx2 , x4 u. Thus, without loss of generality, we may assume
that at most one of the sets ta1 , a2 u, ta3 , a4 u, ta5 , a6 u, and ta7 , a8 u is equal to tx1 , x3 u. Let
u1 , u3 , u5 , u7 be the indi ator fun tions for this equality of sets: that is, ui “ 1 if and only if
tai , ai`1 u “ tx1 , x3 u. By assumption, at least three of the ui are equal to 0.
We now ompute the oe ient of x1 x3 in F . It is equal to q ` 2pu1 ` u3 ´ u5 ´ u7 q “ 0,
and sin e at least three of the ui are zero, we must have that q P t´2, 0, 2u, as desired.
16 IMO 2017, Rio de Janeiro

A3. Let S be a nite set, and let A be the set of all fun tions from S to S . Let f be an
element of A, and let T “ f pSq be the image of S under f . Suppose that f ˝ g ˝ f ‰ g ˝ f ˝ g
for every g in A with g ‰ f . Show that f pT q “ T .
(India)
Solution. For n ě 1, denote the n-th omposition of f with itself by

def
f n “ flooooooomooooooon
˝ f ˝ ¨¨¨˝ f .
n times

By hypothesis, if g P A satises f ˝ g ˝ f “ g ˝ f ˝ g , then g “ f . A natural idea is to try to


n n
plug in g “ f for some n in the expression f ˝ g ˝ f “ g ˝ f ˝ g in order to get f “ f , whi h
solves the problem:

Claim. If there exists ně3 su h that f n`2 “ f 2n`1 , then the restri tion f: T Ñ T of f to T
is a bije tion.

Proof. Indeed, by hypothesis,f n`2 “ f 2n`1 ðñ f ˝ f n ˝ f “ f n ˝ f ˝ f n ùñ f n “ f .


n´2 n´2
Sin e n ´ 2 ě 1, the image of f is ontained in T “ f pSq, hen e f restri ts to a fun tion
n´2
f : T Ñ T . This is the inverse of f : T Ñ T . In fa t, given t P T , say t “ f psq with s P S ,
we have

t “ f psq “ f n psq “ f n´2 pf ptqq “ f pf n´2 ptqq, i.e., f n´2 ˝ f “ f ˝ f n´2 “ id on T

(here id stands for the identity fun tion). Hen e, the restri tion f : T Ñ T of f to T is bije tive
n´2
with inverse given by f : T Ñ T. l
It remains to show that n as in the laim exists. For that, dene

def
Sm “ f m pSq pSm is image of f mq

Clearly the image of f m`1 is ontained in the image of f m, i.e., there is a des ending hain of
subsets of S
S Ě S1 Ě S2 Ě S3 Ě S4 Ě ¨ ¨ ¨ ,
whi h must eventually stabilise sin e S is nite, i.e., there is a kě1 su h that

def
Sk “ Sk`1 “ Sk`2 “ Sk`3 “ ¨ ¨ ¨ “ S8 .

Hen e f restri ts to a surje tive fun tion f : S8 Ñ S8 , S8 Ď S is


whi h is also bije tive sin e
nite. To sum up, f : S8 Ñ S8 is a permutation of the elements of the nite set S8 , hen e
r
there exists an integer r ě 1 su h that f “ id on S8 (for example, we may hoose r “ |S8 |!).
In other words,
f m`r “ f m on S for all m ě k. p˚q
Clearly, p˚q also implies that f m`tr “ f m for all integers t ě 1 and m ě k . So, to nd n as in
the laim and nish the problem, it is enough to hoose m and t in order to ensure that there
exists ně3 satisfying
# #
2n ` 1 “ m ` tr m “ 3 ` tr
ðñ
n`2“m n “ m ´ 2.

This an be learly done by hoosing m large enough with m ” 3 pmod rq. For instan e, we
may take n “ 2kr ` 1, so that

f n`2 “ f 2kr`3 “ f 4kr`3 “ f 2n`1

where the middle equality follows by p˚q sin e 2kr ` 3 ě k .


Shortlisted problems  solutions 17

A4. A sequen e of real numbers a1 , a2 , . . . satises the relation

an “ ´ max pai ` aj q for all n ą 2017.


i`j“n

Prove that this sequen e is bounded, i.e., there is a onstant M su h that |an | ď M for all
positive integers n.
(Russia)
Solution 1. Set D “ 2017. Denote

Mn “ max ak and mn “ ´ min ak “ maxp´ak q.


kăn kăn kăn

Clearly, the sequen es pmn q and pMn q are nonde reasing. We need to prove that both are
bounded.

Consider an arbitrary n ą D; our rst aim is to bound an in terms of mn and Mn .


(i) There exist indi es p and q su h that an “ ´pap ` aq q and p ` q “ n. Sin e ap , aq ď Mn , we
have an ě ´2Mn .
(ii) On the other hand, hoose an index kăn su h that ak “ Mn . Then, we have

an “ ´ maxpan´ℓ ` aℓ q ď ´pan´k ` ak q “ ´an´k ´ Mn ď mn ´ Mn .


ℓăn

Summarizing (i) and (ii), we get

´2Mn ď an ď mn ´ Mn ,

when e

mn ď mn`1 ď maxtmn , 2Mn u and Mn ď Mn`1 ď maxtMn , mn ´ Mn u. (1)

Now, say that an index nąD is lu ky if mn ď 2Mn . Two ases are possible.

Case 1. Assume that there exists a lu ky index n. In this ase, (1) yields mn`1 ď 2Mn and
Mn ď Mn`1 ď Mn . Therefore, Mn`1 “ Mn and mn`1 ď 2Mn “ 2Mn`1 . So, the index n ` 1
is also lu ky, and Mn`1 “ Mn . Applying the same arguments repeatedly, we obtain that all
indi es k ą n are lu ky (i.e., mk ď 2Mk for all these indi es), and Mk “ Mn for all su h indi es.
Thus, all of the mk and Mk are bounded by 2Mn .

Case 2. Assume now that there is no lu ky index, i.e., 2Mn ă mn for all n ą D. Then (1)
shows that for all n ą D we have mn ď mn`1 ď mn , so mn “ mD`1 for all n ą D . Sin e
Mn ă mn {2 for all su h indi es, all of the mn and Mn are bounded by mD`1 .
Thus, in both ases the sequen es pmn q and pMn q are bounded, as desired.

Solution 2. As in the previous solution, let D “ 2017. If the sequen e is bounded above, say,
by Q, then we have that an ě minta1 , . . . , aD , ´2Qu for all n, so the sequen e is bounded. As-
sume for sake of ontradi tion that the sequen e is not bounded above. Let ℓ “ minta1 , . . . , aD u,
and L “ maxta1 , . . . , aD u. Call an index n good if the following riteria hold:

an ą ai for ea h i ă n, an ą ´2ℓ, and nąD (2)

We rst show that there must be some good index n. By assumption, we may take an
index N su h that aN ą maxtL, ´2ℓu. n minimally su h that an “ maxta1 , a2 , . . . , aN u.
Choose
Now, the rst ondition in (2) is satised be ause of the minimality of n, and the se ond and
third onditions are satised be ause an ě aN ą L, ´2ℓ, and L ě ai for every i su h that
1 ď i ď D.
18 IMO 2017, Rio de Janeiro

Let n be a good index. We derive a ontradi tion. We have that

an ` au ` av ď 0, (3)

whenever u ` v “ n.
u to maximize au over 1 ď u ď n ´ 1, and
We dene the index let v “ n ´ u. Then, we note
that au ě av by the maximality of au .
Assume rst that v ď D . Then, we have that

aN ` 2ℓ ď 0,

be ause au ě av ě ℓ. But this ontradi ts our assumption that an ą ´2ℓ in the se ond riteria
of (2).
Now assume that v ą D. Then, there exist some indi es w1 , w2 summing up to v su h that

av ` aw1 ` aw2 “ 0.

But ombining this with (3), we have

an ` au ď aw1 ` aw2 .

Be ause an ą au , we have that maxtaw1 , aw2 u ą au . But sin e ea h of the wi is less than v, this
ontradi ts the maximality of au .

Comment 1. We present two harder versions of this problem below.


Version 1. Let a1 , a2 , . . . be a sequen e of numbers that satises the relation
an “ ´ max pai ` aj ` ak q for all n ą 2017.
i`j`k“n

Then, this sequen e is bounded.


Proof. Set D “ 2017. Denote
Mn “ max ak and mn “ ´ min ak “ maxp´ak q.
kăn kăn kăn

Clearly, the sequen es pmn q and pMn q are nonde reasing. We need to prove that both are bounded.
Consider an arbitrary n ą 2D ; our rst aim is to bound an in terms of mi and Mi . Set k “ tn{2u.
(i) Choose indi es p, q , and r su h that an “ ´pap ` aq ` ar q and p ` q ` r “ n. Without loss of
generality, p ě q ě r .
Assume that p ě k ` 1pą Dq; then p ą q ` r . Hen e

´ap “ max pai1 ` ai2 ` ai3 q ě aq ` ar ` ap´q´r ,


i1 `i2 `i3 “p

and therefore an “ ´pap ` aq ` ar q ě paq ` ar ` ap´q´r q ´ aq ´ ar “ ap´q´r ě ´mn .


Otherwise, we have k ě p ě q ě r . Sin e n ă 3k , we have r ă k . Then ap , aq ď Mk`1 and
ar ď Mk , when e an ě ´2Mk`1 ´ Mk .
Thus, in any ase an ě ´ maxtmn , 2Mk`1 ` Mk u.
(ii) On the other hand, hoose p ď k and q ď k ´ 1 su h that ap “ Mk`1 and aq “ Mk . Then p ` q ă n,
so an ď ´pap ` aq ` an´p´q q “ ´an´p´q ´ Mk`1 ´ Mk ď mn ´ Mk`1 ´ Mk .
To summarize,
´ maxtmn , 2Mk`1 ` Mk u ď an ď mn ´ Mk`1 ´ Mk ,
when e

mn ď mn`1 ď maxtmn , 2Mk`1 ` Mk u and Mn ď Mn`1 ď maxtMn , mn ´ Mk`1 ´ Mk u. (4)


Shortlisted problems  solutions 19

Now, say that an index n ą 2D is lu ky if mn ď 2Mtn{2u`1 ` Mtn{2u . Two ases are possible.
Case 1. Assume that there exists a lu ky index n; set k “ tn{2u. In this ase, (4) yields mn`1 ď
2Mk`1 ` Mk and Mn ď Mn`1 ď Mn (the last relation holds, sin e mn ´ Mk`1 ´ Mk ď p2Mk`1 `
Mk q ´ Mk`1 ´ Mk “ Mk`1 ď Mn ). Therefore, Mn`1 “ Mn and mn`1 ď 2Mk`1 ` Mk ; the last relation
shows that the index n ` 1 is also lu ky.
Thus, all indi es N ą n are lu ky, and MN “ Mn ě mN {3, when e all the mN and MN are
bounded by 3Mn .
Case 2. Conversely, assume that there is no lu ky index, i.e., 2Mtn{2u`1 ` Mtn{2u ă mn for all n ą 2D.
Then (4) shows that for all n ą 2D we have mn ď mn`1 ď mn , i.e., mN “ m2D`1 for all N ą 2D .
Sin e MN ă m2N `1 {3 for all su h indi es, all the mN and MN are bounded by m2D`1 .
Thus, in both ases the sequen es pmn q and pMn q are bounded, as desired. l
Version 2. Let a1 , a2 , . . . be a sequen e of numbers that satises the relation
an “ ´ max pai1 ` ¨ ¨ ¨ ` aik q for all n ą 2017.
i1 `¨¨¨`ik “n

Then, this sequen e is bounded.


Proof. As in the solutions above, let D “ 2017. If the sequen e is bounded above, say, by Q, then we
have that an ě minta1 , . . . , aD , ´kQu for all n, so the sequen e is bounded. Assume for sake of ontra-
di tion that the sequen e is not bounded above. Let ℓ “ minta1 , . . . , aD u, and L “ maxta1 , . . . , aD u.
Call an index n good if the following riteria hold:

an ą ai for ea h i ă n, an ą ´kℓ, and nąD (5)

We rst show that there must be some good index n. By assumption, we may take an index N
su h that aN ą maxtL, ´kℓu. Choose n minimally su h that an “ maxta1 , a2 , . . . , aN u. Now, the rst
ondition is satised be ause of the minimality of n, and the se ond and third onditions are satised
be ause an ě aN ą L, ´kℓ, and L ě ai for every i su h that 1 ď i ď D .
Let n be a good index. We derive a ontradi tion. We have that

an ` av1 ` ¨ ¨ ¨ ` avk ď 0, (6)

whenever v1 ` ¨ ¨ ¨ ` vk “ n.
We dene the sequen e of indi es v1 , . . . , vk´1 to greedily maximize av1 , then av2 , and so forth,
sele ting only from indi es su h that the equation v1 ` ¨ ¨ ¨ ` vk “ n an be satised by positive integers
v1 , . . . , vk . More formally, we dene them indu tively so that the following riteria are satised by
the vi :

1. 1 ď vi ď n ´ pk ´ iq ´ pv1 ` ¨ ¨ ¨ ` vi´1 q.
2. avi is maximal among all hoi es of vi from the rst riteria.

First of all, we note that for ea h i, the rst riteria is always satisable by some vi , be ause we
are guaranteed that
vi´1 ď n ´ pk ´ pi ´ 1qq ´ pv1 ` ¨ ¨ ¨ ` vi´2 q,
whi h implies
1 ď n ´ pk ´ iq ´ pv1 ` ¨ ¨ ¨ ` vi´1 q.
Se ondly, the sum v1 ` ¨ ¨ ¨ ` vk´1 is at most n ´ 1. Dene vk “ n ´ pv1 ` ¨ ¨ ¨ ` vk´1 q. Then, (6)
is satised by the vi . We also note that avi ě avj for all i ă j ; otherwise, in the denition of vi , we
ould have sele ted vj instead.
Assume rst that vk ď D . Then, from (6), we have that

an ` kℓ ď 0,

by using that av1 ě ¨ ¨ ¨ ě avk ě ℓ. But this ontradi ts our assumption that an ą ´kℓ in the se ond
riteria of (5).
20 IMO 2017, Rio de Janeiro

Now assume that vk ą D , and then we must have some indi es w1 , . . . , wk summing up to vk su h
that
avk ` aw1 ` ¨ ¨ ¨ ` awk “ 0.
But ombining this with (6), we have

an ` av1 ` ¨ ¨ ¨ ` avk´1 ď aw1 ` ¨ ¨ ¨ ` awk .

Be ause an ą av1 ě ¨ ¨ ¨ ě avk´1 , we have that maxtaw1 , . . . , awk u ą avk´1 . But sin e ea h of the wi
is less than vk , in the denition of the vk´1 we ould have hosen one of the wi instead, whi h is a
ontradi tion. l

Comment 2. It seems that ea h sequen e satisfying the ondition in Version 2 is eventually periodi ,
at least when its terms are integers.
However, up to this moment, the Problem Sele tion Committee is not aware of a proof for this fa t
(even in the ase k “ 2).
Shortlisted problems  solutions 21

A5. An integer n ě 3 is given. We all an n-tuple of real numbers px1 , x2 , . . . , xn q Shiny if


for ea h permutation y1 , y2 , . . . , yn of these numbers we have
n´1
ÿ
yi yi`1 “ y1 y2 ` y2 y3 ` y3 y4 ` ¨ ¨ ¨ ` yn´1 yn ě ´1.
i“1

Find the largest onstant K “ Kpnq su h that

ÿ
xi xj ě K
1ďiăjďn

holds for every Shiny n-tuple px1 , x2 , . . . , xn q.


(Serbia)
Answer: K “ ´pn ´ 1q{2.
Solution 1. First of all, we show that we may not take a larger onstant K. Let t be a positive
number, and take x2 “ x3 “ ¨ ¨ ¨ “ t and x1 “ ´1{p2tq. Then, every produ t xi xj (i ‰ j ) is
2
equal to either t or ´1{2. Hen e, for every permutation yi of the xi , we have

y1 y2 ` ¨ ¨ ¨ ` yn´1yn ě pn ´ 3qt2 ´ 1 ě ´1.

This justies that the n-tuple px1 , . . . , xn q is Shiny. Now, we have

ÿ n ´ 1 pn ´ 1qpn ´ 2q 2
xi xj “ ´ ` t.
iăj
2 2
ř
Thus, as t approa hes 0 from above, iăj xi xj gets arbitrarily lose to ´pn ´ 1q{2.řThis shows
that we may not take K any larger than ´pn ´ 1q{2. It remains to show that iăj xi xj ě
´pn ´ 1q{2 for any Shiny hoi e of the xi .
From now onward, assume that px1 , . . . , xn q
n-tuple. Let the zi (1 ď i ď n) be
is a Shiny
some permutation of the xi to be hosen later. The indi es for zi will always be taken modulo n.
ř ř
We will rst split up the sum iăj xi xj “ iăj zi zj into tpn ´ 1q{2u expressions, ea h of the
form y1 y2 ` ¨ ¨ ¨ ` yn´1 yn for some permutation yi of the zi , and some leftover terms. More
spe i ally, write

n´1 t n´1 u
ÿ ÿ ÿ ÿ 2 ÿ
zi zj “ zi zj “ zi zj ` L, (1)
iăj q“0 i`j”q pmod nq p“1 i`j”2p´1,2p pmod nq
iıj pmod nq iıj pmod nq

where L “ z1 z´1 ` z2 z´2 ` ¨ ¨ ¨ ` zpn´1q{2 z´pn´1q{2 if n is odd, and L “ z1 z´1 ` z1 z´2 ` z2 z´2 `
¨ ¨ ¨ ` zpn´2q{2 z´n{2 if n is even. We note that for ea h p “ 1, 2, . . . , tpn ´ 1q{2u, there is some
permutation yi of the zi su h that

ÿ n´1
ÿ
zi zj “ yk yk`1 ,
i`j”2p´1,2p pmod nq k“1
iıj pmod nq

be ause we may hoose y2i´1 “ zi`p´1 for 1 ď i ď pn ` 1q{2 and y2i “ zp´i for 1 ď i ď n{2.
We show (1) graphi ally for n “ 6, 7 in the diagrams below. The edges of the graphs ea h
represent a produ t zi zj , and the dashed and dotted series of lines represents the sum of the
edges, whi h is of the form y1 y2 ` ¨ ¨ ¨ ` yn´1 yn for some permutation yi of the zi pre isely when
the series of lines is a Hamiltonian path. The lled edges represent the summands of L.
22 IMO 2017, Rio de Janeiro

Now, be ause the zi are Shiny, we have that (1) yields the following bound:

ÿ Z^
n´1
zi zj ě ´ ` L.
iăj
2

It remains to show that, for ea h n, there exists some permutation zi of the xi su h that Lě0
when n is odd, and L ě ´1{2 when n is even. We now split into ases based on the parity of n
and provide onstru tions of the permutations zi .
Sin e we have not made any assumptions yet about the xi , we may now assume without
loss of generality that

x1 ď x2 ď ¨ ¨ ¨ ď xk ď 0 ď xk`1 ď ¨ ¨ ¨ ď xn . (2)

Case 1: n is odd.
Without loss of generality, assume that k (from (2)) is even, be ause we may negate all
the xi if k is odd. We then have x1 x2 , x3 x4 , . . . , xn´2 xn´1 ě 0 be ause the fa tors are of the
same sign. Let L “ x1 x2 ` x3 x4 ` ¨ ¨ ¨ ` xn´2 xn´1 ě 0. We hoose our zi so that this denition
of L agrees with the sum of the leftover terms in (1). Relabel the xi as zi su h that

tz1 , zn´1 u, tz2 , zn´2 u, . . . , tzpn´1q{2 , zpn`1q{2 u

are some permutation of


tx1 , x2 u, tx3 , x4 u, . . . , txn´2 , xn´1 u,
and zn “ xn . Then, we have L “ z1 zn´1 ` ¨ ¨ ¨ ` zpn´1q{2 zpn`1q{2 , as desired.

Case 2: n is even.
Let L “ x1 x2 ` x2 x3 ` ¨ ¨ ¨ ` xn´1 xn . Assume without loss of generality k ‰ 1. Now, we have

2L “ px1 x2 ` ¨ ¨ ¨ ` xn´1 xn q ` px1 x2 ` ¨ ¨ ¨ ` xn´1 xn q ě px2 x3 ` ¨ ¨ ¨ ` xn´1 xn q ` xk xk`1

ě x2 x3 ` ¨ ¨ ¨ ` xn´1 xn ` xn x1 ě ´1,
where the rst inequality holds be ause the only negative term in L is xk xk`1 , the se ond
inequality holds be ause x1 ď xk ď 0 ď xk`1 ď xn , and the third inequality holds be ause
the xi are assumed to be Shiny. We thus have that L ě ´1{2. We now hoose a suitable zi
su h that the denition of L mat hes the leftover terms in (1).
Shortlisted problems  solutions 23

Relabel the xi with zi in the following manner: x2i´1 “ z´i , x2i “ zi (again taking indi es
modulo n). We have that
ÿ
L“ zi zj ,
i`j”0,´1 pmod nq
iıj pmod nq

as desired.

ř
Solution 2. iăj xi xj ě ´pn ´ 1q{2 for any Shiny n-tuple
We present another proof that
px1 , . . . , xn q. xi as in (2), and let ℓ “ n ´ k . Assume without loss
Assume an ordering of the
of generality that k ě ℓ. Also assume k ‰ n, (as otherwise, all of the xi are nonpositive, and
so the inequality is trivial). Dene the sets of indi es S “ t1, 2, . . . , ku and T “ tk ` 1, . . . , nu.
Dene the following sums:
ÿ ÿ ÿ
K“ xi xj , M“ xi xj , and L“ xi xj
iăj iPS iăj
i,jPS jPT i,jPT

By denition, K, L ě 0 and M ď 0. We aim to show that K ` L ` M ě ´pn ´ 1q{2.


We split into ases based on whether k“ℓ or k ą ℓ.
Case 1: k ą ℓ.
Consider all permutations φ : t1, 2, . . . , nu Ñ t1, 2, . . . , nu su h that φ´1 pT q “ t2, 4, . . . , 2ℓu.
Note that there are k!ℓ! su h permutations φ. Dene

n´1
ÿ
f pφq “ xφpiq xφpi`1q .
i“1

We know that f pφq ě ´1 for every permutation φ with the above property. Averaging f pφq
over all φ gives
1 ÿ 2ℓ 2pk ´ ℓ ´ 1q
´1 ď f pφq “ M ` K,
k!ℓ! φ kℓ kpk ´ 1q
where the equality holds be ause there are M , of whi h 2ℓ are sele ted for ea
kℓ produ ts in h φ,
and there are kpk ´ 1q{2 produ ts in K , of whi h k ´ ℓ ´ 1 are sele ted for ea h φ. We now
have ˆ ˙
k k´ℓ´1 k ℓ
K `L`M ě K `L` ´ ´ K “´ ` K ` L.
2 k´1 2 k´1
Sin e k ďn´1 and K, L ě 0, we get the desired inequality.

Case 2: k “ ℓ “ n{2.
We do a similar approa h, onsidering all φ : t1, 2, . . . , nu Ñ t1, 2, . . . , nu su h that φ´1 pT q “
t2, 4, . . . , 2ℓu, and dening f the same way. Analogously to Case 1, we have

1 ÿ 2ℓ ´ 1
´1 ď f pφq “ M,
k!ℓ! φ kℓ

be ause there are kℓ produ ts in M, of whi h 2ℓ ´ 1 are sele ted for ea h φ. Now, we have that

n2 n´1
K `L`M ěM ě´ ě´ ,
4pn ´ 1q 2

where the last inequality holds be ause n ě 4.


24 IMO 2017, Rio de Janeiro

A6. Find all fun tions f: RÑR su h that

f pf pxqf pyqq ` f px ` yq “ f pxyq p˚q

for all x, y P R.
(Albania)
Answer: There are 3 solutions:

x ÞÑ 0 or x ÞÑ x ´ 1 or x ÞÑ 1 ´ x px P Rq.

Solution. An easy he k shows that all the 3 above mentioned fun tions indeed satisfy the
original equation p˚q.
In order to show that these are the only solutions, rst observe that if f pxq is a solution
then ´f pxq is also a solution. Hen e, without loss of generality we may (and will) assume that
f p0q ď 0 from now on. We have to show that either f is identi ally zero or f pxq “ x ´ 1
(@x P R).
x
Observe that, for a xed x ‰ 1, we may hoose yPR so that x ` y “ xy ðñ y “ x´1
,
and therefore from the original equation p˚q we have

´ ´ x ¯¯
f f pxq ¨ f “0 px ‰ 1q. (1)
x´1

In parti ular, plugging in x “ 0 in (1), we on lude that f has at least one zero, namely pf p0qq2 :
` ˘
f pf p0qq2 “ 0. (2)

We analyze two ases (re all that f p0q ď 0):


Case 1: f p0q “ 0.
Setting y“0 in the original equation we get the identi ally zero solution:

f pf pxqf p0qq ` f pxq “ f p0q ùñ f pxq “ 0 for all x P R.

From now on, we work on the main

Case 2: f p0q ă 0.
We begin with the following

Claim 1.
f p1q “ 0, f paq “ 0 ùñ a “ 1, and f p0q “ ´1. (3)

Proof. We need to show that 1 is the unique zero of f. First, observe that f has at least one
zero a by (2); if a ‰ 1 then setting x “ a in (1) we get f p0q “ 0, a ontradi tion. Hen e
from (2) we get pf p0qq2 “ 1. Sin e we are assuming f p0q ă 0, we on lude that f p0q “ ´1. l
Setting y“1 in the original equation p˚q we get

f pf pxqf p1qq`f px`1q “ f pxq ðñ f p0q`f px`1q “ f pxq ðñ f px`1q “ f pxq`1 px P Rq.

An easy indu tion shows that

f px ` nq “ f pxq ` n px P R, n P Zq. (4)


Shortlisted problems  solutions 25

Now we make the following

Claim 2. f is inje tive.


Proof. Suppose that f paq “ f pbq with a ‰ b. Then by (4), for all N P Z,

f pa ` N ` 1q “ f pb ` Nq ` 1.

Choose any integer N ă ´b; then there exist x0 , y0 P R with x0 ` y0 “ a ` N ` 1, x0 y0 “ b ` N .


Sin e a ‰ b, we have x0 ‰ 1 and y0 ‰ 1. Plugging in x0 and y0 in the original equation p˚q we
get

f pf px0 qf py0 qq ` f pa ` N ` 1q “ f pb ` Nq ðñ f pf px0 qf py0 qq ` 1 “ 0


ðñ f pf px0 qf py0 q ` 1q “ 0 by (4)

ðñ f px0 qf py0q “ 0 by (3).

However, by Claim 1 we have f px0 q ‰ 0 and f py0 q ‰ 0 sin e x0 ‰ 1 and y0 ‰ 1, a ontradi tion.
l
Now the end is near. For any t P R, plug in px, yq “ pt, ´tq in the original equation p˚q to
get

f pf ptqf p´tqq ` f p0q “ f p´t2 q ðñ f pf ptqf p´tqq “ f p´t2 q ` 1 by (3)

ðñ f pf ptqf p´tqq “ f p´t2 ` 1q by (4)

ðñ f ptqf p´tq “ ´t2 ` 1 by inje tivity of f.

Similarly, plugging in px, yq “ pt, 1 ´ tq in p˚q we get

f pf ptqf p1 ´ tqq ` f p1q “ f ptp1 ´ tqq ðñ f pf ptqf p1 ´ tqq “ f ptp1 ´ tqq by (3)

ðñ f ptqf p1 ´ tq “ tp1 ´ tq by inje tivity of f.

But sin e f p1 ´ tq “ 1 ` f p´tq by (4), we get

f ptqf p1 ´ tq “ tp1 ´ tq ðñ f ptqp1 ` f p´tqq “ tp1 ´ tq ðñ f ptq ` p´t2 ` 1q “ tp1 ´ tq


ðñ f ptq “ t ´ 1,

as desired.

Comment. Other approa hes are possible. For instan e, after Claim 1, we may dene
def
gpxq “ f pxq ` 1.

Repla ing x ` 1 and y ` 1 in pla e of x and y in the original equation p˚q, we get

f pf px ` 1qf py ` 1qq ` f px ` y ` 2q “ f pxy ` x ` y ` 1q px, y P Rq,

and therefore, using (4) (so that in parti ular gpxq “ f px ` 1q), we may rewrite p˚q as

gpgpxqgpyqq ` gpx ` yq “ gpxy ` x ` yq px, y P Rq. p˚˚q

We are now to show that gpxq “ x for all x P R under the assumption (Claim 1) that 0 is the unique
zero of g .
Claim 3. Let n P Z and x P R. Then
(a) gpx ` nq “ x ` n, and the onditions gpxq “ n and x “ n are equivalent.

(b) gpnxq “ ngpxq.


26 IMO 2017, Rio de Janeiro

Proof. For part (a), just note that gpx ` nq “ x ` n is just a reformulation of (4). Then gpxq “ n ðñ
gpx ´ nq “ 0 ðñ x ´ n “ 0 sin e 0 is the unique zero of g. For part (b), we may assume that x ‰ 0
sin e the result is obvious when x “ 0. Plug in y “ n{x in p˚˚q and use part (a) to get
´ ´ n ¯¯ ´ n¯ ´ n¯ ´ ´ n ¯¯ ´n¯
g gpxqg `g x` “g n`x` ðñ g gpxqg “ n ðñ gpxqg “ n.
x x x x x
In other words, for x ‰ 0 we have
n
gpxq “ ` ˘.
g n{x
In parti ular, for n “ 1, we get gp1{xq “ 1{gpxq, and therefore repla ing x Ð nx in the last equation
we nally get
n
gpnxq “ ` ˘ “ ngpxq,
g 1{x
as required.
Claim 4. The fun tion g is additive, i.e., gpa ` bq “ gpaq ` gpbq for all a, b P R.
Proof. Set x Ð ´x and y Ð ´y in p˚˚q; sin e g is an odd fun tion (by Claim 3(b) with n “ ´1), we
get
gpgpxqgpyqq ´ gpx ` yq “ ´gp´xy ` x ` yq.
Subtra ting the last relation from p˚˚q we have

2gpx ` yq “ gpxy ` x ` yq ` gp´xy ` x ` yq

and sin e by Claim 3(b) we have 2gpx ` yq “ gp2px ` yqq, we may rewrite the last equation as
#
α “ xy ` x ` y
gpα ` βq “ gpαq ` gpβq where
β “ ´xy ` x ` y.

In other words, we have additivity for all α, β P R for whi h there are real numbers x and y satisfying

α`β α´β
x`y “ and xy “ ,
2 2

i.e., for all α, β P R su h that p α`β α´β


2 q ´ 4 ¨ 2 ě 0. Therefore, given any a, b P R, we may hoose n P Z
2

large enough so that we have additivity for α “ na and β “ nb, i.e.,

gpnaq ` gpnbq “ gpna ` nbq ðñ ngpaq ` ngpbq “ ngpa ` bq

by Claim 3(b). Can elling n, we get the desired result. (Alternatively, setting either pα, βq “ pa, bq or
pα, βq “ p´a, ´bq will ensure that p α`β α´β
2 q ´ 4 ¨ 2 ě 0).
2 l
Now we may nish the solution. Set y “ 1 in p˚˚q, and use Claim 3 to get

gpgpxqgp1qq ` gpx ` 1q “ gp2x ` 1q ðñ gpgpxqq ` gpxq ` 1 “ 2gpxq ` 1 ðñ gpgpxqq “ gpxq.

By additivity, this is equivalent to gpgpxq ´ xq “ 0. Sin e 0 is the unique zero of g by assumption, we


nally get gpxq ´ x “ 0 ðñ gpxq “ x for all x P R.
Shortlisted problems  solutions 27

A7. Let a0 , a1 , a2 , . . . be a sequen e of integers and b0 , b1 , b2 , . . . be a sequen e of positive


integers su h that a0 “ 0, a1 “ 1, and
#
an bn ` an´1 , if bn´1 “ 1
an`1 “ for n “ 1, 2, . . ..
an bn ´ an´1 , if bn´1 ą 1

Prove that at least one of the two numbers a2017 and a2018 must be greater than or equal to 2017.
(Australia)
Solution 1. The value of b0 is irrelevant sin e a0 “ 0, so we may assume that b0 “ 1.
Lemma. We have an ě 1 for all n ě 1.
Proof. Let us suppose otherwise in order to obtain a ontradi tion. Let

ně1 be the smallest integer with an ď 0. (1)

Note that n ě 2. It follows that an´1 ě 1 and an´2 ě 0. Thus we annot have an “
an´1 bn´1 ` an´2 , so we must have an “ an´1 bn´1 ´ an´2 . Sin e an ď 0, we have an´1 ď an´2 .
Thus we have an´2 ě an´1 ě an .
Let
r be the smallest index with ar ě ar`1 ě ar`2 . (2)

Then r ď n´2 by the above, but also r ě 2: if b1 “ 1, then a2 “ a1 “ 1 and a3 “ a2 b2 `a1 ą a2 ;


if b1 ą 1, then a2 “ b1 ą 1 “ a1 .
By the minimal hoi e (2) of r , it follows that ar´1 ă ar . And sin e 2 ď r ď n ´ 2, by the
minimal hoi e (1) of n we have ar´1 , ar , ar`1 ą 0. In order to have ar`1 ě ar`2 , we must have
ar`2 “ ar`1 br`1 ´ ar so that br ě 2. Putting everything together, we on lude that

ar`1 “ ar br ˘ ar´1 ě 2ar ´ ar´1 “ ar ` par ´ ar´1 q ą ar ,

whi h ontradi ts (2). l


To omplete the problem, we prove that maxtan , an`1 u ě n by indu tion. The ases n “ 0, 1
are given. Assume it is true for all non-negative integers stri tly less than n, where n ě 2. There
are two ases:

Case 1: bn´1 “ 1.
Then an`1 “ an bn ` an´1 . By the indu tive assumption one of an´1 , an is at least n´1 and
the other, by the lemma, is at least 1. Hen e

an`1 “ an bn ` an´1 ě an ` an´1 ě pn ´ 1q ` 1 “ n.

Thus maxtan , an`1 u ě n, as desired.

Case 2: bn´1 ą 1.
Sin e we dened b0 “ 1 there is an index r with 1ďr ďn´1 su h that

bn´1 , bn´2 , . . . , br ě 2 and br´1 “ 1.

We have ar`1 “ ar br ` ar´1 ě 2ar ` ar´1 . Thus ar`1 ´ ar ě ar ` ar´1 .


Now we laim that ar ` ar´1 ě r . Indeed, this holds by inspe tion for r “ 1; for r ě 2, one
of ar , ar´1 is at least r ´ 1 by the indu tive assumption, while the other, by the lemma, is at
least 1. Hen e ar ` ar´1 ě r , as laimed, and therefore ar`1 ´ ar ě r by the last inequality in
the previous paragraph.
Sin e r ě 1 and, by the lemma, ar ě 1, from ar`1 ´ ar ě r we get the following two
inequalities:
ar`1 ě r ` 1 and ar`1 ą ar .
28 IMO 2017, Rio de Janeiro

Now observe that

am ą am´1 ùñ am`1 ą am for m “ r ` 1, r ` 2, . . . , n ´ 1,

sin e am`1 “ am bm ´ am´1 ě 2am ´ am´1 “ am ` pam ´ am´1 q ą am . Thus

an ą an´1 ą ¨ ¨ ¨ ą ar`1 ě r ` 1 ùñ an ě n.

So maxtan , an`1 u ě n, as desired.

Solution 2. We say that an index ną1 is bad bn´1 “ 1 and bn´2 ą 1; otherwise n is good.
if
The value of b0 is irrelevant to the denition of pan q sin e a0 “ 0; so we assume that b0 ą 1.
Lemma 1. (a) an ě 1 for all n ą 0.
(b) If ną1 is good, then an ą an´1 .

Proof. Indu tion on n. In the basen “ 1, 2 we have a1 “ 1 ě 1, a2 “ b1 a1 ě 1, and nally


ases
a2 ą a1 if 2 is good, sin e in this ase b1 ą 1.
Now we assume that the lemma statement is proved for n “ 1, 2, . . . , k with k ě 2, and
prove it for n “ k ` 1. Re all that ak and ak´1 are positive by the indu tion hypothesis.

Case 1: k is bad.
We have bk´1 “ 1, so ak`1 “ bk ak ` ak´1 ě ak ` ak´1 ą ak ě 1, as required.

Case 2: k is good.
We already have ak ą ak´1 ě 1 by the indu tion hypothesis. We onsider three easy
sub ases.

Sub ase 2.1: bk ą 1.


Then ak`1 ě bk ak ´ ak´1 ě ak ` pak ´ ak´1 q ą ak ě 1.
Sub ase 2.2: bk “ bk´1 “ 1.
Then ak`1 “ ak ` ak´1 ą ak ě 1.
Sub ase 2.3: bk “ 1 but bk´1 ą 1.
Then k`1 is bad, and we need to prove only (a), whi h is trivial: ak`1 “ ak ´ ak´1 ě 1.
So, in all three sub ases we have veried the required relations. l
Lemma 2. n ą 1
Assume that is bad. Then there exists a j P t1, 2, 3u su h that an`j ě
an´1 ` j ` 1, and an`i ě an´1 ` i for all 1 ď i ă j.
Proof. Re all that bn´1 “ 1. Set

m “ infti ą 0 : bn`i´1 ą 1u

(possibly m “ `8). We laim that j “ mintm, 3u works. Again, we distinguish several ases,
a ording to the value of m; in ea h of them we use Lemma 1 without referen e.

Case 1: m “ 1, so bn ą 1.
Then an`1 ě 2an ` an´1 ě an´1 ` 2, as required.

Case 2: m “ 2, so bn “ 1 and bn`1 ą 1.


Then we su essively get

an`1 “ an ` an´1 ě an´1 ` 1,


an`2 ě 2an`1 ` an ě 2pan´1 ` 1q ` an “ an´1 ` pan´1 ` an ` 2q ě an´1 ` 4,

whi h is even better than we need.


Shortlisted problems  solutions 29

Case 3: m ą 2, so bn “ bn`1 “ 1.
Then we su essively get

an`1 “ an ` an´1 ě an´1 ` 1, an`2 “ an`1 ` an ě an´1 ` 1 ` an ě an´1 ` 2,


an`3 ě an`2 ` an`1 ě pan´1 ` 1q ` pan´1 ` 2q ě an´1 ` 4,

as required. l
Lemmas 1(b) and 2 provide enough information to prove that maxtan , an`1 u ě n for all n
and, moreover, that an ě n often enough. Indeed, assume that we have found some n with
an´1 ě n´1. If n is good, then by Lemma 1(b) we have an ě n as well. If n is bad, then Lemma 2
yields maxtan`i , an`i`1 u ě an´1 ` i ` 1 ě n ` i for all 0 ď i ă j and an`j ě an´1 ` j ` 1 ě n ` j ;
so n ` j is the next index to start with.
30 IMO 2017, Rio de Janeiro

A8. Assume that a fun tion f: RÑ R satises the following ondition:

` ˘` ˘
For every x, y P R su h that f pxq ` y f pyq ` x ą 0, we have f pxq ` y “ f pyq ` x.

Prove that f pxq ` y ď f pyq ` x whenever x ą y.


(Netherlands)
Solution 1. Denegpxq “ x ´ f pxq. The ondition on f then rewrites as follows:
` ˘` ˘
For every x, y P R su h that px ` yq ´ gpxq px ` yq ´ gpyq ą 0, we have gpxq “ gpyq.
This ondition may in turn be rewritten in the following form:

If gpxq ‰ gpyq, then the number x ` y lies (non-stri tly) between gpxq and gpyq. p˚q
Noti e here that the fun tion g1 pxq “ ´gp´xq also satises p˚q, sin e

g1 pxq ‰ g1 pyq ùñ gp´xq ‰ gp´yq ùñ ´px ` yq lies between gp´xq and gp´yq
ùñ x ` y lies between g1 pxq and g1 pyq.

On the other hand, the relation we need to prove reads now as

gpxq ď gpyq whenever x ă y. (1)

Again, this ondition is equivalent to the same one with g repla ed by g1 .


If gpxq “ 2x for all x P R, then p˚q is obvious; so in what follows we onsider the other
ase. We split the solution into a sequen e of lemmas, strengthening one another. We always
onsider some value of x with gpxq ‰ 2x and denote X “ gpxq.
Lemma 1. X ă 2x. Then on the interval pX ´ x; xs the fun tion g attains at
Assume that
most two values  namely, X and, possibly, some Y ą X . Similarly, if X ą 2x, then g attains
at most two values on rx; X ´ xq  namely, X and, possibly, some Y ă X .

Proof. We start with the rst laim of the lemma. Noti e that X ´ x ă x, so the onsidered
interval is nonempty.
Take anya P pX ´ x; xq with gpaq ‰ X (if it exists). If gpaq ă X , then p˚q yields gpaq ď
a ` x ď gpxq “ X , so a ď X ´ x whi h is impossible. Thus, gpaq ą X and hen e by p˚q we get
X ď a ` x ď gpaq.
Now, for any b P pX ´ x; xq with gpbq ‰ X we similarly get b ` x ď gpbq. Therefore, the
number a ` b (whi h is smaller than ea h of a ` x and b ` x) annot lie between gpaq and gpbq,
whi h by p˚q implies that gpaq “ gpbq. Hen e g may attain only two values on pX ´ x; xs,
namely X and gpaq ą X .
To prove the se ond laim, noti e that g1 p´xq “ ´X ă 2 ¨ p´xq, so g1 attains at most two
values on p´X ` x, ´xs, i.e., ´X and, possibly, some ´Y ą ´X . Passing ba k to g , we get
what we need. l
Lemma 2. If X ă 2x, then g is onstant on pX ´ x; xq. Similarly, if X ą 2x, then g is onstant
on px; X ´ xq.
Proof. Again, it su es to prove the rst laim only. Assume, for the sake of ontradi tion,
that there exista, b P pX ´ x; xq with gpaq ‰ gpbq; by Lemma 1, we may assume that gpaq “ X
and Y “ gpbq ą X .
Noti e that mintX ´ a, X ´ bu ą X ´ x, so there exists a u P pX ´ x; xq su h that
u ă mintX ´ a, X ´ bu. By Lemma 1, we have either gpuq “ X or gpuq “ Y . In the former
ase, by p˚q we have X ď u ` b ď Y whi h ontradi ts u ă X ´ b. In the se ond ase, by p˚q
we have X ď u ` a ď Y whi h ontradi ts u ă X ´ a. Thus the lemma is proved. l
Shortlisted problems  solutions 31

Lemma 3. If X ă 2x, then gpaq “ X for all a P pX ´ x; xq. Similarly, if X ą 2x, then gpaq “ X
for all a P px; X ´ xq.
Proof. Again, we only prove the rst laim.
By Lemmas 1 and 2, this laim may be violated only if g takes on a onstant value Y ąX
on pX ´ x, xq. Choose any a, b P pX ´ x; xq with a ă b. By p˚q, we have

Y ě b ` x ě X. (2)

In parti ular, we haveY ě b ` x ą 2a. Applying Lemma 2 to a in pla e of x, we obtain that g


is onstant on pa, Y ´ aq. By (2) again, we have x ď Y ´ b ă Y ´ a; so x, b P pa; Y ´ aq. But
X “ gpxq ‰ gpbq “ Y , whi h is a ontradi tion. l
Now we are able to nish the solution. Assume that gpxq ą gpyq for some x ă y . Denote
X “ gpxq and Y “ gpyq; by p˚q, we have X ě x ` y ě Y , so Y ´ y ď x ă y ď X ´ x,
and hen e pY ´ y; yq X px; X ´ xq “ px, yq ‰ ∅. On the other hand, sin e Y ´ y ă y and
x ă X ´x, Lemma 3 shows that g should attain a onstant value X on px; X ´xq and a onstant
value Y ‰ X on pY ´ y; yq. Sin e these intervals overlap, we get the nal ontradi tion.

Solution 2. As in the previous solution, we pass to the fun tion p˚q and noti eg satisfying
that we need to prove the g1 .
ondition (1). We will also make use of the fun tion

If g is onstant, then (1) is learly satised. So, in the sequel we assume that g takes on at
least two dierent values. Now we olle t some information about the fun tion g .

Claim 1. For any c P R, all the solutions of gpxq “ c are bounded.


Proof. Fix any y P R with gpyq ‰ c. Assume rst that gpyq ą c. Now, for any x with gpxq “ c,
by p˚q we have c ď x ` y ď gpyq, or c ´ y ď x ď gpyq ´ y . Sin e c and y are onstant, we get
what we need.
If gpyq ă c, g1 for whi h we have g1 p´yq ą ´c. By the above
we may swit h to the fun tion
arguments, we obtain that all the solutions of g1 p´xq “ ´c are bounded, whi h is equivalent
to what we need. l
As an immediate onsequen e, the fun tion g takes on innitely many values, whi h shows
that the next laim is indeed widely appli able.

Claim 2. If gpxq ă gpyq ă gpzq, then x ă z .


Proof. By p˚q, we have gpxq ď x ` y ď gpyq ď z ` y ď gpzq, so x ` y ď z ` y , as required. l
Claim 3. Assume that gpxq ą gpyq for some x ă y . Then gpaq P tgpxq, gpyqu for all a P rx; ys.
Proof. If gpyq ă gpaq ă gpxq, then the triple py, a, xq violates Claim 2. If gpaq ă gpyq ă gpxq,
then the triple pa, y, xq violates Claim 2.
gpyq ă gpxq ă gpaq, then the triple py, x, aq violates
If
Claim 2. The only possible ases left are gpaq P tgpxq, gpyqu. l
In view of Claim 3, we say that an interval I (whi h may be open, losed, or semi-open) is
a Diri hlet interval if the fun tion g takes on just two values on I .

Assume now, for the sake of ontradi tion, that (1) is violated by some x ă y . By Claim 3,
rx; ys is a Diri hlet interval. Set

r “ infta : pa; ys is a Diri hlet intervalu and s “ suptb : rx; bq is a Diri hlet intervalu.

Clearly,r ď x ă y ď s. By Claim 1, r and s are nite. Denote X “ gpxq, Y “ gpyq, and


∆ “ py ´ xq{2.
Suppose rst that there exists a t P pr; r ` ∆q with f ptq “ Y . By the denition of r , the
interval pr ´ ∆; ys is not Diri hlet, so there exists an
1
r P pr ´ ∆; rs su h that gpr 1q R tX, Y u.

The name Diri hlet interval is hosen for the reason that g theoreti ally might a t similarly to the Diri hlet

fun tion on this interval.


32 IMO 2017, Rio de Janeiro

1 1
The fun tion attains at least three distin t values on rr ; ys, namely gpr q, gpxq, and gpyq.
g
1 1
Claim 3 now yields gpr q ď gpyq; the equality is impossible by the hoi e of r , so in fa t
gpr 1 q ă Y . Applying p˚q to the pairs pr 1 , yq and pt, xq we obtain r 1 ` y ď Y ď t ` x, when e
r ´ ∆ ` y ă r 1 ` y ď t ` x ă r ` ∆ ` x, or y ´ x ă 2∆. This is a ontradi tion.
Thus, gptq “ X for all t P pr; r ` ∆q. Applying the same argument to g1 , we get gptq “ Y
for all t P ps ´ ∆; sq.
Finally, hoose some s1 , s2 P ps ´ ∆; sq with s1 ă s2 and denote δ “ ps2 ´ s1 q{2. As before,
we hoose r 1 P pr ´ δ; rq with gpr 1q R tX, Y u and obtain gpr 1q ă Y . Choose any t P pr; r ` δq; by
the above arguments, we have gptq “ X and gps1 q “ gps2 q “ Y . As before, we apply p˚q to the
1 1
pairs pr , s2 q and pt, s1 q obtaining r ´ δ ` s2 ă r ` s2 ď Y ď t ` s1 ă r ` δ ` s1 , or s2 ´ s1 ă 2δ .
This is a nal ontradi tion.

Comment 1. The original submission dis ussed the same fun tions f , but the question was dier-
ent  namely, the following one:
Prove that the equation f pxq “ 2017x has at most one solution, and the equation f pxq “ ´2017x
has at least one solution.
The Problem Sele tion Committee de ided that the question we are proposing is more natural,
sin e it provides more natural information about the fun tion g (whi h is indeed the main hara ter
in this story). On the other hand, the new problem statement is strong enough in order to imply the
original one easily.
Namely, we will dedu e from the new problem statement (along with the fa ts used in the solutions)
that piq for every N ą 0 the equation gpxq “ ´N x has at most one solution, and piiq for every N ą 1
the equation gpxq “ N x has at least one solution.
Claim piq is now trivial. Indeed, g is proven to be non-de reasing, so gpxq`N x is stri tly in reasing
and thus has at most one zero.
We pro eed on laim piiq. If gp0q “ 0, then the required root has been already found. Otherwise,
we may assume that gp0q ą 0 and denote c “ gp0q. We intend to prove that x “ c{N is the required
root. Indeed, by monotoni ity we have gpc{N q ě gp0q “ c; if we had gpc{N q ą c, then p˚q would yield
c ď 0 ` c{N ď gpc{N q whi h is false. Thus, gpxq “ c “ N x.

Comment 2. There are plenty of fun tions g satisfying p˚q (and hen e of fun tions f satisfying
the problem onditions). One simple example is g0 pxq “ 2x. Next, for any in reasing sequen e
A “ p. . . , a´1 , a0 , a1 , . . . q whi h is unbounded in both dire tions (i.e., for every N this sequen e ontains
terms greater than N , as well as terms smaller than ´N ), the fun tion gA dened by

gA pxq “ ai ` ai`1 whenever x P rai ; ai`1 q

satises p˚q. Indeed, pi k any x ă y with gpxq ‰ gpyq; this means that x P rai ; ai`1 q and y P raj ; aj`1 q
for some i ă j . Then we have gpxq “ ai ` ai`1 ď x ` y ă aj ` aj`1 “ gpyq, as required.
There also exist examples of the mixed behavior; e.g., for an arbitrary sequen e A as above and an
arbitrary subset I Ď Z the fun tion
#
g0 pxq, x P rai ; ai`1 q with i P I ;
gA,I pxq “
gA pxq, x P rai ; ai`1 q with i R I

also satises p˚q.


Finally, it is even possible to provide a omplete des ription of all fun tions g satisfying p˚q (and
hen e of all fun tions f satisfying the problem onditions); however, it seems to be far out of s ope for
the IMO. This des ription looks as follows.
Let A be any losed subset of R whi h is unbounded in both dire tions. Dene the fun tions iA ,
sA , and gA as follows:

iA pxq “ infta P A : a ě xu, sA pxq “ supta P A : a ď xu, gA pxq “ iA pxq ` sA pxq.


Shortlisted problems  solutions 33

It is easy to see that for dierent sets A and B the fun tions gA and gB are also dierent (sin e, e.g.,
for any a P A z B the fun tion gB is onstant in a small neighborhood of a, but the fun tion gA is not).
One may he k, similarly to the arguments above, that ea h su h fun tion satises p˚q.
Finally, one more modi ation is possible. Namely, for any x P A one may redene gA pxq (whi h
is 2x) to be any of the numbers

gA` pxq “ iA` pxq ` x or gA´ pxq “ x ` sA´ pxq,


where iA` pxq “ infta P A : a ą xu and sA´ pxq “ supta P A : a ă xu.

This really hanges the value if x has some right (respe tively, left) semi-neighborhood disjoint from A,
so there are at most ountably many possible hanges; all of them an be performed independently.
With some eort, one may show that the onstru tion above provides all fun tions g satisfying p˚q.
34 IMO 2017, Rio de Janeiro

Combinatori s
C1. A re tangle R with odd integer side lengths is divided into small re tangles with integer
side lengths. Prove that there is at least one among the small re tangles whose distan es from
the four sides of R are either all odd or all even.
(Singapore)
Solution. Let the width and height of R be odd numbers a and b. Divide R into ab unit
squares and olor them green and yellow in a he kered pattern. Sin e the side lengths of a
and b are odd, the orner squares of R will all have the same olor, say green.
Call a re tangle (either R or a small re tangle) green if its orners are all green; all it
yellow if the orners are all yellow, and all it mixed if it has both green and yellow orners. In
parti ular, R is a green re tangle.

We will use the following trivial observations.


‚ Every mixed re tangle ontains the same number of green and yellow squares;
‚ Every green re tangle ontains one more green square than yellow square;
‚ Every yellow re tangle ontains one more yellow square than green square.

The re tangle R is green, so it ontains more green unit squares than yellow unit squares.
Therefore, among the small re tangles, at least one is green. Let S be su h a small green
re tangle, and let its distan es from the sides of R be x, y , u and v , as shown in the pi ture.
The top-left orner of R and the top-left orner of S have the same olor, whi h happen if and
only if x and u have the same parity. Similarly, the other three green orners of S indi ate that
x and v have the same parity, y and u have the same parity, i.e. x, y , u and v are all odd or all
even.

R
x

u S v

y
Shortlisted problems  solutions 35

C2. Let n be a positive integer. Dene a hameleon to be any sequen e of 3n letters, with
exa tly no urren es of ea h of the letters a, b,and c. Dene a swap to be the transposition of
two adja ent letters in a hameleon. Prove that for any hameleon X , there exists a hameleon Y
2
su h that X annot be hanged to Y using fewer than 3n {2 swaps.
(Australia)
Solution 1. To start, noti e that the swap of two identi al letters does not hange a hameleon,
so we may assume there are no su h swaps.
For any two hameleons X and Y , dene their distan e dpX, Y q to be the minimal number
of swaps needed to transform X into Y (or vi e versa). Clearly, dpX, Y q ` dpY, Zq ě dpX, Zq
for any three hameleons X , Y , and Z .
Lemma. Consider two hameleons

P “ loomoon cc . . . c
bb . . . b loomoon
aa . . . a loomoon and Q “ loomoon
cc . . . c loomoon aa . . . a .
bb . . . b loomoon
n n n n n n

Then dpP, Qq ě 3n2 .


Proof. For any hameleon X u, v P ta, b, cu, we dene fu,v pXq
and any pair of distin t letters
to be the number of pairs of positions in X su h that the left one is o upied by u, and
the right one is o upied by v . Dene f pXq “ fa,b pXq ` fa,c pXq ` fb,c pXq. Noti e that
fa,b pP q “ fa,c pP q “ fb,c pP q “ n2 and fa,b pQq “ fa,c pQq “ fb,c pQq “ 0, so f pP q “ 3n2 and
f pQq “ 0.
1
Now onsider some swap hanging a hameleon X to X ; say, the letters a and b are swapped.
1 1 1
Then fa,b pXq and fa,b pX q dier by exa tly 1, while fa,c pXq “ fa,c pX q and fb,c pXq “ fb,c pX q.
1
This yields |f pXq ´ f pX q| “ 1, i.e., on any swap the value of f hanges by 1. Hen e dpX, Y q ě
|f pXq ´ f pY q| for any two hameleons X and Y . In parti ular, dpP, Qq ě |f pP q ´ f pQq| “ 3n2 ,
as desired. l
Ba k to the problem, take any hameleon X and noti e that dpX, P q ` dpX, Qq ě dpP, Qq ě
2
3n by the lemma. Consequently, maxtdpX, P q, dpX, Qqu ě 3n2 , whi h establishes the problem
2

statement.

Comment 1. The problem may be reformulated in a graph language. Constru t a graph G with the
hameleons as verti es, two verti es being onne ted with an edge if and only if these hameleons dier
by a single swap. Then dpX, Y q is the usual distan e between the verti es X and Y in this graph.
Re all that the radius of a onne ted graph G is dened as

rpGq “ min max dpu, vq.


vPV uPV

So we need to prove that the radius of the onstru ted graph is at least 3n2 {2.
It is well-known that the radius of any onne ted graph is at least the half of its diameter (whi h
is simply maxu,vPV dpu, vq). Exa tly this fa t has been used above in order to nish the solution.
Solution 2. We use the notion of distan e from Solution 1, but provide a dierent lower
bound for it.
In any hameleon X, we enumerate the positions in it from left to right by 1, 2, . . . , 3n.
Dene sc pXq as the sum of positions o upied by c. The value of sc hanges by at most 1 on
ea h swap, but this fa t alone does not su e to solve the problem; so we need an improvement.
For every hameleon X, denote by Xc the sequen e obtained from X by removing all n
letters c. Enumerate the positions in Xc from left to right by 1, 2, . . . , 2n, and dene sc,b pXq
as the sum of positions in Xc o upied by b. (In other words, here we onsider the positions of
the b's relatively to the a's only.) Finally, denote

d1 pX, Y q :“ |sc pXq ´ sc pY q| ` |sc,b pXq ´ sc,b pY q|.


36 IMO 2017, Rio de Janeiro

1
Now onsider any swap hanging a hameleon X to X . If no letter c is involved into this
1
swap, then sc pXq “ sc pX q; on the other hand, exa tly one letter b hanges its position in Xc , so
|sc,b pXq ´ sc,b pX 1 q| “ 1. If a letter c is involved into a swap, then Xc “ Xc1 , so sc,b pXq “ sc,b pX 1 q
1 1 1
and |sc pXq ´ sc pX q| “ 1. Thus, in all ases we have d pX, X q “ 1.
1
As in the previous solution, this means that dpX, Y q ě d pX, Y q for any two hameleons X
1 2
and Y . Now, for any hameleon X we will indi ate a hameleon Y with d pX, Y q ě 3n {2, thus
nishing the solution.
npn`1q
The fun tion sc attains all integer values from 1 ` ¨ ¨ ¨ ` n “ to p2n ` 1q ` ¨ ¨ ¨ ` 3n “
2
2 npn`1q 2 npn`1q
2n ` 2 . If sc pXq ď n ` 2 , then we put the letter c into the last n positions in Y ;
otherwise we put the letter c into the rst n positions in Y . In either ase we already have
|sc pXq ´ sc pY q| ě n2 .
npn`1q npn`1q n2
Similarly, sc,b ranges from
2
2
to n `
2
. So, if sc,b pXq ď
2
` npn`1q
2
, then we put
the letter b into the last n positions in Y whi h are still free; otherwise, we put the letter b into
the rst n su h positions. The remaining positions are o upied by a. In any ase, we have
2 2 2
|sc,b pXq ´ sc,b pY q| ě n2 , thus d1 pX, Y q ě n2 ` n2 “ 3n2 , as desired.

Comment 2. The two solutions above used two lower bounds |f pXq ´ f pY q| and d1 pX, Y q for the
number dpX, Y q. One may see that these bounds are losely related to ea h other, as
npn ` 1q npn ` 1q
fa,c pXq ` fb,c pXq “ sc pXq ´ and fa,b pXq “ sc,b pXq ´ .
2 2
One an see that, e.g., the bound d1 pX, Y q ould as well be used in the proof of the lemma in Solution 1.
Let us des ribe here an even sharper bound whi h also an be used in dierent versions of the
solutions above.
In ea h hameleon X , enumerate the o urren es of a from the left to the right as a1 , a2 , . . . , an .
Sin e we got rid of swaps of identi al letters, the relative order of these letters remains the same during
the swaps. Perform the same operation with the other letters, obtaining new letters b1 , . . . , bn and
c1 , . . . , cn . Denote by A the set of the 3n obtained letters.
Sin e all 3n letters be ame dierent, for any hameleon X and any s P A we may dene the
position Ns pXq of s in X (thus 1 ď Ns pXq ď 3n). Now, for any two hameleons X and Y we say that
a pair of letters ps, tq P Aˆ A is an pX, Y q-inversion if Ns pXq ă Nt pXq but Ns pY q ą Nt pY q, and dene
d˚ pX, Y q to be the number of pX, Y q-inversions. Then for any two hameleons Y and Y 1 diering by a
single swap, we have |d˚ pX, Y q ´ d˚ pX, Y 1 q| “ 1. Sin e d˚ pX, Xq “ 0, this yields dpX, Y q ě d˚ pX, Y q
for any pair of hameleons X and Y . The bound d˚ may also be used in both Solution 1 and Solution 2.

Comment 3. In fa t, one may prove that the distan e d˚ dened in the previous omment oin ides
with d. Indeed, if X ‰ Y , then there exist an pX, Y q-inversion ps, tq. One an show that su h s and t
may be hosen to o upy onse utive positions in Y . Clearly, s and t orrespond to dierent letters
among ta, b, cu. So, swapping them in Y we get another hameleon Y 1 with d˚ pX, Y 1 q “ d˚ pX, Y q ´ 1.
Pro eeding in this manner, we may hange Y to X in d˚ pX, Y q steps.
Using this fa t, one an show that the estimate in the problem statement is sharp for all n ě 2.
(For n “ 1 it is not sharp, sin e any permutation of three letters an be hanged to an opposite one in
no less than three swaps.) We outline the proof below.
For any k ě 0, dene

X2k “ abc abc . . . abc cba


looooooomooooooon cba . . . cba
looooooomooooooon and X2k`3 “ abc abc . . . abc abc bca cab cba
looooooomooooooon cba . . . cba .
looooooomooooooon
3k letters 3k letters 3k letters 3k letters
T P
We laim that for every n ě 2 and every hameleon Y , we have d˚ pXn , Y q ď 3n2 {2 . This will mean
P n2 ěT2 the number 3n {2 in the problem statement annot be hanged by any number
that for every 2

larger than 3n {2 .
For any distin t letters u, v P ta, b, cu and any two hameleons X and Y , we dene d˚u,v pX, Y q as
the number of pX, Y q-inversions ps, tq su h that s and t are instan es of u and v (in any of the two
possible orders). Then d˚ pX, Y q “ d˚a,b pX, Y q ` d˚b,c pX, Y q ` d˚c,a pX, Y q.
Shortlisted problems  solutions 37

We start with the ase when n “ 2k is even; denote X “ X2k . We show that d˚a,b pX, Y q ď 2k 2
for any hameleon Y ; this yields the required estimate. Pro eed by the indu tion on k with the trivial
base ase k “ 0. To perform the indu tion step, noti e that d˚a,b pX, Y q is indeed the minimal number of
swaps needed to hange Yc into Xc . One may show that moving a1 and a2k in Y onto the rst and the
last positions in Y , respe tively, takes at most 2k swaps, and that subsequent moving b1 and b2k onto
the se ond and the se ond last positions takes at most 2k ´ 2 swaps. After performing that, one may
delete these letters from both Xc and Yc and apply the indu tion hypothesis; so Xc an be obtained
from Yc using at most 2pk ´ 1q2 ` 2k ` p2k ´ 2q “ 2k 2 swaps, as required.
If n “ 2k ` 3 is odd, the proof is similar but more te hni ally involved. Namely, we laim that
d˚a,b pX2k`3 , Y q ď 2k2 ` 6k ` 5 for any hameleon Y , and that the equality is a hieved only if Yc “
bb . . . b aa . . . a. The proof pro eeds by a similar indu tion, with some are taken of the base ase, as
well as of extra ting the equality ase. Similar estimates hold for d˚b,c and d˚c,a . Summing three su h
estimates, we obtain R 2V
˚ 2 3n
d pX2k`3 , Y q ď 3p2k ` 6k ` 5q “ ` 1,
2
whi h is by 1 more than we need. But the equality ould be a hieved only if Yc “ bb . . . b aa . . . a
and, similarly, Yb “ aa . . . a cc . . . c and Ya “ cc . . . c bb . . . b. Sin e these three equalities annot hold
simultaneously, the proof is nished.
38 IMO 2017, Rio de Janeiro

C3. Sir Alex plays the following game on a row of 9 ells. Initially, all ells are empty. In
ea h move, Sir Alex is allowed to perform exa tly one of the following two operations:

(1) Choose any number of the form 2j , where j is a non-negative integer, and put it into an
empty ell.

(2) Choose two (not ne essarily adja ent) ells with the same number in them; denote that
j j`1
number by 2 . Repla e the number in one of the ells with 2 and erase the number in
the other ell.

At the end of the game, one ell ontains the number 2n , where n is a given positive integer,
while the other ells are empty. Determine the maximum number of moves that Sir Alex ould
have made, in terms of n.
(Thailand)
ř8 ` n˘
Answer: 2 j“0 j
´ 1.
Solution 1. We will solve a more general problem, repla ing the row of 9 ells with a row of k
ells, where k is a positive integer. Denote by mpn, kq the maximum possible number of moves
Sir Alex an make starting with a row of k empty ells, and ending with one ell ontaining
the number 2n and all the other k ´ 1 ells empty. Call an operation of type (1) an , insertion
and an operation of type (2) a merge.
Only one move is possible when k “ 1, so we have mpn, 1q “ 1. From now on we onsider
k ě 2, and we may assume Sir Alex's last move was a merge. Then, just before the last move,
n´1
there were exa tly two ells with the number 2 , and the other k ´ 2 ells were empty.
n´1
Paint one of those numbers 2 blue, and the other one red. Now tra e ba k Sir Alex's
moves, always painting the numbers blue or red following this rule: if a and b merge into c,
paint a and b with the same olor as c. Noti e that in this ba kward pro ess new numbers are
produ ed only by reversing merges, sin e reversing an insertion simply means deleting one of
the numbers. Therefore, all numbers appearing in the whole pro ess will re eive one of the two
olors.
Sir Alex's rst move is an insertion. Without loss of generality, assume this rst number
inserted is blue. Then, from this point on, until the last move, there is always at least one ell
with a blue number.
Besides the last move, there is no move involving a blue and a red number, sin e all merges
involves numbers with the same olor, and insertions involve only one number. Call an insertion
of a blue number or merge of two blue numbers a blue move, and dene a red move analogously.
The whole sequen e of blue moves ould be repeated on another row of k ells to produ e
n´1
one ell with the number 2 and all the others empty, so there are at most mpn ´ 1, kq blue
moves.
Now we look at the red moves. Sin e every time we perform a red move there is at least
one ell o upied with a blue number, the whole sequen e of red moves ould be repeated on a
row of k ´ 1 ells to produ e one ell with the number 2n´1 and all the others empty, so there
are at most mpn ´ 1, k ´ 1q red moves. This proves that

mpn, kq ď mpn ´ 1, kq ` mpn ´ 1, k ´ 1q ` 1.


On the other hand, wean start with an empty row of k ells and perform mpn ´ 1, kq
n´1
moves to produ e one ell with the number 2 and all the others empty, and after that
n´1
perform mpn ´ 1, k ´ 1q moves on those k ´ 1 empty ells to produ e the number 2 in one
n
of them, leaving k ´ 2 empty. With one more merge we get one ell with 2 and the others
empty, proving that

mpn, kq ě mpn ´ 1, kq ` mpn ´ 1, k ´ 1q ` 1.


Shortlisted problems  solutions 39

It follows that

mpn, kq “ mpn ´ 1, kq ` mpn ´ 1, k ´ 1q ` 1, (1)

forn ě 1 and k ě 2.
k “ 1 or n “ 0, we must insert 2n on our rst move and immediately get the nal
If
onguration, so mp0, kq “ 1 and mpn, 1q “ 1, for n ě 0 and k ě 1. These initial values,
together with the re urren e relation (1), determine mpn, kq uniquely.

Finally, we show that


ÿˆ
k´1
n
˙
mpn, kq “ 2 ´ 1, (2)
j“0
j
for all integers ně0 and k ě 1.
We use indu tion on n. Sin e mp0, kq “ 1 for k ě 1, (2) is true for the base ase. We make
the indu tion hypothesis that (2) is true for some xed positive integer n and all k ě 1. We
`n`1˘
have mpn ` 1, 1q “ 1 “ 2 ´ 1, and for k ě 2 the re urren e relation (1) and the indu tion
0
hypothesis give us

n
˙ ÿ ˆn˙
ÿˆ
k´2
k´1
mpn ` 1, kq “ mpn, kq ` mpn, k ´ 1q ` 1 “ 2 ´1`2 ´1`1
j“0
j j“0
j
k´1
ÿ n ˆ ˙ k´1
ÿ ˆ ˙ k´1
ÿ ˆˆ ˙ ˆ ˙˙ ÿ ˆn ` 1˙
k´1
n n n
“2 `2 ´1“2 ` ´1“2 ´ 1,
j“0
j j“0
j´1 j“0
j j´1 j“0
j

whi h ompletes the proof.

Comment 1. After dedu ing the re urren e relation (1), it may be onvenient to homogenize the
re urren e relation by dening hpn, kq “ mpn, kq ` 1. We get the new relation

hpn, kq “ hpn ´ 1, kq ` hpn ´ 1, kq, (3)

for n ě 1 and k ě 2, with initial values hp0, kq “ hpn, 1q “ 2, for n ě 0 and k ě 1.


This may help one to guess the answer, and also with other approa hes like the one we develop
next.

Comment 2. We an use a generating fun tion to nd the answer without guessing. We work with
ř hpn, 0q “ 0 so that (3) is valid for k “ 1 as well. Now
the homogenized re urren e relation (3). Dene
we set up the generating fun tion f px, yq “ n,kě0 hpn, kqxn y k . Multiplying the re urren e relation (3)
by xn y k and summing over n, k ě 1, we get
ÿ ÿ ÿ
hpn, kqxn y k “ x hpn ´ 1, kqxn´1 y k ` xy hpn ´ 1, k ´ 1qxn´1 y k´1 .
n,kě1 n,kě1 n,kě1

Completing the missing terms leads to the following equation on f px, yq:
ÿ ÿ ÿ
f px, yq ´ hpn, 0qxn ´ hp0, kqy k “ xf px, yq ´ x hpn, 0qxn ` xyf px, yq.
ně0 kě1 ně0

Substituting the initial values, we obtain


2y 1
f px, yq “ ¨ .
1 ´ y 1 ´ xp1 ` yq
Developing as a power series, we get
ÿ ÿ
f px, yq “ 2 yj ¨ p1 ` yqn xn .
jě1 ně0
40 IMO 2017, Rio de Janeiro

The oe ient of xn in this power series is


ÿ ÿ ˆn ˙
ÿ
j n j
2 y ¨ p1 ` yq “ 2 y ¨ yi,
jě1 jě1 iě0
i

and extra ting the oe ient of y k in this last expression we nally obtain the value for hpn, kq,

ÿˆ
k´1
n
˙
hpn, kq “ 2 .
j“0
j

This proves that

ÿˆ
k´1
n
˙
mpn, kq “ 2 ´ 1.
j“0
j

The generating fun tion approa h also works if applied to the non-homogeneous re urren e rela-
tion (1), but the omputations are less straightforward.
Solution 2. Dene merges and insertions as in Solution 1. After ea h move made by Sir Alex
we ompute the number N of empty ells, and the sum S of all the numbers written in the
ells. Insertions always in rease S by some power of 2, and in rease N exa tly by 1. Merges do
not hange S and de rease N exa tly by 1. Sin e the initial value of N is 0 and its nal value
is 1, the total number of insertions ex eeds that of merges by exa tly one. So, to maximize the
number of moves, we need to maximize the number of insertions.
We will need the following lemma.

Lemma. If the binary representation of a positive integer A has d nonzero digits, then A annot
be represented as a sum of fewer than d powers of 2. Moreover, any representation of A as a
sum of d powers of 2 must oin ide with its binary representation.

Proof. Let s be the minimum number of summands in all possible representations of A as sum
of powers of 2. Suppose there is su h a representation with s summands, where two of the
summands are equal to ea h other. Then, repla ing those two summands with the result of
their sum, we obtain a representation with fewer than s summands, whi h is a ontradi tion.
We dedu e that in any representation with s summands, the summands are all distin t, so any
su h representation must oin ide with the unique binary representation of A, and s “ d. l
Now we split the solution into a sequen e of laims.

Claim 1. After every move, the number S is the sum of at most k ´ 1 distin t powers of 2.
Proof. If S is the sum of k (or more) distin t powers of 2, the Lemma implies that the k ells
are lled with these numbers. This is a ontradi tion sin e no more merges or insertions an
be made. l
n
Let Apn, k ´ 1q denote the set of all positive integers not ex eeding 2 with at most k ´ 1
nonzero digits in its base 2 representation. Sin e every insertion in reases the value of S , by
Claim 1, the total number of insertions is at most |Apn, k ´ 1q|. We pro eed to prove that it is
possible to a hieve this number of insertions.

Claim 2. Apn, k ´1q “ ta1 , a2 , . . . , am u, with a1 ă a2 ă ¨ ¨ ¨ ă am . If after some of Sir Alex's


Let
moves the value of S is aj , with j P t1, 2, . . . , m ´ 1u, then there is a sequen e of moves after
whi h the value of S is exa tly aj`1 .

Proof. Suppose S “ aj . Performing all possible merges, we eventually get dierent powers of 2
in all nonempty ells. After that, by Claim 1 there will be at least one empty ell, in whi h we
want to insert aj`1 ´ aj . aj`1 ´ aj is a power of 2.
It remains to show that
For this purpose, we noti e that if aj has less than k ´ 1 nonzero digits in base 2 then
aj`1 “ aj ` 1. Otherwise, we have aj “ 2bk´1 ` ¨ ¨ ¨ ` 2b2 ` 2b1 with b1 ă b2 ă ¨ ¨ ¨ ă bk´1 . Then,
b
adding any number less than 2 1 to aj will result in a number with more than k ´ 1 nonzero
Shortlisted problems  solutions 41

binary digits. On the other hand,aj ` 2b1 is a sum of k powers of 2, not all distin t, so by the
b
Lemma it will be a sum of less then k distin t powers of 2. This means that aj`1 ´ aj “ 2 1 ,
ompleting the proof. l
Claims 1 and 2 prove that the maximum number of insertions is |Apn, k ´ 1q|. We now
ompute this number.
ř ` ˘
Claim 3. |Apn, k ´ 1q| “ j“0
k´1 n
j
.

Proof. The number 2 is the only


n
element of Apn, k ´ 1q with n`1 binary digits. Any other
element has at most n binary digits, at least one and at most k ´ 1 of them are nonzero (so
`n˘
they are ones). For ea h j P t1, 2, . . . , k ´ 1u, there are su h elements with exa tly j binary
j
řk´1 `n˘ řk´1 `n˘
digits equal to one. We on lude that |Apn, k ´ 1q| “ 1 ` j“1 j “ j“0 j . l
Re alling that the number of insertions ex eeds that of merges by exa tly
řk´1 `n˘ 1, we dedu e that
the maximum number of moves is 2 j“0 j
´ 1.
42 IMO 2017, Rio de Janeiro

C4. Let N ě2 be an integer. NpN ` 1q so er players, no two of the same height, stand
in a row in some order. Coa h Ralph wants to remove NpN ´ 1q people from this row so that
in the remaining row of 2N players, no one stands between the two tallest ones, no one stands
between the third and the fourth tallest ones, . . . , and nally no one stands between the two
shortest ones. Show that this is always possible.
(Russia)
Solution 1. Split the row into N blo ks with N `1 onse utive people ea h. We will show
how to remove N ´1 people from ea h blo k in order to satisfy the oa h's wish.
First, onstru t a pN ` 1q ˆ N matrix where xi,j is the height of the ith tallest person of
th
the j blo kin other words, ea h olumn lists the heights within a single blo k, sorted in
de reasing order from top to bottom.
We will reorder this matrix by repeatedly swapping whole olumns. First, by olumn per-
mutation, make sure that x2,1 “ maxtx2,i : i “ 1, 2, . . . , Nu (the rst olumn ontains the
largest height of the se ond row). With the rst olumn xed, permute the other ones so that
x3,2 “ maxtx3,i : i “ 2, . . . , Nu (the se ond olumn ontains the tallest person of the third row,
rst olumn ex luded). In short, at step k (k “ 1, 2, . . . , N ´ 1), we permute the olumns from
k to N so that xk`1,k “ maxtxi,k : i “ k, k ` 1, . . . , Nu, and end up with an array like this:

x1,1 x1,2 x1,3 ¨ ¨ ¨ x1,N ´1 x1,N


ą

ą
x2,1 ą x2,2 x2,3 ¨ ¨ ¨ x2,N ´1 x2,N
ą
ą

ą
x3,1 x3,2 ą x3,3 ¨ ¨ ¨ x3,N ´1 x3,N
ą
ą

. . . .. . .
.. .. .. . .. ..
ą
ą

xN,1 xN,2 xN,3 ¨ ¨ ¨ xN,N ´1 ą xN,N


ą
ą

xN `1,1 xN `1,2 xN `1,3 ¨ ¨ ¨ xN `1,N ´1 xN `1,N


Now we make the bold hoi e: from the original row of people, remove everyone but those
with heights
x1,1 ą x2,1 ą x2,2 ą x3,2 ą ¨ ¨ ¨ ą xN,N ´1 ą xN,N ą xN `1,N p˚q
Of ourse this height order p˚q is not ne essarily their spatial order in the new row. We now
need to onvin e ourselves that ea h pair pxk,k ; xk`1,k q remains spatially together in this new
row. But xk,k and xk`1,k belong to the same olumn/blo k of onse utive N `1 people; the
only people that ould possibly stand between them were also in this blo k, and they are all
gone.

Solution 2. Split the people into N groups by height :


N ` 1 tallest ones, group G1 has the
group G2 has the next N ` 1 tallest, and so on, up to group GN with the N ` 1 shortest people.
Now s an the original row from left to right, stopping as soon as you have s anned two
people ( onse utively or not) from the same group, say, Gi . Sin e we have N groups, this must
th
happen before or at the pN ` 1q person of the row. Choose this pair of people, removing all
the other people from the same group Gi and also all people that have been s anned so far.
The only people that ould separate this pair's heights were in group Gi (and they are gone);
the only people that ould separate this pair's positions were already s anned (and they are
gone too).
We are now left with N ´ 1 groups (all ex ept Gi ). Sin e ea h of them lost at most one
person, ea h one has at least N uns anned people left in the row. Repeat the s anning pro ess
from left to right, hoosing the next two people from the same group, removing this group and
Shortlisted problems  solutions 43

everyone s anned up to that point. On e again we end up with two people who are next to
ea h other in the remaining row and whose heights annot be separated by anyone else who
remains (sin e the rest of their group is gone). After pi king these 2 pairs, we still have N ´2
groups with at least N ´1 people ea h.
If we repeat the s anning pro ess a total of N times, it is easy to he k that we will end
up with 2 people from ea h group, for a total of 2N people remaining. The height order is
guaranteed by the grouping, and the s anning onstru tion from left to right guarantees that
ea h pair from a group stand next to ea h other in the nal row. We are done.

Solution 3. This is essentially the same as solution 1, but presented indu tively. The essen e
of the argument is the following lemma.

Lemma. Assume that we have N disjoint groups of at least N `1 people in ea h, all people
have distin t heights. Then one an hoose two people from ea h group so that among the
hosen people, the two tallest ones are in one group, the third and the fourth tallest ones are
in one group, . . . , and the two shortest ones are in one group.

Proof. Indu tion on N ě 1; for N “ 1, the statement is trivial.


Consider now N groups G1 , . . . , GN with at least N `1 people in ea h for N ě 2. Enumerate
the people by 1, 2, . . . , NpN ` 1q a ording to their height, say, from tallest to shortest. Find
the least s su h that two people among 1, 2, . . . , s are in one group (without loss of generality,
say this group is GN ). By the minimality of s, the two mentioned people in GN are s and some
i ă s.
Now we hoose people i and s in GN , forget about this group, and remove the people
1, 2, . . . , s from G1 , . . . , GN ´1 . Due to minimality of s again, ea h of the obtained groups
G11 , . . . , G1N ´1 ontains at least N people. By the indu tion hypothesis, one an hoose a pair
1 1
of people from ea h of G1 , . . . , GN ´1 so as to satisfy the required onditions. Sin e all these
people have numbers greater than s, addition of the pair ps, iq from GN does not violate these
requirements. l
To solve the problem, it su es now to split the row into N ontiguous groups with N `1
people in ea h and apply the Lemma to those groups.

Comment 1. One an identify ea h person with a pair of indi es pp, hq (p, h P t1, 2, . . . , N pN ` 1qu)
so that the pth personin the row (say, from left to right) is the hth tallest person in the group. Say
that pa, bq separates px1 , y1 q and px2 , y2 q whenever a is stri tly between x1 and y1 , or b is stri tly
between x2 and y2 . So the oa h wants to pi k 2N people ppi , hi qpi “ 1, 2, . . . , 2N q su h that no hosen
person separates pp1 , h1 q from pp2 , h2 q, no hosen person separates pp3 , h3 q and pp4 , h4 q, and so on.
This formulation reveals a duality between positions and heights. In that sense, solutions 1 and 2 are
dual of ea h other.

Comment 2. The number N pN ` 1q is sharp for N “ 2 and N “ 3, due to arrangements 1, 5, 3, 4, 2


and 1, 10, 6, 4, 3, 9, 5, 8, 7, 2, 11.
44 IMO 2017, Rio de Janeiro

C5. A hunter and an invisible rabbit play a game in the Eu lidean plane. The hunter's
starting point H0 oin ides with the rabbit's starting point R0 . In the nth round of the game
(n ě 1), the following happens.
(1) First the invisible rabbit moves se retly and unobserved from its urrent point Rn´1 to
some new point Rn with Rn´1 Rn “ 1.
1
(2) The hunter has a tra king devi e (e.g. dog) that returns an approximate position Rn of
1
the rabbit, so that Rn Rn ď 1.
(3) The hunter then visibly moves from point Hn´1 to a new point Hn with Hn´1 Hn “ 1.
9
Is there a strategy for the hunter that guarantees that after 10 su h rounds the distan e
between the hunter and the rabbit is below 100?
(Austria)
Answer: There is no su h strategy for the hunter. The rabbit wins".

Solution. If the answer were yes", the hunter would have a strategy that would work", no
matter how the rabbit moved or where the radar pings Rn1 appeared. We will show the opposite:
with bad lu k from the radar pings, there is no strategy for the hunter that guarantees that
9
the distan e stays below 100 in 10 rounds.

So, let dn
be the distan e between the hunter and the rabbit after n rounds. Of ourse, if
9
dn ě 100 for any n ă 10 , the rabbit has won  it just needs to move straight away from the
hunter, and the distan e will be kept at or above 100 thereon.
We will now show that, while dn ă 100, whatever given strategy the hunter follows, the
2 1
rabbit has a way of in reasing dn by at least every 200 rounds (as long as the radar pings are
2
2 4 4 6 9
lu ky enough for the rabbit). This way, dn will rea h 10 in less than 2 ¨ 10 ¨ 200 “ 4 ¨ 10 ă 10
rounds, and the rabbit wins.
Suppose the hunter is at Hn and the rabbit is at Rn . Suppose even that the rabbit reveals
its position at this moment to the hunter (this allows us to ignore all information from previous
radar pings). Let r be the line Hn Rn , and Y1 and Y2 be points whi h are 1 unit away from r
and 200 units away from Rn , as in the gure below.

Y1

200 y 1
r dn 200 − dn ε
Hn Rn H ′ Z R′

200 y 1

Y2

The rabbit's plan is simply to hoose one of the points Y1 or Y2 and hop 200 rounds straight
towards it. Sin e all hops stay within 1 distan e unit from r , it is possible that all radar pings
stay on r. In parti ular, in this ase, the hunter has no way of knowing whether the rabbit
hose Y1 or Y2 .
Looking at su h pings, what is the hunter going to do? If the hunter's strategy tells him to
1
go 200rounds straight to the right, he ends up at point H in the gure. Note that the hunter
does not have a better alternative! Indeed, after these 200 rounds he will always end up at
1
a point to the left of H . If his strategy took him to a point above r , he would end up even
further from Y2 ; and if his strategy took him below r, he would end up even further from Y1 .
In other words, no matter what strategy the hunter follows, he an never be sure his distan e
def 1 1
to the rabbit will be less than y “ H Y1 “ H Y2 after these 200 rounds.
2 1
To estimate y , we take Z as the midpoint of segment Y1 Y2 , we take R as a point 200 units
1 1 1
to the right of Rn and we dene ε “ ZR (note that H R “ dn ). Then
Shortlisted problems  solutions 45

y 2 “ 1 ` pH 1 Zq2 “ 1 ` pdn ´ εq2


where
? 1 1
ε “ 200 ´ Rn Z “ 200 ´ 2002 ´ 1 “ ? ą .
200 ` 2002 ´ 1 400
In parti ular, ε2 ` 1 “ 400ε, so

y 2 “ d2n ´ 2εdn ` ε2 ` 1 “ d2n ` εp400 ´ 2dn q.


1 2 2 1
Sin e εą 400
and we assumed dn ă 100, this shows that y ą dn ` . So, as we laimed, with this
2
2 2 1
list of radar pings, no matter what the hunter does, the rabbit might a hieve dn`200 ą dn ` .
2
The wabbit wins.

Comment 1. Many dierent versions of the solution above an be found by repla ing 200 with some
other number N for the number of hops the rabbit takes between reveals. If this is done, we have:
a 1 1
ε“N´ N2 ´ 1 ą ? ą
N ` N2 ´ 1 2N

and
ε2 ` 1 “ 2N ε,
so, as long as N ą dn , we would nd

N ´ dn
y 2 “ d2n ` εp2N ´ 2dn q ą d2n ` .
N
For example, taking N “ 101 is already enoughthe squared distan e in reases by at least 101
1
every
101 rounds, and 101 ¨ 10 “ 1.0201 ¨ 10 ă 10 rounds are enough for the rabbit. If the statement is
2 4 8 9

made sharper, some su h versions might not work any longer.

Comment 2. The original statement asked whether the distan e ould be kept under 1010 in 10100
rounds.
46 IMO 2017, Rio de Janeiro

C6. Let n ą 1 be an integer. An n ˆ n ˆ n ube is omposed of n3 unit ubes. Ea h


unit ube is painted with one olor. For ea h n ˆ n ˆ 1 box onsisting of n2 unit ubes (of any
of the three possible orientations), we onsider the set of the olors present in that box (ea h
olor is listed only on e). This way, we get 3n sets of olors, split into three groups a ording
to the orientation. It happens that for every set in any group, the same set appears in both
of the other groups. Determine, in terms of n, the maximal possible number of olors that are
present.
(Russia)
npn`1qp2n`1q
Answer: The maximal number is .
6

Solution 1. Call a nˆnˆ1 box an x-box, a y -box, or a z -box, a ording to the dire tion of
its short side. Let C be the number of olors in a valid onguration. We start with the upper
bound for C.
Let C1 , C2 , and C3 be the sets of olors whi h appear in the big ube exa tly on e, exa tly
twi e, and at least thri e, respe tively. Let Mi be the set of unit ubes whose olors are in Ci ,
and denote ni “ |Mi |.
Consider any x-box X , and let Y and Z be a y- and a z -box ontaining the same set of
olors asX does.
Claim. 4|X X M1 | ` |X X M2 | ď 3n ` 1.
Proof. We distinguish two ases.

Case 1: X X M1 ‰ ∅.
A X X M1 should appear in all three boxes X , Y , and Z , so it should lie in
ube from
X X Y X Z. X X M1 “ X X Y X Z and |X X M1 | “ 1.
Thus
Consider now the ubes in X X M2 . There are at most 2pn ´ 1q of them lying in X X Y or
X X Z (be ause the ube from X X Y X Z is in M1 ). Let a be some other ube from X X M2 .
1
Re all that there is just one other ube a sharing a olor with a. But both Y and Z should
1 1 1
ontain su h ube, so a P Y X Z (but a R X X Y X Z ). The map a ÞÑ a is learly inje tive,
so the number of ubes a we are interested in does not ex eed |pY X Zq z X| “ n ´ 1. Thus
|X XM2 | ď 2pn´1q`pn´1q “ 3pn´1q, and hen e 4|X XM1 |`|X XM2 | ď 4`3pn´1q “ 3n`1.
Case 2: X X M1 “ ∅.
In this ase, the same argument applies with several hanges. X X M2 ontains
Indeed,
at most 2n ´ 1 ubes from X X Y or X X Z . Any other ube a in X X M2 orresponds to
some a P Y X Z (possibly with a1 P X ), so there are at most n of them. All this results
1
in
|X X M2 | ď p2n ´ 1q ` n “ 3n ´ 1, whi h is even better than we need (by the assumptions of
our ase). l
Summing up the inequalities from the Claim over all x-boxes X , we obtain

4n1 ` n2 ď np3n ` 1q.

Obviously, we also have n1 ` n2 ` n3 “ n3 .


Now we are prepared to estimate C . Due to the denition of the Mi , we have ni ě i|Ci |, so

n2 n3 n1 ` n2 ` n3 4n1 ` n2 n3 3n2 ` n npn ` 1qp2n ` 1q


C ď n1 ` ` “ ` ď ` “ .
2 3 3 6 3 6 6
It remains to present an example of an appropriate oloring in the above-mentioned number
of olors. For ea h olor, we present the set of all ubes of this olor. These sets are:

1. n singletons of the form Si “ tpi, i, iqu (with 1 ď i ď n);


` ˘
2. 3 n2 doubletons of the forms Di,j 1 2
“ tpi, j, jq, pj, i, iqu, Di,j “ tpj, i, jq, pi, j, iqu, and
3
Di,j “
tpj, j, iq, pi, i, jqu (with 1 ď i ă j ď n);
Shortlisted problems  solutions 47

` ˘
3. 2 n3 triplets of the form Ti,j,k “ tpi, j, kq, pj, k, iq, pk, i, jqu (with 1ďiăj ăk ďn or
1 ď i ă k ă j ď n).

One may easily see that the ith boxes of ea h orientation ontain the same set of olors, and
that
3npn ´ 1q npn ´ 1qpn ´ 2q npn ` 1qp2n ` 1q
n` ` “
2 3 6
olors are used, as required.

Solution 2. We will approa h a new version of the original problem. In this new version, ea h
ube may have a olor, or be invisible (not both). Now we make sets of olors for ea h nˆnˆ1
box as before (where invisible" is not onsidered a olor) and group them by orientation, also
as before. Finally, we require that, for every non-empty set in any group, the same set must
appear in the other 2 groups. What is the maximum number of olors present with these new
requirements?
Let us all strange a big nˆnˆn ube whose painting s heme satises the new requirements,
and let D be the number of olors in a strange ube. Note that any ube that satises the
original requirements is also strange, so maxpDq is an upper bound for the original answer.

Claim. D ď npn`1qp2n`1q
6
.

Proof. The proof is by indu tion on n. If n “ 1, we must paint the ube with at most 1 olor.
Now, pi k a nˆnˆn strange ube A, where n ě 2. If A is ompletely invisible, D “ 0 and
we are done. Otherwise, pi k a non-empty set of olors S whi h orresponds to, say, the boxes
X, Y and Z of dierent orientations.
Now nd all ubes in A whose olors are in S and make them invisible. Sin e X , Y
and Z are now ompletely invisible, we an throw them away and fo us on the remaining
pn ´ 1q ˆ pn ´ 1q ˆ pn ´ 1q ube B . The sets of olors in all the groups for B are the same
as the sets for A, removing exa tly the olors in S , and no others! Therefore, every nonempty
set that appears in one group for B still shows up in all possible orientations (it is possible
that an empty set of olors in B only mat hed X , Y or Z before these were thrown away, but
remember we do not require empty sets to mat h anyway). In summary, B is also strange.
pn´1qnp2n´1q
By the indu tion hypothesis, we may assume that B has at most olors. Sin e
6
2 pn´1qnp2n´1q
there were at most n dierent olors in S , we have that A has at most
6
` n2 “
npn`1qp2n`1q
6
olors. l
Finally, the onstru tion in the previous solution shows a painting s heme (with no invisible
ubes) that rea hes this maximum, so we are done.
48 IMO 2017, Rio de Janeiro

C7. For any nite sets X and Y of positive integers, denote by fX pkq the k th smallest
positive integer not in X, and let

X ˚ Y “ X Y tfX pyq : y P Y u.

Let A be a set ofa ą 0 positive integers, and let B be a set of bą0 positive integers. Prove
that if A ˚ B “ B ˚ A, then

A ˚ pA ˚ ¨ ¨ ¨ ˚ pA ˚ pA ˚ Aqq . . . q “ looooooooooooooooooomooooooooooooooooooon
looooooooooooooooooomooooooooooooooooooon B ˚ pB ˚ ¨ ¨ ¨ ˚ pB ˚ pB ˚ Bqq . . . q .
A appears b times B appears a times

(U.S.A.)
Solution 1. g : Zą0 Ñ Zą0 and any subset X Ă Zą0 , we dene gpXq “
For any fun tion
tgpxq : x P Xu. We have that the image of fX is fX pZą0 q “ Zą0 z X . We now show a general
lemma about the operation ˚, with the goal of showing that ˚ is asso iative.

Lemma 1. Let X and Y be nite sets of positive integers. The fun tions fX˚Y and fX ˝ fY are
equal.

Proof. We have

fX˚Y pZą0 q “ Zą0 zpX ˚Y q “ pZą0 zXqzfX pY q “ fX pZą0 qzfX pY q “ fX pZą0 zY q “ fX pfY pZą0 qq.

Thus, the fun tions fX˚Y and fX ˝ fY are stri tly in reasing fun tions with the same range.
Be ause a stri tly fun tion is uniquely dened by its range, we have fX˚Y “ fX ˝ fY . l
Lemma 1 implies that ˚ is asso iative, in the sense that pA ˚ Bq ˚ C “ A ˚ pB ˚ Cq for any
nite sets A, B , and C of positive integers. We prove the asso iativity by noting

Zą0 z ppA ˚ Bq ˚ Cq “ fpA˚Bq˚C pZą0 q “ fA˚B pfC pZą0 qq “ fA pfB pfC pZą0 qqq

“ fA pfB˚C pZą0 q “ fA˚pB˚Cq pZą0 q “ Zą0 z pA ˚ pB ˚ Cqq.


In light of the asso iativity of ˚, we may drop the parentheses when we write expressions
like A ˚ pB ˚ Cq. We also introdu e the notation

X ˚k “ loooooooooooooooooooomoooooooooooooooooooon
X ˚ pX ˚ ¨ ¨ ¨ ˚ pX ˚ pX ˚ Xqq . . . q .
X appears k times

Our goal is then to show that A ˚ B “ B ˚ A implies A˚b “ B ˚a . We will do so via the following
general lemma.

Lemma 2. Suppose that X and Y are nite sets of positive integers satisfying X ˚Y “ Y ˚X
and |X| “ |Y |. Then, we must have X “ Y.
Proof. Assume that X and Y are not equal. Let s be the largest number in exa tly one of
X and Y. Without loss of generality, say that s P X z Y . The number fX psq ounts the sth
number not in X, whi h implies that
ˇ ˇ
fX psq “ s ` ˇX X t1, 2, . . . , fX psquˇ. (1)

Sin e fX psq ě s, we have that

( (
fX psq ` 1, fX psq ` 2, . . . X X “ fX psq ` 1, fX psq ` 2, . . . X Y,

whi h, together with the assumption that |X| “ |Y |, gives


ˇ ˇ ˇ ˇ
ˇX X t1, 2, . . . , fX psquˇ “ ˇY X t1, 2, . . . , fX psquˇ. (2)
Shortlisted problems  solutions 49

Now onsider the equation


ˇ ˇ
t ´ ˇY X t1, 2, . . . , tuˇ “ s.
“ ˘
This equation is satised only when t P fY psq, fY ps ` 1q , be ause the left hand side ounts
the number of elements up to t that are not in Y . We have that the value t “ fX psq satises
the above equation be ause of (1) and (2). Furthermore, sin e fX psq R X and fX psq ě s, we
have that fX psq R Y due to the maximality of s. Thus, by the above dis ussion, we must have
fX psq “ fY psq.
Finally, we arrive at a ontradi tion. The value fX psq is neither in X nor in fX pY q, be ause
s is not in Y by assumption. Thus, fX psq R X ˚Y . However, sin e s P X , we have fY psq P Y ˚X ,
a ontradi tion. l
˚b ˚a
We are now ready to nish the proof. Note rst of all that |A | “ ab “ |B |. Moreover,
˚b
sin e A ˚ B “ B ˚ A, and ˚ is asso iative, it follows that A ˚ B ˚a “ B ˚a ˚ A˚b . Thus, by
˚b
Lemma 2, we have A “ B ˚a , as desired.

Comment 1. Taking A “ X ˚k and B “ X ˚l generates many non-trivial examples where A˚B “ B˚A.
There are also other examples not of this form. For example, if A “ t1, 2, 4u and B “ t1, 3u, then
A ˚ B “ t1, 2, 3, 4, 6u “ B ˚ A.
Solution 2. We will use Lemma 1 from Solution 1. Additionally, let X ˚k be dened as in
Solution 1. If X and Y are nite sets, then

fX “ fY ðñ fX pZą0 q “ fY pZą0 q ðñ pZą0 z Xq “ pZą0 z Y q ðñ X “ Y, (3)

where the rst equivalen e is be ause fX and fY are stri tly in reasing fun tions, and the se ond
equivalen e is be ause fX pZą0 q “ Zą0 z X and fY pZą0 q “ Zą0 z Y .
Denote g “ fA and h “ fB . The given relation A ˚ B “ B ˚ A is equivalent to fA˚B “ fB˚A
be ause of (3), and by Lemma 1 of the rst solution, this is equivalent to g ˝h “ h˝g . Similarly,
˚b
the required relation A “ B ˚a is equivalent to g b “ ha . We will show that
g b pnq “ ha pnq (4)

for all n P Zą0 , whi h su es to solve the problem.

To start, we laim that (4) holds for all su iently large n. Indeed, let p and q be the
maximal elements of A and B , respe tively; we may assume that p ě q . Then, for every n ě p
b a
we have gpnq “ n ` a and hpnq “ n ` b, when e g pnq “ n ` ab “ h pnq, as was laimed.
b
In view of this laim, if (4) is not identi ally true, then there exists a maximal s with g psq ‰
ha psq. Without loss of generality, we may assume that gpsq ‰ s, for if we had gpsq “ hpsq “ s,
then s would satisfy (4). As g is in reasing, we then have gpsq ą s, so (4) holds for n “ gpsq.
But then we have

gpg bpsqq “ g b`1 psq “ g bpnq “ ha pnq “ ha pgpsqq “ gpha psqq,


where the last equality holds in view of g ˝ h “ h ˝ g. By the inje tivity of g, the above
b a
equality yields g psq “ h psq, whi h ontradi ts the hoi e of s. Thus, we have proved that (4)
is identi ally true on Zą0 , as desired.

Comment 2. We present another proof of Lemma 2 of the rst solution.


Let x “ |X| “ |Y |. Say that u is the smallest number in X and v is the smallest number in Y ;
assume without loss of generality that u ď v .
Let T be any nite set of positive integers, and dene t “ |T |. Enumerate the elements of X as
x1 ă x2 ă ¨ ¨ ¨ ă xn . Dene Sm “ fpT ˚X ˚pm´1q q pXq, and enumerate its elements sm,1 ă sm,2 ă ¨ ¨ ¨ ă
sm,n . Note that the Sm are pairwise disjoint; indeed, if we have m ă m1 , then
1 1 1
Sm Ă T ˚ X ˚m Ă T ˚ X ˚pm ´1q and Sm1 “ pT ˚ X ˚m q z pT ˚ X ˚pm ´1q q
We laim the following statement, whi h essentially says that the Sm are eventually linear translates
of ea h other:
50 IMO 2017, Rio de Janeiro

Claim. For every i, there exists some mi and ci su h that for all m ą mi , we have that sm,i “ t`mn´ci .
Furthermore, the ci do not depend on the hoi e of T .
First, we show that this laim implies Lemma 2. We may hoose T “ X and T “ Y . Then, there
is some m1 su h that for all m ě m1 , we have

fX ˚m pXq “ fpY ˚X ˚pm´1q q pXq. (5)

Be ause u is the minimum element of X , v is the minimum element of Y , and u ď v , we have that
˜ ¸ ˜ ¸
8
ď 8
ď
1 ` 1 ˘
fX ˚m pXq Y X ˚m “ fpY ˚X ˚pm´1q q pXq Y Y ˚ X ˚pm ´1q “ tu, u ` 1, . . . u,
m“m1 m“m1

and in both the rst and se ond expressions, the unions are of pairwise distin t sets. By (5), we obtain
1 1 1 1
X ˚m “ Y ˚ X ˚pm ´1q . Now, be ause X and Y ommute, we get X ˚m “ X ˚pm ´1q ˚ Y , and so X “ Y .
We now prove the laim.
Proof of the laim. We indu t downwards on i, rst proving the statement for i “ n, and so on.
Assume that m is hosen so that all elements of Sm are greater than all elements of T (whi h is
possible be ause T is nite). For i “ n, we have that sm,n ą sk,n for every k ă m. Thus, all pm ´ 1qn
numbers of the form sk,u for k ă m and 1 ď u ď n are less than sm,n . We then have that sm,n is the
ppm ´ 1qn ` xn qth number not in T , whi h is equal to t ` pm ´ 1qn ` xn. So we may hoose cn “ xn ´ n,
whi h does not depend on T , whi h proves the base ase for the indu tion.
For i ă n, we have again that all elements sm,j for j ă i and sp,i for p ă m are less than sm,i ,
so sm,i is the ppm ´ 1qi ` xi qth element not in T or of the form sp,j for j ą i and p ă m. But by
the indu tive hypothesis, ea h of the sequen es sp,j is eventually periodi with period n, and thus the
sequen e sm,i su h must be as well. Sin e ea h of the sequen es sp,j ´ t with j ą i eventually do not
depend on T , the sequen e sm,i ´ t eventually does not depend on T either, so the indu tive step is
omplete. This proves the laim and thus Lemma 2. l
Shortlisted problems  solutions 51

C8. Let n be a given positive integer. In the Cartesian plane, ea h latti e point with
nonnegative oordinates initially ontains a buttery, and there are no other butteries. The
neighborhood of a latti e point c onsists of all latti e points within the axis-aligned p2n ` 1q ˆ
p2n ` 1q square entered at c, apart from c itself. We all a buttery lonely, rowded, or om-
fortable, depending on whether the number of butteries in its neighborhood N is respe tively
less than, greater than, or equal to half of the number of latti e points in N.
Every minute, all lonely butteries y away simultaneously. This pro ess goes on for as
long as there are any lonely butteries. Assuming that the pro ess eventually stops, determine
the number of omfortable butteries at the nal state.
(Bulgaria)
2
Answer: n ` 1.
Solution. We always identify a buttery with the latti e point it is situated at. For two points p
and q, we write pěq if ea h oordinate of p is at least the orresponding oordinate of q. Let
O be the origin, and let Q be the set of initially o upied points, i.e., of all latti e points with
nonnegative oordinates. Let RH “ tpx, 0q : x ě 0u and RV “ tp0, yq : y ě 0u be the sets of
the latti e points lying on the horizontal and verti al boundary rays of Q. Denote by Npaq the
neighborhood of a latti e point a.
1. Initial observations. We all a set of latti e points up-right losed if its points stay in the
set after being shifted by any latti e ve tor pi, jq with i, j ě 0. Whenever the butteries form a
up-right losed set S , we have |Nppq X S| ě |Npqq X S| for any two points p, q P S with p ě q .
So, sin e Q is up-right losed, the set of butteries at any moment also preserves this property.
We assume all forth oming sets of latti e points to be up-right losed.
When speaking of some set S of latti e points, we all its points lonely, omfortable, or
rowded with respe t to this set (i.e., as if the butteries were exa tly at all points of S ). We
all a set S Ă Q stable if it ontains no lonely points. In what follows, we are interested only
in those stable sets whose omplements in Q are nite, be ause one an easily see that only a
nite number of butteries an y away on ea h minute.
If the initial set Q of butteries ontains some stable set S, then, learly no buttery of
this set will y away. On the other hand, the set F of all butteries in the end of the pro ess
is stable. This means that F is the largest (with respe t to in lusion) stable set within Q, and
we are about to des ribe this set.

2. A des ription of a nal set. The following notion will be useful. Let U “ t~u1 , ~u2, . . . , ~ud u
be a set of d pairwise non-parallel latti e ve tors, ea h having a positive x- and a negative
y- oordinate. Assume that they are numbered in in reasing order a ording to slope. We now
dene a U - urve to be the broken line p0 p1 . . . pd su h that p0 P RV , pd P RH , and
Ý
pÝ ÝÑ ui
i´1 pi “ ~
for all i “ 1, 2, . . . , m (see the Figure below to the left).

~u~u44444
pp00000
~u1
O
~u~u22222 ~u pp1111 d0
~u33333 Kn
−→

d1 D
D
~u1 pp2222 d2
~u2 ~v1 d3
−→
~u3 ~v~v33333
pp33333 ~v4
~u4 O pp4444 r1 r2 r3 r4 (k4 = 3)

Constru tion of U- urve Constru tion of D


52 IMO 2017, Rio de Janeiro

Now, letKn “ tpi, jq : 1 ď i ď n, ´n ď j ď ´1u. Consider all the rays emerging at O and
passing through a point from Kn ; number them as r1 , . . . , rm in in reasing order a ording to
ÝÝÑ
slope. Let Ai be the farthest from O latti e point in ri X Kn , set ki “ |ri X Kn |, let ~ vi “ OAi ,
and nally denote V “ t~ vi : 1 ď i ď mu; see the Figure above to the right. We will on entrate
1
on the V - urve d0 d1 . . . dm ; let D be the set of all latti e points p su h that p ě p for some (not
1
ne essarily latti e) point p on the V - urve. In fa t, we will show that D “ F .
Clearly, the V - urve is symmetri in the line y “ x. Denote by D the onvex hull of D .

3. We prove that the set D ontains all stable sets. Let S Ă Q be a stable set (re all that
it is assumed to be up-right losed and to have a nite omplement in Q). Denote by S its
onvex hull; learly, the verti es of S are latti e points. The boundary of S onsists of two rays
(horizontal and verti al ones) along with some V˚ - urve for some set of latti e ve tors V˚ .

Claim 1. For every ~vi P V , there is a ~vi˚ P V˚ o-dire ted with ~v with |~vi˚ | ě |~v |.
Proof. Let ℓ be the supporting line of S parallel to ~vi (i.e., ℓ ontains some point of S , and
the set S lies on one side of ℓ). Take any point b P ℓ X S and onsider Npbq. The line ℓ splits
the set Npbq z ℓ into two ongruent parts, one having an empty interse tion with S . Hen e, in
order for b not to be lonely, at least half of the set ℓ X Npbq (whi h ontains 2ki points) should
lie in S . Thus, the boundary of S ontains a segment ℓ X S with at least ki ` 1 latti e points
(in luding b) on it; this segment orresponds to the required ve tor ~ vi˚ P V˚ . l

~v1∗

~v~viiii
|| ~v2∗
b ~v1
∗∗
> k {{zz ~v~viiiii∗∗
> ~v3∗
Kn kiiii p ~v2
pooii ~v4∗
nntts
s }}
ℓ ~v3 p ′
∂S
p
~v4
∂D
Proof of Claim 1 Proof of Claim 2

Claim 2. Ea h stable set SĎQ lies in D.


Proof. To show this, it su es to prove that the V˚ - urve lies in D , i.e., that all its verti es
1 1
do so. Let p be an arbitrary vertex of the V˚ - urve; p partitions this urve into two parts, X
(being down-right of p) and Y (being up-left of p). The set V is split now into two parts: VX
onsisting of those ~vi P V for whi h ~vi˚ orresponds to a segment in X, and a similar part VY .
Noti e that the V - urve onsists of several segments orresponding to VX , followed by those
orresponding to VY . Hen e there is a vertex p of the V - urve separating VX from VY . Claim 1
now yields that p ě p, so p1 P D , as required.
1
l
Claim 2 implies that the nal set F is ontained in D.
4. D is stable, and its omfortable points are known. Re all the denitions of ri ; let ri1 be the
ray omplementary to ri . By our denitions, the set NpOq ontains no points between the rays
ri and ri`1 , as well as between ri1 and ri`1
1
.

Claim 3. In the set D, all latti e points of the V - urve are omfortable.
Proof. Let p be any latti e point of the V - urve, belonging to some segment di di`1 . Draw the
lineℓ ontaining this segment. Then ℓ X D ontains exa tly ki ` 1 latti e points, all of whi h lie
inNppq ex ept for p. Thus, exa tly half of the points in Nppq X ℓ lie in D . It remains to show
that all points of Nppq above ℓ lie in D (re all that all the points below ℓ la k this property).
Shortlisted problems  solutions 53

Noti e that ea h ve tor in V has one oordinate greater than n{2; thus the neighborhood
of p ontains parts of at most two segments of the V- urve su eeding di di`1 , as well as at most
two of those pre eding it.
The angles formed by these onse utive segments are obtained from those formed by rj and
1
rj´1 (with i ´ 1 ď j ď i ` 2) by shifts; see the Figure below. All the points in Nppq above ℓ
1 1
whi h ould lie outside D lie in shifted angles between rj , rj`1 or rj , rj´1 . But those angles,
restri ted to Nppq, have no latti e points due to the above remark. The laim is proved. l


ri−1

ri+2 di
ri+2
di+1
ri+1 p
Kn ddi+2
i+2
i+2
i+2
ri

ri−1
Proof of Claim 3

Claim 4. All the points of D whi h are not on the boundary of D are rowded.
Proof. Let p P D be su h a point. If it is to the up-right of some point p1 on the urve, then the
ÝÑ
laim is easy: the shift of p1 p is still in D , and Nppq ontains at least one more
Npp1 q X D by
point of D  either below or to the left of p. So, we may assume that p lies in a right triangle
onstru ted on some hypothenuse di di`1 . Noti e here that di , di`1 P Nppq.
Draw a line ℓ k di di`1 through p, and draw a verti al line h through di ; see Figure below.
Let DL and DR be the parts of D lying to the left and to the right of h, respe tively (points
of D X h lie in both parts).


p p
ddiiiii −→
di
di+1
ddi+1
i+1
i+1
i+1
i+1

Proof of Claim 4

ÝÑ ÝÝÝÝÝÑ ÝÝÝÑ ÝÝÝÑ ÝÝÝÑ


Noti e that the ve torsdi p, di`1 di`2 , di di`1 , di´1 di , and pdi`1 are arranged in non-in reasing
ÝÑ ÝÝÝÑ
order by slope. This means that DL shifted by di p still lies in D , as well as DR shifted by di`1 p.
As we have seen in the proof of Claim 3, these two shifts over all points of Nppq above ℓ, along
with those on ℓ to the left of p. Sin e Nppq ontains also di and di`1 , the point p is rowded.
l
Thus, we have proved that D “ F , and have shown that the latti e points on the V - urve
are exa tly the omfortable points of D . It remains to nd their number.
Re all the denition of Kn (see Figure on the rst page of the solution). Ea h segment di di`1
ontains ki latti e points dierent from di . Taken over all i, these points exhaust all the latti e
points in the V - urve, ex ept for d1 , and thus the number of latti e points on the V - urve is
ř řm
1` m i“1 ki . On the other hand, i“1 ki is just the number of points in Kn , so it equals n .
2
2
Hen e the answer to the problem is n ` 1.
54 IMO 2017, Rio de Janeiro

Comment 1. The assumption that the pro ess eventually stops is unne essary for the problem, as
one an see that, in fa t, the pro ess stops for every n ě 1. Indeed, the proof of Claims 3 and 4 do not
rely essentially on this assumption, and they together yield that the set D is stable. So, only butteries
that are not in D may y away, and this takes only a nite time.
This assumption has been inserted into the problem statement in order to avoid several te hni al
details regarding niteness issues. It may also simplify several other arguments.

Comment 2. The des ription of the nal set Fp“ Dq seems to be ru ial for the solution; the
Problem Sele tion Committee is not aware of any solution that ompletely avoids su h a des ription.
On the other hand, after the set D has been dened, the further steps may be performed in several
ways. For example, in order to prove that all butteries outside D will y away, one may argue as
follows. (Here we will also make use of the assumption that the pro ess eventually stops.)
First of all, noti e that the pro ess an be modied in the following manner: Ea h minute, exa tly
one of the lonely butteries ies away, until there are no more lonely butteries. The modied pro ess
ne essarily stops at the same state as the initial one. Indeed, one may observe, as in solution above,
that the (unique) largest stable set is still the nal set for the modied pro ess.
Thus, in order to prove our laim, it su es to indi ate an order in whi h the butteries should y
away in the new pro ess; if we are able to exhaust the whole set Q z D , we are done.
Let C0 “ d0 d1 . . . dm be the V - urve. Take its opy C and shift it downwards so that d0 omes to
some point below the origin O . Now we start moving C upwards ontinuously, until it omes ba k to its
initial position C0 . At ea h moment when C meets some latti e points, we onvin e all the butteries at
those points to y away in a ertain order. We will now show that we always have enough arguments
for butteries to do so, whi h will nish our argument for the laim..
Let C 1 “ d10 d11 . . . d1m be a position of C when it meets some butteries. We assume that all butteries
under this urrent position of C were already onvin ed enough and ied away. Consider the lowest
buttery b on C 1 . Let d1i d1i`1 be the segment it lies on; we hoose i so that b ‰ d1i`1 (this is possible
be ause C as not yet rea hed C0 ).
Draw a line ℓ ontaining the segment d1i d1i`1 . Then all the butteries in N pbq are situated on or
above ℓ; moreover, those on ℓ all lie on the segment di di`1 . But this segment now ontains at most ki
butteries (in luding b), sin e otherwise some buttery had to o upy d1i`1 whi h is impossible by the
hoi e of b. Thus, b is lonely and hen e may be onvin ed to y away.
After b has ied away, we swit h to the lowest of the remaining butteries on C 1 , and so on.
Claims 3 and 4 also allow some dierent proofs whi h are not presented here.
Shortlisted problems  solutions 55

This page is intentionally left blank


56 IMO 2017, Rio de Janeiro

Geometry
G1. ABCDE be a onvex pentagon su h that AB “ BC “ CD , =EAB “ =BCD , and
Let
=EDC “ =CBA. Prove that the perpendi ular line from E to BC and the line segments AC
and BD are on urrent.
(Italy)
Solution 1. =A, =B , =C , =D , and =E as internal
Throughout the solution, we refer to
angles of the pentagon ABCDE . Let the perpendi ular bise tors of AC and BD , whi h pass
respe tively through B and C , meet at point I . Then BD K CI and, similarly, AC K BI .
Hen e AC and BD meet at the ortho enter H of the triangle BIC , and IH K BC . It remains
to prove that E lies on the line IH or, equivalently, EI K BC .
Lines IB and IC bise t =B and =C , respe tively. Sin e IA “ IC , IB “ ID , and AB “
BC “ CD , the triangles IAB , ICB and ICD are ongruent. Hen e =IAB “ =ICB “
=C{2 “ =A{2, so the line IA bise ts =A. Similarly, the line ID bise ts =D . Finally, the
line IE bise ts =E be ause I lies on all the other four internal bise tors of the angles of the
pentagon.
The sum of the internal angles in a pentagon is 5400 , so

=E “ 5400 ´ 2=A ` 2=B.

In quadrilateral ABIE ,

1 1
=BIE “ 3600 ´ =EAB ´ =ABI ´ =AEI “ 3600 ´ =A ´ =B ´ =E
2 2
0 1 0
“ 360 ´ =A ´ =B ´ p270 ´ =A ´ =Bq
2
1
0
“ 90 ` =B “ 900 ` =IBC,
2
whi h means that EI K BC , ompleting the proof.

D
I

B T C

Solution 2. We present another proof of the fa t that E lies on line IH . Sin e all ve internal
bise tors of ABCDE meet at I, this pentagon has an ins ribed ir le with enter I. Let this
ir le tou h side BC at T .
Applying Brian hon's theorem to the (degenerate) hexagon ABT CDE we on lude that
AC , BD and ET are on urrent, so point E also lies on line IHT , ompleting the proof.
Shortlisted problems  solutions 57

Solution 3. We present yet another proof that EI K BC . In pentagon ABCDE , =E ă


0
180 ðñ =A ` =B ` =C ` =D ą 3600 . Then =A ` =B “ =C ` =D ą 1800 , so rays EA
and CB meet at a point P, and rays BC and ED meet at a point Q. Now,

=P BA “ 1800 ´ =B “ 1800 ´ =D “ =QDC

and, similarly, =P AB “ =QCD . Sin e AB “ CD , the triangles P AB and QCD are ongruent
with the same orientation. Moreover, P QE is isos eles with EP “ EQ.

A
D
I

P B C Q

In Solution 1 we have proved that triangles IAB


ICD are also ongruent with the
and
same orientation. Then we on lude that quadrilaterals P BIA and QDIC are ongruent,
whi h implies IP “ IQ. Then EI is the perpendi ular bise tor of P Q and, therefore, EI K
P Q ðñ EI K BC .

Comment. Even though all three solutions used the point I , there are solutions that do not need it.
We present an outline of su h a solution: if J is the in enter of △QCD (with P and Q as dened in
Solution 3), then a simple angle hasing shows that triangles CJD and BHC are ongruent. Then if
S is the proje tion of J onto side CD and T is the orthogonal proje tion of H onto side BC , one an
verify that
CD ` DQ ´ QC P B ` BC ` QC PQ
QT “ QC ` CT “ QC ` DS “ QC ` “ “ ,
2 2 2
so T is the midpoint of P Q, and E , H and T all lie on the perpendi ular bise tor of P Q.
58 IMO 2017, Rio de Janeiro

G2. Let R and S ir le Ω, and let t denote the tangent line to Ω at R.


be distin t points on
Point R1 R with respe t to S . A point I is hosen on the smaller ar RS of
is the ree tion of
Ω so that the ir um ir le Γ of triangle ISR1 interse ts t at two dierent points. Denote by A
1
the ommon point of Γ and t that is losest to R. Line AI meets Ω again at J . Show that JR
is tangent to Γ.
(Luxembourg)
Solution 1. In the ir lesΓ we have =JRS “ =JIS “ =AR1 S . On the other hand,
Ω and
1
sin e RA is tangent to Ω, we get =SJR “ =SRA. So the triangles ARR and SJR are similar,
and
R1 R AR1 AR1
“ “ .
RJ SR SR1
1 1 1 1
The last relation, together with =AR S “ =JRR , yields △ASR „ △R JR, hen e
1 1 1 1
=SAR “ =RR J . It follows that JR is tangent to Γ at R .

ω
A

ω
A R

I
R

I
Ω S

J

S

J R′

R′ A′
Solution 1 Solution 2

Solution 2. As in Solution 1, we noti e that =JRS “ =JIS “ =AR1 S , so we have RJ k AR1 .


Let A1
be the ree tion of A about S ; then ARA1 R1 is a parallelogram with enter S , and
1
hen e the point J lies on the line RA .
1 1 1 1
From =SR A “ =SRA “ =SJR we get that the points S, J, A , R are on y li . This
1 1 1 1 1 1
proves that =SR J “ =SA J “ =SA R “ =SAR , so JR is tangent to Γ at R .
Shortlisted problems  solutions 59

G3. Let O be the ir um enter of an a ute s alene triangle ABC . Line OA interse ts the
altitudes of ABC through B and C at P and Q, respe tively. The altitudes meet at H . Prove
that the ir um enter of triangle P QH lies on a median of triangle ABC .
(Ukraine)
AB ă AC . We have =P QH “ 900 ´
Solution. Suppose, without loss of generality, that
0 1
=QAB “ 90 ´ =OAB “ 2 =AOB “ =ACB , and similarly =QP H “ =ABC . Thus triangles
ABC and HP Q are similar. Let Ω and ω be the ir um ir les of ABC and HP Q, respe tively.
0
Sin e =AHP “ 90 ´ =HAC “ =ACB “ =HQP , line AH is tangent to ω .

A
A

P
P ω

H
H T O

Q
Q

C
S B
B M

Let T be the ω and let lines AT and BC meet at M . We will take advantage
enter of
of the similarity between ABC and HP Q and the fa t that AH is tangent to ω at H , with
A on line P Q. Consider the orresponding tangent AS to Ω, with S P BC . Then S and A
orrespond to ea h other in △ABC „ △HP Q, and therefore =OSM “ =OAT “ =OAM .
Hen e quadrilateral SAOM is y li , and sin e the tangent line AS is perpendi ular to AO ,
=OMS “ 1800 ´ =OAS “ 900 . This means that M is the orthogonal proje tion of O onto
BC , whi h is its midpoint. So T lies on median AM of triangle ABC .
60 IMO 2017, Rio de Janeiro

G4. In triangle ABC , let ω be the ex ir le opposite A. Let D , E , and F be the points
where ω is tangent to lines BC , CA, and AB , respe tively. The ir le AEF interse ts line BC
at P and Q. Let M be the midpoint of AD . Prove that the ir le MP Q is tangent to ω .
(Denmark)
Solution 1. Ω the ir le AEF P Q, and denote by γ the ir le P QM . Let the line
Denote by
AD meet ω T ‰ D . We will show that γ is tangent to ω at T .
again at
1
We rst prove that points P, Q, M, T are on y li . Let A be the enter of ω . Sin e
1 1 1
A E K AE and A F K AF , AA is a diameter in Ω. Let N be the midpoint of DT ; from
A1 D “ A1 T we an see that =A1 NA “ 900 and therefore N also lies on the ir le Ω. Now, from
the power of D with respe t to the ir les γ and Ω we get

DT
DP ¨ DQ “ DA ¨ DN “ 2DM ¨ “ DM ¨ DT,
2
so P, Q, M, T are on y li .
If EF k BC , then ABC is isos eles and the problem is now immediate by symmetry.
Otherwise, let the tangent line to ω
T meet line BC at point R. The tangent line segments
at
1
RD and RT have the same length, so A R is the perpendi ular bise tor of DT ; sin e ND “ NT ,
N lies on this perpendi ular bise tor.
1 2 1
In right triangle A RD , RD “ RN ¨RA “ RP ¨RQ, in whi h the last equality was obtained
2
from the power of R with respe t to Ω. Hen e RT “ RP ¨ RQ, whi h implies that RT is also
tangent to γ . Be ause RT is a ommon tangent to ω and γ , these two ir les are tangent at T .

γ M

P B D C Q R

ω
E

F N

A

Solution 2. After proving that P, Q, M, T are on y li , we nish the problem in a dierent


fashion. We only onsider the ase in whi h EF and BC are not parallel. Let lines P Q and
EF meet at point R. Sin e P Q and EF are radi al axes of Ω, γ and ω, γ , respe tively, R is the
radi al enter of these three ir les.
With respe t to the ir le ω,
DR is the polar of D , and the line EF is the polar
the line
of A. So the pole of line ADT is DR X EF “ R, and therefore RT is tangent to ω .
Finally, sin e T belongs to γ and ω and R is the radi al enter of γ , ω and Ω, line RT is
the radi al axis of γ and ω , and sin e it is tangent to ω , it is also tangent to γ . Be ause RT is
a ommon tangent to ω and γ , these two ir les are tangent at T .

Comment. In Solution 2 we dened the point R from Solution 1 in a dierent way.


Shortlisted problems  solutions 61

Solution 3. We give an alternative proof that the ir les are tangent at the ommon point T.
Again, we start from the fa t that P, Q, M, T are on y li . Let point O be the midpoint of
1 1 1 1
diameter AA . Then MO is the midline of triangle ADA , so MO k A D . Sin e A D K P Q,
MO is perpendi ular to PQ as well.
Looking at ir le Ω, whi h has enter O , MO K P Q implies that MO is the perpendi ular
bise tor of the hord P Q. Thus M is the midpoint of ar Ŋ
P Q from γ , and the tangent line m
to γ at M is parallel to P Q.


m
γ M

P B O D C Q

ω E

F N

A

TD
Consider the homothety with enter T . It takes D to M , and the line P Q
and ratio
TM
to the line m. Sin e the ir le that is tangent to a line at a given point and that goes through
another given point is unique, this homothety also takes ω (tangent to P Q and going through T )
to γ (tangent to m and going through T ). We on lude that ω and γ are tangent at T .
62 IMO 2017, Rio de Janeiro

G5. ABCC1 B1 A1 be a onvex hexagon su h that AB “ BC , and suppose that the line
Let
segments AA1 , BB1 , and CC1 have the same perpendi ular bise tor. Let the diagonals AC1
and A1 C meet at D , and denote by ω the ir le ABC . Let ω interse t the ir le A1 BC1 again
at E ‰ B . Prove that the lines BB1 and DE interse t on ω .
(Ukraine)
Solution 1. AA1 “ CC1 , then the hexagon is symmetri about the line BB1 ; in par-
If
ti ular the ir les ABC and A1 BC1 are tangent to ea h other. So AA1 and CC1 must be
dierent. Sin e the points A and A1 an be inter hanged with C and C1 , respe tively, we may
assume AA1 ă CC1 .
Let R be the radi al enter of the ir les AEBC and A1 EBC1 , and the ir um ir le of the
symmetri trapezoid ACC1 A1 ; that is the ommon point of the pairwise radi al axes AC , A1 C1 ,
and BE . By the symmetry of AC and A1 C1 , the point R lies on the ommon perpendi ular
bise tor of AA1 and CC1 , whi h is the external bise tor of =ADC .
Let F be the se ond interse tion of the line DR and the ir le ACD . From the power of
R with respe t to the ir les ω and ACF D we have RB ¨ RE “ RA ¨ RC “ RD ¨ DF , so the
points B, E, D and F are on y li .
The line RDF is the external bise tor of =ADC , so the point F bise ts the ar CDA Ŕ.
By AB “ BC , on ir le ω , the point B is the midpoint of ar AEC Ő ; let M be the point
Ŋ of ω . Noti e that the
diametri ally opposite to B , that is the midpoint of the opposite ar CA
points B , F and M lie on the perpendi ular bise tor of AC , so they are ollinear.

A A1
E

D
B X B1

ω
C1
C

Finally, let X be the se ond interse tion point of ω and the line DE . Sin e BM is a diameter
in ω, we have =BXM “ 900 . Moreover,

=EXM “ 1800 ´ =MBE “ 1800 ´ =F BE “ =EDF ,

so MX and F D are parallel. Sin e BX is perpendi ular to MX and BB1 is perpendi ular
to F D , this shows that X lies on line BB1 .
Shortlisted problems  solutions 63

Solution 2. Dene point M as the point opposite to B on ir le ω , and point R as the


interse tion of lines AC , A1 C1 and BE , and show that R lies on the external bise tor of
=ADC , like in the rst solution.
Sin e B is the midpoint of the ar Ő,
AECBER is the external bise tor of =CEA.
the line
Now we show that the internal angle bise tors of =ADC and =CEA meet on the segment AC .
Let the angle bise tor of =ADC meet AC at S , and let the angle bise tor of =CEA, whi h is
1
line EM , meet AC at S . By applying the angle bise tor theorem to both internal and external
bise tors of =ADC and =CEA,

AS : CS “ AD : CD “ AR : CR “ AE : CE “ AS 1 : CS 1 ,

so indeed S “ S 1.
By =RDS “ =SER “ 900 the points R, S , D and E are on y li .

A A1
E

D
B S = S′ B1
X

ω C1
C
M

Now let the linesBB1 and DE meet at point X . Noti e that =EXB “ =EDS be ause both
BB1 and DS are perpendi ular to the line DR, we have that =EDS “ =ERS in ir le SRDE ,
and =ERS “ =EMB be ause SR K BM and ER K ME . Therefore, =EXB “ =EMB , so
indeed, the point X lies on ω .
64 IMO 2017, Rio de Janeiro

G6. Let ně3 be an integer. Two regular n-gons A and B are given in the plane. Prove
that the verti es of A that lie inside B or on its boundary are onse utive.

(That is, prove that there exists a line separating those verti es of A that lie inside B or on
its boundary from the other verti es of A.)
(Cze h Republi )
Solution 1. In both solutions, by a polygon we always mean its interior together with its
boundary.

We start with nding a regular n-gon C whi h piq is ins ribed into B (that is, all verti es
of C lie on the perimeter of B); and piiq is either a translation of A, or a homotheti image of A
with a positive fa tor.

Su h a polygon may be onstru ted as follows. Let O be the enters of A and B,


OA and
ÝÝÝÑ B
respe tively, and let A be an arbitrary vertex of A. Let OB C be the ve tor o-dire tional
ÝÝÝÑ
to OA A, with C lying on the perimeter of B . The rotations of C around OB by multiples
of 2π{n form the required polygon. Indeed, it is regular, ins ribed into B (due to the rotational
ÝÝÝÑ ÝÝÝÑ
symmetry of B ), and nally the translation/homothety mapping OA A to OB C maps A to C .

Now we separate two ases.


BT
C1
A A1

C C2
A22222
A

BR A
OA
OB BL
C C
A
A3333
A C3
B BB
Constru tion of C Case 1: Translation

Case 1: C is a translation of A by a ve tor ~v .


Denote by t the translation transform by ve tor ~v . We need to prove that the verti es of C
whi h stay in B under t are onse utive. To visualize the argument, we refer the plane to Carte-
sian oordinates so that the x-axis is o-dire tional with ~ v . This way, the notions of right/left
and top/bottom are also introdu ed, a ording to the x- and y - oordinates, respe tively.

Let BT and BB be the top and the bottom verti es of B (if several verti es are extremal, we
take the rightmost of them). They split the perimeter of B into the right part BR and the left
part BL (the verti es BT and BB are assumed to lie in both parts); ea h part forms a onne ted
subset of the perimeter of B . So the verti es of C are also split into two parts CL Ă BL and
CR Ă BR , ea h of whi h onsists of onse utive verti es.
Now, all the points in BR (and hen e in CR ) move out from B under t, sin e they are
the rightmost points of B on the orresponding horizontal lines. It remains to prove that the
verti es of CL whi h stay in B under t are onse utive.

For this purpose, let C1 , C2 , and C3 be three verti es in CL su h that C2 is between C1


and C3 , and tpC1 q and tpC3 q lie in B ; we need to prove that tpC2 q P B as well. Let Ai “ tpCi q.
The line through C2 parallel to ~ v rosses the segment C1 C3 to the right of C2 ; this means that
this line rosses A1 A3 to the right of A2 , so A2 lies inside the triangle A1 C2 A3 whi h is ontained
in B . This yields the desired result.

Case 2: C is a homotheti image of A entered at X with fa tor k ą 0.


Shortlisted problems  solutions 65

Denote by h the homothety mapping C to A. We need now to prove that the verti es of C
whi h stay in B after applying h are onse utive. If X P B , the laim is easy. Indeed, if k ă 1,
then the verti es of A lie on the segments of the form XC (C being a vertex of C ) whi h lie
in B . If k ą 1, then the verti es of A lie on the extensions of su h segments XC beyond C ,
and almost all these extensions lie outside B . The ex eptions may o ur only in ase when X
lies on the boundary of B , and they may ause one or two verti es of A stay on the boundary
of B . But even in this ase those verti es are still onse utive.
So, from now on we assume that X R B .

Now, there are two verti es BT and BB of B su h that B is =BT XBB ;


ontained in the angle
if there are several options, say, for BT , then we hoose the farthest one from X if k ą 1, and the
nearest one if k ă 1. For the visualization purposes, we refer the plane to Cartesian oordinates
ÝÝÝÝÑ
so that the y -axis is o-dire tional with BB BT , and X lies to the left of the line BT BB . Again,
the perimeter of B is split by BT and BB into the right part BR and the left part BL , and the
set of verti es of C is split into two subsets CR Ă BR and CL Ă BL .

BT

A1
C11111
C
B
C
A
A22222
C22222
C
X BR
A3 C
C33333
C
X BB A
X
Case 2, X inside B Sub ase 2.1: ką1
Sub ase 2.1: k ą 1.
In this sub ase, all points from BR (and hen e from CR ) move out from B under h, be ause
they are the farthest points of B on the orresponding rays emanated from X. It remains to
prove that the verti es of CL whi h stay in B under h are onse utive.
Again, let C1 , C2 , C3 be three verti es in CL su h that C2 is between C1 and C3 , and hpC1 q
and hpC3 q lie in B . Let Ai “ hpCi q. Then the ray XC2 rosses the segment C1 C3 beyond C2 ,
so this ray rosses A1 A3 beyond A2 ; this implies that A2 lies in the triangle A1 C2 A3 , whi h is
ontained in B .
BT C3333
C
A3

C22222
C
A
A22222
X
A BR

A
A11111 C

BB C11111
C
Sub ase 2.2: kă1
Sub ase 2.2: k ă 1.
This ase is ompletely similar to the previous one. All points from BL (and hen e from CL
move out from B under h, be ause they are the nearest points of B on the orresponding
66 IMO 2017, Rio de Janeiro

rays emanated from X . Assume that C1 , C2 , and C3 are three verti es in CR su h that C2
lies between C1 and C3 , and hpC1 q and hpC3 q lie in B ; let Ai “ hpCi q. Then A2 lies on
the segment XC2 , and the segments XA2 and A1 A3 ross ea h other. Thus A2 lies in the
triangle A1 C2 A3 , whi h is ontained in B .

Comment 1. In fa t, Case 1 an be redu ed to Case 2 via the following argument.


Assume that A and C are ongruent. Apply to A a homothety entered at OB with a fa tor slightly
smaller than 1 to obtain a polygon A1 . With appropriately hosen fa tor, the verti es of A whi h were
outside/inside B stay outside/inside it, so it su es to prove our laim for A1 instead of A. And now,
the polygon A1 is a homotheti image of C , so the arguments from Case 2 apply.

Comment 2. After the polygon C has been found, the rest of the solution uses only the onvexity of
the polygons, instead of regularity. Thus, it proves a more general statement:
Assume that A, B , and C are three onvex polygons in the plane su h that C is ins ribed into B ,
and A an be obtained from it via either translation or positive homothety. Then the verti es of A that
lie inside B or on its boundary are onse utive.
Solution 2. Let OA and OB be the enters of A and B, respe tively. Denote rns “ t1, 2, . . . , nu.
We start with introdu ing appropriate enumerations and notations. Enumerate the sidelines
of B ℓ1 , ℓ2 , . . . , ℓn . Denote by Hi the half-plane of ℓi that ontains B (Hi is assumed
lo kwise as
Ñ
Ý ÝÝÝÑ
to ontain ℓi ); by Bi the midpoint of the side belonging to ℓi ; and nally denote bi “ Bi OB .
(As usual, the numbering is y li modulo n, so ℓn`i “ ℓi et .)
ÝÝÝÑ
Now, hoose a vertex A1 of A su h that the ve tor OA A1 points mostly outside H1 ;
ÝÝÝÑ Ñ Ý
stri tly speaking, this means that the s alar produ t xOA A1 , b1 y is minimal. Starting from A1 ,
enumerate the verti es of A lo kwise as A1 , A2 , . . . , An ; by the rotational symmetry, the hoi e
ÝÝÝÑ
of A1 yields that the ve tor OA Ai points mostly outside Hi , i.e.,
ÝÝÝÑ Ñ Ý ÝÝÝÑ Ñ Ý
xOA Ai , bi y “ minxOA Aj , bi y. (1)
jPrns

ℓ2
ℓ3
B1 B2


b1
ℓ1 A1 A2


b2 B3
Bn −
→ A3
H11111
H b3


An bn
A OB
B OA
Enumerations and notations
We intend to reformulate the problem in more ombinatorial terms, for whi h purpose we
introdu e the following notion. Say that a subset I Ď rns is onne ted if the elements of this
set are onse utive in the y li order (in other words, if we join ea h i with i ` 1 mod n by an
edge, this subset is onne ted in the usual graph sense). Clearly, the union of two onne ted
subsets sharing at least one element is onne ted too. Next, for any half-plane H the indi es
of verti es of, say, A that lie in H form a onne ted set.

To a ess the problem, we denote

M “ tj P rns : Aj R Bu, Mi “ tj P rns : Aj R Hi u for i P rns.


We need to prove that rns Ş
z M is onne ted, whi h Ť
is equivalent to M being onne ted. On
the other hand, sin e B “ iPrns Hi , we have M “ iPrns Mi , where the sets Mi are easier to
investigate. We will utilize the following properties of these sets; the rst one holds by the
denition of Mi , along with the above remark.
Shortlisted problems  solutions 67

M2 = {1, 2, 3}

A
A22222
A11111
A A33333
A
ℓ2 M3 = {3, 4}
A
A44444
M1 = {n, 1, 2}
ℓℓ33333
AAnnnnn
ℓ1 B
B A
A

A55555
A
The sets Mi

Property 1: Ea h set Mi is onne ted. l


Property 2: If Mi is nonempty, then i P Mi .
Proof. Indeed, we have

ÝÝÝÑ Ñ Ý ÝÝÝÑ Ñ Ý ÝÝÝÑ Ñ Ý


j P Mi ðñ Aj R Hi ðñ xBi Aj , bi y ă 0 ðñ xOA Aj , bi y ă xOA Bi , bi y. (2)

The right-hand part of the last inequality does not depend on j. Therefore, if some j lies in Mi ,
then by (1) so does i. l
In view of Property 2, it is useful to dene the set

M 1 “ ti P rns : i P Mi u “ ti P rns : Mi ‰ ∅u.

Property 3: The set M 1 is onne ted.


Proof. To prove this property, we pro eed on with the investigation started in (2) to write

Ý
ÝÝ Ñ Ñ Ý ÝÝÝÝÑ Ñ Ý ÝÝÝÑ Ñ Ý ÝÝÝÑ Ñ Ý
i P M 1 ðñ Ai P Mi ðñ xBi Ai , bi y ă 0 ðñ xOB OA , bi y ă xOB Bi , bi y ` xAi OA , bi y.

The right-hand part of the obtained inequality does not depend on i, due to the rotational
1 ÝÝÝÝÑ Ñ Ý
symmetry; denote its onstant value by µ. Thus, i P M if and only if xOB OA , bi y ă µ. This
ondition is in turn equivalent to the fa t that Bi lies in a ertain (open) half-plane whose
boundary line is orthogonal to OB OA ; thus, it denes a onne ted set. l
Now we an nish the solution. Sin e M1 Ď M, we have
ď ď
M“ Mi “ M 1 Y Mi ,
iPrns iPrns

so M an be obtained from M 1 by adding all the sets Mi one by one. All these sets are
1
onne ted, and ea h nonempty Mi ontains an element of M (namely, i). Thus their union is
also onne ted.

Comment 3. Here we present a way in whi h one an ome up with a solution like the one above.
Assume, for sake of simpli ity, that OA lies inside B . Let us rst put onto the plane a very small
regular n-gon A1 entered at OA and aligned with A; all its verti es lie inside B . Now we start blowing
it up, looking at the order in whi h the verti es leave B . To go out of B , a vertex should ross a ertain
side of B (whi h is hard to des ribe), or, equivalently, to ross at least one sideline of B  and this
event is easier to des ribe. Indeed, the rst vertex of A1 to ross ℓi is the vertex A1i ( orresponding to Ai
ÝÝÝÑ ÝÑ
in A); more generally, the verti es A1j ross ℓi in su h an order that the s alar produ t xOA Aj , bi y does
not in rease. For dierent indi es i, these orders are just y li shifts of ea h other; and this provides
some intuition for the notions and laims from Solution 2.
68 IMO 2017, Rio de Janeiro

G7. A ABCD has an ins ribed ir le with enter I . Let Ia , Ib , Ic ,


onvex quadrilateral
and Id be the in enters of the triangles DAB , ABC , BCD , and CDA, respe tively. Suppose
that the ommon external tangents of the ir les AIb Id and CIb Id meet at X , and the ommon
0
external tangents of the ir les BIa Ic and DIa Ic meet at Y . Prove that =XIY “ 90 .
(Kazakhstan)
Solution. Denote by ωa , ωb , ωc and ωd the ir les AIb Id , BIa Ic , CIb Id , and DIa Ic , let their
enters be Oa , Ob , Oc and Od , and let their radii be ra , rb , rc and rd , respe tively.

Claim 1. Ib Id K AC and Ia Ic K BD.


Proof. Let the in ir les of triangles ABC and ACD be tangent to the line AC at T and T 1 ,
AB`AC´BC 1
respe tively. (See the gure to the left.) We have AT “ in triangle ABC , AT “
2
AD`AC´CD
in triangle ACD , and AB ´ BC “ AD ´ CD in quadrilateral ABCD , so
2

AC ` AB ´ BC AC ` AD ´ CD
AT “ “ “ AT 1 .
2 2
This shows T “ T 1. As an immediate onsequen e, Ib Id K AC .
The se ond statement an be shown analogously. l
D D

Id ωa Id

I
Oa
T′ T
A T C A C
Ib Ib
B B

Claim 2. The points Oa , Ob , Oc and Od lie on the lines AI , BI , CI and DI , respe tively.

Proof. By symmetry it su es to prove the Oa . (See the gure to the right above.)
laim for
Noti e rst that the in ir les of triangles ABC and ACD an be obtained from the in ir le of
the quadrilateral ABCD with homothety enters B and D , respe tively, and homothety fa tors
less than 1, therefore the points Ib and Id lie on the line segments BI and DI , respe tively.
As is well-known, in every triangle the altitude and the diameter of the ir um ir le starting
from the same vertex are symmetri about the angle bise tor. By Claim 1, in triangle AId Ib ,
the segment AT is the altitude starting from A. Sin e the foot T lies inside the segment
Ib Id , the ir um enter Oa of triangle AId Ib lies in the angle domain Ib AId in su h a way that
=Ib AT “ =Oa AId . The points Ib and Id are the in enters of triangles ABC and ACD , so the
lines AIb and AId bise t the angles =BAC and =CAD , respe tively. Then

=Oa AD “ =Oa AId ` =Id AD “ =Ib AT ` =Id AD “ 21 =BAC ` 21 =CAD “ 12 =BAD,

so Oa lies on the angle bise tor of =BAD , that is, on lineAI . l


The point X is the external similitude enter of ωa and ωc ; let U be their internal similitude
enter. The points Oa and Oc lie on the perpendi ular bise tor of the ommon hord Ib Id of ωa
and ωc , and the two similitude enters X and U lie on the same line; by Claim 2, that line is
parallel to AC .
Shortlisted problems  solutions 69

ωc

ωa
Id
I

Oa W U Oc
X

A C
Ib

Y
From the similarity of the ωa and ωc , from Oa Ib “ Oa Id “ Oa A “ ra
ir les and O c Ib “
O c Id “ O c C “ rc , and from AC k Oa Oc we an see that

Oa X Oa U ra O a Ib O a Id Oa A Oa I
“ “ “ “ “ “ .
Oc X Oc U rc O c Ib O c Id Oc C Oc I
So the points X, U, Ib , Id , I lie on the Apollonius ir le of the points Oa , Oc with ratio ra : rc . In
this Apollonius ir le XU is a diameter, and the lines IU and IX are respe tively the internal
and external bise tors of =Oa IOc “ =AIC , a ording to the angle bise tor theorem. Moreover,
in the Apollonius ir le the diameter UX is the perpendi ular bise tor of Ib Id , so the lines IX
and IU are the internal and external bise tors of =Ib IId “ =BID , respe tively.
Repeating the same argument for the points B, D instead of A, C , we get that the line IY is
the internal bise tor of =AIC and the external bise tor of =BID . Therefore, the lines IX and
IY respe tively are the internal and external bise tors of =BID , so they are perpendi ular.

Comment. In fa t the points Oa , Ob , Oc and Od lie on the line segments AI , BI , CI and DI ,


respe tively. For the point Oa this an be shown for example by =Id Oa A ` =AOa Ib “ p1800 ´
2=Oa AId q`p1800 ´2=Ib AOa q “ 360˝ ´=BAD “ =ADI `=DIA`=AIB `=IBA ą =Id IA`=AIIb .
The solution also shows that the line IY passes through the point U , and analogously, IX passes
through the internal similitude enter of ωb and ωd .
70 IMO 2017, Rio de Janeiro

G8. There are 2017 mutually external ir les drawn on a bla kboard, su h that no two are
tangent and no three share a ommon tangent. A tangent segment is a line segment that is
a ommon tangent to two ir les, starting at one tangent point and ending at the other one.
Lu iano is drawing tangent segments on the bla kboard, one at a time, so that no tangent
segment interse ts any other ir les or previously drawn tangent segments. Lu iano keeps
drawing tangent segments until no more an be drawn. Find all possible numbers of tangent
segments when he stops drawing.
(Australia)
Answer: If there were n ir les, there would always be exa tly 3pn ´ 1q segments; so the only
possible answer is 3 ¨ 2017 ´ 3 “ 6048.
Solution 1. First, onsider a parti ular arrangement of ir les C1 , C2 , . . . , Cn where all the
enters are aligned and ea h Ci is e lipsed from the other ir les by its neighbors  for example,
2
taking Ci with enter pi , 0q and radius i{2 works. Then the only tangent segments that an
be drawn are between adja ent ir les Ci and Ci`1 , and exa tly three segments an be drawn
for ea h pair. So Lu iano will draw exa tly 3pn ´ 1q segments in this ase.

C3 C4 C5
C1 C2

For the general ase, start from a nal onguration (that is, an arrangement of ir les
and segments in whi h no further segments an be drawn). The idea of the solution is to
ontinuously resize and move the ir les around the plane, one by one (in parti ular, making
sure we never have 4 ir les with a ommon tangent line), and show that the number of segments
drawn remains onstant as the pi ture hanges. This way, we an redu e any ir le/segment
onguration to the parti ular one mentioned above, and the nal number of segments must
remain at 3n ´ 3.
Some preliminary onsiderations: look at all possible tangent segments joining any two
ir les. A segment that is tangent to a ir le A an do so in two possible orientations  it
may ome out of A in lo kwise or ounter lo kwise orientation. Two segments tou hing the
same ir le with the same orientation will never interse t ea h other. Ea h pair pA, Bq of ir les
has 4 hoi es of tangent segments, whi h an be identied by their orientations  for example,
pA`, B´q would be the segment whi h omes out of A in lo kwise orientation and omes out of
B in ounter lo kwise orientation. In total, we have 2npn ´ 1q possible segments, disregarding
interse tions.
Now we pi k a ir le C and start to ontinuously move and resize it, maintaining all existing
tangent segments a ording to their identi ations, in luding those involving C. We an keep
our hoi e of tangent segments until the onguration rea hes a transition. We lose nothing if
we assume that C is kept at least ε units away from any other ir le, where ε is a positive, xed
onstant; therefore at a transition either: (1) a urrently drawn tangent segment t suddenly
be omes obstru ted; or (2) a urrently absent tangent segment t suddenly be omes unobstru ted
and available.

Claim. A transition an only o ur when three ir les C1 , C2 , C3 are tangent to a ommon line ℓ
ontaining t, in a way su h that the three tangent segments lying on ℓ (joining the three ir les
pairwise) are not obstru ted by any other ir les or tangent segments (other than C1 , C2 , C3 ).
Proof. Sin e (2) is ee tively the reverse of (1), it su es to prove the laim for (1). Suppose t
has suddenly be ome obstru ted, and let us onsider two ases.
Shortlisted problems  solutions 71

Case 1: t be omes obstru ted by a ir le

t
t
t

Ø Ø

Then the new ir le be omes the third ir le tangent to ℓ, and no other ir les or tangent
segments are obstru ting t.
Case 2: t be omes obstru ted by another tangent segment t1
When two segments t and t1 rst interse t ea h other, they must do so at a vertex of one of
1
them. But if a vertex of t rst rossed an interior point of t, the ir le asso iated to this vertex
was already blo king t (absurd), or is about to (we already took are of this in ase 1). So we
1
only have to analyze the possibility of t and t suddenly having a ommon vertex. However,
if that happens, this vertex must belong to a single ir le (remember we are keeping dierent
ir les at least ε units apart from ea h other throughout the moving/resizing pro ess), and
therefore they must have dierent orientations with respe t to that ir le.

t′
t′ t′

t
t
t
Ø Ø

Thus, at the transition moment, both t and t1 are tangent to the same ir le at a ommon
point, that is, they must be on the same line ℓ and hen e we again have three
ir les simultane-
1
ously tangent to ℓ. Also no other ir les or tangent segments are obstru ting t or t (otherwise,
they would have disappeared before this transition). l
Next, we fo us on the maximality of a onguration immediately before and after a tran-
sition, where three ir les share a ommon tangent line ℓ. Let the three ir les be C1 , C2 , C3 ,
ordered by their tangent points. The only possibly ae ted segments are the ones lying on
ℓ, namely t12 , t23 and t13 . Sin e C2 is in the middle, t12 and t23 must have dierent orienta-
tions with respe t to C2 . For C1 , t12 and t13 must have the same orientation, while for C3 , t13
and t23 must have the same orientation. The gure below summarizes the situation, showing
alternative positions for C1 (namely, C1 and C11 ) and for C3 (C3 and C31 ).

C2
C3
C1

t12 t23

C1′
C3′
72 IMO 2017, Rio de Janeiro

Now perturb the diagram slightly so the three ir les no longer have a ommon tangent,
while preserving the denition of t12 , t23 and t13 a ording to their identi ations. First note
that no other ir les or tangent segments an obstru t any of these segments. Also re all that
tangent segments joining the same ir le at the same orientation will never obstru t ea h other.
The availability of the tangent segments an now be he ked using simple diagrams.

Case 1: t13 passes through C2

C2
C3
C1

t13
t12 t23

C1′
C3′

In this ase, t13 is not available, but both t12 and t23 are.

Case 2: t13 does not pass through C2

C2
C3
C1
t12 t23

t13

C1′
C3′

Now t13 is available, but t12 and t23 obstru t ea h other, so only one an be drawn.
In any ase, exa tly 2 out of these 3 segments an be drawn. Thus the maximal number of
segments remains onstant as we move or resize the ir les, and we are done.

Solution 2. First note that all tangent segments lying on the boundary of the onvex hull of
the ir les are always drawn sin e they do not interse t anything else. Now in the nal pi ture,
aside from the n ir les, the bla kboard is divided into regions. We an onsider the pi ture
as a plane (multi-)graph G in whi h the ir les are the verti es and the tangent segments are
the edges. The idea of this solution is to nd a relation between the number of edges and the
number of regions in G; then, on e we prove that G is onne ted, we an use Euler's formula
to nish the problem.
The boundary of ea h region onsists of 1 or more (for now) simple losed urves, ea h
made of ar s and tangent segments. The segment and the ar might meet smoothly (as in Si ,
i “ 1, 2, . . . , 6 in the gure below) or not (as in P1 , P2 , P3 , P4 ; all su h points sharp orners of
the boundary). In other words, if a person walks along the border, her dire tion would suddenly
turn an angle of π at a sharp orner.
Shortlisted problems  solutions 73

S4 P2
P3
S5 S3
S2

S6
S1
P4

P1

Claim 1. The outer boundary B1 of any internal region has at least 3 sharp orners.
Proof. Let a person walk one lap along B1 in the ounter lo kwise orientation. As she does
so, she will turn lo kwise as she moves along the ir le ar s, and not turn at all when moving
along the lines. On the other hand, her total rotation after one lap is 2π in the ounter lo kwise
dire tion! Where ould she be turning ounter lo kwise? She an only do so at sharp orners,
and, even then, she turns only an angle of π there. But two sharp orners are not enough, sin e
at least one ar must be presentso she must have gone through at least 3 sharp orners. l
Claim 2. Ea h internal region is simply onne ted, that is, has only one boundary urve.
Proof. Suppose, by ontradi tion, that some region has an outer boundary B1 and inner boun-
daries B2 , B3 , . . . , Bm (m ě 2). Let P1 be one of the sharp orners of B1 .
Now onsider a ar starting at P1 and traveling ounter lo kwise along B1 . It starts in
reverse, i.e., it is initially fa ing the orner P1 . Due to the tangent onditions, the ar may travel
in a way so that its orientation only hanges when it is moving along an ar . In parti ular, this
means the ar will sometimes travel forward. For example, if the ar approa hes a sharp orner
when driving in reverse, it would ontinue travel forward after the orner, instead of making an
immediate half-turn. This way, the orientation of the ar only hanges in a lo kwise dire tion
sin e the ar always travels lo kwise around ea h ar .
Now imagine there is a laser pointer at the front of the ar, pointing dire tly ahead. Initially,
the laser endpoint hits P1 , but, as soon as the ar hits an ar , the endpoint moves lo kwise
around B1 . In fa t, the laser endpoint must move ontinuously along B1 ! Indeed, if the
endpoint ever jumped (within B1 , or from B1 to one of the inner boundaries), at the moment
of the jump the interrupted laser would be a drawable tangent segment that Lu iano missed
(see gure below for an example).

P2
P3

Car
Laser

P1
74 IMO 2017, Rio de Janeiro

Now, let P2 and P3 be the next two sharp orners the ar goes through, after P1 (the
previous lemma assures their existen e). At P2 the ar starts moving forward, and at P3 it will
P3 , the laser endpoint is at P3 itself. So while the ar
start to move in reverse again. So, at
moved ounter lo kwise between P1
P3 , the laser endpoint moved lo kwise between P1
and
and P3 . That means the laser beam itself s anned the whole region within B1 , and it should
have rossed some of the inner boundaries. l
Claim 3. Ea h region has exa tly 3 sharp orners.

Proof. Consider again the ar of the previous laim, with its laser still rmly atta hed to its
front, traveling the same way as before and going through the same onse utive sharp orners
P1 , P2 and P3 . As we have seen, as the ar goes ounter lo kwise from P1 to P3 , the laser
endpoint goes lo kwise from P1 to P3 , so together they over the whole boundary. If there
were a fourth sharp orner P4 , at some moment the laser endpoint would pass through it. But,
sin e P4 is a sharp orner, this means the ar must be on the extension of a tangent segment
going through P4 . Sin e the ar is not on that segment itself (the ar never goes through P4 ),
we would have 3 ir les with a ommon tangent line, whi h is not allowed.

P3

Laser Car

P4 P2

P1

l
r be the number of internal regions, and s be the
We are now ready to nish the solution. Let
number of tangent segments. Sin e ea h tangent segment ontributes exa tly 2 sharp orners
to the diagram, and ea h region has exa tly 3 sharp orners, we must have 2s “ 3r . Sin e the
graph orresponding to the diagram is onne ted, we an use Euler's formula n ´ s ` r “ 1 and
nd s “ 3n ´ 3 and r “ 2n ´ 2.
Shortlisted problems  solutions 75

Number Theory
N1. The sequen e a0 , a1 , a2 , . . . of positive integers satises
#? ?
an , if an is an integer
an`1 “ for every n ě 0.
an ` 3, otherwise

Determine all values of a0 ą 1 for whi h there is at least one number a su h that an “ a for
innitely many values of n.
(South Afri a)
Answer: All positive multiples of 3.
Solution. Sin e the value of an`1 only depends on the value of an , if an “ am for two dierent
indi es n and m, then the sequen e is eventually periodi . So we look for the values of a0 for
whi h the sequen e is eventually periodi .

Claim 1. If an ” ´1 pmod 3q, then, for all m ą n, am is not a perfe t square. It follows that
the sequen e is eventually stri tly in reasing, so it is not eventually periodi .

Proof. A square annot be ´1 modulo 3, so an ” ´1 pmod 3q implies that an is


ongruent to
not a square, therefore an`1 “ an ` 3 ą an . As a onsequen e, an`1 ” an ” ´1 pmod 3q, so
an`1 is not a square either. By repeating the argument, we prove that, from an on, all terms of
the sequen e are not perfe t squares and are greater than their prede essors, whi h ompletes
the proof. l
Claim 2. If an ı ´1 pmod 3q and an ą 9 then there is an index m ą n su h that am ă an .
Proof. Let t2 be the largest perfe t square whi h is less than an . Sin e an ą 9, t is at least
3. The rst square in the sequen e an , an ` 3, an ` 6, . . . will be pt ` 1q2 , pt ` 2q2 or pt ` 3q2 ,
therefore there is an index m ą n su h that am ď t ` 3 ă t2 ă an , as laimed. l
Claim 3. If an ” 0 pmod 3q, then there is an index m ą n su h that am “ 3.
Proof. First we noti e that, by the denition of the sequen e, a multiple of 3 is always followed
by another multiple of 3. If an P t3, 6, 9u the sequen e will eventually follow the periodi pattern
3, 6, 9, 3, 6, 9, . . . . If an ą 9, let j be an index su h that aj is equal to the minimum value of
the set tan`1 , an`2 , . . . u. We must have aj ď 9, otherwise we ould apply Claim 2 to aj and
get a ontradi tion on the minimality hypothesis. It follows that aj P t3, 6, 9u, and the proof is
omplete. l
Claim 4. If an ” 1 pmod 3q, then there is an index m ą n su h that am ” ´1 pmod 3q.
Proof. In the sequen e, 4 is always followed by 2 ” ´1 pmod 3q, so the laim is true for an “ 4.
If an “ 7, 10, 13, 16, 4, 2, . . . and the laim is also true. For an ě 10, we
the next terms will be
again take an index j ą n su h that aj is equal to the minimum value of the set tan`1 , an`2 , . . . u,
whi h by the denition of the sequen e onsists of non-multiples of 3. Suppose aj ” 1 pmod 3q.
Then we must have aj ď 9 by Claim 2 and the minimality of aj . It follows that aj P t4, 7u,
so am “ 2 ă aj for some m ą j , ontradi ting the minimality of aj . Therefore, we must have
aj ” ´1 pmod 3q. l
It follows from the previous laims that if a0 is a multiple of 3 the sequen e will eventually
rea h the periodi pattern 3, 6, 9, 3, 6, 9, . . . ; if a0 ” ´1 pmod 3q the sequen e will be stri tly
in reasing; and if a0 ” 1 pmod 3q the sequen e will be eventually stri tly in reasing.
So the sequen e will be eventually periodi if, and only if, a0 is a multiple of 3.
76 IMO 2017, Rio de Janeiro

N2. Let p ě 2 be a prime number. Eduardo and Fernando play the following game making
moves alternately: in ea h move, the urrent player hooses an index i in the set t0, 1, . . . , p´1u
that was not hosen before by either of the two players and then hooses an element ai of the
set t0, 1, 2, 3, 4, 5, 6, 7, 8, 9u. Eduardo has the rst move. The game ends after all the indi es
i P t0, 1, . . . , p ´ 1u have been hosen. Then the following number is omputed:

p´1
ÿ
p´1
M “ a0 ` 10 ¨ a1 ` ¨ ¨ ¨ ` 10 ¨ ap´1 “ aj ¨ 10j .
j“0

The goal of Eduardo is to make the number M divisible by p, and the goal of Fernando is to
prevent this.
Prove that Eduardo has a winning strategy.
(Moro o)
Solution. We say that a player makes the move pi, ai q if he hooses the index i and then the
element ai of the set t0, 1, 2, 3, 4, 5, 6, 7, 8, 9u in this move.
If p “ 2 or p “ 5 then Eduardo hooses i “ 0 and a0 “ 0 in the rst move, and wins, sin e,
independently of the next moves, M will be a multiple of 10.
Now assume that the prime number p does not belong to t2, 5u. Eduardo hooses i “ p ´ 1
pp´1q{2 2
and ap´1 “ 0 in the rst move. By Fermat's Little Theorem, p10 q “ 10p´1 ” 1 pmod pq,
pp´1q{2 2 pp´1q{2 pp´1q{2
so p | p10 q ´ 1 “ p10 ` 1qp10 ´ 1q. Sin e p is prime, either p | 10pp´1q{2 ` 1 or
p | 10pp´1q{2 ´ 1. Thus we have two ases:
Case a: 10pp´1q{2 ” ´1 pmod pq
In this ase, for ea h move pi, ai q of Fernando, Eduardo immediately makes the move pj, aj q “
pi ` p´1
2
, ai q, if 0 ď i ď p´3
2
, or pj, aj q “ pi ´
p´1
2
, ai q, if p´1
2
ď i ď p ´ 2. We will have 10j ” ´10i
pmod pq, and so aj ¨ 10j “ ai ¨ 10j ” ´ai ¨ 10i pmod pq. Noti e that this move by Eduardo
is always possible. Indeed, immediately before a move by Fernando, for any set of the type
tr, r ` pp ´ 1q{2u with 0 ď r ď pp ´ 3q{2, either no element of this set was hosen as an index
by the players in the previous moves or else both elements of this set were hosen as indi es by
the players in the previous moves. Therefore, after ea h of his moves, Eduardo always makes
k
the sum of the numbers ak ¨ 10 orresponding to the already hosen pairs pk, ak q divisible by
p, and thus wins the game.

Case b: 10pp´1q{2 ” 1 pmod pq


In this ase, for ea h move pi, ai q of Fernando, Eduardo immediately makes the move pj, aj q “
p´1
pi ` 2
, 9 ´ ai q, if 0 ď i ď p´3
2
, or pj, aj q “ pi ´
p´1
2
, 9 ´ ai q, if p´1
2
ď i ď p ´ 2. The same
j i
argument as above shows that Eduardo an always make su h move. We will have 10 ” 10
pmod pq, and so aj ¨ 10j ` ai ¨ 10i ” pai ` aj q ¨ 10i “ 9 ¨ 10i pmod pq. Therefore, at the end of
k
the game, the sum of all terms ak ¨ 10 will be ongruent to

p´3
ÿ
2

9 ¨ 10i “ 10pp´1q{2 ´ 1 ” 0 pmod pq,


i“0

and Eduardo wins the game.


Shortlisted problems  solutions 77

N3. Determine all integers n ě 2 with the following property: for any integers a1 , a2 , . . . , an
whose sum is not divisible by n, there exists an index 1 ď i ď n su h that none of the numbers

ai , ai ` ai`1 , . . . , ai ` ai`1 ` ¨ ¨ ¨ ` ai`n´1

is divisible by n. (We let ai “ ai´n when i ą n.)


(Thailand)
Answer: These integers are exa tly the prime numbers.

Solution. Let us rst show that, if n “ ab, with a, b ě 2 integers, then the property in the
statement of the problem does not hold. Indeed, in this ak “ a for 1 ď k ď n ´ 1 and
ase, let
an “ 0. The sum a1 ` a2 ` ¨ ¨ ¨ ` an “ a ¨ pn ´ 1q is not divisible by n. Let i with 1 ď i ď n be
an arbitrary index. Taking j “ b if 1 ď i ď n ´ b, and j “ b ` 1 if n ´ b ă i ď n, we have

ai ` ai`1 ` ¨ ¨ ¨ ` ai`j´1 “ a ¨ b “ n ” 0 pmod nq.

It follows that the given example is indeed a ounterexample to the property of the statement.

Now let n be a prime number. Suppose by ontradi tion that the property in the statement
of the problem does not hold. Then there are integers a1 , a2 , . . . , an whose sum is not divisible
by n su h that for ea h i, 1 ď i ď n, there is j , 1 ď j ď n, for whi h the number ai ` ai`1 `
¨ ¨ ¨ ` ai`j´1 is divisible by n. Noti e that, in any su h ase, we should have 1 ď j ď n ´ 1,
sin e a1 ` a2 ` ¨ ¨ ¨ ` an is not divisible by n. So we may onstru t re ursively a nite sequen e
of integers 0 “ i0 ă i1 ă i2 ă ¨ ¨ ¨ ă in with is`1 ´ is ď n ´ 1 for 0 ď s ď n ´ 1 su h that, for
0 ď s ď n ´ 1,
ais `1 ` ais `2 ` ¨ ¨ ¨ ` ais`1 ” 0 pmod nq
(where we take indi es modulo n). Indeed, for 0 ď s ă n, we apply the previous observation
to i “ is ` 1 is`1 “ is ` j .
in order to dene
In the sequen e of n ` 1 indi es i0 , i1 , i2 , . . . , in , by the pigeonhole prin iple, we have two
distin t elements whi h are ongruent modulo n. So there are indi es r, s with 0 ď r ă s ď n
su h that is ” ir pmod nq and

s´1
ÿ
air `1 ` air `2 ` ¨ ¨ ¨ ` ais “ paij `1 ` aij `2 ` ¨ ¨ ¨ ` aij`1 q ” 0 pmod nq.
j“r

Sin e is ” ir pmod nq, we have is ´ ir “ k ¨ n for some positive integer k , and, sin e ij`1 ´ ij ď
n´1 for 0 ď j ď n ´ 1, we have is ´ ir ď pn ´ 1q ¨ n, so k ď n ´ 1. But in this ase

air `1 ` air `2 ` ¨ ¨ ¨ ` ais “ k ¨ pa1 ` a2 ` ¨ ¨ ¨ ` an q

annot be a multiple of n, sin e n is prime and neither k nor a1 ` a2 ` ¨ ¨ ¨ ` an is a multiple


of n. A ontradi tion.
78 IMO 2017, Rio de Janeiro

N4. Call a rational number short if it has nitely many digits in its de imal expansion.
For a positive integer m, m-tasti if there exists a number
we say that a positive integer t is
t
10 ´ 1 10k ´ 1
c P t1, 2, 3, . . . , 2017u su h that is short, and su h that is not short for any
c¨m c¨m
1 ď k ă t. Let Spmq be the set of m-tasti numbers. Consider Spmq for m “ 1, 2, . . .. What is
the maximum number of elements in Spmq?
(Turkey)
Answer: 807.
Solution. First noti e that x P Q is short if and only if there are exponents a, b ě 0 su h that
2a ¨ 5b ¨ x P Z. x is short, then x “ 10nk for some k and we an take a “ b “ k ; on the
In fa t, if
a b 2b ¨5a q
other hand, if 2 ¨ 5 ¨ x “ q P Z then x “ , so x is short.
10a`b
a b 10t ´1 t
If m “ 2 ¨ 5 ¨ s, with gcdps, 10q “ 1, then is short if and only if s divides 10 ´ 1. So
m
we may (and will) suppose without loss of generality that gcdpm, 10q “ 1. Dene

C “ t1 ď c ď 2017 : gcdpc, 10q “ 1u.

The m-tasti numbers are then pre isely the smallest exponents t ą 0 su h that 10t ” 1
pmod cmq for some integer c P C, that is, the set of orders of 10 modulo cm. In other words,

Spmq “ tordcm p10q : c P Cu.

Sin e there are 4 ¨ 201 ` 3 “ 807 numbers c with 1 ď c ď 2017 and gcdpc, 10q “ 1, namely
those su h that c ” 1, 3, 7, 9 pmod 10q,

|Spmq| ď |C| “ 807.

Now we nd m su h that |Spmq| “ 807. Let

P “ t1 ă p ď 2017 : p is prime, p ‰ 2, 5u

and hoose a positive integer α su h that every p P P divides 10α ´ 1 (e.g. α “ ϕpT q, T being
the produ t of all primes in P ), and let m “ 10α ´ 1.
Claim. For every c P C , we have
ordcm p10q “ cα.
As an immediate onsequen e, this implies |Spmq| “ |C| “ 807, nishing the problem.

Proof. Obviously ordm p10q “ α. Let t “ ordcm p10q. Then

cm  10t ´ 1 ùñ m  10t ´ 1 ùñ α  t.

Hen e t “ kα for some k P Zą0 . We will show that k “ c.


Denote by νp pnq the number of prime fa tors p in n, that
is, the maximum exponent β for
whi h pβ  n. For every ℓ ě 1 and p P P , the Lifting the Exponent Lemma provides

νp p10ℓα ´ 1q “ νp pp10α qℓ ´ 1q “ νp p10α ´ 1q ` νp pℓq “ νp pmq ` νp pℓq,

so

cm  10kα ´ 1 ðñ @p P P ; νp pcmq ď νp p10kα ´ 1q


ðñ @p P P ; νp pmq ` νp pcq ď νp pmq ` νp pkq
ðñ @p P P ; νp pcq ď νp pkq
ðñ c  k.

The rst su h k is k “ c, so ordcm p10q “ cα. l


Shortlisted problems  solutions 79

Comment. The Lifting the Exponent Lemma states that, for any odd prime p, any integers a, b
oprime with p su h that p  a ´ b, and any positive integer exponent n,

νp pan ´ bn q “ νp pa ´ bq ` νp pnq,

and, for p “ 2,
ν2 pan ´ bn q “ ν2 pa2 ´ b2 q ` νp pnq ´ 1.
Both laims an be proved by indu tion on n.
80 IMO 2017, Rio de Janeiro

N5. Find all pairs pp, qq of prime numbers with pąq for whi h the number

pp ` qqp`q pp ´ qqp´q ´ 1
pp ` qqp´q pp ´ qqp`q ´ 1

is an integer.
(Japan)
Answer: The only su h pair is p3, 2q.
Solution. Let M “ pp ` qqp´q pp ´ qqp`q ´ 1, whi h is relatively prime with both p`q and
p ´ q . Denote by pp ´ qq´1 the multipli ative inverse of pp ´ qq modulo M .
By eliminating the term ´1 in the numerator,

pp ` qqp`q pp ´ qqp´q ´ 1 ” pp ` qqp´q pp ´ qqp`q ´ 1 pmod Mq


pp ` qq2q ” pp ´ qq2q pmod Mq (1)
´ ¯2q
pp ` qq ¨ pp ´ qq´1 ” 1 pmod Mq. (2)

Case 1: q ě 5.
Consider an arbitrary prime divisor
´ r ¯of M . Noti e that M is odd, so r ě 3. By p2q, the
´1
multipli ative order of pp ` qq ¨ pp ´ qq modulo r is a divisor of the exponent 2q in (2), so

it an be 1, 2, q or 2q .
By Fermat's theorem, the order divides r ´ 1. So, if the order is q or 2q then r ” 1 pmod qq.
2 2
If the order is 1 or 2 then r | pp ` qq ´ pp ´ qq “ 4pq , so r “ p or r “ q . The ase r “ p is not
possible, be ause, by applying Fermat's theorem,

` ˘p
M “ pp ` qqp´q pp ´ qqp`q ´ 1 ” q p´q p´qqp`q ´ 1 “ q 2 ´ 1 ” q 2 ´ 1 “ pq ` 1qpq ´ 1q pmod pq

and the last fa tors q´1 and q ` 1 are less than p and thus p ∤ M . Hen e, all prime divisors
of M are either q or of the form kq ` 1; it follows that all positive divisors of M are ongruent
to 0 or 1 modulo q .
Now noti e that
´ p´q p`q
¯´ p´q p`q
¯
M “ pp ` qq 2 pp ´ qq 2 ´ 1 pp ` qq 2 pp ´ qq 2 ` 1

is the produ t of two onse utive positive odd numbers; both should be ongruent to 0 or 1
modulo q. But this is impossible by the assumption q ě 5. So, there is no solution in Case 1.

Case 2: q “ 2.
By p1q, we have M | pp ` qq2q ´ pp ´ qq2q “ pp ` 2q4 ´ pp ´ 2q4 , so

pp ` 2qp´2 pp ´ 2qp`2 ´ 1 “ M ď pp ` 2q4 ´ pp ´ 2q4 ď pp ` 2q4 ´ 1,


pp ` 2qp´6 pp ´ 2qp`2 ď 1.

If p ě 7 then the left-hand side is obviously greater than 1. For p “ 5 we have


pp ` 2qp´6 pp ´ 2qp`2 “ 7´1 ¨ 37 whi h is also too large.
There remains only one andidate, p “ 3, whi h provides a solution:

pp ` qqp`q pp ´ qqp´q ´ 1 55 ¨ 11 ´ 1 3124


p´q p`q
“ “ “ 781.
pp ` qq pp ´ qq ´1 5 ¨1 ´1
1 5 4

So in Case 2 the only solution is pp, qq “ p3, 2q.


Shortlisted problems  solutions 81

Case 3: q “ 3.
Similarly to Case 2, we have
˜ˆ ˙6 ˆ ˙6 ¸
p`3 p´3
M | pp ` qq2q ´ pp ´ qq2q “ 64 ¨ ´ .
2 2

Sin e M is odd, we on lude that

ˆ ˙6 ˆ ˙6
p`3 p´3
M| ´
2 2

and
ˆ ˙6 ˆ ˙6 ˆ ˙6
p´3 p`3 p`3 p´3 p`3
pp ` 3q pp ´ 3q ´1“M ď ´ ď ´ 1,
2 2 2
64pp ` 3qp´9 pp ´ 3qp`3 ď 1.

Ifp ě 11 then the left-hand side is obviously greater than 1. If p “ 7 then the left-hand side is
64 ¨ 10´2 ¨ 410 ą 1. If p “ 5 then the left-hand side is 64 ¨ 8´4 ¨ 28 “ 22 ą 1. Therefore, there is
no solution in Case 3.
82 IMO 2017, Rio de Janeiro

N6. Find the smallest positive integer n, or show that no su h n exists, with the following
property: there are innitely many distin t n-tuples of positive rational numbers pa1 , a2 , . . . , an q
su h that both
1 1 1
a1 ` a2 ` ¨ ¨ ¨ ` an and ` ` ¨¨¨`
a1 a2 an
are integers.
(Singapore)
Answer: n “ 3.
1
Solution 1. For n “ 1, a1 P Zą0 and
a1
P Zą0 if and only if a1 “ 1. Next we show that

(i) There are nitely many px, yq P Q2ą0 satisfying x ` y P Z and 1


x
` 1
y
PZ
Write x “ ab and y “ dc with a, b, c, d P Zą0 and gcdpa, bq “ gcdpc, dq “ 1. Then x`y P Z
1
and
x
` y1 P Z is equivalent to the two divisibility onditions
bd | ad ` bc p1q and ac | ad ` bc p2q
Condition (1) implies that d | ad ` bc ðñ d | bc ðñ d | b sin e gcdpc, dq “ 1. Still
from (1) we get b | ad ` bc ðñ b | ad ðñ b | d sin e gcdpa, bq “ 1. From b | d and
d | b we have b “ d.
An analogous reasoning with a “ c. Hen e x “ ab “ dc “ y , i.e.,
ondition (2) shows that
2
the problem amounts to nding all x P Qą0 su h that 2x P Zą0 and P Zą0 . Letting
x
2 4
n “ 2x P Zą0 , we have that x P Zą0 ðñ n P Zą0 ðñ n “ 1, 2 or 4, and there are
1 1
nitely many solutions, namely px, yq “ p , q, p1, 1q or p2, 2q.
2 2

(ii) There are innitely many triples px, y, zq P Q2ą0 su h that x ` y ` z P Z and x1 ` y1 ` z1 P Z.
We will look for triples su h that x ` y ` z “ 1, so we may write them in the form
ˆ ˙
a b c
px, y, zq “ , , with a, b, c P Zą0
a`b`c a`b`c a`b`c
We want these to satisfy

1 1 1 a`b`c a`b`c a`b`c b`c a`c a`b


` ` “ ` ` P Z ðñ ` ` PZ
x y z a b c a b c
Fixing a “ 1, it su es to nd innitely many pairs pb, cq P Z2ą0 su h that

1 1 c b
` ` ` “ 3 ðñ b2 ` c2 ´ 3bc ` b ` c “ 0 p˚q
b c b c
To show that equation p˚q has innitely many solutions, we use Vieta jumping (also known
as root ipping ): starting with b “ 2, c “ 3, the following algorithm generates innitely
many solutions. Let c ě b, and view p˚q as a quadrati equation in b for c xed:

b2 ´ p3c ´ 1q ¨ b ` pc2 ` cq “ 0 p˚˚q


Then there exists another root b0 P Z of p˚˚q whi h satises b`b0 “ 3c´1 and b¨b0 “ c2 `c.
Sin e cěb by assumption,
c2 ` c c2 ` c
b0 “ ě ąc
b c
Hen e from the solution pb, cq we obtain another one pc, b0 q with b0 ą c, and we an then
jump again, this time with c as the variable in the quadrati p˚q. This algorithm will
generate an innite sequen e of distin t solutions, whose rst terms are

p2, 3q, p3, 6q, p6, 14q, p14, 35q, p35, 90q, p90, 234q, p234, 611q, p611, 1598q, p1598, 4182q, . . .
Shortlisted problems  solutions 83

Comment. Although not needed for solving this problem, we may also expli itly solve the re ursion
given by the Vieta jumping. Dene the sequen e pxn q as follows:

x0 “ 2, x1 “ 3 and xn`2 “ 3xn`1 ´ xn ´ 1 for n ě 0

Then the triple ˆ ˙


1 xn xn`1
px, y, zq “ , ,
1 ` xn ` xn`1 1 ` xn ` xn`1 1 ` xn ` xn`1
satises the problem onditions for all n P N. It is easy to show that xn “ F2n`1 ` 1, where Fn denotes
the n-th term of the Fibona i sequen e (F0 “ 0, F1 “ 1, and Fn`2 “ Fn`1 ` Fn for n ě 0).
Solution 2. Call the n-tuples pa1 , a2 , . . . , an q P Qną0 satisfying the onditions of the problem
statement good, and those for whi h
ˆ ˙
def 1 1 1
f pa1 , . . . , an q “ pa1 ` a2 ` ¨ ¨ ¨ ` an q ` ` ¨¨¨`
a1 a2 an

is an integer pretty. Then good n-tuples are pretty, and if pb1 , . . . , bn q is pretty then

ˆ ˙
b1 b2 bn
, ,...,
b1 ` b2 ` ¨ ¨ ¨ ` bn b1 ` b2 ` ¨ ¨ ¨ ` bn b1 ` b2 ` ¨ ¨ ¨ ` bn

is good sin e the sum of its omponents is 1, and the sum of the re ipro als of its omponents
equals f pb1 , . . . , bn q. We de lare pretty n-tuples proportional to ea h other equivalent sin e they
are pre isely those whi h give rise to the same good n-tuple. Clearly, ea h su h equivalen e lass
ontains exa tly one n-tuple of positive integers having no ommon prime divisors. Call su h
n-tuple a primitive pretty tuple. Our task is to nd innitely many primitive pretty n-tuples.
2
For n “ 1, there is learly a single primitive 1-tuple. For n “ 2, we have f pa, bq “ pa`bq
ab
,
whi h an be integral (for oprime a, b P Zą0 ) only if a “ b “ 1 (see for instan e (i) in the rst
solution).
Now we onstru t innitely many primitive pretty triples for n “ 3. Fix b, c, k P Zą0 ; we
will try to nd su ient onditions for the existen e of an a P Qą0 su h that f pa, b, cq “ k .
Write σ “ b ` c, τ “ bc. From f pa, b, cq “ k , we have that a should satisfy the quadrati
equation
a2 ¨ σ ` a ¨ pσ 2 ´ pk ´ 1qτ q ` στ “ 0 (1)

whose dis riminant is

∆ “ pσ 2 ´ pk ´ 1qτ q2 ´ 4σ 2 τ “ ppk ` 1qτ ´ σ 2 q2 ´ 4kτ 2 .

We need it to be a square of an integer, say, ∆ “ M2 for some M P Z, i.e., we want

ppk ` 1qτ ´ σ 2 q2 ´ M 2 “ 2k ¨ 2τ 2

so that it su es to set

pk ` 1qτ ´ σ 2 “ τ 2 ` k, M “ τ 2 ´ k.

The rst relation reads σ 2 “ pτ ´ 1qpk ´ τ q, so if b and c satisfy

τ ´ 1 | σ2 i.e. bc ´ 1 | pb ` cq2 (2)

σ2
then k“ τ ´1
`τ will be integral, and we nd rational solutions to (1), namely

σ b`c τ2 ´ τ bc ¨ pbc ´ 1q
a“ “ or a“ “
τ ´1 bc ´ 1 σ b`c
84 IMO 2017, Rio de Janeiro

We an now nd innitely many pairs pb, cq satisfying (2) by Vieta jumping. For example,
if we impose
pb ` cq2 “ 5 ¨ pbc ´ 1q
then all pairs pb, cq “ pvi , vi`1 q satisfy the above ondition, where

v1 “ 2, v2 “ 3, vi`2 “ 3vi`1 ´ vi for iě0

For pb, cq “ pvi , vi`1 q, one of the solutions to (1) will be a “ pb ` cq{pbc ´ 1q “ 5{pb ` cq “
5{pvi ` vi`1 q. Then the pretty triple pa, b, cq will be equivalent to the integral pretty triple

p5, vi pvi ` vi`1 q, vi`1 pvi ` vi`1 qq

After possibly dividing by 5, we obtain innitely many primitive pretty triples, as required.

Comment. There are many other innite series of pb, cq “ pvi , vi`1 q with bc ´ 1 | pb ` cq2 . Some of
them are:

v1 “ 1, v2 “ 3, vi`1 “ 6vi ´ vi´1 , pvi ` vi`1 q2 “ 8 ¨ pvi vi`1 ´ 1q;


v1 “ 1, v2 “ 2, vi`1 “ 7vi ´ vi´1 , pvi ` vi`1 q2 “ 9 ¨ pvi vi`1 ´ 1q;
v1 “ 1, v2 “ 5, vi`1 “ 7vi ´ vi´1 , pvi ` vi`1 q2 “ 9 ¨ pvi vi`1 ´ 1q

(the last two are in fa t one sequen e prolonged in two possible dire tions).
Shortlisted problems  solutions 85

N7. Say that an ordered pair of integers is an irredu ible latti e point if x and y
px, yq
are relatively prime. S of irredu ible latti e points, show that there is a
For any nite set
homogenous polynomial in two variables, f px, yq, with integer oe ients, of degree at least 1,
su h that f px, yq “ 1 for ea h px, yq in the set S .
Note: A homogenous polynomial of degree n is any nonzero polynomial of the form

f px, yq “ a0 xn ` a1 xn´1 y ` a2 xn´2 y 2 ` ¨ ¨ ¨ ` an´1 xy n´1 ` an y n .


(U.S.A.)
Solution 1. First of all, we note that nding a homogenous polynomial f px, yq su h that
f px, yq “ ˘1 is enough, be ause we then have f 2 px, yq “ 1. Label the irredu ible latti e points
px1 , y1 q through pxn , yn q. If any two of these latti e points pxi , yi q and pxj , yj q lie on the same
line through the origin, then pxj , yj q “ p´xi , ´yi q be ause both of the points are irredu ible.
We then have f pxj , yj q “ ˘f pxi , yi q whenever f is homogenous, so we an assume that no two
of the latti e points are ollinear with the origin by ignoring the extra latti e points.
Consider the homogenous polynomials ℓi px, yq “ yi x ´ xi y and dene
ź
gi px, yq “ ℓj px, yq.
j‰i

Then ℓi pxj , yj q “ 0 if and only if j “ i, be ause there is only one latti e point on ea h line
through the origin. Thus, gi pxj , yj q “ 0 for all j ‰ i. Dene ai “ gi pxi , yi q, and note that
ai ‰ 0.
Note that gi px, yq is a degree n´1 polynomial with the following two properties:

1. gi pxj , yj q “ 0 if j ‰ i.
2. gi pxi , yi q “ ai .
For any N ě n ´ 1, there also exists a polynomial of degree N with the same two proper-
ties. Spe i ally, let Ii px, yq be a degree 1 homogenous polynomial su h that Ii pxi , yi q “ 1,
whi h exists sin e pxi , yi q is irredu ible. Then Ii px, yqN ´pn´1q gi px, yq satises both of the above
properties and has degree N .
We may now redu e the problem to the following laim:

Claim: For ea h positive integer a, there is a homogenous polynomial fa px, yq, with integer
oe ients, of degree at least 1, su h that fa px, yq ” 1 pmod aq for all relatively prime px, yq.
To see that this laim solves the problem, take a to be the leastommon multiple of the
k
numbers ai (1 ď i ď n). Take fa given by the laim, hoose some power fa px, yq that has
degree at least n ´ 1, and subtra t appropriate multiples of the gi onstru ted above to obtain
the desired polynomial.
We prove the laim by fa toring a. First, if a is a power of a prime pa “ pk q, then we may
hoose either:

• fa px, yq “ pxp´1 ` y p´1qφpaq if p is odd;

• fa px, yq “ px2 ` xy ` y 2 qφpaq if p “ 2.


Now suppose a is any positive integer, and let a “ q1 q2 ¨ ¨ ¨ qk , where the qi are prime powers,
pairwise relatively prime. Let fqi be the polynomials just onstru ted, and let Fqi be powers of
these that all have the same degree. Note that
a a
Fqi px, yq ” pmod aq
qi qi
for any relatively prime x, y . By Bézout's lemma, there is an integer linear ombination of
a
the that equals 1. Thus, there is a linear ombination of the Fqi su h that Fqi px, yq ” 1
qi
pmod aq for any relatively prime px, yq; and this polynomial is homogenous be ause all the Fqi
have the same degree.
86 IMO 2017, Rio de Janeiro

Solution 2. As in the previous solution, label the irredu ible latti e points px1 , y1q, . . . , pxn , yn q
and assume without loss of generality that no two of the points are ollinear with the origin.
We indu t on n to onstru t a homogenous polynomial f px, yq su h that f pxi , yi q “ 1 for all
1 ď i ď n.
If n “ 1: Sin e x1 and y1 are relatively prime, there exist some integers c, d su h that
cx1 ` dy1 “ 1. Then f px, yq “ cx ` dy is suitable.
If n ě 2: By the indu tion hypothesis we already have a homogeneous polynomial gpx, yq
with gpx1 , y1 q “ . . . “ gpxn´1 , yn´1 q “ 1. Let j “ deg g ,

n´1
ź
gn px, yq “ pyk x ´ xk yq,
k“1

and an “ gn pxn , yn q. By assumption, an ‰ 0. Take some integers c, d su h that cxn ` dyn “ 1.


We will onstru t f px, yq in the form

f px, yq “ gpx, yqK ´ C ¨ gn px, yq ¨ pcx ` dyqL ,


where K and L are some positive integers and C is some integer. We assume that L “ Kj´n`1
so that f is homogenous.
Due to gpx1 , y1 q “ . . . “ gpxn´1 , yn´1 q “ 1 and gn px1 , y1 q “ . . . “ gn pxn´1 , yn´1 q “ 0, the
property f px1 , y1 q “ . . . “ f pxn´1 , yn´1 q “ 1 is automati ally satised with any hoi e of K, L,
and C .
Furthermore,

f pxn , yn q “ gpxn , yn qK ´ C ¨ gn pxn , yn q ¨ pcxn ` dyn qL “ gpxn , yn qK ´ Can .


If we have an exponent K gpxn , yn qK ” 1 pmod an q, then we may
su h that hoose C su h that
f pxn , yn q “ 1. We now hoose su h a K .
Consider an arbitrary prime divisor p of an . By

n´1
ź
p | an “ gn pxn , yn q “ pyk xn ´ xk yn q,
k“1

there is some 1 ď k ă n su h that xk yn ” xn yk pmod pq. We rst show that xk xn or yk yn is


relatively prime with p. This is trivial in the ase xk yn ” xn yk ı 0 pmod pq. In the other ase,
we have xk yn ” xn yk ” 0 pmod pq, If, say p | xk , then p ∤ yk be ause pxk , yk q is irredu ible, so
p | xn ; then p ∤ yn be ause pxk , yk q is irredu ible. In summary, p | xk implies p ∤ yk yn . Similarly,
p | yn implies p ∤ xk xn .
By the homogeneity of g we have the ongruen es

xdk ¨ gpxn , yn q “ gpxk xn , xk yn q ” gpxk xn , yk xn q “ xdn ¨ gpxk , yk q “ xdn pmod pq p1.1q


and

ykd ¨ gpxn , yn q “ gpyk xn , yk yn q ” gpxk yn , yk yn q “ ynd ¨ gpxk , yk q “ ynd pmod pq. p1.2q
If p ∤ xk xn , then take the pp ´ 1qst power of p1.1q; otherwise take the pp ´ 1qst power of p1.2q;
by Fermat's theorem, in both ases we get

gpxn , yn qp´1 ” 1 pmod pq.


If pα | m, then we have

α´1 pp´1q
gpxn , yn qp ” 1 pmod pα q,
whi h implies that the exponent K “ n ¨ ϕpan q, whi h is a multiple of all pα´1 pp ´ 1q, is a
suitable hoi e. (The fa tor n is added only so that Kěn and so L ą 0.)
Shortlisted problems  solutions 87

Comment. It is possible to show that there is no onstant C for whi h, given any two irredu ible
latti e points, there is some homogenous polynomial f of degree at most C with integer oe ients
that takes the value 1 on the two points. Indeed, if one of the points is p1, 0q and the other is pa, bq,
the polynomial f px, yq “ a0 xn ` a1 xn´1 y ` ¨ ¨ ¨ ` an y n should satisfy a0 “ 1, and so an ” 1 pmod bq.
If a “ 3 and b “ 2k with k ě 3, then n ě 2k´2 . If we hoose 2k´2 ą C , this gives a ontradi tion.
88 IMO 2017, Rio de Janeiro

N8. Let p be an odd prime number and Zą0 be the set of positive integers. Suppose that
a fun tion f : Zą0 ˆ Zą0 Ñ t0, 1u satises the following properties:
• f p1, 1q “ 0;

• f pa, bq ` f pb, aq “ 1 for any pair of relatively prime positive integers pa, bq not both equal
to 1;

• f pa ` b, bq “ f pa, bq for any pair of relatively prime positive integers pa, bq.
Prove that
p´1
ÿ a
f pn2 , pq ě 2p ´ 2.
n“1

(Italy)
Solution 1. Denote by Athe set of all pairs of oprime positive integers. Noti e that for
2
every pa, bq P A there exists a pair pu, vq P Z with ua ` vb “ 1. Moreover, if pu0 , v0 q is one
su h pair, then all su h pairs are of the form pu, vq “ pu0 ` kb, v0 ´ kaq, where k P Z. So there
exists a unique su h pair pu, vq with ´b{2 ă u ď b{2; we denote this pair by pu, vq “ gpa, bq.
Lemma. Let pa, bq P A and pu, vq “ gpa, bq. Then f pa, bq “ 1 ðñ u ą 0.
Proof. We indu t on a ` b. The base ase is a ` b “ 2. In this ase, we have that a “ b “ 1,
gpa, bq “ gp1, 1q “ p0, 1q and f p1, 1q “ 0, so the laim holds.
Assume now that a ` b ą 2, and so a ‰ b, sin e a and b are oprime. Two ases are possible.

Case 1: a ą b.
gpa ´ b, bq “ pu, v ` uq, sin e upa ´ bq ` pv ` uqb “ 1 and u P p´b{2, b{2s.
Noti e that Thus
f pa, bq “ 1 ðñ f pa ´ b, bq “ 1 ðñ u ą 0 by the indu tion hypothesis.
Case 2: a ă b. (Then, learly, b ě 2.)
Now we estimate v. Sin e vb “ 1 ´ ua, we have

ab ab 1`a 1 a 1 a a
1` ą vb ě 1 ´ , so ě ` ąvě ´ ą´ .
2 2 2 b 2 b 2 2
Thus 1 ` a ą 2v ą ´a, so a ě 2v ą ´a, hen e a{2 ě v ą ´a{2, and thus gpb, aq “ pv, uq.
Observe that f pa, bq “ 1 ðñ f pb, aq “ 0 ðñ f pb ´ a, aq “ 0. We know from Case 1
that gpb ´ a, aq “ pv, u ` vq. We have f pb ´ a, aq “ 0 ðñ v ď 0 by the indu tive hypothesis.
Then, sin e b ą a ě 1 and ua ` vb “ 1, we have v ď 0 ðñ u ą 0, and we are done. l
The Lemma proves that, for all pa, bq P A, f pa, bq “ 1 if and only if the inverse of a
modulo b, taken in t1, 2, . . . , b ´ 1u, is at most b{2. Then, for any odd prime p and integer
n su h that n ı 0 pmod pq, f pn2 , pq “ 1 i the inverse of n2 mod p is less than p{2. Sin e
tn2 mod p : 1 ď n ď p ´ 1u “ tn´2 mod p : 1 ď n ď p ´ 1u, in luding multipli ities (two for
ea h quadrati residue in ea h set), we on lude that the desired sum is twi e the number of
quadrati residues that are less than p{2, i.e.,

p´1 ˇ" *ˇ
ÿ ˇ p´1 p ˇˇ
f pn , pq “ 2 ˇˇ k : 1 ď k ď
2
and
2
k mod p ă . (1)
n“1
2 2 ˇ
a a
Sin e the number of perfe t squares in the interval r1, p{2q is t p{2u ą p{2 ´ 1, we
on lude that
p´1
ÿ ˆc ˙
2 p a
f pn , pq ą 2 ´1 “ 2p ´ 2.
n“1
2
Shortlisted problems  solutions 89

Solution 2. We provide a dierent proof for the Lemma. For this purpose, we use ontinued
fra tions to nd gpa, bq “ pu, vq expli itly.
The fun tion f is ompletely determined on A by the following

Claim. Represent a{b as a ontinued fra tion; that is, let a0 be an integer and a1 , . . . , ak be
positive integers su h that ak ě 2 and

a 1
“ a0 ` “ ra0 ; a1 , a2 , . . . , ak s.
b 1
a1 `
1
a2 `
1
¨¨¨`
ak
Then f pa, bq “ 0 ðñ k is even.
Proof. We indu t on b. If b “ 1, then a{b “ ras and k “ 0. Then, for a ě 1, an easy indu tion
shows that f pa, 1q “ f p1, 1q “ 0.
Now onsider the ase b ą 1. Perform the Eu lidean division a “ qb ` r , with 0 ď r ă b.
We have r ‰ 0 be ause gcdpa, bq “ 1. Hen e

a b
f pa, bq “ f pr, bq “ 1 ´ f pb, rq, “ rq; a1 , . . . , ak s, and “ ra1 ; a2 , . . . , ak s.
b r
Then the number of terms in the ontinued fra tion representations of a{b and b{r dier by
one. Sin e r ă b, the indu tive hypothesis yields

f pb, rq “ 0 ðñ k ´ 1 is even,

and thus
f pa, bq “ 0 ðñ f pb, rq “ 1 ðñ k ´ 1 is odd ðñ k is even. l
Now we use the following well-known properties of ontinued fra tions to prove the Lemma:
Let pi and qi be oprime positive integers with ra0 ; a1 , a2 , . . . , ai s “ pi {qi , with the notation
borrowed from the Claim. In parti ular, a{b “ ra0 ; a1 , a2 , . . . , ak s “ pk {qk . Assume that k ą 0
and dene q´1 “ 0 if ne essary. Then

• qk “ ak qk´1 ` qk´2 , and

• aqk´1 ´ bpk´1 “ pk qk´1 ´ qk pk´1 “ p´1qk´1.


Assume that k ą 0. Then ak ě 2, and

b
b “ qk “ ak qk´1 ` qk´2 ě ak qk´1 ě 2qk´1 ùñ qk´1 ď ,
2
with stri t inequality for k ą 1, and

p´1qk´1 qk´1 a ` p´1qk pk´1 b “ 1.

Now we nish the proof of the Lemma. It is immediate for k “ 0. If k “ 1, then p´1qk´1 “ 1,
so
´b{2 ă 0 ď p´1qk´1qk´1 ď b{2.
If k ą 1, we have qk´1 ă b{2, so

´b{2 ă p´1qk´1qk´1 ă b{2.

Thus, for any k ą 0, we nd that gpa, bq “ pp´1qk´1 qk´1 , p´1qk pk´1q, and so

f pa, bq “ 1 ðñ k is odd ðñ u “ p´1qk´1 qk´1 ą 0.


90 IMO 2017, Rio de Janeiro

Comment 1. The Lemma an also be established by observing that f is uniquely dened on A,


dening f1 pa, bq “ 1 if u ą 0 in gpa, bq “ pu, vq and f1 pa, bq “ 0 otherwise, and verifying that f1
satises all the onditions from the statement.
It seems that the main di ulty of the problem is in onje turing the Lemma.

Comment 2. The ase p ” 1 pmod 4q is, in fa t, easier than the original problem. We have, in
general, for 1 ď a ď p ´ 1,
f pa, pq “ 1 ´ f pp, aq “ 1 ´ f pp ´ a, aq “ f pa, p ´ aq “ f pa ` pp ´ aq, p ´ aq “ f pp, p ´ aq “ 1 ´ f pp ´ a, pq.
If p ” 1 pmod 4q, then a is a quadrati residue modulo p if and only if p ´ a is a quadrati residue
modulo p. Therefore, denoting by rk (with 1 ď rk ď p ´ 1) the remainder of the division of k 2 by p,
we get
p´1
ÿ p´1
ÿ p´1
2 1 ÿ p´1
f pn , pq “ f prn , pq “ pf prn , pq ` f pp ´ rn , pqq “ .
n“1 n“1
2 n“1
2

ř
Comment 3. The estimate for the sum pn“1 f pn2 , pq an be improved by rening the nal argument
in Solution 1. In fa t, one an prove that
p´1
ÿ p´1
f pn2 , pq ě .
n“1
16

By ounting the number of perfe t squares in the intervals rkp, pk ` 1{2qpq, we nd that
p´1 p´1
˜[dˆ ˙ _ Y ¸
ÿ ÿ 1 a ]
f pn2 , pq “ k` p ´ kp . (2)
n“1 k“0
2

Ea h summand of (2) is non-negative. We now estimate the number of positive summands. Suppose
that a summand is zero, i.e., [ dˆ ˙ _ Y
1 a ]
k` p “ kp “: q.
2
Then both of the numbers kp and kp ` p{2 lie within the interval rq 2 , pq ` 1q2 q. Hen e
p
ă pq ` 1q2 ´ q 2 ,
2
whi h implies
p´1
qě .
4
?
Sin e q ď kp, if the k th summand of (2) is zero, then
q2 pp ´ 1q2 p´2 p´1
kě ě ą ùñ k ě .
p 16p 16 16
So at least the rst r p´1 p´1
16 s summands (from k “ 0 to k “ r 16 s ´ 1) are positive, and the result
follows.

Comment 4. The bound an be further improved by using dierent methods. In fa t, we prove that
p´1
ÿ p´3
f pn2 , pq ě .
n“1
4
To that end, we use the Legendre symbol
$
ˆ ˙ ’ &0 if p  a
a
“ 1 if a is a nonzero quadrati residue mod p
p ’
%
´1 otherwise.
We start with the following Claim, whi h tells us that there are not too many onse utive quadrati
residues or onse utive quadrati non-residues.
Shortlisted problems  solutions 91

řp´1 ` n ˘` n`1 ˘
Claim. n“1 p p “ ´1.
` n ˘` n`1 ˘ ` npn`1q ˘
Proof. We have p p “ p . For 1 ď n ď p ´ 1, we get that npn ` 1q ” n2 p1 ` n´1 q pmod pq,
` npn`1q ˘ ` 1`n´1 ˘
hen e p “ p . Sin e t1 ` n´1 mod p : 1 ď n ď p ´ 1u “ t0, 2, 3, . . . , p ´ 1 mod pu, we nd

ÿˆ
p´1
n
˙ˆ
n`1
˙ ÿˆ
p´1
1 ` n´1
˙ ÿˆ
p´1
n
˙
“ “ ´ 1 “ ´1,
n“1
p p n“1
p n“1
p
řp ` ˘
be ause n
n“1 p “ 0. l
Observe that (1) be omes
p´1
ÿ " ˆ ˙ *
p´1 r
2
f pn , pq “ 2 |S| , S “ r: 1 ď r ď and “1 .
n“1
2 p

We onne t S with the sum from the laim by pairing quadrati residues and quadrati non-residues.
To that end, dene
" ˆ ˙ *
1 p´1 r
S “ r: 1 ď r ď and “ ´1
2 p
" ˆ ˙ *
p`1 r
T “ r: ď r ď p ´ 1 and “1
2 p
" ˆ ˙ *
1 p`1 r
T “ r: ď r ď p ´ 1 and “ ´1
2 p

Sin e there are exa tly pp ´ 1q{2 nonzero quadrati residues modulo p, |S| ` |T | “ pp ´ 1q{2. Also
we obviously have |T | ` |T 1 | “ pp ´ 1q{2. Then |S| “` |T˘`1 |. ˘
For the sake of brevity, dene t “ |S| “ |T 1 |. If np n`1 p “ ´1, then exa tly of one the numbers
`n˘ ` n`1 ˘
p and p is equal to 1, so
ˇ" ˆ ˙ˆ ˙ *ˇ
ˇ p ´ 3 n n ` 1 ˇ
ˇ n: 1 ď n ď
ˇ and “ ´1 ˇˇ ď |S| ` |S ´ 1| “ 2t.
2 p p
` ˘` ˘ ` ˘ ` ˘
On the other hand, if np n`1
p “ ´1, then exa tly one of np and n`1 p is equal to ´1, and
ˇ" ˆ ˙ˆ ˙ *ˇ
ˇ p ` 1 n n ` 1 ˇ
ˇ n:
ˇ ď n ď p ´ 2 and “ ´1 ˇˇ ď |T 1 | ` |T 1 ´ 1| “ 2t.
2 p p
` pp´1q{2 ˘` pp`1q{2 ˘
Thus, taking into a ount that the middle term p p may happen to be ´1,
ˇ" ˆ ˙ˆ ˙ *ˇ
ˇ n`1 ˇ
ˇ n : 1 ď n ď p ´ 2 and n “ ´1 ˇˇ ď 4t ` 1.
ˇ p p

This implies that


ˇ" ˆ ˙ˆ ˙ *ˇ
ˇ n`1 ˇ
ˇ n : 1 ď n ď p ´ 2 and n “ 1 ˇ ě pp ´ 2q ´ p4t ` 1q “ p ´ 4t ´ 3,
ˇ p p ˇ

and so
ÿˆ
p´1
n
˙ˆ
n`1
˙
´1 “ ě p ´ 4t ´ 3 ´ p4t ` 1q “ p ´ 8t ´ 4,
n“1
p p
whi h implies 8t ě p ´ 3, and thus
p´1
ÿ p´3
f pn2 , pq “ 2t ě .
n“1
4
92 IMO 2017, Rio de Janeiro

Comment 5. It is possible to prove that


p´1
ÿ p´1
f pn2 , pq ě .
n“1
2

The ase p ” 1 pmod 4q was already mentioned, and it is the equality ase. If p ” 3 pmod 4q,
then, by a theorem of Diri hlet, we have
ˇ" ˆ ˙ *ˇ
ˇ ˇ
ˇ r : 1 ď r ď p ´ 1 and r “ 1 ˇ ą p ´ 1 ,
ˇ 2 p ˇ 4

whi h implies the result.


See https://en.wikipedia.org/wiki/Quadrati _residue#Diri hlet.27s_formulas for the full
statement of the theorem. It seems that no elementary proof of it is known; a proof using omplex
analysis is available, for instan e, in Chapter 7 of the book Quadrati Residues and Non-Residues:
Sele ted Topi s, by Steve Wright, available in https://arxiv.org/abs/1408.0235.
Shortlisted
Problems
(with solutions)

59th International Mathematical Olympiad


Cluj-Napoca — Romania, 3–14 July 2018
Note of Condentiality

The Shortlist has to be kept stri tly ondential


until the on lusion of the following
International Mathemati al Olympiad.
IMO General Regulations Ÿ6.6

Contributing Countries
The Organising Committee and the Problem Sele tion Committee of IMO 2018 thank the
following 49 ountries for ontributing 168 problem proposals:

Armenia, Australia, Austria, Azerbaijan, Belarus, Belgium,

Bosnia and Herzegovina, Brazil, Bulgaria, Canada, China, Croatia, Cyprus,

Cze h Republi , Denmark, Estonia, Germany, Gree e, Hong Kong, I eland,

India, Indonesia, Iran, Ireland, Israel, Japan, Kosovo, Luxembourg, Mexi o,

Moldova, Mongolia, Netherlands, Ni aragua, Poland, Russia, Serbia,

Singapore, Slovakia, Slovenia, South Afri a, South Korea, Switzerland,

Taiwan, Tanzania, Thailand, Turkey, Ukraine, United Kingdom, U.S.A.

Problem Sele tion Committee

Calin Popes u, Radu Gologan, Marian Androna he, Mihail Baluna,


Ni olae Beli, Ilya Bogdanov, Pavel Kozhevnikov, Géza Kós, Sever Moldoveanu
Shortlisted problems 3

Problems
Algebra
A1. Let Qą0 denote the set of all positive rational numbers. Determine all fun tions
f : Qą0 Ñ Qą0 satisfying ` ˘
f x2 f pyq2 “ f pxq2 f pyq
for all x, y P Qą0 .
(Switzerland)
A2. Find all positive integers n ě 3 for whi h there exist real numbers a1 , a2 , . . . , an ,
an`1 “ a1 , an`2 “ a2 su h that
ai ai`1 ` 1 “ ai`2
for all i “ 1, 2, . . . , n.
(Slovakia)
A3. Given any set S of positive integers, show that at least one of the following two
assertions holds:
ř ř
(1) There exist distin t nite subsets F and G of S su h that xPF 1{x “ xPG 1{x ;
ř
(2) There exists a positive rational number r ă 1 su h that xPF 1{x ‰ r for all nite subsets
F of S .
(Luxembourg)
A4. Let a0 , a1 , a2 , . . . be a sequen e of real numbers su h that a0 “ 0, a1 “ 1, and for
every n ě 2 there exists 1 ď k ď n satisfying
an´1 ` ¨ ¨ ¨ ` an´k
an “ .
k
Find the maximal possible value of a2018 ´ a2017 .
(Belgium)
A5. Determine all fun tions f : p0, 8q Ñ R satisfying
ˆ ˙ ´y¯
1
x` f pyq “ f pxyq ` f
x x
for all x, y ą 0.
(South Korea)
A6. Let m, n ě 2 be integers. Let f px1 , . . . , xn q be a polynomial with real oe ients
su h that
Yx ` . . . ` x ] (
1 n
f px1 , . . . , xn q “ for every x1 , . . . , xn P 0, 1, . . . , m ´ 1 .
m
Prove that the total degree of f is at least n.
(Brazil)
A7. Find the maximal value of
c c c c
3 a 3 b 3 c 3 d
S“ ` ` ` ,
b`7 c`7 d`7 a`7
where a, b, c, d are nonnegative real numbers whi h satisfy a ` b ` c ` d “ 100.
(Taiwan)
4 Cluj-Napo a  Romania, 314 July 2018

Combinatori s
C1. Let n ě 3 be an integer. Prove that there exists a set S of 2n positive integers
satisfying the following property: For every m “ 2, 3, . . . , n the set S an be partitioned into
two subsets with equal sums of elements, with one of subsets of ardinality m.
(I eland)
C2. Queenie and Horst play a game on a 20 ˆ 20 hessboard. In the beginning the board
is empty. In every turn, Horst pla es a bla k knight on an empty square in su h a way that his
new knight does not atta k any previous knights. Then Queenie pla es a white queen on an
empty square. The game gets nished when somebody annot move.
Find the maximal positive K su h that, regardless of the strategy of Queenie, Horst an
put at least K knights on the board.
(Armenia)
C3. Let n be a given positive integer. Sisyphus performs a sequen e of turns on a board
onsisting of n ` 1 squares in a row, numbered 0 to n from left to right. Initially, n stones
are put into square 0, and the other squares are empty. At every turn, Sisyphus hooses any
nonempty square, say with k stones, takes one of those stones and moves it to the right by at
most k squares (the stone should stay within the board). Sisyphus' aim is to move all n stones
to square n.
Prove that Sisyphus annot rea h the aim in less than
QnU QnU QnU QnU
` ` ` ¨¨¨`
1 2 3 n
turns. (As usual, rxs stands for the least integer not smaller than x.)
(Netherlands)
C4. An anti-Pas al pyramid is a nite set of numbers, pla ed in a triangle-shaped array
so that the rst row of the array ontains one number, the se ond row ontains two numbers,
the third row ontains three numbers and so on; and, ex ept for the numbers in the bottom
row, ea h number equals the absolute value of the dieren e of the two numbers below it. For
instan e, the triangle below is an anti-Pas al pyramid with four rows, in whi h every integer
from 1 to 1 ` 2 ` 3 ` 4 “ 10 o urs exa tly on e:

4
2 6
5 7 1
8 3 10 9 .

Is it possible to form an anti-Pas al pyramid with 2018 rows, using every integer from 1 to
1 ` 2 ` ¨ ¨ ¨ ` 2018 exa tly on e?
(Iran)
C5. Let k be a positive integer. The organising ommittee of a tennis tournament is to
s hedule the mat hes for 2k players so that every two players play on e, ea h day exa tly one
mat h is played, and ea h player arrives to the tournament site the day of his rst mat h, and
departs the day of his last mat h. For every day a player is present on the tournament, the
ommittee has to pay 1 oin to the hotel. The organisers want to design the s hedule so as to
minimise the total ost of all players' stays. Determine this minimum ost.
(Russia)
Shortlisted problems 5

C6. Let a and b be distin t positive integers. The following innite pro ess takes pla e on
an initially empty board.

piq If there is at least a pair of equal numbers on the board, we hoose su h a pair and
in rease one of its omponents by a and the other by b.

piiq If no su h pair exists, we write down two times the number 0.

Prove that, no matter how we make the hoi es in piq, operation piiq will be performed only
nitely many times.
(Serbia)
C7. Consider 2018 pairwise rossing ir les no three of whi h are on urrent. These ir les
subdivide the plane into regions bounded by ir ular edges that meet at verti es. Noti e that
there are an even number of verti es on ea h ir le. Given the ir le, alternately olour the
verti es on that ir le red and blue. In doing so for ea h ir le, every vertex is oloured twi e 
on e for ea h of the two ir les that ross at that point. If the two olourings agree at a vertex,
then it is assigned that olour; otherwise, it be omes yellow. Show that, if some ir le ontains
at least 2061 yellow points, then the verti es of some region are all yellow.
(India)
6 Cluj-Napo a  Romania, 314 July 2018

Geometry
G1. Let ABC be an a ute-angled triangle with ir um ir le Γ. Let D and E be points on
the segments AB and AC , respe tively, su h that AD “ AE . The perpendi ular bise tors of
the segments BD and CE interse t the small ar s AB
Ŋ and AC
Ŋ at points F and G respe tively.
Prove that DE k F G.
(Gree e)
G2. Let ABC be a triangle with AB “ AC , and let M be the midpoint of BC . Let P be
a point su h that P B ă P C and P A is parallel to BC . Let X and Y be points on the lines
P B and P C , respe tively, so that B lies on the segment P X , C lies on the segment P Y , and
=P XM “ =P Y M . Prove that the quadrilateral AP XY is y li .
(Australia)
G3. A ir le ω of radius 1 is given. A olle tion T of triangles is alled good, if the following
onditions hold:

piq ea h triangle from T is ins ribed in ω ;

piiq no two triangles from T have a ommon interior point.

Determine all positive real numbers t su h that, for ea h positive integer n, there exists a
good olle tion of n triangles, ea h of perimeter greater than t.
(South Afri a)
G4. A point T is hosen inside a triangle ABC . Let A1 , B1 , and C1 be the ree tions
of T in BC , CA, and AB , respe tively. Let Ω be the ir um ir le of the triangle A1 B1 C1 .
The lines A1 T , B1 T , and C1 T meet Ω again at A2 , B2 , and C2 , respe tively. Prove that the
lines AA2 , BB2 , and CC2 are on urrent on Ω.
(Mongolia)
G5. Let ABC be a triangle with ir um ir le ω and in entre I . A line ℓ interse ts the
lines AI , BI , and CI at points D , E , and F , respe tively, distin t from the points A, B , C ,
and I . The perpendi ular bise tors x, y , and z of the segments AD , BE , and CF , respe tively
determine a triangle Θ. Show that the ir um ir le of the triangle Θ is tangent to ω .
(Denmark)
G6. A onvex quadrilateral ABCD satises AB ¨ CD “ BC ¨ DA. A point X is hosen
inside the quadrilateral so that =XAB “ =XCD and =XBC “ =XDA. Prove that =AXB `
=CXD “ 180˝.
(Poland)
G7. Let O be the ir um entre, and Ω be the ir um ir le of an a ute-angled triangle ABC .
Let P be an arbitrary point on Ω, distin t from A, B , C , and their antipodes in Ω. Denote
the ir um entres of the triangles AOP , BOP , and COP by OA , OB , and OC , respe tively.
The lines ℓA , ℓB , and ℓC perpendi ular to BC , CA, and AB pass through OA , OB , and OC ,
respe tively. Prove that the ir um ir le of the triangle formed by ℓA , ℓB , and ℓC is tangent to
the line OP .
(Russia)
Shortlisted problems 7

Number Theory
N1. Determine all pairs pn, kq of distin t positive integers su h that there exists a positive
integer s for whi h the numbers of divisors of sn and of sk are equal.
(Ukraine)
N2. Let n ą 1 be a positive integer. Ea h ell of an n ˆ n table ontains an integer.
Suppose that the following onditions are satised:

piq Ea h number in the table is ongruent to 1 modulo n;

piiq The sum of numbers in any row, as well as the sum of numbers in any olumn, is ongruent
to n modulo n2 .

Let Ri be the produ t of the numbers in the ith row, and Cj be the produ t of the numbers in
the j th olumn. Prove that the sums R1 ` ¨ ¨ ¨ ` Rn and C1 ` ¨ ¨ ¨ ` Cn are ongruent modulo n4 .
(Indonesia)
N3. Dene the sequen e a0 , a1 , a2 , . . . by an “ 2n ` 2tn{2u . Prove that there are innitely
many terms of the sequen e whi h an be expressed as a sum of (two or more) distin t terms
of the sequen e, as well as innitely many of those whi h annot be expressed in su h a way.
(Serbia)
N4. Let a1 , a2 , . . ., an , . . . be a sequen e of positive integers su h that
a1 a2 an´1 an
` ` ¨¨¨` `
a2 a3 an a1
is an integer for all n ě k , where k is some positive integer. Prove that there exists a positive
integer m su h that an “ an`1 for all n ě m.
(Mongolia)
N5. Four positive integers x, y , z , and t satisfy the relations

xy ´ zt “ x ` y “ z ` t.

Is it possible that both xy and zt are perfe t squares?


(Russia)
N6. Let f : t1, 2, 3, . . .u Ñ t2, 3, . . .u be a fun tion su h that f pm ` nq | f pmq ` f pnq for
all pairs m, n of positive integers. Prove that there exists a positive integer c ą 1 whi h divides
all values of f .
(Mexi o)
N7. Let n ě 2018 be an integer, and let a1 , a2 , . . . , an , b1 , b2 , . . . , bn be pairwise distin t
positive integers not ex eeding 5n. Suppose that the sequen e
a1 a2 an
, , ...,
b1 b2 bn
forms an arithmeti progression. Prove that the terms of the sequen e are equal.
(Thailand)
8 Cluj-Napo a  Romania, 314 July 2018
Shortlisted problems  solutions 9

Solutions
Algebra
A1. Let Qą0 denote the set of all positive rational numbers. Determine all fun tions
f : Qą0 Ñ Qą0 satisfying ` ˘
f x2 f pyq2 “ f pxq2 f pyq p˚q
for all x, y P Qą0 .
(Switzerland)
Answer: f pxq “ 1 for all x P Qą0 .
Solution. Take any a, b P Qą0 . By substituting x “ f paq, y “ b and x “ f pbq, y “ a into p˚q
we get ` ˘2 ` ˘ ` ˘2
f f paq f pbq “ f f paq2 f pbq2 “ f f pbq f paq,
whi h yields ` ˘2 ` ˘2
f f paq f f pbq
“ for all a, b P Qą0 .
f paq f pbq
` ˘2
In other words, this shows that there exists a onstant C P Qą0 su h that f f paq “ Cf paq,
or ˜ ` ˘ ¸2
f f paq f paq
“ for all a P Qą0 . (1)
C C

f pf p. . . pf pxqq . . . qq the nth iteration of f . Equality (1) yields


Denote by f n pxq “ loooomoooon
n

ˆ ˙2 ˆ ˙4 ˆ ˙2n
f paq f 2 paq f 3 paq f n`1paq
“ “ “ ¨¨¨ “
C C C C

for all positive integer n. So, f paq{C is the 2n -th power of a rational number for all positive
integer n. This is impossible unless f paq{C “ 1, sin e otherwise the exponent of some prime in
the prime de omposition of f paq{C is not divisible by su iently large powers of 2. Therefore,
f paq “ C for all a P Qą0 .
Finally, after substituting f ” C into p˚q we get C “ C 3 , when e C “ 1. So f pxq ” 1 is the
unique fun tion satisfying p˚q.

Comment 1. There are several variations of the solution above. For instan e, one may start with
nding f p1q “ 1. To do this, let d “ f p1q. By substituting x “ y “ 1 and x “ d2 , y “ 1 into p˚q
2 3 6 2 2 7
we get f pd q “ d and f pd q “ f pd q ¨ d “ d . By substituting now x “ 1, y “ d we obtain
2

f pd6 q “ d2 ¨ d3 “ d5 . Therefore, d7 “ f pd6 q “ d5 , when e d “ 1.


f pf p1qq2
After that, the rest of the solution simplies a bit, sin e we already know that C “ “ 1.
f p1q
2
Hen e equation p1q be omes merely f pf paqq “ f paq, whi h yields f paq “ 1 in a similar manner.

Comment 2.
?
There exist non onstant fun tions f : R` Ñ R` satisfying p˚q for all real x, y ą 0 
e.g., f pxq “ x.
10 Cluj-Napo a  Romania, 314 July 2018

A2. Find all positive integers n ě 3 for whi h there exist real numbers a1 , a2 , . . . , an ,
an`1 “ a1 , an`2 “ a2 su h that
ai ai`1 ` 1 “ ai`2
for all i “ 1, 2, . . . , n.
(Slovakia)
Answer: n an be any multiple of 3.
Solution 1. For the sake of onvenien e, extend the sequen e a1 , . . . , an`2 to an innite
periodi sequen e with period n. (n is not ne essarily the shortest period.)
If n is divisible by 3, then pa1 , a2 , . . .q “ p´1, ´1, 2, ´1, ´1, 2, . . .q is an obvious solution.
We will show that in every periodi sequen e satisfying the re urren e, ea h positive term is
followed by two negative values, and after them the next number is positive again. From this,
it follows that n is divisible by 3.

If the sequen e ontains two onse utive positive numbers ai , ai`1 , then ai`2 “ ai ai`1 `1 ą 1,
so the next value is positive as well; by indu tion, all numbers are positive and greater than 1.
But then ai`2 “ ai ai`1 ` 1 ě 1 ¨ ai`1 ` 1 ą ai`1 for every index i, whi h is impossible: our
sequen e is periodi , so it annot in rease everywhere.
If the number 0 o urs in the sequen e, ai “ 0 for some index i, then it follows that
ai`1 “ ai´1 ai ` 1 and ai`2 “ ai ai`1 ` 1 are two onse utive positive elements in the sequen es
and we get the same ontradi tion again.
Noti e that after any two onse utive negative numbers the next one must be positive: if
ai ă 0 and ai`1 ă 0, then ai`2 “ a1 ai`1 ` 1 ą 1 ą 0. Hen e, the positive and negative numbers
follow ea h other in su h a way that ea h positive term is followed by one or two negative values
and then omes the next positive term.
Consider the ase when the positive and negative values alternate. So, if ai is a negative
value then ai`1 is positive, ai`2 is negative and ai`3 is positive again.
Noti e that ai ai`1 ` 1 “ ai`2 ă 0 ă ai`3 “ ai`1 ai`2 ` 1; by ai`1 ą 0 we on lude ai ă ai`2 .
Hen e, the negative values form an innite in reasing subsequen e, ai ă ai`2 ă ai`4 ă . . .,
whi h is not possible, be ause the sequen e is periodi .
The only ase left is when there are onse utive negative numbers in the sequen e. Suppose
that ai and ai`1 are negative; then ai`2 “ ai ai`1 ` 1 ą 1. The number ai`3 must be negative.
We show that ai`4 also must be negative.
Noti e that ai`3 is negative and ai`4 “ ai`2 ai`3 ` 1 ă 1 ă ai ai`1 ` 1 “ ai`2 , so
ai`5 ´ ai`4 “ pai`3 ai`4 ` 1q ´ pai`2 ai`3 ` 1q “ ai`3 pai`4 ´ ai`2 q ą 0,
therefore ai`5 ą ai`4 . Sin e at most one of ai`4 and ai`5 an be positive, that means that ai`4
must be negative.
Now ai`3 and ai`4 are negative and ai`5 is positive; so after two negative and a positive
terms, the next three terms repeat the same pattern. That ompletes the solution.

Solution 2. We prove that the shortest period of the sequen e must be 3. Then it follows
that n must be divisible by 3.
Noti e that the equation x2 ` 1 “ x has no real root, so the numbers a1 , . . . , an annot be
all equal, hen e the shortest period of the sequen e annot be 1.
By applying the re urren e relation for i and i ` 1,
pai`2 ´ 1qai`2 “ ai ai`1 ai`2 “ ai pai`3 ´ 1q, so
a2i`2 ´ ai ai`3 “ ai`2 ´ ai .
Shortlisted problems  solutions 11

By summing over i “ 1, 2, . . . , n, we get


n
ÿ
pai ´ ai`3 q2 “ 0.
i“1

That proves that ai “ ai`3 for every index i, so the sequen e a1 , a2 , . . . is indeed periodi with
period 3. The shortest period annot be 1, so it must be 3; therefore, n is divisible by 3.

Comment. By solving the system of equations ab ` 1 “ c, bc ` 1 “ a, ca ` 1 “ b, it an be seen


that the pattern p´1, ´1, 2q is repeated in all sequen es satisfying the problem onditions.
12 Cluj-Napo a  Romania, 314 July 2018

A3. Given any set S of positive integers, show that at least one of the following two
assertions holds:
ř ř
(1) There exist distin t nite subsets F and G of S su h that xPF 1{x “ xPG 1{x ;
ř
(2) There exists a positive rational number r ă 1 su h that xPF 1{x ‰ r for all nite subsets
F of S .

(Luxembourg)
Solution 1. Argue indire tly. Agree, as usual, that the empty sum is 0 to onsider rationals
ř
in r0, 1q; adjoining 0 auses no harm, sin e xPF 1{x “ 0 for no nonempty nite ř subset F of S .
For every rational r in r0, 1q, let Fr be the unique nite subset of S su h that xPFr 1{x “ r .
The argument hinges on the lemma below.
Lemma. If x is a member of S and q and r are rationals in r0, 1q su h that q ´ r “ 1{x, then x
is a member of Fq if and only if it is not one of Fr .
Proof. If x is a member of Fq , then
ÿ 1 ÿ 1 1 1 ÿ 1
“ ´ “q´ “r“ ,
yPFq rtxu
y yPF
y x x yPF
y
q r

so Fr “ Fq r txu, and x is not a member of Fr . Conversely, if x is not a member of Fr , then


ÿ 1 ÿ 1 1 1 ÿ 1
“ ` “r` “q“ ,
yPFr Ytxu
y yPF y x x yPF
y
r q

so Fq “ Fr Y txu, and x is a member of Fq . l


Consider now an element x of S and a positive rational r ă 1. Let n “ trxu and onsider
the sets Fr´k{x , k “ 0, . . . , n. Sin e 0 ď r ´ n{x ă 1{x, the set Fr´n{x does not ontain x, and
a repeated appli ation of the lemma shows that the Fr´pn´2kq{x do not ontain x, whereas the
Fr´pn´2k´1q{x do. Consequently, x is a member of Fr if and only if n is odd.
Finally, onsider F2{3 . By the pre eding, t2x{3u is odd for ea h x in F2{3 , so 2x{3 is not
integral. Sin e F2{3 is nite, there exists a positive rational ε su h that tp2{3 ´ εqxu “ t2x{3u
for all x in F2{3 . This implies that F2{3 is a subset of F2{3´ε whi h is impossible.

Comment. The solution above an be adapted to show that the problem statement still holds, if the
ondition r ă 1 in (2) is repla ed with r ă δ , for an arbitrary positive δ . This yields that, if S does not
ř
satisfy (1), then there exist innitely many positive rational numbers r ă 1 su h that xPF 1{x ‰ r
for all nite subsets F of S.
Solution 2. A nite S learly satises (2), so let S be innite. If S fails both onditions,
so does S r t1u. We may and will therefore assume that S onsists of integers greater than 1.
Label the elements of S in reasingly x1 ă x2 ă ¨ ¨ ¨ , where x1 ě 2.
We rst show that S satises (2) if xn`1 ě 2xn for all n. In this ase, xn ě 2n´1 x1 for
all n, so
ÿ 1 ÿ 1 2
s“ ď n´1 x
“ .
ně1
xn ně1
2 1 x 1
ř
If x1 ě 3, or x1 “ 2 and xn`1 ą 2xn for some n, then xPF 1{x ă s ă 1 for every nite subset
F of S , so S satises (2); and if x1 “ 2 and xn`1 “ 2xř n for all n, that is, xn “ 2 for all n, then
n

every nite subset F of S onsists of powers of 2, so xPF 1{x ‰ 1{3 and again S satises (2).
Finally, we deal with the ase whereř xn`1 ă 2xn for some n. Consider the positive rational
r “ 1{xn ´ 1{xn`1 ă 1{xn`1 . If r “ xPF 1{x for no nite subset F of S , then S satises (2).
Shortlisted problems  solutions 13

ř
We now
ř assume that r “ xPF0 1{x for some nite subset F0 of S , and show that S satises (1).
Sin e xPF0 1{x “ r ă 1{xn`1 , it follows that xn`1 is not a member of F0 , so
ÿ 1 ÿ 1 1 1 1
“ ` “r` “ .
xPF0 Ytxn`1 u
x xPF x xn`1 xn`1 xn
0

Consequently,
ř ř F “ F0 Y txn`1 u and G “ txn u are distin t nite subsets of S su h that
xPF 1{x “ xPG 1{x, and S satises (1).
14 Cluj-Napo a  Romania, 314 July 2018

A4. Let a0 , a1 , a2 , . . . be a sequen e of real numbers su h that a0 “ 0, a1 “ 1, and for every


n ě 2 there exists 1 ď k ď n satisfying
an´1 ` ¨ ¨ ¨ ` an´k
an “ .
k
Find the maximal possible value of a2018 ´ a2017 .
(Belgium)
Answer: The maximal value is 2016
20172
.
Solution 1. The laimed maximal value is a hieved at
a2016 ` ¨ ¨ ¨ ` a0 1
a1 “ a2 “ ¨ ¨ ¨ “ a2016 “ 1, a2017 “ “1´ ,
2017 2017
a2017 ` ¨ ¨ ¨ ` a1 1
a2018 “ “1´ .
2017 20172
Now we need to show that this value is optimal. For brevity, we use the notation

Spn, kq “ an´1 ` an´2 ` ¨ ¨ ¨ ` an´k for nonnegative integers k ď n.

In parti ular, Spn, 0q “ 0 and Spn, 1q “ an´1 . In these terms, for every integer n ě 2 there
exists a positive integer k ď n su h that an “ Spn, kq{k .
For every integer n ě 1 we dene
Spn, kq Spn, kq
Mn “ max , mn “ min , and ∆n “ Mn ´ mn ě 0.
1ďkďn k 1ďkďn k
By denition, an P rmn , Mn s for all n ě 2; on the other hand, an´1 “ Spn, 1q{1 P rmn , Mn s.
Therefore,
a2018 ´ a2017 ď M2018 ´ m2018 “ ∆2018 ,
and we are interested in an upper bound for ∆2018 .
Also by denition, for any 0 ă k ď n we have kmn ď Spn, kq ď kMn ; noti e that these
inequalities are also valid for k “ 0.
Claim 1. For every n ą 2, we have ∆n ď n´1 n
∆n´1 .
Proof. Choose positive integers k, ℓ ď n su h that Mn “ Spn, kq{k and mn “ Spn, ℓq{ℓ. We
have Spn, kq “ an´1 ` Spn ´ 1, k ´ 1q, so

kpMn ´ an´1 q “ Spn, kq ´ kan´1 “ Spn ´ 1, k ´ 1q ´ pk ´ 1qan´1 ď pk ´ 1qpMn´1 ´ an´1 q,

sin e Spn ´ 1, k ´ 1q ď pk ´ 1qMn´1 . Similarly, we get

ℓpan´1 ´ mn q “ pℓ ´ 1qan´1 ´ Spn ´ 1, ℓ ´ 1q ď pℓ ´ 1qpan´1 ´ mn´1 q.

Sin e mn´1 ď an´1 ď Mn´1 and k, ℓ ď n, the obtained inequalities yield


k´1 n´1
Mn ´ an´1 ď pMn´1 ´ an´1 q ď pMn´1 ´ an´1 q and
k n
ℓ´1 n´1
an´1 ´ mn ď pan´1 ´ mn´1 q ď pan´1 ´ mn´1 q.
ℓ n
Therefore,
n ´ 1` ˘ n´1
∆n “ pMn ´ an´1 q ` pan´1 ´ mn q ď pMn´1 ´ an´1 q ` pan´1 ´ mn´1 q “ ∆n´1 . l
n n
Shortlisted problems  solutions 15

Ba k to the problem, if an “ 1 for all n ď 2017, then a2018 ď 1 and hen e a2018 ´ a2017 ď 0.
Otherwise, let 2 ď q ď 2017 be the minimal index with aq ă 1. We have Spq, iq “ i for all
i “ 1, 2, . . . , q ´ 1, while Spq, qq “ q ´ 1. Therefore, aq ă 1 yields aq “ Spq, qq{q “ 1 ´ 1q .
Now we have Spq ` 1, iq “ i ´ 1q for i “ 1, 2, . . . , q , and Spq ` 1, q ` 1q “ q ´ 1q . This gives us

Spq ` 1, 1q Spq ` 1, q ` 1q q´1 Spq ` 1, qq q2 ´ 1


mq`1 “ “ “ and Mq`1 “ “ ,
1 q`1 q q q2

so ∆q`1 “ Mq`1 ´ mq`1 “ pq ´ 1q{q 2 . Denoting N “ 2017 ě q and using Claim 1 for
n “ q ` 2, q ` 3, . . . , N ` 1 we nally obtain
ˆ ˙ ˆ ˙
q´1 q`1 q`2 N 1 1 1 1 N ´1
∆N `1 ď 2 ¨ ¨ ¨¨¨ “ 1´ 2 ď 1´ 2 “ ,
q q`2 q`3 N `1 N `1 q N `1 N N2

as required.

Comment 1. One may he k that the maximal value of a2018 ´ a2017 is attained at the unique
sequen e, whi h is presented in the solution above.

Comment 2. An easier question would be to determine the maximal value of |a2018 ´ a2017 |. In this
1
version, the answer
2018 is a hieved at

a2017 ` ¨ ¨ ¨ ` a0 1
a1 “ a2 “ ¨ ¨ ¨ “ a2017 “ 1, a2018 “ “1´ .
2018 2018
1
To prove that this value is optimal, it su es to noti e that ∆2 “ 2 and to apply Claim 1 obtaining

1 2 2017 1
|a2018 ´ a2017 | ď ∆2018 ď ¨ ¨¨¨ “ .
2 3 2018 2018

Solution 2. We present a dierent proof of the estimate a2018 ´ a2017 ď 2017


2016
2 . We keep the

same notations of Spn, kq, mn and Mn from the previous solution.


Noti e that Spn, nq “ Spn, n ´ 1q, as a0 “ 0. Also noti e that for 0 ď k ď ℓ ď n we have
Spn, ℓq “ Spn, kq ` Spn ´ k, ℓ ´ kq.
Claim 2. For every positive integer n, we have mn ď mn`1 and Mn`1 ď Mn , so the segment
rmn`1 , Mn`1 s is ontained in rmn , Mn s.
Proof. Choose a positive integer k ď n ` 1 su h that mn`1 “ Spn ` 1, kq{k. Then we have
kmn`1 “ Spn ` 1, kq “ an ` Spn, k ´ 1q ě mn ` pk ´ 1qmn “ kmn ,

whi h establishes the rst inequality in the Claim. The proof of the se ond inequality is
similar. l
Claim 3. For every positive integers k ě n, we have mn ď ak ď Mn .
Proof. By Claim 2, we have rmk , Mk s Ď rmk´1 , Mk´1 s Ď ¨ ¨ ¨ Ď rmn , Mn s. Sin e ak P rmk , Mk s,
the laim follows. l
16 Cluj-Napo a  Romania, 314 July 2018

Claim 4. For every integer n ě 2, we have Mn “ Spn, n ´ 1q{pn ´ 1q and mn “ Spn, nq{n.
Proof. We use indu tion on n. The base ase n “ 2 is routine. To perform the indu tion step,
we need to prove the inequalities

Spn, nq Spn, kq Spn, kq Spn, n ´ 1q


ď and ď (1)
n k k n´1
for every positive integer k ď n. Clearly, these inequalities hold for k “ n and k “ n ´ 1, as
Spn, nq “ Spn, n ´ 1q ą 0. In the sequel, we assume that k ă n ´ 1. ` ˘
Now the rst inequality in (1) rewrites as nSpn, kq ě kSpn, nq “ k Spn, kq`Spn´k, n´kq ,
or, an elling the terms o urring on both parts, as

Spn ´ k, n ´ kq
pn ´ kqSpn, kq ě kSpn ´ k, n ´ kq ðñ Spn, kq ě k ¨ .
n´k
By the indu tion hypothesis, we have Spn ´ k, n ´ kq{pn ´ kq “ mn´k . By Claim 3, we get
an´i ě mn´k for all i “ 1, 2, . . . , k . Summing these k inequalities we obtain

Spn ´ k, n ´ kq
Spn, kq ě kmn´k “ k ¨ ,
n´k
as required.
The se ond inequality in (1) is proved similarly. Indeed, this inequality is equivalent to

pn ´ 1qSpn, kq ď kSpn, n ´ 1q ðñ pn ´ k ´ 1qSpn, kq ď kSpn ´ k, n ´ k ´ 1q


Spn ´ k, n ´ k ´ 1q
ðñ Spn, kq ď k ¨ “ kMn´k ;
n´k´1
the last inequality follows again from Claim 3, as ea h term in Spn, kq is at most Mn´k . l
Now we an prove the required estimate for a2018 ´ a2017 . Set N “ 2017. By Claim 4,

SpN ` 1, Nq aN ` SpN, N ´ 1q
aN `1 ´ aN ď MN `1 ´ aN “ ´ aN “ ´ aN
N N
SpN, N ´ 1q N ´ 1
“ ´ ¨ aN .
N N
On the other hand, the same Claim yields

SpN, Nq SpN, N ´ 1q
aN ě mN “ “ .
N N
Noti ing that ea h term in SpN, N ´ 1q is at most 1, so SpN, N ´ 1q ď N ´ 1, we nally obtain

SpN, N ´ 1q N ´ 1 SpN, N ´ 1q SpN, N ´ 1q N ´1


aN `1 ´ aN ď ´ ¨ “ 2
ď .
N N N N N2

Comment 1. Claim 1 in Solution 1 an be dedu ed from Claims 2 and 4 in Solution 2.


Spn,n´1q Spn,nq Spn,n´1q
By Claim 4 we have Mn “ n´1 and mn “ n “ n . It follows that ∆n “ Mn ´ mn “
Spn,n´1q
pn´1qn and so Mn “ n∆n and mn “ pn ´ 1q∆n
Similarly, Mn´1 “ pn ´ 1q∆n´1 and mn´1 “ pn ´ 2q∆n´1 . Then the inequalities mn´1 ď mn and
Mn ď Mn´1 from Claim 2 write as pn ´ 2q∆n´1 ď pn ´ 1q∆n and n∆n ď pn ´ 1q∆n´1 . Hen e we have
the double inequality
n´2 n´1
∆n´1 ď ∆n ď ∆n´1 .
n´1 n
Shortlisted problems  solutions 17

Comment 2. Both solutions above dis uss the properties of an arbitrary sequen e satisfying the
problem onditions. Instead, one may investigate only an optimal sequen e whi h maximises the value
of a2018 ´ a2017 . Here we present an observation whi h allows to simplify su h investigation  for
instan e, the proofs of Claim 1 in Solution 1 and Claim 4 in Solution 2.
The sequen e pan q is uniquely determined by hoosing, for every n ě 2, a positive integer kpnq ď n
su h that an “ Spn, kpnqq{kpnq. Take an arbitrary 2 ď n0 ď 2018, and assume that all su h inte-
gers kpnq, for n ‰ n0 , are xed. Then, for every n, the value of an is a linear fun tion in an0 (whose
possible values onstitute some dis rete subset of rmn0 , Mn0 s ontaining both endpoints). Hen e,
a2018 ´ a2017 is also a linear fun tion in an0 , so it attains its maximal value at one of the endpoints of
the segment rmn0 , Mn0 s.
This shows that, while dealing with an optimal sequen e, we may assume an P tmn , Mn u for all
`nMn
2 ď n ď 2018. Now one an easily see that, if an “ mn , then mn`1 “ mn and Mn`1 ď mnn`1 ; similar
estimates hold in the ase an “ Mn . This already establishes Claim 1, and simplies the indu tive
proof of Claim 4, both applied to an optimal sequen e.
18 Cluj-Napo a  Romania, 314 July 2018

A5. Determine all fun tions f : p0, 8q Ñ R satisfying


ˆ ˙ ´y¯
1
x` f pyq “ f pxyq ` f p1q
x x

for all x, y ą 0.
(South Korea)
C2
Answer: f pxq “ C1 x ` with arbitrary onstants C1 and C2 .
x
Solution 1. Fix a real number a ą 1, and take a new variable t. For the values f ptq, f pt2 q,
f patq and f pa2 t2 q, the relation (1) provides a system of linear equations:
ˆ ˙
1
x “ y “ t: t` f ptq “ f pt2 q ` f p1q (2a)
ˆ t ˙
t t a
x “ , y “ at : ` f patq “ f pt2 q ` f pa2 q (2b)
a ˆ a t ˙ ˆ ˙
1 1
x “ a2 t, y “ t : a2 t ` 2 f ptq “ f pa2 t2 q ` f (2 )
ˆ a ˙t a2
1
x “ y “ at : at ` f patq “ f pa2 t2 q ` f p1q (2d)
at

In order to eliminate f pt2 q, take the dieren e of (2a) and (2b); from (2 ) and (2d) eliminate
f pa2 t2 q; then by taking a linear ombination, eliminate f patq as well:
ˆ ˙ ˆ ˙
1 t a
t` f ptq ´ ` f patq “ f p1q ´ f pa2 q and
t a t
ˆ ˙ ˆ ˙
1 1
2
a t ` 2 f ptq ´ at ` f patq “ f p1{a2 q ´ f p1q, so
at at
˜ˆ ˙ˆ ˙ ˆ ˙ˆ ˙¸
1 1 t a 1
at ` t` ´ ` a2 t ` 2 f ptq
at t a t at
ˆ ˙ ˆ ˙
1 ` 2
˘ t a ` ˘
“ at ` f p1q ´ f pa q ´ ` f p1{a2 q ´ f p1q .
at a t

Noti e that on the left-hand side, the oe ient of f ptq is nonzero and does not depend on t:
ˆ ˙ˆ ˙ ˆ ˙ˆ ˙ ˆ ˙
1 1 t a 2 1 1 3 1
at ` t` ´ ` a t` 2 “ a ` ´ a ` 3 ă 0.
at t a t at a a

After dividing by this xed number, we get


C2
f ptq “ C1 t ` p3q
t
where the numbers C1 and C2 are expressed in terms of a, f p1q, f pa2 q and f p1{a2 q, and they
do not depend on t.
The fun tions of the form (3) satisfy the equation:
ˆ ˙ ˆ ˙ˆ ˙ ˆ ˙ ˆ ˙ ´y¯
1 1 C2 C2 y x
x` f pyq “ x ` C1 y ` “ C1 xy ` ` C1 ` C2 “ f pxyq ` f .
x x y xy x y x
Shortlisted problems  solutions 19

Solution 2. We start with an observation. If we substitute x “ a ‰ 1 and y “ an in (1), we


obtain ˆ ˙
n`1 1
f pa q´ a` f pan q ` f pan´1 q “ 0.
a
For the sequen e zn “ an , this is`a homogeneous
˘ linear re urren e of the se ond order, and its
hara teristi polynomial is t2 ´ a ` a1 t ` 1 “ pt ´ aqpt ´ a1 q with two distin t nonzero roots,
namely a and 1{a. As is well-known, the general solution is zn “ C1 an ` C2 p1{aqn where the
index n an be as well positive as negative. Of ourse, the numbers C1 and C2 may depend of
the hoi e of a, so in fa t we have two fun tions, C1 and C2 , su h that

C2 paq
f pan q “ C1 paq ¨ an ` for every a ‰ 1 and every integer n. p4q
an
The relation (4) an be easily extended to rational values of n, so we may onje ture that C1
and C2 are onstants, and when e f ptq “ C1 t ` Ct2 . As it was seen in the previous solution,
su h fun tions indeed satisfy (1).
The equation (1) is linear in f ; so if some fun tions f1 and f2 satisfy (1) and c1 , c2 are real
numbers, then c1 f1 pxq ` c2 f2 pxq is also a solution of (1). In order to make our formulas simpler,
dene
f0 pxq “ f pxq ´ f p1q ¨ x.
This fun tion is another one satisfying (1) and the extra onstraint f0 p1q “ 0. Repeating the
same argument on linear re urren es, we an write f0 paq “ Kpaqan ` Lpaq
an
with some fun tions
K and L. By substituting n “ 0, we an see that Kpaq ` Lpaq “ f0 p1q “ 0 for every a. Hen e,
ˆ ˙
n n 1
f0 pa q “ Kpaq a ´ n .
a

Now take two numbers a ą b ą 1 arbitrarily and substitute x “ pa{bqn and y “ pabqn in (1):
ˆ n ˙
a bn ` ˘ ` ˘ ` ˘
n
` n f0 pabqn “ f0 a2n ` f0 b2n , so
b a
ˆ n n
˙ ˆ ˙ ˆ ˙ ˆ ˙
a b 1 1 1
` Kpabq pabq ´n
“ Kpaq a ´ 2n ` Kpbq b ´ 2n , or equivalently
2n 2n
bn an pabqn a b
ˆ ˙ ˆ ˙ ˆ ˙
1 1 1 1
2n 2n 2n
Kpabq a ´ 2n ` b ´ 2n “ Kpaq a ´ 2n ` Kpbq b ´ 2n . 2n
(5)
a b a b

By dividing (5) by a2n and then taking limit with n Ñ `8 we get Kpabq “ Kpaq. Then (5)
redu es to Kpaq “ Kpbq. Hen e, Kpaq “ Kpbq for all a ą b ą 1.
Fix a ą 1. For every x ą 0 there is some b and an integer n su h that 1 ă b ă a and x “ bn .
Then ˆ ˙ ˆ ˙
n n 1 1
f0 pxq “ f0 pb q “ Kpbq b ´ n “ Kpaq x ´ .
b x
Hen e, we have f pxq “ f0 pxq ` f p1qx “ C1 x ` C2
x
with C1 “ Kpaq ` f p1q and C2 “ ´Kpaq.

Comment. After establishing (5), there are several variants of nishing the solution. For example,
instead of taking a limit, we an obtain a system of linear equations for Kpaq, Kpbq and Kpabq by
substituting two positive integers n in (5), say n “1 and n “ 2. This approa h leads to a similar
ending as in the rst solution.
` ˘
Optionally, we dene another fun tion f1 pxq “ f0 pxq ´ C x ´ x1 and pres ribe Kpcq “ 0 for
another xed c. Then we an hoose ab “ c and de rease the number of terms in (5).
20 Cluj-Napo a  Romania, 314 July 2018

A6. Let m, n ě 2 be integers. Let f px1 , . . . , xn q be a polynomial with real oe ients su h
that Yx ` . . . ` x ]
1 n (
f px1 , . . . , xn q “ for every x1 , . . . , xn P 0, 1, . . . , m ´ 1 .
m
Prove that the total degree of f is at least n.
(Brazil)
Solution. We transform the problem to a single variable question by the following

Lemma. Let a1 , . . . , an be nonnegative integers and let Gpxq be a nonzero polynomial with
deg G ď a1 ` . . . ` an . Suppose that some polynomial F px1 , . . . , xn q satises

F px1 , . . . , xn q “ Gpx1 ` . . . ` xn q for px1 , . . . , xn q P t0, 1, . . . , a1 u ˆ . . . ˆ t0, 1, . . . , an u.

Then F annot be the zero polynomial, and deg F ě deg G.


For proving the lemma, we will use forward dieren es of polynomials. If ppxq is a polyno-
mial with a single variable, then dene p∆pqpxq “ ppx ` 1q ´ ppxq. It is well-known that if p is
a non onstant polynomial then deg ∆p “ deg p ´ 1.
If ppx1 , . . . , xn q is a polynomial with n variables and 1 ď k ď n then let

p∆k pqpx1 , . . . , xn q “ ppx1 , . . . , xk´1 , xk ` 1, xk`1, . . . , xn q ´ ppx1 , . . . , xn q.

It is also well-known that either ∆k p is the zero polynomial or degp∆k pq ď deg p ´ 1.


Proof of the lemma. We apply indu tion on the degree of G. If G is a onstant polynomial
then we have F p0, . . . , 0q “ Gp0q ‰ 0, so F annot be the zero polynomial.
Suppose that deg G ě 1 and the lemma holds true for lower degrees. Sin e a1 ` . . . ` an ě
deg G ą 0, at least one of a1 , . . . , an is positive; without loss of generality suppose a1 ě 1.
Consider the polynomials F1 “ ∆1 F and G1 “ ∆G. On the grid t0, . . . , a1 ´1uˆt0, . . . , a2 uˆ
. . . ˆ t0, . . . , an u we have

F1 px1 , . . . , xn q “ F px1 ` 1, x2 , . . . , xn q ´ F px1 , x2 , . . . , xn q “


“ Gpx1 ` . . . ` xn ` 1q ´ Gpx1 ` . . . ` xn q “ G1 px1 ` . . . ` xn q.

Sin e G is non onstant, we have deg G1 “ deg G ´ 1 ď pa1 ´ 1q ` a2 ` . . . ` an . Therefore we an


apply the indu tion hypothesis to F1 and G1 and on lude that F1 is not the zero polynomial
and deg F1 ě deg G1 . Hen e, deg F ě deg F1 ` 1 ě deg G1 ` 1 “ deg G. That nishes the
proof. l
Xx\
To prove the problem ( statement, take the unique polynomial gpxq so that gpxq “ m for
x P 0, 1, . . . , npm ´ 1q and deg g ď npm ´ 1q. Noti e that pre isely npm ´ 1q ` 1 values
of g are pres ribed, so gpxq indeed exists and is unique. Noti e further that the onstraints
gp0q “ gp1q “ 0 and gpmq “ 1 together enfor e deg g ě 2.
By applying the lemma to a1 “ . . . “ an “ m ´ 1 and the polynomials f and g , we a hieve
deg f ě deg g . Hen e we just need a suitable lower bound on deg g .
Consider the polynomial hpxq “ gpx ` mq ´ gpxq ´ 1. The degree of gpx ` mq ´ gpxq is
deg g ´ 1 ě 1, so deg h “ deg g ´ 1 ě 1, and therefore h annot be the zero polynomial. On the
other hand, h vanishes at the points 0, 1, . . . , npm ´ 1q ´ m, so h has at least pn ´ 1qpm ´ 1q
roots. Hen e,
deg f ě deg g “ deg h ` 1 ě pn ´ 1qpm ´ 1q ` 1 ě n.
Shortlisted problems  solutions 21

Comment 1. In the lemma we have equality for the hoi e F px1 , . . . , xn q “ Gpx1 ` . . . ` xn q, so it
indeed transforms the problem to an equivalent single-variable question.

Comment 2. If m ě 3, the polynomial hpxq an be repla ed by ∆g . Noti e that

#
1 if x ” ´1 pmod mq
p∆gqpxq “ for x “ 0, 1, . . . , npm ´ 1q ´ 1.
0 otherwise

Hen e, ∆g vanishes at all integers x with 0 ď x ă npm ´ 1q and x ı ´1 pmod mq. This leads to
pm´1q2 n
deg g ě m ` 1.
m is even then this
If lower bound an be improved to npm ´ 1q. For 0 ď N ă npm ´ 1q, the
pN ` 1qst forward dieren e at x“0 is

ÿN ˆ ˙ ÿ ˆ ˙
` N `1 ˘ N ´k N N ´k N
∆ gp0q “ p´1q p∆gqpkq “ p´1q . p˚q
k“0
k 0ďkďN
k
k”´1 pmod mq

Sin e m is even, all signs in the last sum are equal; with N “ npm ´ 1q´ 1 this proves ∆npm´1q gp0q ‰ 0,
indi ating that deg g ě npm ´ 1q.

However, there are innitely many ases when all terms in p˚q an el out, for example if m is an
odd divisor of n ` 1. In su h ases, deg f an be less than npm ´ 1q.

Comment 3. The lemma is losely related to the so- alled

AlonFüredi bound. Let S1 , . . . , Sn be nonempty nite sets in a eld and suppose that
the polynomial P px1 , . . . , xn q vanishes at the points of the grid S1 ˆ . . . ˆ Sn , ex ept for a
řn ` ˘
single point. Then deg P ě |Si | ´ 1 .
i“1
(A well-known appli ation of the AlonFüredi bound was the former IMO problem 2007/6.
Sin e then, this result be ame popular among the students and is part of the IMO training
for many IMO teams.)

The proof of the lemma an be repla ed by an appli ation of the AlonFüredi bound as follows. Let
(
d “ deg G, and let G0 be the unique polynomial su h that G0 pxq “ Gpxq for x P 0, 1, . . . , d ´ 1 but
deg G0 ă d. The polynomials G0 and G are dierent be ause they have dierent degrees, and they
attain the same values at 0, 1, . . . , d ´ 1; that enfor es G0 pdq ‰ Gpdq.
Choose some nonnegative integers b1 , . . . , bn so that b1 ď a1 , . . . , bn ď an , and b1 ` . . . ` bn “ d,
and onsider the polynomial

Hpx1 , . . . , xn q “ F px1 , . . . , xn q ´ G0 px1 ` . . . ` xn q


( (
on the grid 0, 1, . . . , b1 ˆ . . . ˆ 0, 1, . . . , bn .
At the point pb1 , . . . , bn q we have Hpb1 , . . . , bn q “ Gpdq ´ G0 pdq ‰ 0. At all other points of the grid
we have F “ G and therefore H “ G´G0 “ 0. So, by the AlonFüredi bound, deg H ě b1 `. . .`bn “ d.
Sin e deg G0 ă d, this implies deg F “ degpH ` G0 q “ deg H ě d “ deg G. l
22 Cluj-Napo a  Romania, 314 July 2018

A7. Find the maximal value of


c c c c
3 a 3 b 3 c 3 d
S“ ` ` ` ,
b`7 c`7 d`7 a`7

where a, b, c, d are nonnegative real numbers whi h satisfy a ` b ` c ` d “ 100.


(Taiwan)
8
3 , rea hed when pa, b, c, dq is a y li permutation of p1, 49, 1, 49q.
Answer: ?
7
?
3 ?
3
Solution 1. Sin e the value 8{ 7 is rea hed, it su es to prove that S ď 8{ 7.
Assume that x, y, z, t is a permutation of the variables, with x ď y ď z ď t. Then, by the
rearrangement inequality,
˜c c ¸ ˆc c ˙
3 x 3 t 3 y 3 z
Sď ` ` ` .
t`7 x`7 z`7 y`7

c
x ` t ` 14
Claim. The rst bra ket above does not ex eed
3
.
7
Proof. Sin e
1 ` ˘
X 3 ` Y 3 ` 3XY Z ´ Z 3 “ pX ` Y ´ Zq pX ´ Y q2 ` pX ` Zq2 ` pY ` Zq2 ,
2
the inequality X ` Y ď Z is equivalent (when X, Y, Z ě 0) to X 3 ` Y 3 ` 3XY Z ď Z 3 .
Therefore, the laim is equivalent to
d
x t 3 xtpx ` t ` 14q x ` t ` 14
` `3 ď .
t`7 x`7 7px ` 7qpt ` 7q 7

Noti e that
d d
3 xtpx ` t ` 14q 3 tpx ` 7q xpt ` 7q 7px ` t ` 14q
3 “3 ¨ ¨
7px ` 7qpt ` 7q 7pt ` 7q 7px ` 7q pt ` 7qpx ` 7q
tpx ` 7q xpt ` 7q 7px ` t ` 14q
ď ` `
7pt ` 7q 7px ` 7q pt ` 7qpx ` 7q

by the AMGM inequality, so it su es to prove

x t tpx ` 7q xpt ` 7q 7px ` t ` 14q x ` t ` 14


` ` ` ` ď .
t ` 7 x ` 7 7pt ` 7q 7px ` 7q pt ` 7qpx ` 7q 7

A straightforward he k veries that the last inequality is in fa t an equality. l


The laim leads now to
c c c
3 x ` t ` 14 3 y ` z ` 14 3 x ` y ` z ` t ` 28 8
Sď ` ď2 “ ?3 ,
7 7 14 7
?
3
the last inequality being due to the AMCM inequality (or to the fa t that is on ave on
r0, 8q).
Shortlisted problems  solutions 23

?
3
Solution 2. We present a dierent proof for the estimate S ď 8{ 7.
Start by using Hölder's inequality:
˜ ? ¸3 ÿ ˙3 ˜ÿ ¸2 ÿ
ÿ? 6a¨ 6 a `? ˘3
ÿ ` ? ˘3
ÿ ˆ
1 ? 1
S3 “ ?
3 ď 6
a ¨ 6
a ¨ ?
3 “ a .
cyc b ` 7 cyc cyc cyc b ` 7 cyc cyc
b ` 7

Noti e that
px ´ 1q2 px ´ 7q2 2 448
ě 0 ðñ x ´ 16x ` 71 ě
x2 ` 7 x2 ` 7
yields
?
ÿ 1 1 ÿ` ? ˘ 1 ´ ÿ ? ¯ 48 ´ 2 ř b
ď b ´ 16 b ` 71 “ 384 ´ 16 b “ .
b`7 448 448 56
Finally,
˜ř ? ř? ` ř ? ˘ ¸3
1 ´ÿ ? ¯2 ´ ÿ? ¯ 1 a` a ` 48 ´ 2 a 512
S3 ď a 48 ´ 2 a ď “
56 56 3 7

by the AMGM inequality. The on lusion follows.

Comment. All the above works if we repla e 7 and 100 with ką0 and 2pk2 ` 1q, respe tively; in this
ase, the answer be omes
c
3 pk ` 1q2
2 .
k
Even further, a linear substitution allows to extend the solutions to a version with 7 and 100 being
repla ed with arbitrary positive real numbers p and q satisfying q ě 4p.
24 Cluj-Napo a  Romania, 314 July 2018

Combinatori s
C1. Let n ě 3 be an integer. Prove that there exists a set S of 2n positive integers
satisfying the following property: For every m “ 2, 3, . . . , n the set S an be partitioned into
two subsets with equal sums of elements, with one of subsets of ardinality m.
(I eland)
Solution. We show that one of possible examples is the set
" *
k k 3n ` 9
S “ t1 ¨ 3 , 2 ¨ 3 : k “ 1, 2, . . . , n ´ 1u Y 1, ´1 .
2
It is readily veried that all the numbers listed above are distin t (noti e that the last two are
not divisible by 3).
The sum of elements in S is
ˆ n ˙ n´1ÿ n´1
3 `9 k k 3n ` 9 ÿ k`1 3n ` 9 3n`1 ´ 9
Σ “ 1` ´1 ` p1 ¨ 3 ` 2 ¨ 3 q “ ` 3 “ ` “ 2 ¨ 3n .
2 k“1
2 k“1
2 2

Hen e, in order to show that this set satises the problem requirements, it su es to present,
for every m “ 2, 3, . . . , n, an m-element subset Am Ă S whose sum of elements equals 3n .
Su h a subset is

Am “ t2 ¨ 3k : k “ n ´ m ` 1, n ´ m ` 2, . . . , n ´ 1u Y t1 ¨ 3n´m`1 u.

Clearly, |Am | “ m. The sum of elements in Am is


n´1
ÿ 2 ¨ 3n ´ 2 ¨ 3n´m`1
3n´m`1 ` 2 ¨ 3k “ 3n´m`1 ` “ 3n ,
k“n´m`1
2

as required.

Comment. Let us present a more general onstru tion. Let s1 , s2 , . . . , s2n´1 be a sequen e of pairwise
distin t positive integers satisfying s2i`1 “ s2i ` s2i´1 for all i “ 2, 3, . . . , n ´ 1. Set s2n “ s1 ` s2 `
¨ ¨ ¨ ` s2n´4 .
Assume that s2n is distin t from the other terms of the sequen e. Then the set S “ ts1 , s2 , . . . , s2n u
satises the problem requirements. Indeed, the sum of its elements is

2n´4
ÿ
Σ“ si ` ps2n´3 ` s2n´2 q ` s2n´1 ` s2n “ s2n ` s2n´1 ` s2n´1 ` s2n “ 2s2n ` 2s2n´1 .
i“1

Therefore, we have

Σ
“ s2n ` s2n´1 “ s2n ` s2n´2 ` s2n´3 “ s2n ` s2n´2 ` s2n´4 ` s2n´5 “ . . . ,
2
whi h shows that the required sets Am an be hosen as

Am “ ts2n , s2n´2 , . . . , s2n´2m`4 , s2n´2m`3 u.

So, the only ondition to be satised is s2n R ts1 , s2 , . . . , s2n´1 u, whi h an be a hieved in many
dierent ways (e.g., by hoosing properly the number s1 after spe ifying s2 , s3 , . . . , s2n´1 ).

The solution above is an instan e of this general onstru tion. Another instan e, for n ą 3, is the
set
tF1 , F2 , . . . , F2n´1 , F1 ` ¨ ¨ ¨ ` F2n´4 u,
where F1 “ 1, F2 “ 2, Fn`1 “ Fn ` Fn´1 is the usual Fibona i sequen e.
Shortlisted problems  solutions 25

C2. Queenie and Horst play a game on a 20 ˆ 20 hessboard. In the beginning the board
is empty. In every turn, Horst pla es a bla k knight on an empty square in su h a way that his
new knight does not atta k any previous knights. Then Queenie pla es a white queen on an
empty square. The game gets nished when somebody annot move.
Find the maximal positive K su h that, regardless of the strategy of Queenie, Horst an
put at least K knights on the board.
(Armenia)
Answer: K “ 202 {4 “ 100. In ase of a 4N ˆ 4M board, the answer is K “ 4NM .
Solution. We show two strategies, one for Horst to pla e at least 100 knights, and another
strategy for Queenie that prevents Horst from putting more than 100 knights on the board.
A strategy for Horst: Put knights only on bla k squares, until all bla k squares get
o upied.
Colour the squares of the board bla k and white in the usual way, su h that the white
and bla k squares alternate, and let Horst put his knights on bla k squares as long as it is
possible. Two knights on squares of the same olour never atta k ea h other. The number of
bla k squares is 202 {2 “ 200. The two players o upy the squares in turn, so Horst will surely
nd empty bla k squares in his rst 100 steps.
A strategy for Queenie: Group the squares into y les of length 4, and after ea h step
of Horst, o upy the opposite square in the same y le.
Consider the squares of the board as verti es of a graph; let two squares be onne ted if
two knights on those squares would atta k ea h other. Noti e that in a 4 ˆ 4 board the squares
an be grouped into 4 y les of length 4, as shown in Figure 1. Divide the board into parts of
size 4 ˆ 4, and perform the same grouping in every part; this way we arrange the 400 squares
of the board into 100 y les (Figure 2).

A C

B
Figure 1 Figure 2 Figure 3

The strategy of Queenie an be as follows: Whenever Horst puts a new knight to a ertain
square A, whi h is part of some y le A ´ B ´ C ´ D ´ A, let Queenie put her queen on the
opposite square C in that y le (Figure 3). From this point, Horst annot put any knight on
A or C be ause those squares are already o upied, neither on B or D be ause those squares
are atta ked by the knight standing on A. Hen e, Horst an put at most one knight on ea h
y le, that is at most 100 knights in total.

Comment 1. Queenie's strategy an be pres ribed by a simple rule: divide the board into 4ˆ4
parts; whenever Horst puts a knight in a part P, Queenie ree ts that square about the entre of P
and puts her queen on the ree ted square.

Comment 2. The result remains the same if Queenie moves rst. In the rst turn, she may put
her rst queen arbitrarily. Later, if she has to put her next queen on a square that already ontains a
queen, she may move arbitrarily again.
26 Cluj-Napo a  Romania, 314 July 2018

C3. Let n be a given positive integer. Sisyphus performs a sequen e of turns on a board
onsisting of n ` 1 squares in a row, numbered 0 to n from left to right. Initially, n stones
are put into square 0, and the other squares are empty. At every turn, Sisyphus hooses any
nonempty square, say with k stones, takes one of those stones and moves it to the right by at
most k squares (the stone should stay within the board). Sisyphus' aim is to move all n stones
to square n.
Prove that Sisyphus annot rea h the aim in less than
QnU QnU QnU QnU
` ` ` ¨¨¨`
1 2 3 n
turns. (As usual, rxs stands for the least integer not smaller than x.)
(Netherlands)
Solution. The stones are indistinguishable, and all have the same origin and the same nal
position. So, at any turn we an pres ribe whi h stone from the hosen square to move. We
do it in the following manner. Number the stones from 1 to n. At any turn, after hoosing a
square, Sisyphus moves the stone with the largest number from this square.
This way, when stone k is moved from some square, that square ontains not more than k
stones (sin e all their numbers are at most k ). Therefore, stone k is moved by at most k squares
at ea h turn. Sin e the total shift of the stone is exa tly n, at least rn{ks moves of stone k
should have been made, for every k “ 1, 2, . . . , n.
By summing up over all k “ 1, 2, . . . , n, we get the required estimate.

Comment. The original submission ontained the se ond part, asking for whi h values of n the equality
an be a hieved. The answer is n “ 1, 2, 3, 4, 5, 7. The Problem Sele tion Committee onsidered this
part to be less suitable for the ompetition, due to te hni alities.
Shortlisted problems  solutions 27

C4. An anti-Pas al pyramid is a nite set of numbers, pla ed in a triangle-shaped array


so that the rst row of the array ontains one number, the se ond row ontains two numbers,
the third row ontains three numbers and so on; and, ex ept for the numbers in the bottom
row, ea h number equals the absolute value of the dieren e of the two numbers below it. For
instan e, the triangle below is an anti-Pas al pyramid with four rows, in whi h every integer
from 1 to 1 ` 2 ` 3 ` 4 “ 10 o urs exa tly on e:
4
2 6
5 7 1
8 3 10 9 .
Is it possible to form an anti-Pas al pyramid with 2018 rows, using every integer from 1 to
1 ` 2 ` ¨ ¨ ¨ ` 2018 exa tly on e?
(Iran)
Answer: No, it is not possible.
Solution. Let T be an anti-Pas al pyramid with n rows, ontaining every integer from 1 to
1`2`¨ ¨ ¨`n, and let a1 be the topmost number in T (Figure 1). The two numbers below a1 are
some a2 and b2 “ a1 ` a2 , the two numbers below b2 are some a3 and b3 “ a1 ` a2 ` a3 , and so
on and so forth all the way down to the bottom row, where some an and bn “ a1 ` a2 ` ¨ ¨ ¨ ` an
are the two neighbours below bn´1 “ a1 ` a2 ` ¨ ¨ ¨ ` an´1 . Sin e the ak are n pairwise distin t
positive integers whose sum does not ex eed the largest number in T , whi h is 1 ` 2 ` ¨ ¨ ¨ ` n,
it follows that they form a permutation of 1, 2, . . . , n.

a1
a2 b2
a3 b3 T
..................
an-1 bn-1
T’ T’’
bn an
Figure 1 Figure 2
Consider now (Figure 2) the two `equilateral' subtriangles of T whose bottom rows ontain
the numbers to the left, respe tively right, of the pair an , bn . (One of these subtriangles may
very well be empty.) At least one of these subtriangles, say T 1 , has side length ℓ ě rpn ´ 2q{2s.
Sin e T 1 obeys the anti-Pas al rule, it ontains ℓ pairwise distin t positive integers a11 , a12 , . . . , a1ℓ ,
where a11 is at the apex, and a1k and b1k “ a11 ` a12 ` ¨ ¨ ¨` a1k are the two neighbours below b1k´1 for
ea h k “ 2, 3 . . . , ℓ. Sin e the ak all lie outside T 1 , and they form a permutation of 1, 2, . . . , n,
the a1k are all greater than n. Consequently,
ℓp2n ` ℓ ` 1q
b1ℓ ě pn ` 1q ` pn ` 2q ` ¨ ¨ ¨ ` pn ` ℓq “
ˆ ˙ 2
1 n´2 n´2 5npn ´ 2q
ě ¨ 2n ` `1 “ ,
2 2 2 8
whi h is greater than 1 ` 2 ` ¨ ¨ ¨ ` n “ npn ` 1q{2 for n “ 2018. A ontradi tion.
Comment. The above estimate may be slightly improved by noti ing that b1ℓ ‰ bn . This implies
npn ` 1q{2 “ bn ą b1ℓ ě rpn ´ 2q{2s p2n ` rpn ´ 2q{2s ` 1q {2, so nď7 if n is odd, and n ď 12 if n is
even. It seems that the largest anti-Pas al pyramid whose entries are a permutation of the integers
from 1 to 1 ` 2 ` ¨¨¨ ` n has 5 rows.
28 Cluj-Napo a  Romania, 314 July 2018

C5. Let k be a positive integer. The organising ommittee of a tennis tournament is to


s hedule the mat hes for 2k players so that every two players play on e, ea h day exa tly one
mat h is played, and ea h player arrives to the tournament site the day of his rst mat h, and
departs the day of his last mat h. For every day a player is present on the tournament, the
ommittee has to pay 1 oin to the hotel. The organisers want to design the s hedule so as to
minimise the total ost of all players' stays. Determine this minimum ost.
(Russia)
Answer: The required minimum is kp4k 2 ` k ´ 1q{2.
`2k˘
Solution 1. Enumerate the days of the tournament 1, 2, . . . , 2
. Let b1 ď b2 ď ¨ ¨ ¨ ď b2k be
the days the players arrive to the tournament, arranged in nonde reasing order; similarly, let
e1 ě ¨ ¨ ¨ ě e2k be the days they depart arranged in nonin reasing order (it may happen that a
player arrives on day bi and departs on day ej , where i ‰ j ). If a player arrives on day b and
departs on day e, then his stay ost is e ´ b ` 1. Therefore, the total stay ost is
2k
ÿ 2k
ÿ 2k
ÿ
Σ“ ei ´ bi ` n “ pei ´ bi ` 1q.
i“1 i“1 i“1

Bounding the total ost from below. To` ˘this end, estimate ei`1 ´ bi`1 ` 1. Before day
` i ˘ bi`1 ,
only i players were present, so at most 2 mat hes ould be played. Therefore, bi`1 ď
i
2
` 1.
`˘ ` ˘ `i˘
Similarly, at most 2i mat hes ould be played after day ei`1 , so ei ě 2k
2
´ 2 . Thus,
ˆ ˙ ˆ ˙
2k i
ei`1 ´ bi`1 ` 1 ě ´2 “ kp2k ´ 1q ´ ipi ´ 1q.
2 2
This lower bound an be improved for i ą k : List the i players who arrived rst, and
the i players who departed last; at least 2i ´ 2k players appear in both lists. The mat hes
between these players were ounted twi e, though the players in ea h pair have played only
on e. Therefore, if i ą k , then
ˆ ˙ ˆ ˙ ˆ ˙
2k i 2i ´ 2k
ei`1 ´ bi`1 ` 1 ě ´2 ` “ p2k ´ iq2 .
2 2 2

An optimal tournament, We now des ribe a s hedule in whi h the lower bounds above are all
a hieved simultaneously. Split players into two groups X and Y , ea h of ardinality k . Next,
partition the s hedule into three parts. During the rst part, the players from X arrive one by
one, and ea h newly arrived player immediately plays with everyone already present. During
the third part (after all players from X have already departed) the players from Y depart one
by one, ea h playing with everyone still present just before departing.
In the middle part, everyone from X should play with everyone from Y . Let S1 , S2 , . . . , Sk
be the players in X , and let T1 , T2 , . . . , Tk be the players in Y . Let T1 , T2 , . . . , Tk arrive in
this order; after Tj arrives, he immediately plays with all the Si , i ą j . Afterwards, players Sk ,
Sk´1 , . . . , S1 depart in this order; ea h Si plays with all the Tj , i ď j , just before his departure,
and Sk departs the day Tk arrives. For 0 ď s ď k ´ 1, the number of mat hes played between
Tk´s 's arrival and Sk´s 's departure is
k´1
ÿ k´1
ÿ 1 1
pk ´ jq ` 1 ` pk ´ j ` 1q “ sps ` 1q ` 1 ` sps ` 3q “ ps ` 1q2 .
j“k´s j“k´s
2 2

Thus, if i ą k , then the number of mat hes that have been played between Ti´k`1 's arrival,
whi h is bi`1 , and Si´k`1 's departure, whi h is ei`1 , is p2k ´iq2 ; that is, ei`1 ´bi`1 `1 “ p2k ´iq2 ,
showing the se ond lower bound a hieved for all i ą k .
Shortlisted problems  solutions 29

If i ď k , then the mat hes `between


˘ the i players `present
˘ before bi`1 all fall in the rst part
of the s hedule, so there are 2i su h, and bi`1 “ 2i ` 1. Similarly, after ei`1 , there are i
`˘ ` ˘ `i˘
players left, all 2i mat hes now fall in the third part of the s hedule, and ei`1 “ 2k 2
´ 2 .
The rst lower bound is therefore also a hieved for all i ď k .
Consequently, all lower bounds are a hieved simultaneously, and the s hedule is indeed
optimal.
Evaluation. Finally, evaluate the total ost for the optimal s hedule:
k k k´1
ÿ ` ˘ 2k´1
ÿ ÿ ÿ
Σ“ kp2k ´ 1q ´ ipi ´ 1q ` p2k ´ iq2 “ pk ` 1qkp2k ´ 1q ´ ipi ´ 1q ` j2
i“0 i“k`1 i“0 j“1
1 1
“ kpk ` 1qp2k ´ 1q ´ k 2 ` kpk ` 1q “ kp4k 2 ` k ´ 1q.
2 2

Solution 2. Consider any tournament s hedule. Label players P1 , P2 , . . . , P2k in order of


their arrival, and label them again Q2k , Q2k´1 , . . ., Q1 in order of their departure, to dene a
permutation a1 , a2 , . . . , a2k of 1, 2, . . . , 2k by Pi “ Qai .
We rst des ribe an optimal tournament for any given permutation a1 , a2 , . . . , a2k of the
indi es 1, 2, . . . , 2k . Next, we nd an optimal permutation and an optimal tournament.
Optimisation for a xed a1 , . . . , a2k . We say that the ost of the mat h between Pi and Pj
is the number of players present at the tournament when this mat h is played. Clearly, the
Committee pays for ea h day the ost of the mat h of that day. Hen e, we are to minimise the
total ost of all mat hes.
Noti e that Q2k 's departure does not pre ede P2k 's arrival. Hen e, the number of play-
ers at the tournament monotoni ally in reases (non-stri tly) until it rea hes 2k , and then
monotoni ally de reases (non-stri tly). So, the best time to s hedule the mat h between Pi
and `Pj is either when Pmaxpi,jq˘ arrives, or when Qmaxpai ,aj q departs, in whi h ase the ost is
min maxpi, jq, maxpai , aj q .
Conversely, assuming that i ą j , if this mat h is s heduled between the arrivals of Pi and
Pi`1 , then its ost will be exa tly i “ maxpi, jq. Similarly, one an make it ost maxpai , aj q.
Obviously, these onditions an all be simultaneously satised, so the minimal ost for a xed
sequen e a1 , a2 , . . . , a2k is
ÿ ` ˘
Σpa1 , . . . , a2k q “ min maxpi, jq, maxpai , aj q . (1)
1ďiăjď2k

Optimising the sequen e pai q. Optimisation hinges on the lemma below.


Lemma. If a ď b and c ď d, then
` ˘ ` ˘
min maxpa, xq, maxpc, yq ` min maxpb, xq, maxpd, yq
` ˘ ` ˘
ě min maxpa, xq, maxpd, yq ` min maxpb, xq, maxpc, yq .
Proof. Write a1 “ maxpa, xq ď maxpb, xq “ b1 and c1 “ maxpc, yq ď maxpd, yq “ d1 and he k
that minpa1 , c1 q ` minpb1 , d1 q ě minpa1 , d1 q ` minpb1 , c1 q. l
Consider a permutation a1 , a2 , . . . , a2k su h that ai ă aj for some i ă j . Swapping ai
and aj does not hange the pi, jqth summand in (1), and for ℓ R ti, ju the sum of the pi, ℓqth
and the pj, ℓqth summands does not in rease by the Lemma. Hen e the optimal value does not
in rease, but the number of disorders in the permutation in reases. This pro ess stops when
ai “ 2k ` 1 ´ i for all i, so the required minimum is
ÿ ` ˘
Sp2k, 2k ´ 1, . . . , 1q “ min maxpi, jq, maxp2k ` 1 ´ i, 2k ` 1 ´ jq
1ďiăjď2k
ÿ
“ minpj, 2k ` 1 ´ iq.
1ďiăjď2k
30 Cluj-Napo a  Romania, 314 July 2018

The latter sum is fairly tra table and yields the stated result; we omit the details.

Comment. If the number of players is odd, say, 2k ´ 1, the required minimum is kpk ´ 1qp4k ´ 1q{2.
In this ase, |X| “ k, |Y | “ k ´ 1, the argument goes along the same lines, but some additional
te hni alities are to be taken are of.
Shortlisted problems  solutions 31

This page is intentionally left blank


32 Cluj-Napo a  Romania, 314 July 2018

C6. Let a and b be distin t positive integers. The following innite pro ess takes pla e on
an initially empty board.

piq If there is at least a pair of equal numbers on the board, we hoose su h a pair and
in rease one of its omponents by a and the other by b.

piiq If no su h pair exists, we write down two times the number 0.

Prove that, no matter how we make the hoi es in piq, operation piiq will be performed only
nitely many times.
(Serbia)
Solution 1. We may assume gcdpa, bq “ 1; otherwise we work in the same way with multiples
of d “ gcdpa, bq.
Suppose that after N moves of type piiq and some moves of type piq we have to add two
new zeros. For ea h integer k , denote by f pkq the number of times that the number k appeared
on the board up to this moment. Then f p0q “ 2N and f pkq “ 0 for k ă 0. Sin e the board
ontains at most one k ´ a, every se ond o urren e of k ´ a on the board produ ed, at some
moment, an o urren e of k ; the same stands for k ´ b. Therefore,
Z ^ Z ^
f pk ´ aq f pk ´ bq
f pkq “ ` , p1q
2 2

yielding
f pk ´ aq ` f pk ´ bq
f pkq ě ´ 1. p2q
2
Sin e gcdpa, bq “ 1, every integer x ą ab ´ a ´ b is expressible in the form x “ sa ` tb, with
integer s, t ě 0.
We will prove by indu tion on s ` t that if x “ sa ` bt, with s, t nonnegative integers, then

f p0q
f pxq ą ´ 2. p3q
2s`t
The base ase s`t “ 0 is trivial. Assume now that p3q is true for s`t “ v . Then, if s`t “ v `1
and x “ sa ` tb, at least one of the numbers s and t  say s  is positive, hen e by p2q,
` ˘ ˆ ˙
f ps ´ 1qa ` tb 1 f p0q f p0q
f pxq “ f psa ` tbq ě ´1ą s`t´1
´ 2 ´ 1 “ s`t ´ 2.
2 2 2 2

Assume now that we must perform moves of type piiq ad innitum. Take n “ ab ´ a ´ b and
suppose b ą a. Sin e ea h of the numbers n ` 1, n ` 2, . . . , n ` b an be expressed in the form
sa ` tb, with 0 ď s ď b and 0 ď t ď a, after moves of type piiq have been performed 2a`b`1
times and we have to add a new pair of zeros, ea h f pn ` kq, k “ 1, 2, . . . , b, is at least 2. In
this ase p1q yields indu tively f pn ` kq ě 2 for all k ě 1. But this is absurd: after a nite
number of moves, f annot attain nonzero values at innitely many points.

Solution 2. We start by showing that the result of the pro ess in the problem does not
depend on the way the operations are performed. For that purpose, it is onvenient to modify
the pro ess a bit.
Claim 1. Suppose that the board initially ontains a nite number of nonnegative integers,
and one starts performing type piq moves only. Assume that one had applied k moves whi h led
to a nal arrangement where no more type piq moves are possible. Then, if one starts from the
same initial arrangement, performing type piq moves in an arbitrary fashion, then the pro ess
will ne essarily stop at the same nal arrangement
Shortlisted problems  solutions 33

Proof. Throughout this proof, all moves are supposed to be of type piq.
Indu t on k ; the base ase k “ 0 is trivial, sin e no moves are possible. Assume now that
k ě 1. Fix some anoni al pro ess, onsisting of k moves M1 , M2 , . . . , Mk , and rea hing the
nal arrangement A. Consider any sample pro ess m1 , m2 , . . . starting with the same initial
arrangement and pro eeding as long as possible; learly, it ontains at least one move. We need
to show that this pro ess stops at A.
Let move m1 onsist in repla ing two opies of x with x ` a and x ` b. If move M1 does
the same, we may apply the indu tion hypothesis to the arrangement appearing after m1 .
Otherwise, the anoni al pro ess should still ontain at least one move onsisting in repla ing
px, xq ÞÑ px ` a, x ` bq, be ause the initial arrangement ontains at least two opies of x, while
the nal one ontains at most one su h.
Let Mi be the rst su h move. Sin e the opies of x are indistinguishable and no other opy
of x disappeared before Mi in the anoni al pro ess, the moves in this pro ess an be permuted
as Mi , M1 , . . . , Mi´1 , Mi`1 , . . . , Mk , without ae ting the nal arrangement. Now it su es to
perform the move m1 “ Mi and apply the indu tion hypothesis as above. l
Claim 2. Consider any pro ess starting from the empty board, whi h involved exa tly n moves
of type piiq and led to a nal arrangement where all the numbers are distin t. Assume that
one starts with the board ontaining 2n zeroes (as if n moves of type piiq were made in the
beginning), applying type piq moves in an arbitrary way. Then this pro ess will rea h the same
nal arrangement.
Proof. Starting with the board with 2n zeros, one may indeed model the rst pro ess mentioned
in the statement of the laim, omitting the type piiq moves. This way, one rea hes the same
nal arrangement. Now, Claim 1 yields that this nal arrangement will be obtained when
type piq moves are applied arbitrarily. l
Claim 2 allows now to reformulate the problem statement as follows: There exists an integer
n su h that, starting from 2n zeroes, one may apply type piq moves indenitely.
In order to prove this, we start with an obvious indu tion on s ` t “ k ě 1 to show that if
we start with 2s`t zeros, then we an get simultaneously on the board, at some point, ea h of
the numbers sa ` tb, with s ` t “ k .
Suppose now that a ă b. Then, an appropriate use of separate groups of zeros allows us to
get two opies of ea h of the numbers sa ` tb, with 1 ď s, t ď b.
Dene N “ ab´a´b, and noti e that after representing ea h of numbers N `k , 1 ď k ď b, in
the form sa`tb, 1 ď s, t ď b we an get, using enough zeros, the numbers N `1, N `2, . . . , N `a
and the numbers N ` 1, N ` 2, . . . , N ` b.
From now on we an perform only moves of type piq. Indeed, if n ě N , the o urren e of the
numbers n ` 1, n ` 2, . . . , n ` a and n ` 1, n ` 2, . . . , n ` b and the repla ement pn ` 1, n ` 1q ÞÑ
pn ` b ` 1, n ` a ` 1q leads to the o urren e of the numbers n ` 2, n ` 3, . . . , n ` a ` 1 and
n ` 2, n ` 3, . . . , n ` b ` 1.

Comment. The proofs of Claims 1 and 2 may be extended in order to show that in fa t the number
of moves in the anoni al pro ess is the same as in an arbitrary sample one.
34 Cluj-Napo a  Romania, 314 July 2018

C7. Consider 2018 pairwise rossing ir les no three of whi h are on urrent. These ir les
subdivide the plane into regions bounded by ir ular edges that meet at verti es. Noti e that
there are an even number of verti es on ea h ir le. Given the ir le, alternately olour the
verti es on that ir le red and blue. In doing so for ea h ir le, every vertex is oloured twi e 
on e for ea h of the two ir les that ross at that point. If the two olourings agree at a vertex,
then it is assigned that olour; otherwise, it be omes yellow. Show that, if some ir le ontains
at least 2061 yellow points, then the verti es of some region are all yellow.
(India)
Solution 1. Letting n “ 2018, we will show that,
? if every region has at least one non-yellow
vertex, then every ir le ontains at most n ` t n ´ 2u ´ 2 yellow points. In the ase at hand,
the latter equals 2018 ` 44 ´ 2 “ 2060, ontradi ting the hypothesis.
Consider the natural geometri graph G asso iated with the onguration of n ir les. Fix
any ir le C in the onguration, let k be the number of yellow points on C , and nd a suitable
lower bound for the total number of yellow verti es of G in terms of k and n. It turns out that
k is even, and G has at least
ˆ ˙ ˆ ˙
k{2 n ´ k{2 ´ 1 k2
k`2 `2 “ ´ pn ´ 2qk ` pn ´ 2qpn ´ 1q p˚q
2 2 2

yellow verti es. The proof hinges on the two lemmata below.
Lemma 1. Let two ir les in the onguration ross at x and y . Then x and y are either both
yellow or both non-yellow.
Proof. This is be ause the numbers of interior verti es on the four ar s x and y determine on
the two ir les have like parities. l
In parti ular, ea h ir le in the onguration ontains an even number of yellow verti es.
Lemma 2. If xŇy , yŇz , and zŇx are ir ular ar s of three pairwise distin t ir les in the ongu-
ration, then the number of yellow verti es in the set tx, y, zu is odd.
Proof. Let C1 , C2 , C3 be the three ir les under onsideration. Assume, without loss of gen-
erality, that C2 and C3 ross at x, C3 and C1 ross at y , and C1 and C2 ross at z . Let k1 ,
k2 , k3 be the numbers of interior verti es on the three ir ular ar s under onsideration. Sin e
ea h ir le in the onguration, dierent from the Ci , rosses the y le x x at an even
Ňy Y yŇz Y zŇ
number of points (re all that no three ir les are on urrent), and self- rossings are ounted
twi e, the sum k1 ` k2 ` k3 is even.
Let Z1 be the olour z gets from C1 and dene the other olours similarly. By the pre eding,
the number of bi hromati pairs in the list pZ1 , Y1 q, pX2 , Z2 q, pY3 , X3 q is odd. Sin e the total
number of olour hanges in a y le Z1 Y1 Y3 X3 X2 Z2 Z1 is even, the number of bi hromati
pairs in the list pX2 , X3 q, pY1 , Y3 q, pZ1 , Z2q is odd, and the lemma follows. l
We are now in a position to prove that p˚q bounds the total number of yellow verti es from
below. Refer to Lemma 1 to infer that the k yellow verti es on C pair o to form the pairs of
points where C is rossed by k{2` ir˘les in the onguration. By Lemma 2, these ir les ross
pairwise to a ount for another 2 k{2 2
yellow verti es. Finally, the remaining n ´ k{2 ´ 1 ir les
in the onguration ross C at non-yellow verti es, by Lemma 1, and` Lemma ˘ 2 applies again
to show that these ir les ross pairwise to a ount for yet another 2 n´k{2´1
2
yellow verti es.
Consequently, there are at least p˚q yellow verti es.
Next, noti e that G is a plane graph on npn ´ 1q degree 4 verti es, having exa tly 2npn ´ 1q
edges and exa tly npn ´ 1q ` 2 fa es (regions), the outer fa e in lusive (by Euler's formula for
planar graphs).
Lemma 3. Ea h fa e of G has equally many red and blue verti es. In parti ular, ea h fa e has
an even number of non-yellow verti es.
Shortlisted problems  solutions 35

Proof. Tra e the boundary of a fa e on e in ir ular order, and onsider the olours ea h vertex
is assigned in the olouring of the two ir les that ross at that vertex, to infer that olours of
non-yellow verti es alternate. l
Consequently, if ea h region has at least one non-yellow vertex, then it has at least two su h.
Sin e ea h vertex of G has degree 4, onsideration of vertex-fa e in iden es shows that G has
at least npn ´ 1q{2 ` 1 non-yellow verti es, and hen e at most npn ´ 1q{2 ´ 1 yellow verti es. (In
fa t, Lemma 3 shows that there are at least npn ´ 1q{4 ` 1{2 red, respe tively blue, verti es.)
Finally, re all the lower bound p˚q for the total number of yellow verti es?in G, to write
npn ´ 1q{2 ´ 1 ě k 2 {2 ´ pn ´ 2qk ` pn ´ 2qpn ´ 1q, and on lude that k ď n ` t n ´ 2u ´ 2, as
laimed in the rst paragraph.

Solution 2. The rst two lemmata in Solution 1 show that the ir les in the onguration
split into two lasses: Consider any ir le C along with all ir les that ross C at yellow points
to form one lass; the remaining ir les then form the other lass. Lemma 2 shows that any pair
of ir les in the same lass ross at yellow points; otherwise, they ross at non-yellow points.
Call the ir les from the two lasses white and bla k, respe tively. Call a region yellow if
its verti es are all yellow. Let w and b be the numbers of white and bla k ir les, respe tively;
learly, w ` b “ n. Assume that w ě b, and that there is no yellow region. Clearly, b ě 1,
otherwise ea h region is yellow. The white ir les subdivide the plane into wpw ´ 1q ` 2 larger
regions  all them white. The white regions (or rather their boundaries) subdivide ea h bla k
ir le into bla k ar s. Sin e there are no yellow regions, ea h white region ontains at least one
bla k ar .
Consider any white region; let it ontain t ě 1 bla k ar s. We laim that the number of
points at whi h these t ar s ross does not ex eed t ´ 1. To prove this, onsider a multigraph
whose verti es are these bla k ar s, two verti es being joined by an edge for ea h point at whi h
the orresponding ar s ross. If this graph had more than t ´ 1 edges, it would ontain a y le,
sin e it has t verti es; this y le would orrespond to a losed ontour formed by bla k sub-ar s,
lying inside the region under onsideration. This ontour would, in turn, dene at least one
yellow region, whi h is impossible.
Let řti be the number of bla k ar s `inside
˘ the ith white region. The total number of bla k
ar s is i ti “ 2wb, and they ross at 2 2b “ bpb ´ 1q points. By the pre eding,

w2 ÿ
´w`2 w2 ÿ
´w`2
bpb ´ 1q ď pti ´ 1q “ ti ´ pw 2 ´ w ` 2q “ 2wb ´ pw 2 ´ w ` 2q,
i“1 i“1
?
or, equivalently, pw ´ bq2`ď w `?b ´ 2 “˘n ´ 2, whi h is the ase if and only if w ´ b ?
ď t n ´ 2u.
Consequently, b ď w ď n ` t n ´ 2u {2, so there are at most 2pw ´ 1q ď n ` t n ´ 2u ´ 2
yellow verti es on ea h ir le  a ontradi tion.
36 Cluj-Napo a  Romania, 314 July 2018

Geometry
G1. Let ABC be an a ute-angled triangle with ir um ir le Γ. Let D and E be points on
the segments AB and AC , respe tively, su h that AD “ AE . The perpendi ular bise tors of
the segments BD and CE interse t the small ar s AB
Ŋ and AC
Ŋ at points F and G respe tively.
Prove that DE k F G.
(Gree e)
Solution 1. In the sequel, all the onsidered ar s are small ar s.
Let P be the midpoint of the ar BC Ŋ . Then AP is the bise tor of =BAC , hen e, in the
isos eles triangle ADE , AP K DE . So, the statement of the problem is equivalent to AP K F G.
In order to prove this, let K be the se ond interse tion of Γ with F D . Then the triangle
F BD is isos eles, therefore
=AKF “ =ABF “ =F DB “ =ADK,
yielding AK “ AD . In the same way, denoting by L the se ond interse tion of Γ with GE , we
get AL “ AE . This shows that AK “ AL.
A
K

L
E
D
G
F

B C
P

Now =F BD “ =F DB gives AF Ŋ “ BF
Ŋ ` AK
Ŋ “ BF Ň , hen e BF
Ŋ ` AL Ň . In a similar
Ŋ “ LF
way, we get CG
Ŋ “ GKŊ . This yields
Ŋ`P
AF ŊG Ň ` LF
AL Ň `P Ŋ Ŋ
C ` CG Ŋ ` LB
KL Ŋ ` BCŊ ` CK
Ŋ
=pAP, F Gq “ “ “ “ 90˝ .
2 2 4

Solution 2. Let Z “ AB X F G, T “ AC X F G. It su es to prove that =AT Z “ =AZT .


Let X be the point for whi h F XAD is a parallelogram. Then
=F XA “ =F DA “ 180˝ ´ =F DB “ 180˝ ´ =F BD,
where in the last equality we used that F D “ F B . It follows that the quadrilateral BF XA is
y li , so X lies on Γ.
G
C
Y

E T

A D Z
B
X
F
Shortlisted problems  solutions 37

Analogously, if Y is the point for whi h GY AE is a parallelogram, then Y lies on Γ. So


the quadrilateral XF GY is y li and F X “ AD “ AE “ GY , hen e XF GY is an isos eles
trapezoid.
Now, by XF k AZ and Y G k AT , it follows that =AT Z “ =Y GF “ =XF G “ =AZT .

Solution 3. As in the rst solution, we prove that F G K AP , where P is the midpoint of the
small ar BC
Ŋ.
Let O be the ir um entre of the triangle ABC , and let M and N be the midpoints of the
small ar s AB
Ŋ and ACŊ , respe tively. Then OM and ON are the perpendi ular bise tors of AB
and AC , respe tively.
A

M
O E d
d G
D
F

B C
P

The distan e d between OM and the perpendi ular bise tor of BD is 12 AB ´ 12 BD “ 21 AD ,


hen e it is equal to the distan e between ON and the perpendi ular bise tor of CE .
This shows that the isos eles trapezoid determined by the diameter δ of Γ through M and
the hord parallel to δ through F is ongruent to the isos eles trapezoid determined by the
diameter δ 1 of Γ through N and the hord parallel to δ 1 through G. Therefore MF “ NG,
yielding MN k F G.
Now
1 ` Ŋ Ŋ Ŋ ˘ 1 `Ŋ Ŋ Ŋ˘
=pMN, AP q “ AM ` P C ` CN “ AB ` BC ` CA “ 90˝ ,
2 4
hen e MN K AP , and the on lusion follows.
38 Cluj-Napo a  Romania, 314 July 2018

G2. Let ABC be a triangle with AB “ AC , and let M be the midpoint of BC . Let P be
a point su h that P B ă P C and P A is parallel to BC . Let X and Y be points on the lines
P B and P C , respe tively, so that B lies on the segment P X , C lies on the segment P Y , and
=P XM “ =P Y M . Prove that the quadrilateral AP XY is y li .
(Australia)
Solution. Sin e AB “ AC , AM is the perpendi ular bise tor of BC , hen e =P AM “
=AMC “ 90˝ .

P A

M C
B

X Z

Now let Z be the ommon point of AM and the perpendi ular through Y to P C (noti e
that Z lies on to the ray AM beyond M ). We have =P AZ “ =P Y Z “ 90˝ . Thus the points
P , A, Y , and Z are on y li .
Sin e =CMZ “ =CY Z “ 90˝ , the quadrilateral CY ZM is y li , hen e =CZM “
=CY M . By the ondition in the statement, =CY M “ =BXM , and, by symmetry in ZM ,
=CZM “ =BZM . Therefore, =BXM “ =BZM . It follows that the points B , X , Z , and M
are on y li , hen e =BXZ “ 180˝ ´ =BMZ “ 90˝ .
Finally, we have =P XZ “ =P Y Z “ =P AZ “ 90˝ , hen e the ve points P, A, X, Y, Z are
on y li . In parti ular, the quadrilateral AP XY is y li , as required.

Comment 1. Clearly, the key point Z from the solution above an be introdu ed in several dierent
ways, e.g., as the se ond meeting point of the ir le CM Y and the line AM , or as the se ond meeting
point of the ir les CM Y andBM X , et .
For some of denitions of Z its lo ation is not obvious. For instan e, if Z is dened as a ommon
point of AM and the perpendi ular through X to P X , it is not lear that Z lies on the ray AM
beyond M . To avoid su h slippery details some more restri tions on the onstru tion may be required.

Comment 2. Let us dis uss a onne tion to the Miquel point of a y li quadrilateral. Set X1 “
1
M X X P C , Y “ M Y X P B , and Q “ XY X X 1 Y 1 (see the gure below).
We laim that BC k P Q. (One way of proving this is the following. Noti e that the quadruple
of lines P X, P M, P Y, P Q is harmoni , hen e the quadruple B , M , C , P Q X BC of their interse tion
points with BC is harmoni . Sin e M is the midpoint of BC , P Q X BC is an ideal point, i.e.,
P Q k BC .)
1 1
It follows from the given equality =P XM “ =P Y M that the quadrilateral XY X Y is y li .
Note that A is the proje tion of M onto P Q. By a known des ription, A is the Miquel point for the
1 1 1 1
sidelines XY, XY , X Y, X Y . In parti ular, the ir le P XY passes through A.
Shortlisted problems  solutions 39

A
Y’
B
X’
M
X
C
Y

Comment 3. An alternative approa h is the following. One an note that the (oriented) lengths of
the segments CY and BX are both linear fun tions of a parameter t “ cot =P XM . As t varies, the
interse tion point S of the perpendi ular bise tors of P X and P Y tra es a xed line, thus the family
of ir les P XY has a xed ommon point (other than P ). By he king parti ular ases, one an show
that this xed point is A.

Comment 4. The problem states that =P XM “ =P Y M implies that AP XY is y li . The original


submission laims that these two onditions are in fa t equivalent. The Problem Sele tion Committee
omitted the onverse part, sin e it follows easily from the dire t one, by reversing arguments.
40 Cluj-Napo a  Romania, 314 July 2018

G3. A ir le ω of radius 1 is given. A olle tion T of triangles is alled good, if the following
onditions hold:

piq ea h triangle from T is ins ribed in ω ;

piiq no two triangles from T have a ommon interior point.

Determine all positive real numbers t su h that, for ea h positive integer n, there exists a
good olle tion of n triangles, ea h of perimeter greater than t.
(South Afri a)
Answer: t P p0, 4s.
Solution. First, we show how to onstru t a good olle tion of n triangles, ea h of perimeter
greater than 4. This will show that all t ď 4 satisfy the required onditions.
Constru t indu tively an pn ` 2q-gon BA1 A2 . . . An C ins ribed in ω su h that BC is a
diameter, and BA1 A2 , BA2 A3 , . . . , BAn´1 An , BAn C is a good olle tion of n triangles. For
n “ 1, take any triangle BA1 C ins ribed in ω su h that BC is a diameter; its perimeter is greater
than 2BC “ 4. To perform the indu tive step, assume that the pn ` 2q-gon BA1 A2 . . . An C is
already onstru ted. Sin e An B ` An C ` BC ą 4, one an hoose a point An`1 on the small
ar CA
Őn , lose enough to C , so that An B ` An An`1 ` BAn`1 is still greater than 4. Thus ea h
of these new triangles BAn An`1 and BAn`1 C has perimeter greater than 4, whi h ompletes
the indu tion step.

A1
A2

A3

C B

We pro eed by showing that no t ą 4 satises the onditions of the problem. To this end,
we assume that there exists a good olle tion T of n triangles, ea h of perimeter greater than t,
and then bound n from above.
Take ε ą 0 su h that t “ 4 ` 2ε.
Claim. There exists a positive onstant σ “ σpεq su h that any triangle ∆ with perimeter
2s ě 4 ` 2ε, ins ribed in ω , has area Sp∆q at least σ .
Proof. Let a, b, c be the side lengths of ∆. Sin e ∆ is ins ribed in ω , ea h side has length at
most 2. Therefore, as ´ a ě p2 ` εq ´ 2 “ ε.aSimilarly, s ´ b ě ε and s ´ c ě ε. a By Heron's
formula, Sp∆q “ sps ´ aqps ´ bqps ´ cq ě p2 ` εqε . Thus we an set σpεq “ p2 ` εqε3 .
3

l
Now we see that the total area S of all triangles from T is at least nσpεq. On the other
hand, S does not ex eed the area of the disk bounded by ω . Thus nσpεq ď π , whi h means
that n is bounded from above.
abc
Comment 1. One may prove the Claim using the formula S“ instead of Heron's formula.
4R
Comment 2. In the statement of the problem ondition piq ould be repla ed by a weaker one: ea h
triangle from T lies within ω. This does not ae t the solution above, but redu es the number of ways
to prove the Claim.
Shortlisted problems  solutions 41

This page is intentionally left blank


42 Cluj-Napo a  Romania, 314 July 2018

G4. A point T is hosen inside a triangle ABC . Let A1 , B1 , and C1 be the ree tions
of T in BC , CA, and AB , respe tively. Let Ω be the ir um ir le of the triangle A1 B1 C1 .
The lines A1 T , B1 T , and C1 T meet Ω again at A2 , B2 , and C2 , respe tively. Prove that the
lines AA2 , BB2 , and CC2 are on urrent on Ω.
(Mongolia)
Solution. By ?pℓ, nq we always mean the dire ted angle of the lines ℓ and n, taken modulo 180˝ .
Let CC2 meet Ω again at K (as usual, if CC2 is tangent to Ω, we set T “ C2 ). We show
that the line BB2 ontains K ; similarly, AA2 will also pass through K . For this purpose, it
su es to prove that
?pC2 C, C2 A1 q “ ?pB2 B, B2 A1 q. (1)

By the problem ondition, CB and CA are the perpendi ular bise tors of T A1 and T B1 ,
respe tively. Hen e, C is the ir um entre of the triangle A1 T B1 . Therefore,

?pCA1 , CBq “ ?pCB, CT q “ ?pB1 A1 , B1 T q “ ?pB1 A1 , B1 B2 q.

In ir le Ω we have ?pB1 A1 , B1 B2 q “ ?pC2 A1 , C2 B2 q. Thus,

?pCA1 , CBq “ ?pB1 A1 , B1 B2 q “ ?pC2 A1 , C2 B2 q. (2)

Similarly, we get
?pBA1 , BCq “ ?pC1 A1 , C1 C2 q “ ?pB2 A1 , B2 C2 q. (3)
The two obtained relations yield that the triangles A1 BC and A1 B2 C2 are similar and
equioriented, hen e

A1 B2 A1 C2
“ and ?pA1 B, A1 Cq “ ?pA1 B2 , A1 C2 q.
A1 B A1 C

The se ond equality may be rewritten as ?pA1 B, A1 B2 q “ ?pA1 C, A1 C2 q, so the triangles


A1 BB2 and A1 CC2 are also similar and equioriented. This establishes (1).
C1 A2

A
A
Ω K

B1
TT

B22222
B
B
C

C2

A11111
A

Comment 1. In fa t, the triangle A1 BC is an image of A1 B2 C2 under a spiral similarity entred


at A1 ; in this ase, the triangles ABB2 and ACC2 are also spirally similar with the same entre.
Shortlisted problems  solutions 43

Comment 2. After obtaining (2) and (3), one an nish the solution in dierent ways.

For instan e, introdu ing the point X “ BC XB2 C2 , one gets from these relations that the 4-tuples
pA1 , B, B2 , Xq and pA1 , C, C2 , Xq are both y li . Therefore, K is the Miquel point of the lines BB2 ,
CC2 , BC , and B2 C2 ; this yields that the meeting point of BB2 and CC2 lies on Ω.
Yet another way is to show that the points A1 , B , C , and K are on y li , as

?pKC, KA1 q “ ?pB2 C2 , B2 A1 q “ ?pBC, BA1 q.

By symmetry, the se ond point K1 of interse tion of BB2 with Ω is also on y li to A1 , B , and C,
hen e K
1 “ K.
C1 A2

A
A
Ω K
C′′′′′
C
C
C
B1
TT
B′′′′′
B
B
B

B22222
B

B A′
B X
X C

C2

A
A11111

Comment 3. The requirement that the ommon point of the lines AA2 , BB2 , and CC2 should lie
on Ω may seem to make the problem easier, sin e it suggests some approa hes. On the other hand,
there are also dierent ways of showing that the linesAA2 , BB2 , and CC2 are just on urrent.
In parti ular, the problem A2 T , B2 T , and C2 T are perpendi ular to
onditions yield that the lines
the orresponding sides of the triangle ABC . One may show that the lines AT , BT , and CT are also
perpendi ular to the orresponding sides of the triangle A2 B2 C2 , i.e., the triangles ABC and A2 B2 C2
are orthologi , and their orthology entres oin ide. It is known that su h triangles are also perspe tive,
i.e. the lines AA2 , BB2 , and CC2 are on urrent (in proje tive sense).
To show this mutual orthology, one may again apply angle hasing, but there are also other methods.
Let A1 , B 1 , and C 1 be the proje tions of T onto the sides of the triangle ABC . Then A2 T ¨ T A1 “
B2 T ¨ T B 1 “ C2 T ¨ T C 1 , sin e all three produ ts equal (minus) half the power of T with respe t to Ω.
This means that A2 , B2 , and C2 are the poles of the sidelines of the triangle ABC with respe t to
some ir le entred at T and having pure imaginary radius (in other words, the ree tions of A2 , B2 ,
and C2 in T are the poles of those sidelines with respe t to some regular ir le entred at T ). Hen e,
dually, the verti es of the triangle ABC are also the poles of the sidelines of the triangle A2 B2 C2 .
44 Cluj-Napo a  Romania, 314 July 2018

G5. Let ABC be a triangle with ir um ir le ω and in entre I . A line ℓ interse ts the
lines AI , BI , and CI at points D , E , and F , respe tively, distin t from the points A, B , C ,
and I . The perpendi ular bise tors x, y , and z of the segments AD , BE , and CF , respe tively
determine a triangle Θ. Show that the ir um ir le of the triangle Θ is tangent to ω .
(Denmark)

Preamble. Let X “ y X z , Y “ x X z , Z “ x X y and let Ω denote the ir um ir le of the


triangle XY Z . Denote by X0 , Y0 , and Z0 the se ond interse tion points of AI , BI and CI ,
respe tively, with ω . It is known that Y0 Z0 is the perpendi ular bise tor of AI , Z0 X0 is the
perpendi ular bise tor of BI , and X0 Y0 is the perpendi ular bise tor of CI . In parti ular, the
triangles XY Z and X0 Y0 Z0 are homotheti , be ause their orresponding sides are parallel.
The solutions below mostly exploit the following approa h. Consider the triangles XY Z
and X0 Y0 Z0 , or some other pair of homotheti triangles ∆ and δ ins ribed into Ω and ω ,
respe tively. In order to prove that Ω and ω are tangent, it su es to show that the entre T
of the homothety taking ∆ to δ lies on ω (or Ω), or, in other words, to show that ∆ and δ are
perspe tive (i.e., the lines joining orresponding verti es are on urrent), with their perspe tor
lying on ω (or Ω).
We use dire ted angles throughout all the solutions.
Solution 1.
Claim 1. The ree tions ℓa , ℓb and ℓc of the line ℓ in the lines x, y , and z , respe tively, are
on urrent at a point T whi h belongs to ω .
T
A Y0
la Y

l
Z0

Z I
x F w
D lc W
B C
E
Dc
lb y X0
z
Db

X
Proof. Noti e that ?pℓb , ℓcq “ ?pℓb , ℓq ` ?pℓ, ℓc q “ 2?py, ℓq ` 2?pℓ, zq “ 2?py, zq. But y K BI
and z K CI implies ?py, zq “ ?pBI, ICq, so, sin e 2?pBI, ICq “ ?pBA, ACq, we obtain

?pℓb , ℓc q “ ?pBA, ACq. p1q

Sin e A is the ree tion of D in x, A belongs to ℓa ; similarly, B belongs to ℓb . Then p1q


shows that the ommon point T 1 of ℓa and ℓb lies on ω ; similarly, the ommon point T 2 of ℓc
and ℓb lies on ω .
If B R ℓa and B R ℓc , then T 1 and T 2 are the se ond point of interse tion of ℓb and ω , hen e
they oin ide. Otherwise, if, say, B P ℓc , then ℓc “ BC , so ?pBA, ACq “ ?pℓb , ℓc q “ ?pℓb , BCq,
whi h shows that ℓb is tangent at B to ω and T 1 “ T 2 “ B . So T 1 and T 2 oin ide in all the
ases, and the on lusion of the laim follows. l
Shortlisted problems  solutions 45

Now we prove that X , X0 , T are ollinear. Denote by Db and Dc the ree tions of the point
D in the lines y and z , respe tively. Then Db lies on ℓb , Dc lies on ℓc , and

?pDb X, XDc q “ ?pDb X, DXq ` ?pDX, XDc q “ 2?py, DXq ` 2?pDX, zq “ 2?py, zq
“ ?pBA, ACq “ ?pBT, T Cq,

hen e the quadrilateral XDb T Dc is y li . Noti e also that sin e XDb “ XD “ XDc , the
points D, Db , Dc lie on a ir le with entre X . Using in this ir le the diameter Dc Dc1 yields
?pDb Dc , Dc Xq “ 90˝ ` ?pDb Dc1 , Dc1 Xq “ 90˝ ` ?pDb D, DDc q. Therefore,

?pℓb , XT q “ ?pDb T, XT q “ ?pDb Dc , Dc Xq “ 90˝ ` ?pDb D, DDc q


“ 90˝ ` ?pBI, ICq “ ?pBA, AIq “ ?pBA, AX0 q “ ?pBT, T X0 q “ ?pℓb , X0 T q,

so the points X , X0 , T are ollinear. By a similar argument, Y, Y0 , T and Z, Z0 , T are ollinear.


As mentioned in the preamble, the statement of the problem follows.

Comment 1. After proving Claim 1 one may pro eed in another way. As it was shown, the ree tions
of ℓ in the sidelines of XY Z are on urrent at T . Thus ℓ is the Steiner line of T with respe t to ∆XY Z
(that is the line ontaining the ree tions Ta , Tb , Tc of T in the sidelines of XY Z ). The properties of
the Steiner line imply that T lies on Ω, and ℓ passes through the ortho entre H of the triangle XY Z .
T
A
Ha la lc
lb
Y
l
Tc
x I Ta
Z
w W
H F
B D
C

E
Hb Hc
y z
Tb
X
LetHa , Hb , and Hc be the ree tions of the point H in the lines x, y , and z , respe tively. Then
the triangle Ha Hb Hc is ins ribed in Ω and homotheti to ABC (by an easy angle hasing). Sin e
Ha P ℓa , Hb P ℓb , and Hc P ℓc , the triangles Ha Hb Hc and ABC form a required pair of triangles ∆ and
δ mentioned in the preamble.

Comment 2. The following observation shows how one may guess the des ription of the tangen y
point T from Solution 1.
Let us x a dire tion and move the line ℓ parallel to this dire tion with onstant speed.
Then the points D , E , and F are moving with onstant speeds along the lines AI , BI , and CI ,
respe tively. In this ase x, y , and z are moving with onstant speeds, dening a family of homotheti
triangles XY Z with a ommon entre of homothety T . Noti e that the triangle X0 Y0 Z0 belongs to
this family (for ℓ passing through I ). We may spe ify the lo ation of T onsidering the degenerate
ase when x, y , and z are on urrent. In this degenerate ase all the lines x, y , z , ℓ, ℓa , ℓb , ℓc have a
ommon point. Note that the lines ℓa , ℓb , ℓc remain onstant as ℓ is moving (keeping its dire tion).
Thus T should be the ommon point of ℓa , ℓb , and ℓc , lying on ω .
46 Cluj-Napo a  Romania, 314 July 2018

Solution 2. As mentioned in the preamble, it is su ient to prove that the entre T of the
homothety taking XY Z to X0 Y0 Z0 belongs to ω . Thus, it su es to prove that ?pT X0 , T Y0 q “
?pZ0 X0 , Z0 Y0 q, or, equivalently, ?pXX0 , Y Y0 q “ ?pZ0 X0 , Z0 Y0 q.
Re all that Y Z and Y0 Z0 are the perpendi ular bise tors of AD and AI , respe tively. Then,
ÝÑ
the ve tor ÑÝ
x perpendi ular to Y Z and shifting the line Y0 Z0 to Y Z is equal to 12 ID. Dene
ÝÑ Ý ÝÑ
the shifting ve tors Ñ Ýy “ 21 IE , Ñ
z “ 12 IF similarly. Consider now the triangle UV W formed by
the perpendi ulars to AI , BI , and CI through D , E , and F , respe tively (see gure below).
This is another triangle whose sides are parallel to the orresponding sides of XY Z .
Claim 2. Ý Ñ ÝÝÝÑ ÝÑ ÝÝÑ ÝÝÑ
IU “ 2X0 X , IV “ 2Y0 Y , IW “ 2Z0 Z .
ÝÝÑ

Proof. We prove one of the relations, the other proofs being similar. To prove the equality of two
ve tors it su es to proje t them onto two non-parallel axes and he k that their proje tions
are equal.
ÝÝÝÑ ÝÑ ÝÑ
The proje tion of X0 X onto IB equals ~y , while the proje tion of IU onto IB is IE “ 2~y .
ÝÑ ÝÑ ÝÝÝÑ
The proje tions onto the other axis IC are ~z and IF “ 2~z. Then IU “ 2X0 X follows. l
Noti e that the line ℓ is the Simson line of the point I with respe t to the triangle UV W ;
thus U , V , W , and I are on y li . It follows from Claim 2 that ?pXX0 , Y Y0 q “ ?pIU, IV q “
?pW U, W V q “ ?pZ0 X0 , Z0 Y0 q, and we are done.
V
Y
l
Ib
u
x F

W Y0
w
C z

A
D w
T I
X0
Ia X
Z0 B U
y
v
Ic Z E W

Solution 3. Let Ia , Ib , and Ic be the ex entres of triangle ABC orresponding to A, B , and


C , respe tively. Also, let u, v , and w be the lines through D , E , and F whi h are perpendi ular
to AI , BI , and CI , respe tively, and let UV W be the triangle determined by these lines, where
u “ V W , v “ UW and w “ UV (see gure above).
Noti e that the line u is the ree tion of Ib Ic in the line x, be ause u, x, and Ib Ic are
perpendi ular to AD and x is the perpendi ular bise tor of AD . Likewise, v and Ia Ic are
ree tions of ea h other in y , while w and Ia Ib are ree tions of ea h other in z . It follows that
X , Y , and Z are the midpoints of UIa , V Ib and W Ic , respe tively, and that the triangles UV W ,
XY Z and Ia Ib Ic are either translates of ea h other or homotheti with a ommon homothety
entre.
Constru t the points T and S su h that the quadrilaterals UV IW , XY T Z and Ia Ib SIc are
homotheti . Then T is the midpoint of IS . Moreover, note that ℓ is the Simson line of the
point I with respe t to the triangle UV W , hen e I belongs to the ir um ir le of the triangle
UV W , therefore T belongs to Ω.
Shortlisted problems  solutions 47

Consider now the homothety or translation h1 that maps XY ZT to Ia Ib Ic S and the homo-
thety h2 with entre I and fa tor 12 . Furthermore, let h “ h2 ˝ h1 . The transform h an be a
homothety or a translation, and

h pT q “ h2 ph1 pT qq “ h2 pSq “ T,

hen e T is a xed point of h. So, h is a homothety with entre T . Note that h2 maps the
ex entres Ia , Ib , Ic to X0 , Y0 , Z0 dened in the preamble. Thus the entre T of the homothety
taking XY Z to X0 Y0 Z0 belongs to Ω, and this ompletes the proof.
48 Cluj-Napo a  Romania, 314 July 2018

G6. A onvex quadrilateral ABCD satises AB ¨ CD “ BC ¨ DA. A point X is hosen


inside the quadrilateral so that =XAB “ =XCD and =XBC “ =XDA. Prove that =AXB `
=CXD “ 180˝.
(Poland)
Solution 1. Let B 1 be the ree tion of B in the internal angle bise tor of =AXC , so that
=AXB 1 “ =CXB and =CXB 1 “ =AXB . If X , D , and B 1 are ollinear, then we are done.
Now assume the ontrary.
On the ray XB 1 take a point E su h that XE ¨ XB “ XA ¨ XC , so that △AXE „
△BXC and △CXE „ △BXA. We have =XCE ` =XCD “ =XBA ` =XAB ă 180˝ and
=XAE ` =XAD “ =XDA ` =XAD ă 180˝ , whi h proves that X lies inside the angles
=ECD and =EAD of the quadrilateral EADC . Moreover, X lies in the interior of exa tly
one of the two triangles EAD , ECD (and in the exterior of the other).

B’
E
C
B

A
D

The similarities mentioned above imply XA ¨ BC “ XB ¨ AE and XB ¨ CE “ XC ¨ AB .


Multiplying these equalities with the given equality AB ¨ CD “ BC ¨ DA, we obtain XA ¨ CD ¨
CE “ XC ¨ AD ¨ AE , or, equivalently,
XA ¨ DE XC ¨ DE
“ . p˚q
AD ¨ AE CD ¨ CE

Lemma. Let P QR be a triangle, and let X be a point in the interior of the angle QP R su h that
P X ¨ QR
=QP X “ =P RX . Then ă 1 if and only if X lies in the interior of the triangle P QR.
PQ ¨ PR
Proof. The lo us of points X with =QP X “ =P RX lying inside the angle QP R is an ar α
of the ir le γ through R tangent to P Q at P . Let γ interse t the line QR again at Y (if γ
PQ ¨ PR
is tangent to QR, then set Y “ R). The similarity △QP Y „ △QRP yields P Y “ .
QR
Now it su es to show that P X ă P Y if and only if X lies in the interior of the triangle P QR.
Let m be a line through Y parallel to P Q. Noti e that the points Z of γ satisfying P Z ă P Y
are exa tly those between the lines m and P Q.
Case 1: Y lies in the segment QR (see the left gure below).
In this ase Y splits α into two ar s P
Ŋ Y and Y
Ŋ R. The ar PŊ Y lies inside the triangle P QR,
and P Y lies between m and P Q, hen e P X ă P Y for points X P P
Ŋ Ŋ Y . The other ar Y ŊR
lies outside triangle P QR, and Y R is on the opposite side of m than P , hen e P X ą P Y for
Ŋ
X PY ŊR.
Shortlisted problems  solutions 49

Case 2: Y lies on the ray QR beyond R (see the right gure below).
In this ase the whole ar α lies inside triangle P QR, and between m and P Q, thus P X ă
P Y for all X P α. l

P P
R
X

Q
Y R
Q
X Y

Applying the Lemma (to △EAD with the point X , and to △ECD with the point X ),
XA ¨ DE XC ¨ DE
we obtain that exa tly one of two expressions and is less than 1, whi h
AD ¨ AE CD ¨ CE
ontradi ts (˚).

Comment 1. One may show that AB ¨ CD “ XA ¨ XC ` XB ¨ XD . We know that D, X, E are


ollinear and =DCE “ =CXD “ 180˝ ´ =AXB . Therefore,
sin =AXB sin =CED
AB ¨ CD “ XB ¨ ¨ DE ¨ “ XB ¨ DE.
sin =BAX sin =DCE
Furthermore, XB ¨ DE “ XB ¨ pXD ` XEq “ XB ¨ XD ` XB ¨ XE “ XB ¨ XD ` XA ¨ XC .

Comment 2. For a onvex quadrilateral ABCD with AB ¨ CD “ BC ¨ DA, it is known that


=DAC ` =ABD ` =BCA ` =CDB “ 180˝ (among other, it was used as a problem on the Regional
round of All-Russian olympiad in 2012), but it seems that there is no essential onne tion between this
fa t and the original problem.

Solution 2. The solution onsists of two parts. In Part 1 we show that it su es to prove
that
XB AB
“ p1q
XD CD
and
XA DA
“ . p2q
XC BC
In Part 2 we establish these equalities.
Part 1. Using the sine law and applying (1) we obtain

sin =AXB AB CD sin =CXD


“ “ “ ,
sin =XAB XB XD sin =XCD
so sin =AXB “ sin =CXD by the problem onditions. Similarly, (2) yields sin =DXA “
sin =BXC . If at least one of the pairs p=AXB, =CXDq and p=BXC, =DXAq onsists of
supplementary angles, then we are done. Otherwise, =AXB “ =CXD and =DXA “ =BXC .
In this ase X “ AC X BD , and the problem onditions yield that ABCD is a parallelogram
and hen e a rhombus. In this last ase the laim also holds.
Part 2. To prove the desired equality (1), invert ABCD at entre X with unit radius; the
images of points are denoted by primes.
We have

=A1 B 1 C 1 “ =XB 1 A1 ` =XB 1 C 1 “ =XAB ` =XCB “ =XCD ` =XCB “ =BCD.


50 Cluj-Napo a  Romania, 314 July 2018

Similarly, the orresponding angles of quadrilaterals ABCD and D 1 A1 B 1 C 1 are equal.


Moreover, we have
AB CD BC DA
A1 B 1 ¨ C 1 D 1 “ ¨ “ ¨ “ B 1 C 1 ¨ D 1 A1 .
XA ¨ XB XC ¨ XD XB ¨ XC XD ¨ DA
B′
B

X X
A 7→
A′
C′
C
D

D′
Now we need the following Lemma.
Lemma. Assume that the orresponding angles of onvex quadrilaterals XY ZT and X 1 Y 1 Z 1 T 1
are equal, and that XY ¨ ZT “ Y Z ¨ T X and X 1 Y 1 ¨ Z 1 T 1 “ Y 1 Z 1 ¨ T 1 X 1 . Then the two
quadrilaterals are similar.
Proof. Take the quadrilateral XY Z1 T1 similar to X 1 Y 1 Z 1 T 1 and sharing the side XY with
XY ZT , su h that Z1 and T1 lie on the rays Y Z and XT , respe tively, and Z1 T1 k ZT . We
need to prove that Z1 “ Z and T1 “ T . Assume the ontrary. Without loss of generality,
T X ą XT1 . Let segments XZ and Z1 T1 interse t at U . We have
T1 X T1 X TX XY XY
ă “ “ ă ,
T1 Z1 T1 U ZT YZ Y Z1
thus T1 X ¨ Y Z1 ă T1 Z1 ¨ XY . A ontradi tion. l
X Y

Z1
T1 U
Z
T
It follows from the Lemma that the quadrilaterals ABCD and D 1 A1 B 1 C 1 are similar, hen e
BC A1 B 1 AB XD ¨ XA AB XD
“ 1 1 “ ¨ “ ¨ ,
AB DA XA ¨ XB DA AD XB
and therefore
XB AB 2 AB 2 AB
“ “ “ .
XD BC ¨ AD AB ¨ CD CD
We obtain (1), as desired; (2) is proved similarly.

Comment. Part 1 is an easy one, while part 2 seems to be ru ial. On the other hand, after the
proof of the similarityD 1 A1 B 1 C 1 „ ABCD one may nish the solution in dierent ways, e.g., as
follows. The similarity taking D A B C to ABCD maps X to the point X isogonally onjugate
1 1 1 1 1
1
of X with respe t to ABCD (i.e. to the point X inside ABCD su h that =BAX “ =DAX ,
1
1 1 1
=CBX “ =ABX , =DCX “ =BCX , =ADX “ =CDX ). It is known that the required equality
=AXB ` =CXD “ 180˝ is one of known onditions on a point X inside ABCD equivalent to the
existen e of its isogonal onjugate.
Shortlisted problems  solutions 51

This page is intentionally left blank


52 Cluj-Napo a  Romania, 314 July 2018

G7. Let O be the ir um entre, and Ω be the ir um ir le of an a ute-angled triangle ABC .


Let P be an arbitrary point on Ω, distin t from A, B , C , and their antipodes in Ω. Denote
the ir um entres of the triangles AOP , BOP , and COP by OA , OB , and OC , respe tively.
The lines ℓA , ℓB , and ℓC perpendi ular to BC , CA, and AB pass through OA , OB , and OC ,
respe tively. Prove that the ir um ir le of the triangle formed by ℓA , ℓB , and ℓC is tangent to
the line OP .
(Russia)
Solution. As usual, we denote the dire ted angle between the lines a and b by ?pa, bq. We
frequently use the fa t that a1 K a2 and b1 K b2 yield ?pa1 , b1 q “ ?pa2 , b2 q.
Let the lines ℓB and ℓC meet at LA ; dene the points LB and LC similarly. Note that
the sidelines of the triangle LA LB LC are perpendi ular to the orresponding sidelines of ABC .
Points OA , OB , OC are lo ated on the orresponding sidelines of LA LB LC ; moreover, OA , OB ,
OC all lie on the perpendi ular bise tor of OP .
A

L
L
LCC
C
C
C
ωC

C
C
O
O
OAA
A
A
A ωB
O
L
L
LAA
A
A
A O
O
OCC
C
C
C

B O
O
OBB
B
B
B

P
P
P
P

LB

Claim 1. The points LB , P , OA , and OC are on y li .


Proof. Sin e O is symmetri to P in OAOC , we have
?pOA P, OC P q “ ?pOC O, OA Oq “ ?pCP, AP q “ ?pCB, ABq “ ?pOA LB , OC LB q. l

Denote the ir le through LB , P , OA , and OC by ωB . Dene the ir les ωA and ωC similarly.


Claim 2. The ir um ir le of the triangle LA LB LC passes through P .
Proof. From y li quadruples of points in the ir les ωB and ωC , we have
?pLC LA , LC P q “ ?pLC OB , LC P q “ ?pOA OB , OA P q
“ ?pOA OC , OA P q “ ?pLB OC , LB P q “ ?pLB LA , LB P q. l

Claim 3. The points P , LC , and C are ollinear.


Proof. We have ?pP LC , LC LA q “ ?pP LC , LC OB q “ ?pP OA, OAOB q. Further, sin e OA is
the entre of the ir le AOP , ?pP OA , OA OB q “ ?pP A, AOq. As O is the ir um entre of the
triangle P CA, ?pP A, AOq “ π{2 ´ ?pCA, CP q “ ?pCP, LC LA q. We obtain ?pP LC , LC LA q “
?pCP, LC LA q, whi h shows that P P CLC . l
Shortlisted problems  solutions 53

Similarly, the points P , LA , A are ollinear, and the points P , LB , B are also ollinear.
Finally, the omputation above also shows that

?pOP, P LA q “ ?pP A, AOq “ ?pP LC , LC LA q,

whi h means that OP is tangent to the ir le P LA LB LC .

Comment 1. The proof of Claim 2 may be repla ed by the following remark: sin e P belongs to the
ir les ωA and ωC , P is the Miquel point of the four lines ℓA , ℓB , ℓC , and OA OB OC .

Comment 2. Claims 2 and 3 an be proved in several dierent ways and, in parti ular, in the reverse
order.
Claim 3 implies that the triangles ABC and LA LB LC are perspe tive with perspe tor P. Claim 2
an be derived from this observation using spiral similarity. Consider the entre Q of the spiral similarity
that maps ABC to LA LB LC . From known spiral similarity properties, the points LA , LB , P, Q are
on y li , and so are LA , LC , P, Q.

Comment 3. The nal on lusion an also be proved it terms of spiral similarity: the spiral similarity
with entre Q lo ated on the ir le ABC maps the ir le ABC to the ir le P LA LB LC . Thus these
ir les are orthogonal.

Comment 4. Noti e that the homothety with O and ratio 2 takes OA to A1 that is the ommon
entre
1
point of tangents to Ω at A and P . Similarly, let this homothety take OB to B and OC to C . Let
1
2 2 2
the tangents to Ω at B and C meet at A , and dene the points B and C similarly. Now, repla ing
2 2 2
labels O with I , Ω with ω , and swapping labels A Ø A , B Ø B , C Ø C we obtain the following

Reformulation. Let ω be the in ir le, and let I be the in entre of a triangle ABC . Let P be
a point of ω onta t of ω with the sides of ABC ). The tangent to ω at P
(other than the points of
meets the lines AB , BC , and CA at A1 , B 1 , and C 1 , respe tively. Line ℓA parallel to the internal
1
angle bise tor of =BAC passes through A ; dene lines ℓB and ℓC similarly. Prove that the line IP is
tangent to the ir um ir le of the triangle formed by ℓA , ℓB , and ℓC .

Though this formulation is equivalent to the original one, it seems more hallenging, sin e the point
of onta t is now hidden.
54 Cluj-Napo a  Romania, 314 July 2018

Number Theory
N1. Determine all pairs pn, kq of distin t positive integers su h that there exists a positive
integer s for whi h the numbers of divisors of sn and of sk are equal.
(Ukraine)
Answer: All pairs pn, kq su h that n ∤ k and k ∤ n.
Solution. As usual, the number of divisors of a positive integer n is denoted by dpnq. If
ś ś
n “ i pαi i is the prime fa torisation of n, then dpnq “ i pαi ` 1q.
We start by showing that one annot nd any suitable number s if k | n or n | k (and
k ‰ n). Suppose that n | k , and hoose any positive integer s. Then the set of divisors of sn is
a proper subset of that of sk , hen e dpsnq ă dpskq. Therefore, the pair pn, kq does not satisfy
the problem requirements. The ase k | n is similar.
Now assume that n ∤ k and k ∤ n. Let p1 , . . . , pt be all primes dividing nk , and onsider the
prime fa torisations
źt ź t
n“ pi and k “
αi
pβi i .
i“1 i“1

It is reasonable to sear h for the number s having the form


t
ź
s“ pγi i .
i“1

The (nonnegative integer) exponents γi should be hosen so as to satisfy


t
dpsnq ź αi ` γi ` 1
“ “ 1. (1)
dpskq i“1 βi ` γi ` 1

First of all, if αi “ βi for some i, then, regardless of the value of γi , the orresponding fa tor
in (1) equals 1 and does not ae t the produ t. So we may assume that there is no su h index i.
For the other fa tors in (1), the following lemma is useful.
Lemma. Let α ą β be nonnegative integers. Then, for every integer M ě β ` 1, there exists a
nonnegative integer γ su h that
α`γ`1 1 M `1
“1` “ .
β`γ`1 M M

Proof.
α`γ`1 1 α´β 1
“1` ðñ “ ðñ γ “ Mpα ´ βq ´ pβ ` 1q ě 0. l
β`γ`1 M β`γ`1 M

Now we an nish the solution. Without loss of generality, there exists an index u su h that
αi ą βi for i “ 1, 2, . . . , u, and αi ă βi for i “ u ` 1, . . . , t. The onditions n ∤ k and k ∤ n mean
that 1 ď u ď t ´ 1.
Choose an integer X greater than all the αi and βi . By the lemma, we an dene the
numbers γi so as to satisfy
αi ` γ i ` 1 uX ` i
“ for i “ 1, 2, . . . , u, and
βi ` γi ` 1 uX ` i ´ 1
βu`i ` γu`i ` 1 pt ´ uqX ` i
“ for i “ 1, 2, . . . , t ´ u.
αu`i ` γu`i ` 1 pt ´ uqX ` i ´ 1
Shortlisted problems  solutions 55

Then we will have


u t´u
dpsnq ź uX ` i ź pt ´ uqX ` i ´ 1 upX ` 1q pt ´ uqX
“ ¨ “ ¨ “ 1,
dpskq i“1
uX ` i ´ 1 i“1 pt ´ uqX ` i uX pt ´ uqpX ` 1q

as required.

Comment. The lemma an be used in various ways, in order to provide a suitable value of s. In
parti ular, one may apply indu tion on the number t of prime fa tors, using identities like

n n2 n`1
“ 2 ¨ .
n´1 n ´1 n
56 Cluj-Napo a  Romania, 314 July 2018

N2. Let n ą 1 be a positive integer. Ea h ell of an n ˆ n table ontains an integer.


Suppose that the following onditions are satised:

piq Ea h number in the table is ongruent to 1 modulo n;

piiq The sum of numbers in any row, as well as the sum of numbers in any olumn, is ongruent
to n modulo n2 .

Let Ri be the produ t of the numbers in the ith row, and Cj be the produ t of the numbers in
the j th olumn. Prove that the sums R1 ` ¨ ¨ ¨ ` Rn and C1 ` ¨ ¨ ¨ ` Cn are ongruent modulo n4 .
(Indonesia)
Solution 1. Let Ai,j be the entry in the ith row and the j th olumn; let P be the produ t of
all n2 entries. For onvenien e, denote ai,j “ Ai,j ´ 1 and ri “ Ri ´ 1. We show that
n
ÿ
Ri ” pn ´ 1q ` P pmod n4 q. (1)
i“1

Due to symmetry of the problem onditions, the sum of all the Cj is also ongruent to pn ´ 1q`P
modulo n4 , when e the on lusion.
By ondition piq, the number n divides ai,j for all i and j . So, every produ t of at least two
of the ai,j is divisible by n2 , hen e
n
ź n
ÿ ÿ n
ÿ n
ÿ
Ri “ p1`ai,j q “ 1` ai,j ` ai,j1 ai,j2 `¨ ¨ ¨ ” 1` ai,j ” 1´n` Ai,j pmod n2 q
j“1 j“1 1ďj1 ăj2 ďn j“1 j“1

for every index i. Using ondition piiq, we obtain Ri ” 1 pmod n2 q, and so n2 | ri .


Therefore, every produ t of at least two of the ri is divisible by n4 . Repeating the same
argument, we obtain
n
ź n
ź n
ÿ
P “ Ri “ p1 ` ri q ” 1 ` ri pmod n4 q,
i“1 i“1 i“1

when e n n
ÿ ÿ
Ri “ n ` ri ” n ` pP ´ 1q pmod n4 q,
i“1 i“1

as desired.

Comment. The original version of the problem statement ontained also the ondition

piiiq The produ t of all the numbers in the table is ongruent to 1 modulo n4 .

This ondition appears to be superuous, so it was omitted.

Solution 2. We present a more straightforward (though lengthier) way to establish (1). We


also use the notation of ai,j .
By ondition piq, all the ai,j are divisible by n. Therefore, we have
n ź
ź n ÿ ÿ
P “ p1 ` ai,j q ” 1 ` ai,j ` ai1 ,j1 ai2 ,j2
i“1 j“1 pi,jq pi1 ,j1 q, pi2 ,j2 q
ÿ
` ai1 ,j1 ai2 ,j2 ai3 ,j3 pmod n4 q,
pi1 ,j1 q, pi2 ,j2 q, pi3 ,j3 q
Shortlisted problems  solutions 57

where the last two sums are taken over all unordered pairs/triples of pairwise dierent pairs
pi, jq; su h onventions are applied throughout the solution.
Similarly,
n
ÿ n ź
ÿ n ÿÿ ÿ ÿ ÿ ÿ
Ri “ p1 ` ai,j q ” n ` ai,j ` ai,j1 ai,j2 ` ai,j1 ai,j2 ai,j3 pmod n4 q.
i“1 i“1 j“1 i j i j1 , j2 i j1 , j2 , j3

Therefore,
ÿ ÿ ÿ
P ` pn ´ 1q ´ Ri ” ai1 ,j1 ai2 ,j2 ` ai1 ,j1 ai2 ,j2 ai3 ,j3
i pi1 ,j1 q, pi2 ,j2 q pi1 ,j1 q, pi2 ,j2 q, pi3 ,j3 q
i1 ‰i2 i1 ‰i2 ‰i3 ‰i1
ÿ
` ai1 ,j1 ai2 ,j2 ai3 ,j3 pmod n4 q.
pi1 ,j1 q, pi2 ,j2 q, pi3 ,j3 q
i1 ‰i2 “i3

We show that in fa t ea h of the three sums appearing in the right-hand part of this ongruen e
is divisible by n4 ; this yields (1). Denote those three sums by Σ1 , Σ2 , and Σ3 in order of
appearan e. Re all that by ondition piiq we have
ÿ
ai,j ” 0 pmod n2 q for all indi es i.
j

For every two indi es i1 ă i2 we have


ÿÿ ˆÿ ˙ ˆÿ ˙
ai1 ,j1 ai2 ,j2 “ ai1 ,j1 ¨ ai2 ,j2 ” 0 pmod n4 q,
j1 j2 j1 j2

sin e ea h of the two fa tors is divisible by n2 . Summing over all pairs pi1 , i2 q we obtain n4 | Σ1 .
Similarly, for every three indi es i1 ă i2 ă i3 we have
ÿÿÿ ˆÿ ˙ ˆÿ ˙ ˆÿ ˙
ai1 ,j1 ai2 ,j2 ai3 ,j3 “ ai1 ,j1 ¨ ai2 ,j2 ¨ ai3 ,j3
j1 j2 j3 j1 j2 j3

whi h is divisible even by n6 . Hen e n4 | Σ2 .


Finally, for every indi es i1 ‰ i2 “ i3 and j2 ă j3 we have
ÿ
ai2 ,j2 ¨ ai2 ,j3 ¨ ai1 ,j1 ” 0 pmod n4 q,
j1

sin e the three fa tors are divisible by n, n, and n2 , respe tively. Summing over all 4-tuples of
indi es pi1 , i2 , j2 , j3 q we get n4 | Σ3 .
58 Cluj-Napo a  Romania, 314 July 2018

N3. Dene the sequen e a0 , a1 , a2 , . . . by an “ 2n ` 2tn{2u . Prove that there are innitely
many terms of the sequen e whi h an be expressed as a sum of (two or more) distin t terms
of the sequen e, as well as innitely many of those whi h annot be expressed in su h a way.
(Serbia)
Solution 1. Call a nonnegative integer representable if it equals the sum of several (possibly 0
or 1) distin t terms of the sequen e. We say that two nonnegative integers b and c are equivalent
(written as b „ c) if they are either both representable or both non-representable.
One an easily ompute
Sn´1 :“ a0 ` ¨ ¨ ¨ ` an´1 “ 2n ` 2rn{2s ` 2tn{2u ´ 3.
Indeed, we have Sn ´ Sn´1 “ 2n ` 2tn{2u “ an so we an use the indu tion. In parti ular,
S2k´1 “ 22k ` 2k`1 ´ 3.
Note that, if n ě 3, then 2rn{2s ě 22 ą 3, so
Sn´1 “ 2n ` 2rn{2s ` 2tn{2u ´ 3 ą 2n ` 2tn{2u “ an .
Also noti e that Sn´1 ´ an “ 2rn{2s ´ 3 ă an .
The main tool of the solution is the following laim.
Claim 1. Assume that b is a positive integer su h that Sn´1 ´ an ă b ă an for some n ě 3.
Then b „ Sn´1 ´ b.
Proof. As seen above, we have Sn´1 ą an . Denote c “ Sn´1 ´ b; then Sn´1 ´ an ă c ă an , so
the roles of b and c are symmetri al.
Assume that b is representable. The representation annot ontain ai with i ě n, sin e
b ă an . So b is the sum of some subset of ta0 , a1 , . . . , an´1 u; then c is the sum of the omplement.
The onverse is obtained by swapping b and c. l
We also need the following version of this laim.
Claim 2. For any n ě 3, the number an an be represented as a sum of two or more distin t
terms of the sequen e if and only if Sn´1 ´ an “ 2rn{2s ´ 3 is representable.
Proof. Denote c “ Sn´1 ´ an ă an . If an satises the required ondition, then it is the sum
of some subset of ta0 , a1 , . . . , an´1 u; then c is the sum of the omplement. Conversely, if c is
representable, then its representation onsists only of the numbers from ta0 , . . . , an´1 u, so an is
the sum of the omplement. l
By Claim 2, in order to prove the problem statement, it su es to nd innitely many
representable numbers of the form 2t ´ 3, as well as innitely many non-representable ones.
Claim 3. For every t ě 3, we have 2t ´ 3 „ 24t´6 ´ 3, and 24t´6 ´ 3 ą 2t ´ 3.
Proof. The inequality follows from t ě 3. In order to prove the equivalen e, we apply Claim 1
twi e in the following manner.
First, sin e S2t´3 ´ a2t´2 “ 2t´1 ´ 3 ă 2t ´ 3 ă 22t´2 ` 2t´1 “ a2t´2 , by Claim 1 we have
2t ´ 3 „ S2t´3 ´ p2t ´ 3q “ 22t´2 .
Se ond, sin e S4t´7 ´ a4t´6 “ 22t´3 ´ 3 ă 22t´2 ă 24t´6 ` 22t´3 “ a4t´6 , by Claim 1 we have
2 2t´2
„ S4t´7 ´ 22t´2 “ 24t´6 ´ 3.
Therefore, 2t ´ 3 „ 22t´2 „ 24t´6 ´ 3, as required. l
Now it is easy to nd the required numbers. Indeed, the number 2 ´ 3 “ 5 “ a0 ` a1 is
3

representable, so Claim 3 provides an innite sequen e of representable numbers


23 ´ 3 „ 26 ´ 3 „ 218 ´ 3 „ ¨ ¨ ¨ „ 2t ´ 3 „ 24t´6 ´ 3 „ ¨ ¨ ¨ .
On the other hand, the number 27 ´ 3 “ 125 is non-representable (sin e by Claim 1 we have
125 „ S6 ´ 125 “ 24 „ S4 ´ 24 “ 17 „ S3 ´ 17 “ 4 whi h is learly non-representable). So
Claim 3 provides an innite sequen e of non-representable numbers
27 ´ 3 „ 222 ´ 3 „ 282 ´ 3 „ ¨ ¨ ¨ „ 2t ´ 3 „ 24t´6 ´ 3 „ ¨ ¨ ¨ .
Shortlisted problems  solutions 59

Solution 2. We keep the notion of representability and the notation Sn from the previous
solution. We say that an index n is good if an writes as a sum of smaller terms from the
sequen e a0 , a1 , . . .. Otherwise we say it is bad. We must prove that there are innitely many
good indi es, as well as innitely many bad ones.
Lemma 1. If m ě 0 is an integer, then 4m is representable if and only if either of 2m ` 1 and
2m ` 2 is good.
Proof. The ase m “ 0 is obvious, so we may assume that m ě 1. Let n “ 2m ` 1 or 2m ` 2.
Then n ě 3. We noti e that
Sn´1 ă an´2 ` an .

The inequality writes as 2n ` 2rn{2s ` 2tn{2u ´ 3 ă 2n ` 2tn{2u ` 2n´2 ` 2tn{2u´1 , i.e. as 2rn{2s ă
2n´2 ` 2tn{2u´1 ` 3. If n ě 4, then n{2 ď n ´ 2, so rn{2s ď n ´ 2 and 2rn{2s ď 2n´2 . For n “ 3
the inequality veries separately.
If n is good, then an writes as an “ ai1 ` ¨ ¨ ¨ ` air , where r ě 2 and i1 ă ¨ ¨ ¨ ă ir ă n.
Then ir “ n ´ 1 and ir´1 “ n ´ 2, for if n ´ 1 or n ´ 2 is missing from the sequen e i1 , . . . , ir ,
then ai1 ` ¨ ¨ ¨ ` air ď a0 ` ¨ ¨ ¨ ` an´3 ` an´1 “ Sn´1 ´ an´2 ă an . Thus, if n is good, then both
an ´ an´1 and an ´ an´1 ´ an´2 are representable.
We now onsider the ases n “ 2m ` 1 and n “ 2m ` 2 separately.
If n “ 2m ` 1, then an ´ an´1 “ a2m`1 ´ a2m “ p22m`1 ` 2m q ´ p22m ` 2m q “ 22m . So we
proved that, if 2m ` 1 is good, then 22m is representable. Conversely, if 22m is representable,
then 22m ă a2m , so 22m is a sum of some distin t terms ai with i ă 2m. It follows that
a2m`1 “ a2m ` 22m writes as a2m plus a sum of some distin t terms ai with i ă 2m. Hen e
2m ` 1 is good.
If n “ 2m ` 2, then an ´ an´1 ´ an´2 “ a2m`2 ´ a2m`1 ´ a2m “ p22m`2 ` 2m`1 q ´ p22m`1 `
2m q ´ p22m ` 2m q “ 22m . So we proved that, if 2m ` 2 is good, then 22m is representable.
Conversely, if 22m is representable, then, as seen in the previous ase, it writes as a sum of some
distin t terms ai with i ă 2m. Hen e a2m`2 “ a2m`1 ` a2m ` 22m writes as a2m`1 ` a2m plus a
sum of some distin t terms ai with i ă 2m. Thus 2m ` 2 is good. l
Lemma 2. If k ě 2, then 24k´2 is representable if and only if 2k`1 is representable.
In parti ular, if s ě 2, then 4s is representable if and only if 44s´3 is representable. Also,
4 4s´3
ą 4s .
Proof. We have 24k´2 ă a4k´2 , so in a representation of 24k´2 we an have only terms ai with
i ď 4k ´ 3. Noti e that

a0 ` ¨ ¨ ¨ ` a4k´3 “ 24k´2 ` 22k ´ 3 ă 24k´2 ` 22k ` 2k “ 24k´2 ` a2k .

Hen e, any representation of 24k´2 must ontain all terms from a2k to a4k´3 . (If any of these
terms is missing, then the sum of the remaining ones is ď pa0 ` ¨ ¨ ¨ ` a4k´3 q ´ a2k ă 24k´2 .)
ř4k´3
Hen e, if 2 4k´2
is representable, then 2 4k´2
´ i“2k ai is representable. But

4k´3
ÿ
24k´2 ´ ai “ 24k´2 ´ pS4k´3 ´ S2k´1 q “ 24k´2 ´ p24k´2 ` 22k ´ 3q ` p22k ` 2k`1 ´ 3q “ 2k`1 .
i“2k

So, if 24k´2 is representable, then 2k`1 is representable. Conversely, if 2k`1 is representable,


then 2k`1 ă 22k ` 2k ř “ a2k , so 2k`1 writes as a sum of some distin t terms ai with i ă 2k . It
4k´3
follows that 24k´2 “ i“2k ai ` 2k`1 writes as a4k´3 ` a4k´4 ` ¨ ¨ ¨ ` a2k plus the sum of some
distin t terms ai with i ă 2k . Hen e 24k´2 is representable.
For the se ond statement, if s ě 2, then we just take k “ 2s´1 and we noti e that 2k`1 “ 4s
and 24k´2 “ 44s´3 . Also, s ě 2 implies that 4s ´ 3 ą s. l
60 Cluj-Napo a  Romania, 314 July 2018

Now 42 “ a2 `a3 is representable, whereas 46 “ 4096 is not. Indeed, note that 46 “ 212 ă a12 ,
so the only available terms for a representation are a0 , . . . , a11 , i.e., 2, 3, 6, 10, 20, 36, 72,
136, 272, 528, 1056, 2080. Their sum is S11 “ 4221, whi h ex eeds 4096 by 125. Then any
representation of 4096 must ontain all the terms from a0 , . . . , a11 that are greater that 125,
i.e., 136, 272, 528, 1056, 2080. Their sum is 4072. Sin e 4096 ´ 4072 “ 24 and 24 is learly not
representable, 4096 is non-representable as well.
Starting with these values of m, by using Lemma 2, we an obtain innitely many rep-
resentable powers of 4, as well as innitely many non-representable ones. By Lemma 1, this
solves our problem.
Shortlisted problems  solutions 61

This page is intentionally left blank


62 Cluj-Napo a  Romania, 314 July 2018

N4. Let a1 , a2 , . . ., an , . . . be a sequen e of positive integers su h that


a1 a2 an´1 an
` ` ¨¨¨` `
a2 a3 an a1
is an integer for all n ě k , where k is some positive integer. Prove that there exists a positive
integer m su h that an “ an`1 for all n ě m.
(Mongolia)
Solution 1. The argument hinges on the following two fa ts: Let a, b, c be positive integers
su h that N “ b{c ` pc ´ bq{a is an integer.
(1) If gcdpa, cq “ 1, then c divides b ; and
(2) If gcdpa, b, cq “ 1, then gcdpa, bq “ 1.
To prove (1), write ab “ cpaN ` b ´ cq. Sin e gcdpa, cq “ 1, it follows that c divides b. To
prove (2), write c2 ´ bc “ apcN ´ bq to infer that a divides c2 ´ bc. Letting d “ gcdpa, bq, it
follows that d divides c2 , and sin e the two are relatively prime by hypothesis, d “ 1.
Now, let sn “ a1 {a2 ` a2 {a3 ` ¨ ¨ ¨ ` an´1 {an ` an {a1 , let δn “ gcdpa1 , an , an`1 q and write

an an`1 ´ an an {δn an`1 {δn ´ an {δn


sn`1 ´ sn “ ` “ ` .
an`1 a1 an`1 {δn a1 {δn

Let n ě k . Sin e gcdpa1 {δn , an {δn , an`1 {δn q “ 1, it follows by (2) that gcdpa1 {δn , an {δn q “ 1.
Let dn “ gcdpa1 , an q. Then dn “ δn ¨ gcdpa1 {δn , an {δn q “ δn , so dn divides an`1 , and therefore
dn divides dn`1 .
Consequently, from some rank on, the dn form a nonde reasing sequen e of integers not
ex eeding a1 , so dn “ d for all n ě ℓ, where ℓ is some positive integer.
Finally, sin e gcdpa1 {d, an`1 {dq “ 1, it follows by (1) that an`1 {d divides an {d, so an ě an`1
for all n ě ℓ. The on lusion follows.

Solution 2. We use the same notation sn . This time, we explore the exponents of primes in
the prime fa torizations of the an for n ě k .
To start, for every n ě k , we know that the number
an an`1 an
sn`1 ´ sn “ ` ´ p˚q
an`1 a1 a1

is integer. Multiplying it by a1 we obtain that a1 an {an`1 is integer as well, so that an`1 | a1 an .


This means that an | a1n´k ak , so all prime divisors of an are among those of a1 ak . There are
nitely many su h primes; therefore, it su es to prove that the exponent of ea h of them in
the prime fa torization of an is eventually onstant.
Choose any prime p | a1 ak . Re all that vp pqq is the standard notation for the exponent of p
in the prime fa torization of a nonzero rational number q . Say that an index n ě k is large if
vp pan q ě vp pa1 q. We separate two ases.
Case 1: There exists a large index n.
If vp pan`1 q ă vp pa1 q, then vp pan {an`1 q and vp pan {a1 q are nonnegative, while vp pan`1 {a1 q ă 0;
hen e p˚q annot be an integer. This ontradi tion shows that index n ` 1` is also large. ˘
On the other hand, if vp pan`1 q ą vp pan q, then vp pan {an`1 q ă 0, while vp pan`1 ´an q{a1 ě 0,
so p˚q is not integer again. Thus, vp pa1 q ď vp pan`1 q ď vp pan q.
The above arguments an now be applied su essively to indi es n ` 1, n ` 2, . . . , showing
that all the indi es greater than n are large, and the sequen e vp pan q, vp pan`1 q, vp pan`2 q, . . . is
nonin reasing  hen e eventually onstant.
Shortlisted problems  solutions 63

Case 2: There is no large index.


We have vp pa1 q ą vp pan q for all n ě k . If we had vp pan`1 q ă vp pan q for some n ě k ,
then vp pan`1 {a1 q ă vp pan {a1 q ă 0 ă vp pan {an`1 q whi h would also yield that p˚q is not integer.
Therefore, in this ase the sequen e vp pak q, vp pak`1 q, vp pak`2 q, . . . is nonde reasing and bounded
by vp pa1 q from above; hen e it is also eventually onstant.

Comment. Given any positive odd integer m, onsider the m-tuple p2, 22 , . . . , 2m´1 , 2m q. Appending
an innite string of 1's to this m-tuple yields an eventually onstant sequen e of integers satisfying
the ondition in the statement, and shows that the rank from whi h the sequen e stabilises may be
arbitrarily large.
There are more sophisti ated examples. The solution to part (b) of 10532, Amer. Math. Monthly,
Vol. 105 No. 8 (O t. 1998), 775777 (available at https://www.jstor.org/stable/2589009), shows
that, for every integer m ě 5, there exists an m-tuple pa1 , a2 , . . . , am q of pairwise distin t positive
integers su h that gcdpa1 , a2 q “ gcdpa2 , a3 q “ ¨ ¨ ¨ “ gcdpam´1 , am q “ gcdpam , a1 q “ 1, and the sum
a1 {a2 ` a2 {a3 ` ¨ ¨ ¨ ` am´1 {am ` am {a1 is an integer. Letting am`k “ a1 , k “ 1, 2, . . . , extends su h an
m-tuple to an eventually onstant sequen e of positive integers satisfying the ondition in the statement
of the problem at hand.
Here is the example given by the proposers of 10532. Let b1 “ 2, let bk`1 “ 1 ` b1 ¨ ¨ ¨ bk “
1 ` bk pbk ´ 1q, k ě 1, and set Bm “ b1 ¨ ¨ ¨ bm´4 “ bm´3 ´ 1. The m-tuple pa1 , a2 , . . . , am q dened below
satises the required onditions:

a1 “ 1, a2 “ p8Bm ` 1qBm ` 8, a3 “ 8Bm ` 1, ak “ bm´k for 4 ď k ď m ´ 1,


ˆ ˙
a2 Bm 1 Bm
am “ ¨ a3 ¨ “ p8Bm ` 1qBm ` 4 ¨ p8Bm ` 1q ¨ .
2 2 2 2

It is readily he ked that a1 ă am´1 ă am´2 ă ¨ ¨ ¨ ă a3 ă a2 ă am . For further details we refer to


the solution mentioned above. A quaintan e with this example (or more elaborated examples derived
from) oers no advantage in ta kling the problem.
64 Cluj-Napo a  Romania, 314 July 2018

N5. Four positive integers x, y , z , and t satisfy the relations

xy ´ zt “ x ` y “ z ` t. p˚q

Is it possible that both xy and zt are perfe t squares?


(Russia)
Answer: No.
Solution 1. Arguing indire tly, assume that xy “ a2 and zt “ c2 with a, c ą 0.
Suppose that the number x ` y “ z ` t is odd. Then x and y have opposite parity, as well
as z and t. This means that both xy and zt are even, as well as xy ´ zt “ x ` y ; a ontradi tion.
Thus, x ` y is even, so the number s “ x`y
2
“ z`t
2
is a positive integer.
|x´y| |z´t|
Next, we set b “ 2 , d “ 2 . Now the problem onditions yield

s2 “ a2 ` b2 “ c2 ` d2 (1)

and
2s “ a2 ´ c2 “ d2 ´ b2 (2)
(the last equality in (2) follows from (1)). We readily get from (2) that a, d ą 0.
In the sequel we will use only the relations (1) and (2), along with the fa t that a, d, s
are positive integers, while b and c are nonnegative integers, at most one of whi h may be
zero. Sin e both relations are symmetri with respe t to the simultaneous swappings a Ø d
and b Ø c, we assume, without loss of generality, that b ě c (and hen e b ą 0). Therefore,
d2 “ 2s ` b2 ą c2 , when e
c2 ` d 2 s2
d2 ą “ . (3)
2 2
On the other hand, sin e d2 ´ b2 is even by (2), the numbers b and d have the same parity,
so 0 ă b ď d ´ 2. Therefore,
s
2s “ d2 ´ b2 ě d2 ´ pd ´ 2q2 “ 4pd ´ 1q, i.e., dď ` 1. (4)
2
Combining (3) and (4) we obtain
´s ¯2
2s2 ă 4d2 ď 4 `1 , or ps ´ 2q2 ă 8,
2
whi h yields s ď 4.
Finally, an easy he k shows that ea h number of the form s2 with 1 ď s ď 4 has a unique
representation as a sum of two squares, namely s2 “ s2 ` 02 . Thus, (1) along with a, d ą 0
imply b “ c “ 0, whi h is impossible.

Solution 2. We start with a omplete des ription of all 4-tuples px, y, z, tq of positive integers
satisfying p˚q. As in the solution above, we noti e that the numbers

x`y z`t x´y z´t


s“ “ , p“ , and q“
2 2 2 2
are integers (we may, and will, assume that p, q ě 0). We have

2s “ xy ´ zt “ ps ` pqps ´ pq ´ ps ` qqps ´ qq “ q 2 ´ p2 ,

so p and q have the same parity, and q ą p.


Shortlisted problems  solutions 65

q 2 ´p2
Set now k “ q´p
2
, ℓ“ q`p
2
. Then we have s “ 2
“ 2kℓ and hen e

x “ s ` p “ 2kℓ ´ k ` ℓ, y “ s ´ p “ 2kℓ ` k ´ ℓ,
(5)
z “ s ` q “ 2kℓ ` k ` ℓ, t “ s ´ q “ 2kℓ ´ k ´ ℓ.

Re all here that ℓ ě k ą 0 and, moreover, pk, ℓq ‰ p1, 1q, sin e otherwise t “ 0.
Assume now that both xy and zt are squares. Then xyzt is also a square. On the other
hand, we have

xyzt “ p2kℓ ´ k ` ℓqp2kℓ ` k ´ ℓqp2kℓ ` k ` ℓqp2kℓ ´ k ´ ℓq


` ˘` ˘
“ 4k 2 ℓ2 ´ pk ´ ℓq2 4k 2 ℓ2 ´ pk ` ℓq2 “ p4k 2 ℓ2 ´ k 2 ´ ℓ2 q2 ´ 4k 2 ℓ2 . (6)

Denote D “ 4k 2 ℓ2 ´ k 2 ´ ℓ2 ą 0. From (6) we get D 2 ą xyzt. On the other hand,

pD ´ 1q2 “ D 2 ´ 2p4k 2 ℓ2 ´ k 2 ´ ℓ2 q ` 1 “ pD 2 ´ 4k 2 ℓ2 q ´ p2k 2 ´ 1qp2ℓ2 ´ 1q ` 2


“ xyzt ´ p2k 2 ´ 1qp2ℓ2 ´ 1q ` 2 ă xyzt,

sin e ℓ ě 2 and k ě 1. Thus pD ´ 1q2 ă xyzt ă D 2 , and xyzt annot be a perfe t square; a
ontradi tion.

Comment. The rst part of Solution 2 shows that all 4-tuples of positive integers x ě y , z ě t
satisfying p˚q have the form (5), where ℓ ě k ą 0 and ℓ ě 2. The onverse is also true: every pair
of positive integers ℓ ě k ą 0, ex ept for the pair k “ ℓ “ 1, generates via (5) a 4-tuple of positive
integers satisfying p˚q.
66 Cluj-Napo a  Romania, 314 July 2018

N6. Let f : t1, 2, 3, . . .u Ñ t2, 3, . . .u be a fun tion su h that f pm ` nq | f pmq ` f pnq for all
pairs m, n of positive integers. Prove that there exists a positive integer c ą 1 whi h divides
all values of f .
(Mexi o)
Solution 1. For every positive integer m, dene Sm “ tn : m | f pnqu.
Lemma. If the set Sm is innite, then Sm “ td, 2d, 3d, . . .u “ d ¨ Zą0 for some positive integer d.
Proof. Let d “ min Sm ; the denition of Sm yields m | f pdq.
Whenever n P Sm and n ą d, we have m | f pnq | f pn ´ dq ` f pdq, so m | f pn ´ dq and
therefore n ´ d P Sm . Let r ď d be the least positive integer with n ” r pmod dq; repeating
the same step, we an see that n ´ d, n ´ 2d, . . . , r P Sm . By the minimality of d, this shows
r “ d and therefore d | n.
Starting from an arbitrarily large element of Sm , the pro ess above rea hes all multiples
of d; so they all are elements of Sm . l
The solution for the problem will be split into two ases.
Case 1: The fun tion f is bounded.
Call a prime p frequent if the set Sp is innite, i.e., if p divides f pnq for innitely many
positive integers n; otherwise all p sporadi . Sin e the fun tion f is bounded, there are only
a nite number of primes that divide at least one f pnq; so altogether there are nitely many
numbers n su h that f pnq has a sporadi prime divisor. Let N be a positive integer, greater
than all those numbers n.
Let p1 , . . . , pk be the frequent primes. By the lemma we have Spi “ di ¨ Zą0 for some di .
Consider the number
n “ Nd1 d2 ¨ ¨ ¨ dk ` 1.
Due to n ą N , all prime divisors of f pnq are frequent primes. Let pi be any frequent prime
divisor of f pnq. Then n P Spi , and therefore di | n. But n ” 1 pmod di q, whi h means di “ 1.
Hen e Spi “ 1 ¨ Zą0 “ Zą0 and therefore pi is a ommon divisor of all values f pnq.
Case 2: f is unbounded.
We prove that f p1q divides all f pnq.
Let a “ f p1q. Sin e 1 P Sa , by the lemma it su es to prove that Sa is an innite set.
` ˘
Call a positive integer p a peak if f ppq ą max f p1q, . . . , f pp ´ 1q . Sin e f is not bounded,
there are innitely many peaks. Let 1 “ p1 ă p2 ă . . . be the sequen e of all peaks, and let
hk “ f ppk q. Noti e that for any peak pi and for any k ă pi , we have f ppi q | f pkq ` f ppi ´ kq ă
2f ppi q, hen e
f pkq ` f ppi ´ kq “ f ppi q “ hi . p1q
By the pigeonhole prin iple, among the numbers h1 , h2 , . . . there are innitely many that
are ongruent modulo a. Let k0 ă k1 ă k2 ă . . . be an innite sequen e of positive integers
su h that hk0 ” hk1 ” . . . pmod aq. Noti e that

f ppki ´ pk0 q “ f ppki q ´ f ppk0 q “ hki ´ hk0 ” 0 pmod aq,

so pki ´ pk0 P Sa for all i “ 1, 2, . . .. This provides innitely many elements in Sa .


Hen e, Sa is an innite set, and therefore f p1q “ a divides f pnq for every n.

Comment. As an extension of the solution above, it an be proven that if f is not bounded then
f pnq “ an with a “ f p1q.
Take an arbitrary positive integer n; we will show that f pn ` 1q “ f pnq ` a. Then it follows by
indu tion that f pnq “ an.
Shortlisted problems  solutions 67

Take a peak p su h that p ą n ` 2 and h “ f ppq ą f pnq ` 2a. By (1) we have f pp ´ 1q “


f ppq ´ f p1q “ h ´ a and f pn ` 1q “ f ppq ´ f pp ´ n ´ 1q “ h ´ f pp ´ n ´ 1q. From h ´ a “ f pp ´ 1q |
f pnq ` f pp ´ n ´ 1q ă f pnq ` h ă 2ph ´ aq we get f pnq ` f pp ´ n ´ 1q “ h ´ a. Then
` ˘ ` ˘
f pn ` 1q ´ f pnq “ h ´ f pp ´ n ´ 1q ´ h ´ a ´ f pp ´ n ´ 1q “ a.

On the other hand, there exists a wide family of bounded fun tions satisfying the required proper-
ties. Here we present a few examples:
# #
2c if n is even 2018c if n ď 2018
f pnq “ c; f pnq “ f pnq “
c if n is odd; c if n ą 2018.
` ˘
Solution 2. Let dn “ gcd f pnq, f p1q . From` dn`1 | f p1q ˘ and dn`1 | f pn ` 1q | f pnq ` f p1q,
we an see that dn`1 | f pnq; then dn`1 | gcd f pnq, f p1q “ dn . So the sequen e d1 , d2 , . . .
is nonin reasing in the sense that every element ` is a divisor
˘ of the previous elements. Let
d “ minpd1 , d2 , . . .q “ gcdpd1 .d2 , . . .q “ gcd f p1q, f p2q, . . . ; we have to prove d ě 2.
For the sake of ontradi tion, suppose that the statement is wrong, so d “ 1; that means
there is some index n0 su h that dn “ 1 for every n ě n0 , i.e., f pnq is oprime with f p1q.
Claim 1. If 2k ě n0 then f p2k q ď 2k .
Proof. By the ondition, f p2nq | 2f pnq; a trivial indu tion yields f p2k q | 2k f p1q. If 2k ě n0 then
f p2k q is oprime with f p1q, so f p2k q is a divisor of 2k . l
Claim 2. There is a onstant C su h that f pnq ă n ` C for every n.
Proof. Take the rst power of 2 whi h is greater than or equal to n0 : let K “ 2k ě n0 . By
Claim 1, we have f pKq ď K . Noti e that f pn ` Kq | f pnq ` f pKq implies f pn ` Kq ď
f pnq ` f pKq ď f pnq ` K . If n “ tK ` r for some t ě 0 and 1 ď r ď K , then we on lude
` ˘
f pnq ď K ` f pn ´ Kq ď 2K ` f pn ´ 2Kq ď . . . ď tK ` f prq ă n ` max f p1q, f p2q, . . . , f pKq ,
` ˘
so the laim is true with C “ max f p1q, . . . , f pKq . l
` ˘
Claim 3. If a, b P Zą0 are oprime then gcd f paq, f pbq | f p1q. In parti ular, if a, b ě n0 are
oprime then f paq and f pbq are oprime.
` ˘
Proof. Let d “ gcd f paq, f pbq . We an repli ate Eu lid's algorithm. Formally, apply indu tion
on a ` b. If a “ 1 or b “ 1 then we already have d | f p1q.
Without loss of generality, suppose` 1 ă a ă b. Then
˘ d | f paq and d | f pbq | f paq ` f pb ´ aq,
so d | f pb´aq. Therefore d divides gcd f paq, f pb´aq whi h is a divisor of f p1q by the indu tion
hypothesis. l
Let p1 ă p2 ă . . . be the sequen e of all prime numbers; for every k , let qk be the lowest
power of pk with qk ě n0 . (Noti e that there are only nitely many positive integers with
qk ‰ pk .)
Take a positive integer N , and onsider the numbers
f p1q, f pq1 q, f pq2 q, . . . , f pqN q.
Here we have N ` 1 numbers, ea h being greater than 1, and they are pairwise oprime by
Claim 3. Therefore, they have at least N ` 1 dierent prime divisors in total, and their greatest
prime divisor is at least pN `1 . Hen e, maxpf p1q, f pq1q, . . . , f pqN qq ě pN `1 .
Choose N su h that maxpq1 , . . . , qN q “ pN (this is a hieved if N is su iently large), and
pN `1 ´ pN ą C (that is possible, be ause there are arbitrarily long gaps between the primes).
Then we establish a ontradi tion
pN `1 ď maxpf p1q, f pq1 q, . . . , f pqN qq ă maxp1 ` C, q1 ` C, . . . , qN ` Cq “ pN ` C ă pN `1
whi h proves the statement.
68 Cluj-Napo a  Romania, 314 July 2018

N7. Let n ě 2018 be an integer, and let a1 , a2 , . . . , an , b1 , b2 , . . . , bn be pairwise distin t


positive integers not ex eeding 5n. Suppose that the sequen e
a1 a2 an
, , ..., p1q
b1 b2 bn
forms an arithmeti progression. Prove that the terms of the sequen e are equal.
(Thailand)
Solution. Suppose that (1) is an arithmeti progression with nonzero dieren e. Let the
dieren e be ∆ “ c
d
, where d ą 0 and c, d are oprime.
We will show that too many denominators bi should be divisible by d. To this end, for any
1 ď i ď n and any prime divisor p of d, say that the index i is p-wrong, if vp pbi q ă vp pdq. (vp pxq
stands for the exponent of p in the prime fa torisation of x.)
Claim 1. For any prime p, all p-wrong indi es are ongruent modulo p. In other words, the
p-wrong indi es (if they exist) are in luded in an arithmeti progression with dieren e p.
Proof. Let α “ vp pdq. For the sake of ontradi tion, suppose that i and j are p-wrong indi es
(i.e., none of bi and bj is divisible by pα ) su h that i ı j pmod pq. Then the least ommon
a
denominator of abii and bjj is not divisible by pα . But this is impossible be ause in their dieren e,
pi´jqc
pi ´ jq∆ “ d
, the numerator is oprime to p, but pα divides the denominator d. l
Claim 2. d has no prime divisors greater than 5.
PProof.
T Suppose that p ě 7 is a prime divisor of d. Among the indi es 1, 2, . . . , n, at most
n
p
ă np ` 1 are p-wrong, so p divides at least p´1
p
n ´ 1 of b1 , . . . , bn . Sin e these denominators
are distin t,
ˆ ˙
( p´1
5n ě max bi : p | bi ě n ´ 1 p “ pp ´ 1qpn ´ 1q ´ 1 ě 6pn ´ 1q ´ 1 ą 5n,
p
a ontradi tion. l

Claim 3. For every 0 ď k ď n ´ 30, among the denominators bk`1 , bk`2 , . . . , bk`30 , at least
ϕp30q “ 8 are divisible by d.
Proof. By Claim 1, the 2-wrong, 3-wrong and 5-wrong indi es an be overed by three arithmeti
progressions with dieren es 2, 3 and 5. By a simple in lusion-ex lusion, p2´1q¨p3´1q¨p5´1q “ 8
indi es are not overed; by Claim 2, we have d | bi for every un overed index i. l

Claim 4. |∆| ă n´2


20
and d ą n´2
20
.
Proof. From the sequen e (1), remove all fra tions with bn ă n2 , There remain at least n
2
fra tions, and they annot ex eed “ 10. So we have at least elements of the arithmeti
5n
n{2
n
2
progression (1) in the interval p0, 10s, hen e the dieren e must be below n{2´1
10 20
“ n´2 .
|c|
The se ond inequality follows from 1
d
ď d
“ |∆|. l
Now
X n \we have everything to get the nal ontradi tion. By Claim 3, we have d | bi for at
least 30 ¨ 8 indi es i. By Claim 4, we have d ě 20 . Therefore,
n´2

( ´Y n ] ¯ ´n ¯ n´2
5n ě max bi : d | bi ě ¨8 ¨dą ´1 ¨8¨ ą 5n.
30 30 20

Comment 1. It is possible that all terms in (1) are equal, for example with ai “ 2i´ 1 and bi “ 4i´ 2
ai 1
we have
bi “ 2.

Comment 2. The bound 5n in the statement is far from sharp; the solution above
3
an be modied
to work for 9n. For large n, the bound 5n an be repla ed by n 2 ´ε .
Shortlisted
Problems
(with solutions)

60th International Mathematical Olympiad


Bath — UK, 11th–22nd July 2019
Note of Confidentiality

The Shortlist has to be kept strictly confidential


until the conclusion of the following
International Mathematical Olympiad.
IMO General Regulations §6.6

Contributing Countries

The Organising Committee and the Problem Selection Committee of IMO 2019 thank the
following 58 countries for contributing 204 problem proposals:

Albania, Armenia, Australia, Austria, Belarus, Belgium, Brazil, Bulgaria,


Canada, China, Croatia, Cuba, Cyprus, Czech Republic, Denmark,
Ecuador, El Salvador, Estonia, Finland, France, Georgia, Germany,
Greece, Hong Kong, Hungary, India, Indonesia, Iran, Ireland, Israel,
Italy, Japan, Kazakhstan, Kosovo, Luxembourg, Mexico, Netherlands,
New Zealand, Nicaragua, Nigeria, North Macedonia, Philippines, Poland,
Russia, Serbia, Singapore, Slovakia, Slovenia, South Africa, South Korea,
Sweden, Switzerland, Taiwan, Tanzania, Thailand, Ukraine, USA, Vietnam.

Problem Selection Committee

Tony Gardiner, Edward Crane, Alexander Betts, James Cranch, Joseph Myers (chair),
James Aaronson, Andrew Carlotti, Géza Kós, Ilya I. Bogdanov, Jack Shotton
4 Bath — UK, 11th–22nd July 2019

Problems
Algebra
A1. Let Z be the set of integers. Determine all functions f : Z Ñ Z such that, for all
integers a and b,
f p2aq ` 2f pbq “ f pf pa ` bqq.
(South Africa)
A2. Let u1 , u2 , . . . , u2019 be real numbers satisfying

u1 ` u2 ` ¨ ¨ ¨ ` u2019 “ 0 and u21 ` u22 ` ¨ ¨ ¨ ` u22019 “ 1.

Let a “ minpu1 , u2 , . . . , u2019 q and b “ maxpu1 , u2 , . . . , u2019 q. Prove that


1
ab ď ´ .
2019
(Germany)
A3. Let n ě 3 be a positive integer and let pa1 , a2 , . . . , an q be a strictly increasing
sequence of n positive real numbers with sum equal to 2. Let X be a subset of t1, 2, . . . , nu
such that the value of ˇ ˇ
ˇ ÿ ˇ
ˇ ˇ
ˇ1 ´ ai ˇ
ˇ iPX
ˇ
is minimised. Prove that there exists a strictly increasing sequence of n positive real numbers
pb1 , b2 , . . . , bn q with sum equal to 2 such that
ÿ
bi “ 1.
iPX

(New Zealand)
A4. Let n ě 2 be a positive integer and a1 , a2 , . . . , an be real numbers such that

a1 ` a2 ` ¨ ¨ ¨ ` an “ 0.

Define the set A by ˇ (


A “ pi, jq ˇ 1 ď i ă j ď n, |ai ´ aj | ě 1 .
Prove that, if A is not empty, then ÿ
ai aj ă 0.
pi,jqPA

(China)
A5. Let x1 , x2 , . . . , xn be different real numbers. Prove that
#
ÿ ź 1 ´ xi xj 0, if n is even;

1ďiďn j‰i
xi ´ xj 1, if n is odd.

(Kazakhstan)
Shortlisted problems 5

A6. A polynomial P px, y, zq in three variables with real coefficients satisfies the identities

P px, y, zq “ P px, y, xy ´ zq “ P px, zx ´ y, zq “ P pyz ´ x, y, zq.

Prove that there exists a polynomial F ptq in one variable such that

P px, y, zq “ F px2 ` y 2 ` z 2 ´ xyzq.

(Russia)
A7. Let Z be the set of integers. We consider functions f : Z Ñ Z satisfying
` ˘ ` ˘
f f px ` yq ` y “ f f pxq ` y

for all integers x and y. For such a function, we say that an integer v is f -rare if the set

Xv “ tx P Z : f pxq “ vu

is finite and nonempty.

(a) Prove that there exists such a function f for which there is an f -rare integer.

(b) Prove that no such function f can have more than one f -rare integer.

(Netherlands)
6 Bath — UK, 11th–22nd July 2019

Combinatorics
C1. The infinite sequence a0 , a1 , a2 , . . . of (not necessarily different) integers has the
following properties: 0 ď ai ď i for all integers i ě 0, and
ˆ ˙ ˆ ˙ ˆ ˙
k k k
` ` ¨¨¨` “ 2k
a0 a1 ak
for all integers k ě 0.
Prove that all integers N ě 0 occur in the sequence (that is, for all N ě 0, there exists i ě 0
with ai “ N).
(Netherlands)
C2. You are given a set of n blocks, each weighing at least 1; their total weight is 2n.
Prove that for every real number r with 0 ď r ď 2n ´ 2 you can choose a subset of the blocks
whose total weight is at least r but at most r ` 2.
(Thailand)
C3. Let n be a positive integer. Harry has n coins lined up on his desk, each showing
heads or tails. He repeatedly does the following operation: if there are k coins showing heads
and k ą 0, then he flips the k th coin over; otherwise he stops the process. (For example, the
process starting with T HT would be T HT Ñ HHT Ñ HT T Ñ T T T , which takes three
steps.)
Letting C denote the initial configuration (a sequence of n H’s and T ’s), write ℓpCq for the
number of steps needed before all coins show T . Show that this number ℓpCq is finite, and
determine its average value over all 2n possible initial configurations C.
(USA)
C4. On a flat plane in Camelot, King Arthur builds a labyrinth L consisting of n walls,
each of which is an infinite straight line. No two walls are parallel, and no three walls have a
common point. Merlin then paints one side of each wall entirely red and the other side entirely
blue.
At the intersection of two walls there are four corners: two diagonally opposite corners
where a red side and a blue side meet, one corner where two red sides meet, and one corner
where two blue sides meet. At each such intersection, there is a two-way door connecting the
two diagonally opposite corners at which sides of different colours meet.
After Merlin paints the walls, Morgana then places some knights in the labyrinth. The
knights can walk through doors, but cannot walk through walls.
Let kpLq be the largest number k such that, no matter how Merlin paints the labyrinth L,
Morgana can always place at least k knights such that no two of them can ever meet. For
each n, what are all possible values for kpLq, where L is a labyrinth with n walls?
(Canada)
C5. On a certain social network, there are 2019 users, some pairs of which are friends,
where friendship is a symmetric relation. Initially, there are 1010 people with 1009 friends each
and 1009 people with 1010 friends each. However, the friendships are rather unstable, so events
of the following kind may happen repeatedly, one at a time:
Let A, B, and C be people such that A is friends with both B and C, but B and C
are not friends; then B and C become friends, but A is no longer friends with them.
Prove that, regardless of the initial friendships, there exists a sequence of such events after
which each user is friends with at most one other user.
(Croatia)
Shortlisted problems 7

C6. Let n ą 1 be an integer. Suppose we are given 2n points in a plane such that
no three of them are collinear. The points are to be labelled A1 , A2 , . . . , A2n in some order.
We then consider the 2n angles =A1 A2 A3 , =A2 A3 A4 , . . . , =A2n´2 A2n´1 A2n , =A2n´1 A2n A1 ,
=A2n A1 A2 . We measure each angle in the way that gives the smallest positive value (i.e.
between 0˝ and 180˝). Prove that there exists an ordering of the given points such that the
resulting 2n angles can be separated into two groups with the sum of one group of angles equal
to the sum of the other group.
(USA)
C7. There are 60 empty boxes B1 , . . . , B60 in a row on a table and an unlimited supply
of pebbles. Given a positive integer n, Alice and Bob play the following game.
In the first round, Alice takes n pebbles and distributes them into the 60 boxes as she
wishes. Each subsequent round consists of two steps:

(a) Bob chooses an integer k with 1 ď k ď 59 and splits the boxes into the two groups
B1 , . . . , Bk and Bk`1, . . . , B60 .

(b) Alice picks one of these two groups, adds one pebble to each box in that group, and removes
one pebble from each box in the other group.

Bob wins if, at the end of any round, some box contains no pebbles. Find the smallest n
such that Alice can prevent Bob from winning.
(Czech Republic)
C8. Alice has a map of Wonderland, a country consisting of n ě 2 towns. For every
pair of towns, there is a narrow road going from one town to the other. One day, all the roads
are declared to be “one way” only. Alice has no information on the direction of the roads, but
the King of Hearts has offered to help her. She is allowed to ask him a number of questions.
For each question in turn, Alice chooses a pair of towns and the King of Hearts tells her the
direction of the road connecting those two towns.
Alice wants to know whether there is at least one town in Wonderland with at most one
outgoing road. Prove that she can always find out by asking at most 4n questions.

Comment. This problem could be posed with an explicit statement about points being awarded for
weaker bounds cn for some c ą 4, in the style of IMO 2014 Problem 6.
(Thailand)
C9. For any two different real numbers x and y, we define Dpx, yq to be the unique
integer d satisfying 2d ď |x ´ y| ă 2d`1 . Given a set of reals F , and an element x P F , we say
that the scales of x in F are the values of Dpx, yq for y P F with x ‰ y.
Let k be a given positive integer. Suppose that each member x of F has at most k different
scales in F (note that these scales may depend on x). What is the maximum possible size of F ?
(Italy)
8 Bath — UK, 11th–22nd July 2019

Geometry
G1. Let ABC be a triangle. Circle Γ passes through A, meets segments AB and AC
again at points D and E respectively, and intersects segment BC at F and G such that F lies
between B and G. The tangent to circle BDF at F and the tangent to circle CEG at G meet
at point T . Suppose that points A and T are distinct. Prove that line AT is parallel to BC.
(Nigeria)
G2. Let ABC be an acute-angled triangle and let D, E, and F be the feet of altitudes
from A, B, and C to sides BC, CA, and AB, respectively. Denote by ωB and ωC the incircles
of triangles BDF and CDE, and let these circles be tangent to segments DF and DE at M
and N, respectively. Let line MN meet circles ωB and ωC again at P ‰ M and Q ‰ N,
respectively. Prove that MP “ NQ.
(Vietnam)
G3. In triangle ABC, let A1 and B1 be two points on sides BC and AC, and let P and Q
be two points on segments AA1 and BB1 , respectively, so that line P Q is parallel to AB. On
ray P B1 , beyond B1 , let P1 be a point so that =P P1 C “ =BAC. Similarly, on ray QA1 ,
beyond A1 , let Q1 be a point so that =CQ1 Q “ =CBA. Show that points P , Q, P1 , and Q1
are concyclic.
(Ukraine)
G4. Let P be a point inside triangle ABC. Let AP meet BC at A1 , let BP meet CA
at B1 , and let CP meet AB at C1 . Let A2 be the point such that A1 is the midpoint of P A2 ,
let B2 be the point such that B1 is the midpoint of P B2 , and let C2 be the point such that
C1 is the midpoint of P C2 . Prove that points A2 , B2 , and C2 cannot all lie strictly inside the
circumcircle of triangle ABC.
(Australia)
G5. Let ABCDE be a convex pentagon with CD “ DE and =EDC ‰ 2 ¨ =ADB.
Suppose that a point P is located in the interior of the pentagon such that AP “ AE and
BP “ BC. Prove that P lies on the diagonal CE if and only if areapBCDq ` areapADEq “
areapABDq ` areapABP q.
(Hungary)
G6. Let I be the incentre of acute-angled triangle ABC. Let the incircle meet BC, CA,
and AB at D, E, and F , respectively. Let line EF intersect the circumcircle of the triangle
at P and Q, such that F lies between E and P . Prove that =DP A ` =AQD “ =QIP .
(Slovakia)
G7. The incircle ω of acute-angled scalene triangle ABC has centre I and meets sides BC,
CA, and AB at D, E, and F , respectively. The line through D perpendicular to EF meets ω
again at R. Line AR meets ω again at P . The circumcircles of triangles P CE and P BF meet
again at Q ‰ P . Prove that lines DI and P Q meet on the external bisector of angle BAC.
(India)
G8. Let L be the set of all lines in the plane and let f be a function that assigns to each
line ℓ P L a point f pℓq on ℓ. Suppose that for any point X, and for any three lines ℓ1 , ℓ2 , ℓ3
passing through X, the points f pℓ1 q, f pℓ2 q, f pℓ3 q and X lie on a circle.
Prove that there is a unique point P such that f pℓq “ P for any line ℓ passing through P .
(Australia)
Shortlisted problems 9

Number Theory
N1. Find all pairs pm, nq of positive integers satisfying the equation

p2n ´ 1qp2n ´ 2qp2n ´ 4q ¨ ¨ ¨ p2n ´ 2n´1 q “ m!

(El Salvador)
N2. Find all triples pa, b, cq of positive integers such that a3 ` b3 ` c3 “ pabcq2 .
(Nigeria)
N3. We say that a set S of integers is rootiful if, for any positive integer n and any
a0 , a1 , . . . , an P S, all integer roots of the polynomial a0 ` a1 x ` ¨ ¨ ¨ ` an xn are also in S. Find
all rootiful sets of integers that contain all numbers of the form 2a ´ 2b for positive integers
a and b.
(Czech Republic)
N4. Let Zą0 be the set of positive integers. A positive integer constant C is given. Find
all functions f : Zą0 Ñ Zą0 such that, for all positive integers a and b satisfying a ` b ą C,

a ` f pbq | a2 ` b f paq.

(Croatia)
N5. Let a be a positive integer. We say that a positive integer b is a-good if `anb˘ ´ 1 is
divisible by an ` 1 for all positive integers n with an ě b. Suppose b is a positive integer such
that b is a-good, but b ` 2 is not a-good. Prove that b ` 1 is prime.
(Netherlands)
N6. Let H “ Xi?2\ : i P Zą0 ( “ t1, 2, 4, 5, 7, . . .u, and let n be a positive integer. Prove
?
that there exists a constant C such that, if A Ă t1, 2, . . . , nu satisfies |A| ě C n, then there
exist a, b P A such that a ´ b P H. (Here Zą0 is the set of positive integers, and tzu denotes the
greatest integer less than or equal to z.)
(Brazil)
N7. Prove that there is a constant c ą 0 and infinitely many positive integers n with the
following property: there are infinitely many positive integers that cannot be expressed as the
sum of fewer than cn logpnq pairwise coprime nth powers.
(Canada)
N8. Let a and b be two positive integers. Prove that the integer
R 2V
2 4a
a `
b

is not a square. (Here rzs denotes the least integer greater than or equal to z.)
(Russia)
10 Bath — UK, 11th–22nd July 2019

Solutions

Algebra
A1. Let Z be the set of integers. Determine all functions f : Z Ñ Z such that, for all
integers a and b,
f p2aq ` 2f pbq “ f pf pa ` bqq. (1)
(South Africa)

Answer: The solutions are f pnq “ 0 and f pnq “ 2n ` K for any constant K P Z.

Common remarks. Most solutions to this problem first prove that f must be linear, before
determining all linear functions satisfying (1).

Solution 1. Substituting a “ 0, b “ n ` 1 gives f pf pn ` 1qq “ f p0q ` 2f pn ` 1q. Substituting


a “ 1, b “ n gives f pf pn ` 1qq “ f p2q ` 2f pnq.
In particular, f p0q ` 2f pn ` 1q “ f p2q ` 2f pnq, and so f pn ` 1q ´ f pnq “ 21 pf p2q ´ f p0qq.
Thus f pn ` 1q ´ f pnq must be constant. Since f is defined only on Z, this tells us that f must
be a linear function; write f pnq “ Mn ` K for arbitrary constants M and K, and we need only
determine which choices of M and K work.
Now, (1) becomes
2Ma ` K ` 2pMb ` Kq “ MpMpa ` bq ` Kq ` K
which we may rearrange to form
` ˘
pM ´ 2q Mpa ` bq ` K “ 0.
Thus, either M “ 2, or Mpa ` bq ` K “ 0 for all values of a ` b. In particular, the only possible
solutions are f pnq “ 0 and f pnq “ 2n ` K for any constant K P Z, and these are easily seen to
work.

Solution 2. Let K “ f p0q.


First, put a “ 0 in (1); this gives
f pf pbqq “ 2f pbq ` K (2)
for all b P Z.
Now put b “ 0 in (1); this gives
f p2aq ` 2K “ f pf paqq “ 2f paq ` K,
where the second equality follows from (2). Consequently,
f p2aq “ 2f paq ´ K (3)
for all a P Z.
Substituting (2) and (3) into (1), we obtain
f p2aq ` 2f pbq “ f pf pa ` bqq
2f paq ´ K ` 2f pbq “ 2f pa ` bq ` K
f paq ` f pbq “ f pa ` bq ` K.
Shortlisted problems – solutions 11

Thus, if we set gpnq “ f pnq ´ K we see that g satisfies the Cauchy equation gpa ` bq “
gpaq`gpbq. The solution to the Cauchy equation over Z is well-known; indeed, it may be proven
by an easy induction that gpnq “ Mn for each n P Z, where M “ gp1q is a constant.
Therefore, f pnq “ Mn ` K, and we may proceed as in Solution 1.

Comment 1. Instead of deriving (3) by substituting b “ 0 into (1), we could instead have observed
that the right hand side of (1) is symmetric in a and b, and thus

f p2aq ` 2f pbq “ f p2bq ` 2f paq.

Thus, f p2aq ´ 2f paq “ f p2bq ´ 2f pbq for any a, b P Z, and in particular f p2aq ´ 2f paq is constant.
Setting a “ 0 shows that this constant is equal to ´K, and so we obtain (3).

Comment 2. Some solutions initially prove that f pf pnqq is linear (sometimes via proving that
f pf pnqq ´ 3K satisfies the Cauchy equation). However, one can immediately prove that f is linear by
substituting something of the form f pf pnqq “ M 1 n ` K 1 into (2).
12 Bath — UK, 11th–22nd July 2019

A2. Let u1 , u2 , . . . , u2019 be real numbers satisfying


u1 ` u2 ` ¨ ¨ ¨ ` u2019 “ 0 and u21 ` u22 ` ¨ ¨ ¨ ` u22019 “ 1.
Let a “ minpu1 , u2 , . . . , u2019 q and b “ maxpu1 , u2 , . . . , u2019 q. Prove that
1
ab ď ´ .
2019
(Germany)
2019
ř
Solution 1. Notice first that b ą 0 and a ă 0. Indeed, since u2i “ 1, the variables ui
i“1
2019
ř
cannot be all zero, and, since ui “ 0, the nonzero elements cannot be all positive or all
i“1
negative.
Let P “ ti : ui ą 0u and N “ ti : ui ď 0u be the indices of positive and nonpositive elements
in the sequence, and let p “ |P | and n “ |N| be the sizes of these sets; then p ` n “ 2019. By
2019
ř 2019
ř ř ř
the condition ui “ 0 we have 0 “ ui “ ui ´ |ui |, so
i“1 i“1 iPP iPN
ÿ ÿ
ui “ |ui |. p1q
iPP iPN

After this preparation, estimate the sum of squares of the positive and nonpositive elements
as follows:
ÿ ÿ ÿ ÿ ÿ
u2i ď bui “ b ui “ b |ui | ď b |a| “ ´nab; (2)
iPP iPP iPP
ÿ ÿ ÿ iPN ÿiPN ÿ
u2i ď |a| ¨ |ui | “ |a| |ui | “ |a| ui ď |a| b “ ´pab. (3)
iPN iPN iPN iPP iPP

The sum of these estimates is


2019
ÿ ÿ ÿ
1“ u2i “ u2i ` u2i ď ´pp ` nqab “ ´2019ab;
i“1 iPP iPN

´1
that proves ab ď 2019
.
ř ř ř ř
Comment 1. After observing u2i ď b ui and u2i ď |a| |ui |, instead of p2, 3q an alternative
iPP iPP iPN iPP
continuation is ř ř ř
u2i u2i u2i ÿ 1 ÿ 2
|ab| ě iPP
ř ¨ iPN
ř “ ´ iPP ¯2 u2i ě u
ui |ui | ř p iPN i
iPP iPN
ui iPN
iPP
1 ř
(by the AM-QM or the Cauchy–Schwarz inequality) and similarly |ab| ě n u2i .
iPP

Solution 2. As in the previous solution we conclude that a ă 0 and b ą 0.


For every index i, the number ui is a convex combination of a and b, so
ui “ xi a ` yi b with some weights 0 ď xi , yi ď 1, with xi ` yi “ 1.

2019
ř 2019
ř 2019
ř 2019
ř
Let X “ xi and Y “ yi . From 0 “ ui “ pxi a ` yi bq “ ´|a|X ` bY , we get
i“1 i“1 i“1 i“1

|a|X “ bY. p4q


Shortlisted problems – solutions 13

2019
ř
From pxi ` yi q “ 2019 we have
i“1
X ` Y “ 2019. p5q
The system of linear equations p4, 5q has a unique solution:

2019b 2019|a|
X“ , Y “ .
|a| ` b |a| ` b

Now apply the following estimate to every u2i in their sum:

u2i “ x2i a2 ` 2xi yi ab ` yi2 b2 ď xi a2 ` yi b2 ;

we obtain that
2019
ÿ 2019
ÿ 2019b 2 2019|a| 2
1“ u2i ď pxi a2 ` yi b2 q “ Xa2 ` Y b2 “ |a| ` b “ 2019|a|b “ ´2019ab.
i“1 i“1
|a| ` b |a| ` b

´1
Hence, ab ď .
2019
Comment
ř ř 2 Suppose we fix a ă 0 and b ą 0,
2. The idea behind Solution 2 is the following thought.
fix ui “ 0 and vary the ui to achieve the maximum value ř of ui . Considering varying any two of
the ui while preserving their sum: the maximum value of u2i is achieved when those two are as far
apart as possible, so all but at most one of the ui are equal to a or b. Considering a weighted version of
the problem, we see the maximum (with fractional numbers of ui having each value) is achieved when
2019b 2019|a|
of them are a and are b.
|a| ` b |a| ` b
In fact, this happens in the solution: the number ui is replaced by xi copies of a and yi copies of b.
14 Bath — UK, 11th–22nd July 2019

A3. Let n ě 3 be a positive integer and let pa1 , a2 , . . . , an q be a strictly increasing


sequence of n positive real numbers with sum equal to 2. Let X be a subset of t1, 2, . . . , nu
such that the value of ˇ ˇ
ˇ ÿ ˇ
ˇ ˇ
ˇ1 ´ ai ˇ
ˇ iPX
ˇ
is minimised. Prove that there exists a strictly increasing sequence of n positive real numbers
pb1 , b2 , . . . , bn q with sum equal to 2 such that
ÿ
bi “ 1.
iPX

(New Zealand)
Common remarks. In all solutions, we say an index set X is pai q-minimising if it has
the property in the problem for the given sequence pai q. Write X c for the complement of X,
and ra, bs for the interval of integers k such that a ď k ď b. Note that
ˇ ˇ ˇ ˇ
ˇ ÿ ˇˇ ˇˇ ÿ ˇˇ
ˇ
ˇ1 ´ ai ˇ “ ˇ1 ´ ai ˇ ,
ˇ iPX
ˇ ˇ iPX c
ˇ
so we may exchange X and X c where convenient. Let
ÿ ÿ
∆“ ai ´ ai
iPX c iPX
ř
and note that X is pai q-minimising if and only if it minimises |∆|, and that iPX ai “ 1 if and
only if ∆ “ 0.
In some solutions, a scaling process is used. If we have a strictly increasing sequence of
positive real numbers ci (typically obtained by perturbing the ai in some way) such that
ÿ ÿ
ci “ ci ,
iPX iPX c
řn
then we may put bi “ 2ci { j“1 cj . So it suffices to construct such a sequence without needing
its sum to be 2.
The solutions below show various possible approaches to the problem. Solutions 1 and 2
perturb a few of the ai to form the bi (with scaling in the case of Solution 1, without scaling in
the case of Solution 2). Solutions 3 and 4 look at properties of the index set X. Solution 3 then
perturbs many of the ai to form the bi , together with scaling. Rather than using such perturba-
tions, Solution 4 constructs a sequence pbi q directly from the set X with the required properties.
Solution 4 can be used to give a complete description of sets X that are pai q-minimising for
some pai q.
ř
Solution 1. Without loss of generality, assume iPX ai ď 1, and we may assume strict
inequality as otherwise bi “ ai works. Also, X clearly cannotřbe empty.ř
If n P X, add ∆ to an , producing a sequence of ci with iPX ci “ iPX c ci , and then scale
as described above to make the sum equal to 2. Otherwise, there is some k with k P X and
k ` 1 P X c . Let δ “ ak`1 ´ ak .
• If δ ą ∆, add ∆ to ak and then scale.
• If δ ă ∆, then considering X Y tk ` 1u z tku contradicts X being pai q-minimising.
• If δ “ ∆, choose any j ‰ k, k ` 1 (possible since n ě 3), and any ǫ less than the least
of a1 and all the differences ai`1 ´ ai . If j P X then add ∆ ´ ǫ to ak and ǫ to aj , then
scale; otherwise, add ∆ to ak and ǫ{2 to ak`1 , and subtract ǫ{2 from aj , then scale.
Shortlisted problems – solutions 15

Solution 2. This is similar


ř to Solution 1, but without scaling. As in that solution, without
loss of generality, assume iPX ai ă 1.
Suppose there exists 1 ď j ď n ´ 1 such that j P X but j ` 1 P X c . Then aj`1 ´ aj ě ∆,
because otherwise considering X Y tj ` 1u z tju contradicts X being pai q-minimising.
If aj`1 ´ aj ą ∆, put $
&aj ` ∆{2,
’ if i “ j;
bi “ aj`1 ´ ∆{2, if i “ j ` 1;

%
ai , otherwise.
If aj`1 ´ aj “ ∆, choose any ǫ less than the least of ∆{2, a1 and all the differences ai`1 ´ ai .
If |X| ě 2, choose k P X with k ‰ j, and put
$
’aj ` ∆{2 ´ ǫ, if i “ j;


&a ´ ∆{2, if i “ j ` 1;
j`1
bi “

’ ak ` ǫ, if i “ k;

%
ai , otherwise.
Otherwise, |X c | ě 2, so choose k P X c with k ‰ j ` 1, and put
$

’ aj ` ∆{2, if i “ j;

&a ´ ∆{2 ` ǫ, if i “ j ` 1;
j`1
bi “


’ ak ´ ǫ, if i “ k;
%
ai , otherwise.
If there is no 1 ď j ď n such that j P X but j ` 1 P X c , there must be some 1 ă k ď n
such that X “ rk, ns (certainly X cannot be empty). We must have a1 ą ∆, as otherwise
considering X Y t1u contradicts X being pai q-minimising. Now put
$
&a1 ´ ∆{2, if i “ 1;

bi “ an ` ∆{2, if i “ n;

%
ai , otherwise.
ř
Solution 3. Without loss of generality, assume iPX ai ď 1, so ∆ ě 0. If ∆ “ 0 we can take
bi “ ai , so now assume that ∆ ą 0.
Suppose that there is some k ď n such that |X X rk, ns| ą |X c X rk, ns|. If we choose the
largest such k then |X X rk, ns| ´ |X c X rk, ns| “ 1. We can now find the required sequence pbi q
by starting with ci “ ai for i ă k and ci “ ai ` ∆ for i ě k, and then scaling as described
above.
If no such k exists, we will derive a contradiction. For each i P X we can choose i ă ji ď n
in such a way that ji P X c and all the ji are different. (For instance, note that necessarily
n P X c and now just work downwards; each time an i P X is considered, let ji be the least
element of X c greater than i and not yet used.) Let Y be the (possibly empty) subset of r1, ns
consisting of those elements in X c that are also not one of the ji . In any case
ÿ ÿ
∆“ paji ´ ai q ` aj
iPX jPY

where each term in the sums is positive. Since n ě 3 the total number of terms above is at
least two. Take a least such term and its corresponding index i and consider the set Z which
we form from X by removing i and adding ji (if it is a term of the first type) or just by adding j
if it is a term of the second type. The corresponding expression of ∆ for Z has the sign of its
least term changed, meaning that the sum is still nonnegative but strictly less than ∆, which
contradicts X being pai q-minimising.
16 Bath — UK, 11th–22nd July 2019

Solution 4. This uses some similar ideas to Solution 3, but describes properties of the index
sets X that are sufficient to describe a corresponding sequence pbi q that is not derived from pai q.
Note that, for two subsets X, Y of r1, ns, the following are equivalent:

• |X X ri, ns| ď |Y X ri, ns| for all 1 ď i ď n;

• Y is at least as large as X, and for all 1 ď j ď |Y |, the j th largest element of Y is at least


as big as the j th largest element of X;

• there is an injective function f : X Ñ Y such that f piq ě i for all i P X.

If these equivalent conditions are satisfied, we write X ĺ Y . We write X ă Y if X ĺ Y and


X ‰Y.
ř ř
Note that if X ă Y , then iPX ai ă iPY ai (the second description above makes this clear).
We claim first that, if n ě 3 and X ă X c , then there exists Y with X ă Y ă X c . Indeed,
as |X| ď |X c |, we have |X c | ě 2. Define Y to consist of the largest element of X c , together
with all but the largest element of X; it is clear both that Y is distinct from X and X c , and
that X ĺ Y ĺ X c , which is what we need.
But, in this situation, we have
˜ ¸
ÿ ÿ ÿ ÿ ÿ
ai ă ai ă ai and 1´ ai “ ´ 1 ´ ai ,
iPX iPY iPX c iPX iPX c

ř ř
so |1 ´ iPY ai | ă |1 ´ iPX ai |.
Hence if X is pai q-minimising, we do not have X ă X c , and similarly we do not have
X c ă X.
Considering the first description above, this immediately implies the following Claim.
Claim. There exist 1 ď k, ℓ ď n such that |X X rk, ns| ą n´k`1
2
and |X X rℓ, ns| ă n´ℓ`1
2
.
We now construct our sequence pbi q using this claim. Let k and ℓ be the greatest values
satisfying the claim, and without loss of generality suppose k “ n and ℓ ă n (otherwise
replace X by its complement). As ℓ is maximal, n ´ ℓ is even and |X X rℓ, ns| “ n´ℓ 2
. For
sufficiently small positive ǫ, we take
$
&0, if i ă ℓ;

bi “ iǫ ` δ, if ℓ ď i ď n ´ 1;

%
γ, if i “ n.
ř
Let M “ iPX i. So we require
ˆ ˙
n´ℓ
Mǫ ` ´1 δ`γ “1
2

and
npn ` 1q
ǫ ` pn ´ ℓqδ ` γ “ 2.
2
These give ˆ ˙
npn ` 1q
γ “ 2δ ` ´ 2M ǫ
2
and for sufficiently small positive ǫ, solving for γ and δ gives 0 ă δ ă γ (since ǫ “ 0 gives
δ “ 1{p n´ℓ
2
` 1q and γ “ 2δ), so the sequence is strictly increasing and has positive values.
Shortlisted problems – solutions 17

Comment. This solution also shows that the claim gives a complete description of sets X that are
pai q-minimising for some pai q.
Another approach to proving the claim is as follows. We prove the existence of ℓ with the claimed
property; the existence of k follows by considering the complement of X. P T
Suppose, for a contradiction, that for all 1 ď ℓ ď n we have |X X rℓ, ns| ě n´ℓ`1 2 . If we ever
have strict inequality, consider the set Y “ tn, n ´ 2, n ´ 4, . . .u. This set may be obtained from X by
possibly removing some elements and reducing the values of others. (To see this, consider the largest
k P X z Y , if any; remove it, and replace it by the greatest j P X c with j ă k, if any. Such steps
preserve the given inequality, and are possible until we reach the set Y .) So if we had strict inequality,
and so X ‰ Y , we have ÿ ÿ
ai ą ai ą 1,
iPX iPY

contradicting X being pai q-minimising. Otherwise, we always have equality, meaning that X “ Y . But
now consider Z “ Y Y tn ´ 1u z tnu. Since n ě 3, we have
ÿ ÿ ÿ ÿ
ai ą ai ą ai “ 2 ´ ai ,
iPY iPZ iPY c iPY

and so Z contradicts X being pai q-minimising.


18 Bath — UK, 11th–22nd July 2019

A4. Let n ě 2 be a positive integer and a1 , a2 , . . . , an be real numbers such that


a1 ` a2 ` ¨ ¨ ¨ ` an “ 0.
Define the set A by ˇ (
A “ pi, jq ˇ 1 ď i ă j ď n, |ai ´ aj | ě 1 .
Prove that, if A is not empty, then ÿ
ai aj ă 0.
pi,jqPA

(China)
Solution 1. Define sets B and C by
ˇ (
B “ pi, jq ˇ 1 ď i, j ď n, |ai ´ aj | ě 1 ,
ˇ (
C “ pi, jq ˇ 1 ď i, j ď n, |ai ´ aj | ă 1 .
We have
ÿ 1 ÿ
ai aj “ ai aj
pi,jqPA
2 pi,jqPB
ÿ ÿ ÿ ÿ
ai aj “ ai aj ´ ai aj “ 0 ´ ai aj .
pi,jqPB 1ďi,jďn pi,jqRB pi,jqPC

So it suffices to show that if A (and hence B) are nonempty, then


ÿ
ai aj ą 0.
pi,jqPC

Partition the indices into sets P , Q, R, and S such that


ˇ ( ˇ (
P “ i ˇ ai ď ´1 R “ i ˇ 0 ă ai ă 1
ˇ ( ˇ (
Q “ i ˇ ´1 ă ai ď 0 S “ i ˇ 1 ď ai .
Then ˜ ¸2
ÿ ÿ ÿ ÿ ÿ
ai aj ě a2i ` ai aj “ a2i ` ai ě 0.
pi,jqPC iPP YS i,jPQYR iPP YS iPQYR

The first inequality holds because all of the positive terms in the RHS are also in the LHS,
and all of the negative terms in the LHS are also in the RHS. The first inequality attains
equality only if both sides have the same negative terms, which implies |ai ´ aj | ă 1 whenever
i, j P Q Y R; the second inequality attains equality only if P “ S “ ∅. But then we would
have A “ ∅. So A nonempty implies that the inequality holds strictly, as required.
Solution 2. Consider P, Q, R, S as in Solution 1, set
ÿ ÿ ÿ ÿ
p“ ai , q “ ai , r “ ai , s“ ai ,
iPP iPQ iPR iPS

and let ÿ ÿ
t` “ ai aj , t´ “ ai aj .
pi,jqPA, ai aj ě0 pi,jqPA, ai aj ď0

We know that p ` q ` r ` s “ 0, and we need to prove that t` ` t´ ă 0.


Notice that t` ď p2 {2`pq `rs`s2 {2 (with equality only if p “ s “ 0), and t´ ď pr `ps`qs
(with equality only if there do not exist i P Q and j P R with aj ´ ai ą 1). Therefore,
p2 ` s2 pp ` q ` r ` sq2 pq ` rq2 pq ` rq2
t` ` t´ ď ` pq ` rs ` pr ` ps ` qs “ ´ “´ ď 0.
2 2 2 2
If A is not empty and p “ s “ 0, then there must exist i P Q, j P R with |ai ´ aj | ą 1, and
hence the earlier equality conditions cannot both occur.
Shortlisted problems – solutions 19

Comment. The RHS of the original inequality cannot be replaced with any constant c ă 0 (indepen-
dent of n). Indeed, take
n 1 2
a1 “ ´ , a2 “ ¨ ¨ ¨ “ an´1 “ , an “ .
n`2 n`2 n`2
ÿ 2n
Then ai aj “ ´ , which converges to zero as n Ñ 8.
pn ` 2q2
pi,jqPA
20 Bath — UK, 11th–22nd July 2019

This page is intentionally left blank


Shortlisted problems – solutions 21

A5. Let x1 , x2 , . . . , xn be different real numbers. Prove that


#
ÿ ź 1 ´ xi xj 0, if n is even;

1ďiďn j‰i
xi ´ xj 1, if n is odd.

(Kazakhstan)

Common remarks. Let Gpx1 , x2 , . . . , xn q be the function of the n variables x1 , x2 , . . . , xn on


the LHS of the required identity.

Solution 1 (Lagrange interpolation). Since both sides of the identity are rational functions,
it suffices to prove it when all xi R t˘1u. Define
n
ź
f ptq “ p1 ´ xi tq ,
i“1

and note that ź


f pxi q “ p1 ´ x2i q 1 ´ xi xj .
j‰i

Using the nodes `1, ´1, x1 , . . . , xn , the Lagrange interpolation formula gives us the following
expression for f :
n
ÿ px ´ 1qpx ` 1q ź x ´ xj x ` 1 ź x ´ xi x ´ 1 ź x ´ xi
f pxi q ` f p1q ` f p´1q .
i“1
pxi ´ 1qpxi ` 1q j‰i xi ´ xj 1 ` 1 1ďiďn 1 ´ xi ´1 ´ 1 1ďiďn 1 ´ xi

The coefficient of tn`1 in f ptq is 0, since f has degree n. The coefficient of tn`1 in the above
expression of f is
ÿ f pxi q f p1q f p´1q
0“ ź ` ź ` ź
1ďiďn pxi ´ xj q ¨ pxi ´ 1qpxi ` 1q p1 ´ xj q ¨ p1 ` 1q p´1 ´ xj q ¨ p´1 ´ 1q
j‰i 1ďjďn 1ďjďn

1 p´1qn`1
“ ´Gpx1 , . . . , xn q ` ` .
2 2

Comment. The main difficulty is to think of including the two extra nodes ˘1 and evaluating the
coefficient tn`1 in f when n ` 1 is higher than the degree of f .
It is possible to solve the problem using Lagrange interpolation on the nodes x1 , . . . , xn , but the
definition of the polynomial being interpolated should depend on the parity of n. For n even, consider
the polynomial
ź ź
P pxq “ p1 ´ xxi q ´ px ´ xi q.
i i

Lagrange interpolation shows that G is the coefficient of xn´1 in the polynomial P pxq{p1 ´ x2 q, i.e. 0.
For n odd, consider the polynomial
ź ź
P pxq “ p1 ´ xxi q ´ x px ´ xi q.
i i

Now G is the coefficient of xn´1 in P pxq{p1 ´ x2 q, which is 1.


22 Bath — UK, 11th–22nd July 2019

Solution 2 (using
ś symmetries). Observe that G is symmetric in the variables x1 , . . . , xn .
Define V “ iăj pxj ´ xi q and let F “ G ¨ V , which is a polynomial in x1 , . . . , xn . Since
V is alternating, F is also alternating (meaning that, if we exchange any two variables, then
F changes sign). Every alternating polynomial in n variables x1 , . . . , xn vanishes when any two
variables xi , xj (i ‰ j) are equal, and is therefore divisible by xi ´ xj for each pair i ‰ j. Since
these linear factors are pairwise coprime, V divides F exactly as a polynomial. Thus G is in
fact a symmetric polynomial in x1 , . . . , xn .
Now observe that if all xi are nonzero and we set yi “ 1{xi for i “ 1, . . . , n, then we have

1 ´ yi yj 1 ´ xi xj
“ ,
yi ´ yj xi ´ xj

so that ˆ ˙
1 1
G ,..., “ Gpx1 , . . . , xn q .
x1 xn
By continuity this is an identity of rational functions. Since G is a polynomial, it implies that
G is constant. (If G were not constant, we could choose a point pc1 , . . . , cn q with all ci ‰ 0,
such that Gpc1 , . . . , cn q ‰ Gp0, . . . , 0q; then gpxq :“ Gpc1 x, . . ˇ. , c´
n xq would ¯ˇ
be a nonconstant
ˇ y y ˇ
polynomial in the variable x, so |gpxq| Ñ 8 as x Ñ 8, hence ˇG c1 , . . . , cn ˇ Ñ 8 as y Ñ 0,
which is impossible since G is a polynomial.)
We may identify the constant by substituting xi “ ζ i , where ζ is a primitive nth root of unity
in C. In the ith term in the sum in the original expression we have a factor 1´ζ iζ n´i “ 0, unless
i “ n or 2i
ś“ n.1´ζIn the case where n is odd, the only exceptional ś term1`ζis i “ n, which gives
j j
the value j‰n 1´ζ j “ 1. When n is even, we also have the term j‰ ´1´ζ j “ p´1qn´1 “ ´1,
n
2
so the sum is 0.

Comment. If we write out an explicit expression for F ,


ÿ ź ź
F “ p´1qn´i pxk ´ xj q p1 ´ xi xj q
1ďiďn jăk j‰i
j,k‰i

then to prove directly that F vanishes when xi “ xj for some i ‰ j, but no other pair of variables
coincide, we have to check carefully that the two nonzero terms in this sum cancel.
A different and slightly less convenient way to identify the constant is to substitute xi “ 1 ` ǫζ i ,
and throw away terms that are Opǫq as ǫ Ñ 0.

Solution 3 (breaking symmetry). Consider G as a rational function in xn with coefficients


that are rational functions in the other variables. We can write

P pxn q
Gpx1 , . . . , xn q “ ś
j‰n pxn ´ xj q

where P pxn q is a polynomial in xn whose coefficients are rational functions in the other variables.
We then have
˜ ¸ ˜ ¸˜ ¸
ź ÿ ź ź 1 ´ xi xj
P pxn q “ p1 ´ xn xj q ` pxi xn ´ 1q pxn ´ xj q .
j‰n 1ďiďn´1 j‰i,n j‰i,n
xi ´ xj

For any k ‰ n, substituting xn “ xk (which is valid when manipulating the numerator P pxn q
Shortlisted problems – solutions 23

on its own), we have (noting that xn ´ xj vanishes when j “ k)


˜ ¸ ˜ ¸˜ ¸
ź ÿ ź ź 1 ´ xi xj
P pxk q “ p1 ´ xk xj q ` pxi xk ´ 1q pxk ´ xj q
j‰n 1ďiďn´1 j‰i,n j‰i,n
xi ´ xj
˜ ¸ ˜ ¸˜ ¸
ź ` ˘ ź ź 1 ´ xk xj
“ p1 ´ xk xj q ` x2k ´ 1 pxk ´ xj q
j‰n j‰k,n j‰k,n
xk ´ xj
˜ ¸ ˜ ¸
ź ` ˘ ź
“ p1 ´ xk xj q ` x2k ´ 1 p1 ´ xk xj q
j‰n j‰k,n

“ 0.

Note that P is a polynomial in xn of degree n ´ 1. For any choice of distinct real numbers
x1 , . . . , xn´1 , P has those real numbers as its roots, and the denominator has the same degree
and the same roots. This shows that G is constant in xn , for any fixed choice of distinct
x1 , . . ., xn´1 . Now, G is symmetric in all n variables, so it must be also be constant in each of
the other variables. G is therefore a constant that depends only on n. The constant may be
identified as in the previous solution.

Comment. There is also a solution in which we recognise the expression for F in the comment after
Solution 2 as the final column expansion of a certain matrix obtained by modifying the final column
of the Vandermonde matrix. The task is then to show that the matrix can be modified by column
operations either to make the final column identically zero (in the case where n even) or to recover the
Vandermonde matrix (in the case where n odd). The polynomial P {p1 ´ x2 q is helpful for this task,
where P is the parity-dependent polynomial defined in the comment after Solution 1.
24 Bath — UK, 11th–22nd July 2019

A6. A polynomial P px, y, zq in three variables with real coefficients satisfies the identities

P px, y, zq “ P px, y, xy ´ zq “ P px, zx ´ y, zq “ P pyz ´ x, y, zq. p˚q

Prove that there exists a polynomial F ptq in one variable such that

P px, y, zq “ F px2 ` y 2 ` z 2 ´ xyzq.

(Russia)

Common remarks. The polynomial x2 ` y 2 ` z 2 ´ xyz satisfies the condition (˚), so every
polynomial of the form F px2 ` y 2 ` z 2 ´ xyzq does satisfy (˚). We will use without comment the
fact that two polynomials have the same coefficients if and only if they are equal as functions.

Solution 1. In the first two steps, we deal with any polynomial P px, y, zq satisfying P px, y, zq “
P px, y, xy ´ zq. Call such a polynomial weakly symmetric, and call a polynomial satisfying the
full conditions in the problem symmetric.
Step 1. We start with the description of weakly symmetric polynomials. We claim that they
are exactly the polynomials in x, y, and zpxy ´ zq. Clearly, all such polynomials are weakly
symmetric. For the converse statement, consider P1 px, y, zq :“ P px, y, z ` 12 xyq, which satisfies
P1 px, y, zq “ P1 px, y, ´zq and is therefore a polynomial in x, y, and z 2 . This means that P is a
polynomial in x, y, and pz ´ 21 xyq2 “ ´zpxy ´ zq ` 14 x2 y 2, and therefore a polynomial in x, y,
and zpxy ´ zq.
Step 2. Suppose that P is weakly symmetric. Consider the monomials in P px, y, zq of highest
total degree. Our aim is to show that in each such monomial µxa y b z c we have a, b ě c. Consider
the expansion ÿ ` ˘k
P px, y, zq “ µijk xi y j zpxy ´ zq . p1.1q
i,j,k

The maximal total degree of a summand in p1.1q is m “ maxi,j,k : µijk ‰0 pi ` j ` 3kq. Now, for
` ˘k
any i, j, k satisfying i ` j ` 3k “ m the summand µi,j,k xi y j zpxy ´ zq has leading term of
the form µxi`k y j`k z k . No other nonzero summand in p1.1q may have a term of this form in its
expansion, hence this term does not cancel in the whole sum. Therefore, deg P “ m, and the
leading component of P is exactly
ÿ
µi,j,k xi`k y j`k z k ,
i`j`3k“m

and each summand in this sum satisfies the condition claimed above.
Step 3. We now prove the problem statement by induction on m “ deg P . For m “ 0 the
claim is trivial. Consider now a symmetric polynomial P with deg P ą 0. By Step 2, each
of its monomials µxa y bz c of the highest total degree satisfies a, b ě c. Applying other weak
symmetries, we obtain a, c ě b and b, c ě a; therefore, P has
` a unique leading ˘c monomial of the
form µpxyzqc . The polynomial P0 px, y, zq “ P px, y, zq ´ µ xyz ´ x2 ´ y 2 ´ z 2 has smaller total
degree. Since P0 is symmetric, it is representable as a polynomial function of xyz ´ x2 ´ y 2 ´ z 2 .
Then P is also of this form, completing the inductive step.

Comment. We could alternatively carry out Step 1 by an induction on n “ degz P , in a manner


similar to Step 3. If n “ 0, the statement holds. Assume that n ą 0 and check the leading component
of P with respect to z:
P px, y, zq “ Qn px, yqz n ` Rpx, y, zq ,
Shortlisted problems – solutions 25

where degz R ă n. After the change z ÞÑ xy ´ z, the leading component becomes Qn px, yqp´zqn ; on
the other hand, it should remain the same. Hence n is even. Now consider the polynomial
` ˘n{2
P0 px, y, zq “ P px, y, zq ´ Qn px, yq ¨ zpz ´ xyq .

It`is also weakly symmetric,


˘ and degz P0 ă n. By the inductive hypothesis, it has the form P0 px, y, zq “
S x, y, zpz ´ xyq . Hence the polynomial
` ˘ ` ˘n{2
P px, y, zq “ S x, y, zpxy ´ zq ` Qn px, yq zpz ´ xyq

also has this form. This completes the inductive step.

Solution 2. We will rely on the well-known identity

cos2 u ` cos2 v ` cos2 w ´ 2 cos u cos v cos w ´ 1 “ 0 whenever u ` v ` w “ 0. p2.1q

Claim 1. The polynomial P px, y, zq is constant on the surface


(
S “ p2 cos u, 2 cos v, 2 cos wq : u ` v ` w “ 0 .

Proof. Notice that for x “ 2 cos u, y “ 2 cos v, z “ 2 cos w, the Vieta jumps x ÞÑ yz ´ x,
y ÞÑ zx´y, z ÞÑ xy´z in p˚q replace pu, v, wq by pv´w, ´v, wq, pu, w´u, ´wq and p´u, v, u´vq,
respectively. For example, for the first type of jump we have

yz ´ x “ 4 cos v cos w ´ 2 cos u “ 2 cospv ` wq ` 2 cospv ´ wq ´ 2 cos u “ 2 cospv ´ wq.

Define Gpu, v, wq “ P p2 cos u, 2 cos v, 2 cos wq. For u ` v ` w “ 0, the jumps give

Gpu, v, wq “ Gpv ´ w, ´v, wq “ Gpw ´ v, ´v, pv ´ wq ´ p´vqq “ Gp´u ´ 2v, ´v, 2v ´ wq


“ Gpu ` 2v, v, w ´ 2vq .

By induction, ` ˘
Gpu, v, wq “ G u ` 2kv, v, w ´ 2kv pk P Zq. p2.2q
Similarly, ` ˘
Gpu, v, wq “ G u, v ´ 2ℓu, w ` 2ℓu pℓ P Zq. p2.3q
And, of course, we have
` ˘
Gpu, v, wq “ G u ` 2pπ, v ` 2qπ, w ´ 2pp ` qqπ pp, q P Zq. p2.4q

Take two nonzero real numbers u, v such that u, v and π are linearly independent over Q. By
combining (2.2–2.4), we can see that G is constant on a dense subset of the plane u ` v ` w “ 0.
By continuity, G is constant on the entire plane and therefore P is constant on S. l
Claim 2. The polynomial T px, y, zq “ x2 ` y 2 ` z 2 ´ xyz ´ 4 divides P px, y, zq ´ P p2, 2, 2q.
Proof. By dividing P by T with remainders, there exist some polynomials Rpx, y, zq, Apy, zq
and Bpy, zq such that

P px, y, zq ´ P p2, 2, 2q “ T px, y, zq ¨ Rpx, y, zq ` Apy, zqx ` Bpy, zq. p2.5q

On the surface S the LHS of (2.5) is zero by Claim 1 (since p2, 2, 2q P S) and T “ 0 by (2.1).
Hence, Apy, zqx ` Bpy, zq vanishes on S.
Notice that for every y “ 2 cos v and z “ 2 cos w with π3 ă v, w ă 2π 3
, there are two
distinct values of x such that px, y, zq P S, namely x1 “ 2 cospv ` wq (which is negative), and
x2 “ 2 cospv ´ wq (which is positive). This can happen only if Apy, zq “ Bpy, zq “ 0. Hence,
Apy, zq “ Bpy, zq “ 0 for |y| ă 1, |z| ă 1. The polynomials A and B vanish on an open set, so
A and B are both the zero polynomial. l
26 Bath — UK, 11th–22nd July 2019

The quotient pP px, y, zq ´ P p2, 2, 2qq{T px, y, zq is a polynomial of lower degree than P and
it also satisfies (˚). The problem statement can now be proven by induction on the degree of P .

Comment. In the proof of p2.2q and p2.3q we used two consecutive Vieta jumps; in fact from p˚q we
used only P px, y, xy ´ zq “ P px, zx ´ y, zq “ P pyz ´ x, y, zq.

Solution 3 (using algebraic geometry, just for interest). Let Q “ x2 ` y 2 ` z 2 ´ xyz


and let t P C. Checking where Q ´ t, BQ , BQ and BQ
Bx By Bz
vanish simultaneously, we find that the
surface Q “ t is smooth except for the cases t “ 0, when the only singular point is p0, 0, 0q,
and t “ 4, when the four points p˘2, ˘2, ˘2q that satisfy xyz “ 8 are the only singular points.
The singular points are the fixed points of the group Γ of polynomial automorphisms of C3
generated by the three Vieta involutions

ι1 : px, y, zq ÞÑ px, y, xy ´ zq, ι2 : px, y, zq ÞÑ px, xz ´ y, zq, ι3 : px, y, zq ÞÑ pyz ´ x, y, zq .

Γ acts on each surface Vt : Q ´ t “ 0. If Q ´ t were reducible then the surface Q “ t would


contain a curve of singular points. Therefore Q ´ t is irreducible in Crx, y, zs. (One can also
prove algebraically that Q ´ t is irreducible, for example by checking that its discriminant as a
quadratic polynomial in x is not a square in Cry, zs, and likewise for the other two variables.)
In the following solution we will only use the algebraic surface V0 .
Let U be the Γ-orbit of p3, 3, 3q. Consider ι3 ˝ ι2 , which leaves z invariant. For each fixed
value of z, ι3 ˝ ι2 acts linearly on px, yq by the matrix
ˆ 2 ˙
z ´ 1 ´z
Mz :“ .
z ´1

The reverse composition ι2 ˝ι3 acts by Mz´1 “ Mzadj . Note det Mz “ 1 and trMz “ z 2 ´2. When
z does not lie in the real interval r´2, 2s, the eigenvalues of Mz do not have absolute value 1,
so every orbit of the group generated by Mz on C2 z tp0, 0qu is unbounded. For example, fixing
z “ 3 we find p3F2k`1 , 3F2k´1 , 3q P U for every k P Z, where pFn qnPZ is the Fibonacci sequence
with F0 “ 0, F1 “ 1.
Now we may start at any point p3F2k`1, 3F2k´1 , 3q and iteratively apply ι1 ˝ ι2 to generate
another infinite sequence of distinct points of U, Zariski dense in the hyperbola cut out of V0 by
the plane x ´ 3F2k`1 “ 0. (The plane x “ a cuts out an irreducible conic when a R t´2, 0, 2u.)
Thus the Zariski closure U of U contains infinitely many distinct algebraic curves in V0 . Since
V0 is an irreducible surface this implies that U “ V0 .
For any polynomial P satisfying (˚), we have P ´ P p3, 3, 3q “ 0 at each point of U. Since
U “ V0 , P ´ P p3, 3, 3q vanishes on V0 . Then Hilbert’s Nullstellensatz and the irreducibility
of Q imply that P ´ P p3, 3, 3q is divisible by Q. Now pP ´ P p3, 3, 3qq{Q is a polynomial also
satisfying (˚), so we may complete the proof by an induction on the total degree, as in the other
solutions.

Comment. We remark that Solution 2 used a trigonometric parametrisation of a real component of


V4 ; in contrast V0 is birationally equivalent to the projective space P2 under the maps
ˆ 2 ˙
a ` b2 ` c2 a2 ` b2 ` c2 a2 ` b2 ` c2
px, y, zq Ñ px : y : zq, pa : b : cq Ñ , , .
bc ac ab

The set U in Solution 3 is contained in Z3 so it is nowhere dense in V0 in the classical topology.

Comment (background to the problem). A triple pa, b, cq P Z3 is called a Markov triple if


a2 ` b2 ` c2 “ 3abc, and an integer that occurs as a coordinate of some Markov triple is called a
Markov number. (The spelling Markoff is also frequent.) Markov triples arose in A. Markov’s work
in the 1870s on the reduction theory of indefinite binary quadratic forms. For every Markov triple,
Shortlisted problems – solutions 27

p3a, 3b, 3cq lies on Q “ 0. It is well known that all nonzero Markov triples can be generated from
p1, 1, 1q by sequences of Vieta involutions, which are the substitutions described in equation (˚) in the
problem statement. There has been recent work by number theorists about the properties of Markov
numbers (see for example Jean Bourgain, Alex Gamburd and Peter Sarnak, Markoff triples and strong
approximation, Comptes Rendus Math. 345, no. 2, 131–135 (2016), arXiv:1505.06411). Each Markov
number occurs in infinitely many triples, but a famous old open problem is the unicity conjecture,
which asserts that each Markov number occurs in only one Markov triple (up to permutations and sign
changes) as the largest coordinate in absolute value in that triple. It is a standard fact in the modern
literature on Markov numbers that the Markov triples are Zariski dense in the Markov surface. Proving
this is the main work of Solution 3. Algebraic geometry is definitely off-syllabus for the IMO, and one
still has to work a bit to prove the Zariski density. On the other hand the approaches of Solutions
1 and 2 are elementary and only use tools expected to be known by IMO contestants. Therefore we
do not think that the existence of a solution using algebraic geometry necessarily makes this problem
unsuitable for the IMO.
28 Bath — UK, 11th–22nd July 2019

A7. Let Z be the set of integers. We consider functions f : Z Ñ Z satisfying


` ˘ ` ˘
f f px ` yq ` y “ f f pxq ` y
for all integers x and y. For such a function, we say that an integer v is f -rare if the set
Xv “ tx P Z : f pxq “ vu
is finite and nonempty.
(a) Prove that there exists such a function f for which there is an f -rare integer.
(b) Prove that no such function f can have more than one f -rare integer.
(Netherlands)

Solution 1. a) Let f be the function where f p0q “ 0 and f pxq is the largest power of 2
dividing 2x for x ‰ 0. The integer 0 is evidently f -rare, so it remains to verify the functional
equation.
Since f p2xq “ 2f pxq for all x, it suffices to verify the functional equation when at least one
of x and y is odd (the case x “ y “ 0 being trivial). If y is odd, then we have
f pf px ` yq ` yq “ 2 “ f pf pxq ` yq
since all the values attained by f are even. If, on the other hand, x is odd and y is even, then
we already have
f px ` yq “ 2 “ f pxq
from which the functional equation follows immediately.
b) An easy inductive argument (substituting x ` ky for x) shows that
f pf px ` kyq ` yq “ f pf pxq ` yq (˚)
for all integers x, y and k. If v is an f -rare integer and a is the least element of Xv , then by
substituting y “ a ´ f pxq in the above, we see that
f px ` k ¨ pa ´ f pxqqq ´ f pxq ` a P Xv
for all integers x and k, so that in particular
f px ` k ¨ pa ´ f pxqqq ě f pxq
for all integers x and k, by assumption on a. This says that on the (possibly degenerate)
arithmetic progression through x with common difference a ´ f pxq, the function f attains its
minimal value at x.
Repeating the same argument with a replaced by the greatest element b of Xv shows that
f px ` k ¨ pb ´ f pxqq ď f pxq
for all integers x and k. Combined with the above inequality, we therefore have
f px ` k ¨ pa ´ f pxqq ¨ pb ´ f pxqqq “ f pxq (:)
for all integers x and k.
Thus if f pxq ‰ a, b, then the set Xf pxq contains a nondegenerate arithmetic progression, so
is infinite. So the only possible f -rare integers are a and b.
In particular, the f -rare integer v we started with must be one of a or b, so that f pvq “
f paq “ f pbq “ v. This means that there cannot be any other f -rare integers v 1 , as they would
on the one hand have to be either a or b, and on the other would have to satisfy f pv 1 q “ v 1 .
Thus v is the unique f -rare integer.
Shortlisted problems – solutions 29

Comment 1. If f is a solution to the functional equation, then so too is any conjugate of f by a


translation, i.e. any function x ÞÑ f px ` nq ´ n for an integer n. Thus in proving part (b), one is free
to consider only functions f for which 0 is f -rare, as in the following solution.

Solution 2, part (b) only. Suppose v is f -rare, and let a and b be the least and greatest
elements of Xv , respectively. Substituting x “ v and y “ a ´ v into the equation shows that

f pvq ´ v ` a P Xv

and in particular f pvq ě v. Repeating the same argument with x “ v and y “ b ´ v shows that
f pvq ď v, and hence f pvq “ v.
Suppose now that v 1 is a second f -rare integer. We may assume that v “ 0 (see Comment 1).
We’ve seen that f pv 1 q “ v 1 ; we claim that in fact f pkv 1 q “ v 1 for all positive integers k. This
gives a contradiction unless v 1 “ v “ 0.
This claim is proved by induction on k. Supposing it to be true for k, we substitute y “ kv 1
and x “ 0 into the functional equation to yield

f ppk ` 1qv 1 q “ f pf p0q ` kv 1 q “ f pkv 1 q “ v 1

using that f p0q “ 0. This completes the induction, and hence the proof.

Comment 2. There are many functions f satisfying the functional equation for which there is an
f -rare integer. For instance, one may generalise the construction in part (a) of Solution 1 by taking
a sequence 1 “ a0 , a1 , a2 , . . . of positive integers with each ai a proper divisor of ai`1 and choosing
arbitrary functions fi : pZ{ai Zq z t0u Ñ ai Z z t0u from the nonzero residue classes modulo ai to the
nonzero multiples of ai . One then defines a function f : Z Ñ Z by
#
fi`1 px mod ai`1 q, if ai | x but ai`1 ∤ x;
f pxq :“
0, if x “ 0.

If one writes vpxq for the largest i such that ai | x (with vp0q “ 8), then it is easy to verify the
functional equation for f separately in the two cases vpyq ą vpxq and vpxq ě vpyq. Hence this f
satisfies the functional equation and 0 is an f -rare integer.

Comment 3. In fact, if v is an f -rare integer for an f satisfying the functional equation, then its
fibre Xv “ tvu must be a singleton. We may assume without loss of generality that v “ 0. We’ve
already seen in Solution 1 that 0 is either the greatest or least element of X0 ; replacing f with the
function x ÞÑ ´f p´xq if necessary, we may assume that 0 is the least element of X0 . We write b for
the largest element of X0 , supposing for contradiction that b ą 0, and write N “ p2bq!.
It now follows from (˚) that we have

f pf pN bq ` bq “ f pf p0q ` bq “ f pbq “ 0,

from which we see that f pN bq ` b P X0 Ď r0, bs. It follows that f pN bq P r´b, 0q, since by construction
N b R Xv . Now it follows that pf pN bq ´ 0q ¨ pf pN bq ´ bq is a divisor of N , so from (:) we see that
f pN bq “ f p0q “ 0. This yields the desired contradiction.
30 Bath — UK, 11th–22nd July 2019

Combinatorics
C1. The infinite sequence a0 , a1 , a2 , . . . of (not necessarily different) integers has the
following properties: 0 ď ai ď i for all integers i ě 0, and
ˆ ˙ ˆ ˙ ˆ ˙
k k k
` ` ¨¨¨` “ 2k
a0 a1 ak
for all integers k ě 0.
Prove that all integers N ě 0 occur in the sequence (that is, for all N ě 0, there exists i ě 0
with ai “ N).
(Netherlands)

Solution. We prove by induction on k that every initial segment of the sequence, a0 , a1 , . . . , ak ,


consists of the following elements (counted with multiplicity, and not necessarily in order), for
some ℓ ě 0 with 2ℓ ď k ` 1:

0, 1, . . . , ℓ ´ 1, 0, 1, . . . , k ´ ℓ.

For k “ 0 we have a0 “ 0, which is of this form. Now suppose that for k “ m the elements
a0 , a1 , . . . , am are 0, 0, 1, 1, 2, 2, . . . , ℓ ´ 1, ℓ ´ 1, ℓ, ℓ ` 1, . . . , m ´ ℓ ´ 1, m ´ ℓ for some ℓ with
0 ď 2ℓ ď m ` 1. It is given that
ˆ ˙ ˆ ˙ ˆ ˙ ˆ ˙
m`1 m`1 m`1 m`1
` ` ¨¨¨` ` “ 2m`1 ,
a0 a1 am am`1
which becomes
ˆˆ ˙ ˆ ˙ ˆ ˙˙
m`1 m`1 m`1
` ` ¨¨¨`
0 1 ℓ´1
ˆˆ ˙ ˆ ˙ ˆ ˙˙ ˆ ˙
m`1 m`1 m`1 m`1
` ` ` ¨¨¨` ` “ 2m`1 ,
0 1 m´ℓ am`1
` ˘ ` m`1 ˘
or, using m`1i
“ m`1´i , that
ˆˆ ˙ ˆ ˙ ˆ ˙˙
m`1 m`1 m`1
` ` ¨¨¨`
0 1 ℓ´1
ˆˆ ˙ ˆ ˙ ˆ ˙˙ ˆ ˙
m`1 m`1 m`1 m`1
` ` ` ¨¨¨` ` “ 2m`1 .
m`1 m ℓ`1 am`1
On the other hand, it is well known that
ˆ ˙ ˆ ˙ ˆ ˙
m`1 m`1 m`1
` ` ¨¨¨` “ 2m`1 ,
0 1 m`1
and so, by subtracting, we get ˆ ˙ ˆ ˙
m`1 m`1
“ .
am`1 ℓ
` ˘
From this, using the fact that the binomial coefficients m`1 i
are increasing for i ď m`1
2
and
m`1
decreasing for i ě 2 , we conclude that either am`1 “ ℓ or am`1 “ m ` 1 ´ ℓ. In either case,
a0 , a1 , . . . , am`1 is again of the claimed form, which concludes the induction.
As a result of this description, any integer N ě 0 appears as a term of the sequence ai for
some 0 ď i ď 2N.
Shortlisted problems – solutions 31

C2. You are given a set of n blocks, each weighing at least 1; their total weight is 2n.
Prove that for every real number r with 0 ď r ď 2n ´ 2 you can choose a subset of the blocks
whose total weight is at least r but at most r ` 2.
(Thailand)

Solution 1. We prove the following more general statement by induction on n.


Claim. Suppose that you have n blocks, each of weight at least 1, and of total weight s ď 2n.
Then for every r with ´2 ď r ď s, you can choose some of the blocks whose total weight is at
least r but at most r ` 2.
Proof. The base case n “ 1 is trivial. To prove the inductive step, let x be the largest
block weight. Clearly, x ě s{n, so s ´ x ď n´1 n
s ď 2pn ´ 1q. Hence, if we exclude a
block of weight x, we can apply the inductive hypothesis to show the claim holds (for this
smaller set) for any ´2 ď r ď s ´ x. Adding the excluded block to each of those combi-
nations, we see that the claim also holds when x ´ 2 ď r ď s. So if x ´ 2 ď s ´ x, then
we have covered the whole interval r´2, ss. But each block weight is at least 1, so we have
x ´ 2 ď ps ´ pn ´ 1qq ´ 2 “ s ´ p2n ´ pn ´ 1qq ď s ´ ps ´ pn ´ 1qq ď s ´ x, as desired. l

Comment. Instead of inducting on sets of blocks with total weight s ď 2n, we could instead prove the
result only for s “ 2n. We would then need to modify the inductive step to scale up the block weights
before applying the induction hypothesis.

Solution 2. Let x1 , . . . , xn be
ř the weights of the blocks in weakly increasing order. Consider
the set S of sums of the form jPJ xj for a subset J Ď t1, 2, . . . , nu. We want to prove that the
mesh of S – i.e. the largest distance between two adjacentřelements – is at most 2.
For 0 ď k ď n, let Sk denote the set of sums of the form iPJ xi for a subset J Ď t1, 2, . . . , ku.
We will show by induction on k that the mesh of Sk is at most 2.
The base case k “ 0 is trivial (as S0 “ t0u). For k ą 0 we have

Sk “ Sk´1 Y pxk ` Sk´1 q


ř
(where pxk ` Sk´1 q denotes txk ` s : s P Sk´1 u), sořit suffices to prove that xk ď jăk xj ` 2.
But if this were not the case, we would have xl ą jăk xj ` 2 ě k ` 1 for all l ě k, and hence
n
ÿ
2n “ xj ą pn ` 1 ´ kqpk ` 1q ` k ´ 1.
j“1

This rearranges to n ą kpn`1´kq, which is false for 1 ď k ď n, giving the desired contradiction.
32 Bath — UK, 11th–22nd July 2019

C3. Let n be a positive integer. Harry has n coins lined up on his desk, each showing
heads or tails. He repeatedly does the following operation: if there are k coins showing heads
and k ą 0, then he flips the k th coin over; otherwise he stops the process. (For example, the
process starting with T HT would be T HT Ñ HHT Ñ HT T Ñ T T T , which takes three
steps.)
Letting C denote the initial configuration (a sequence of n H’s and T ’s), write ℓpCq for the
number of steps needed before all coins show T . Show that this number ℓpCq is finite, and
determine its average value over all 2n possible initial configurations C.
(USA)

Answer: The average is 41 npn ` 1q.

Common remarks. Throughout all these solutions, we let Epnq denote the desired average
value.

Solution 1. We represent the problem using a directed graph Gn whose vertices are the
length-n strings of H’s and T ’s. The graph features an edge from each string to its successor
(except for T T ¨ ¨ ¨ T T , which has no successor). We will also write H̄ “ T and T̄ “ H.
The graph G0 consists of a single vertex: the empty string. The main claim is that Gn can
be described explicitly in terms of Gn´1 :

• We take two copies, X and Y , of Gn´1 .

• In X, we take each string of n ´ 1 coins and just append a T to it. In symbols, we replace
s1 ¨ ¨ ¨ sn´1 with s1 ¨ ¨ ¨ sn´1 T .

• In Y , we take each string of n ´ 1 coins, flip every coin, reverse the order, and append
an H to it. In symbols, we replace s1 ¨ ¨ ¨ sn´1 with s̄n´1 s̄n´2 ¨ ¨ ¨ s̄1 H.

• Finally, we add one new edge from Y to X, namely HH ¨ ¨ ¨ HHH Ñ HH ¨ ¨ ¨ HHT .

We depict G4 below, in a way which indicates this recursive construction:

Y HHT H HT HH T HT H T T HH

HHHH HT T H TTTH T HHH

X HT T T T HT T HT HT T HHT

TTTT HHT T HHHT T T HT

We prove the claim inductively. Firstly, X is correct as a subgraph of Gn , as the operation on


coins is unchanged by an extra T at the end: if s1 ¨ ¨ ¨ sn´1 is sent to t1 ¨ ¨ ¨ tn´1 , then s1 ¨ ¨ ¨ sn´1 T
is sent to t1 ¨ ¨ ¨ tn´1 T .
Next, Y is also correct as a subgraph of Gn , as if s1 ¨ ¨ ¨ sn´1 has k occurrences of H, then
s̄n´1 ¨ ¨ ¨ s̄1 H has pn ´ 1 ´ kq ` 1 “ n ´ k occurrences of H, and thus (provided that k ą 0), if
s1 ¨ ¨ ¨ sn´1 is sent to t1 ¨ ¨ ¨ tn´1 , then s̄n´1 ¨ ¨ ¨ s̄1 H is sent to t̄n´1 ¨ ¨ ¨ t̄1 H.
Finally, the one edge from Y to X is correct, as the operation does send HH ¨ ¨ ¨ HHH to
HH ¨ ¨ ¨ HHT .
Shortlisted problems – solutions 33

To finish, note that the sequences in X take an average of Epn ´ 1q steps to terminate,
whereas the sequences in Y take an average of Epn ´ 1q steps to reach HH ¨ ¨ ¨ H and then an
additional n steps to terminate. Therefore, we have
1 n
Epnq “ pEpn ´ 1q ` pEpn ´ 1q ` nqq “ Epn ´ 1q ` .
2 2
We have Ep0q “ 0 from our description of G0 . Thus, by induction, we have Epnq “ 12 p1 ` ¨ ¨ ¨ `
nq “ 41 npn ` 1q, which in particular is finite.

Solution 2. We consider what happens with configurations depending on the coins they start
and end with.

• If a configuration starts with H, the last n ´ 1 coins follow the given rules, as if they were
all the coins, until they are all T , then the first coin is turned over.

• If a configuration ends with T , the last coin will never be turned over, and the first
n ´ 1 coins follow the given rules, as if they were all the coins.

• If a configuration starts with T and ends with H, the middle n ´ 2 coins follow the given
rules, as if they were all the coins, until they are all T . After that, there are 2n ´ 1 more
steps: first coins 1, 2, . . . , n ´ 1 are turned over in that order, then coins n, n ´ 1, . . . , 1
are turned over in that order.

As this covers all configurations, and the number of steps is clearly finite for 0 or 1 coins, it
follows by induction on n that the number of steps is always finite.
We define EAB pnq, where A and B are each one of H, T or ˚, to be the average number of
steps over configurations of length n restricted to those that start with A, if A is not ˚, and
that end with B, if B is not ˚ (so ˚ represents “either H or T ”). The above observations tell us
that, for n ě 2:

• EH˚ pnq “ Epn ´ 1q ` 1.

• E˚T pnq “ Epn ´ 1q.

• EHT pnq “ Epn ´ 2q ` 1 (by using both the observations for H˚ and for ˚T ).

• ET H pnq “ Epn ´ 2q ` 2n ´ 1.

Now EH˚ pnq “ 21 pEHH pnq ` EHT pnqq, so EHH pnq “ 2Epn ´ 1q ´ Epn ´ 2q ` 1. Similarly,
ET T pnq “ 2Epn ´ 1q ´ Epn ´ 2q ´ 1. So
1 n
Epnq “ pEHT pnq ` EHH pnq ` ET T pnq ` ET H pnqq “ Epn ´ 1q ` .
4 2
We have Ep0q “ 0 and Ep1q “ 21 , so by induction on n we have Epnq “ 14 npn ` 1q.

Solution 3. Let Hi be the number of heads in positions 1 to i inclusive (so Hn is the total
number of heads), and let Ii be 1 if the ith coin is a head, 0 otherwise. Consider the function

tpiq “ Ii ` 2pminti, Hn u ´ Hi q.

We claim that tpiq is the total number of times coin i is turned over (which implies that the
process terminates). Certainly tpiq “ 0 when all coins are tails, and tpiq is always a nonnegative
integer, so it suffices to show that when the k th coin is turned over (where k “ Hn ), tpkq goes
down by 1 and all the other tpiq are unchanged. We show this by splitting into cases:
34 Bath — UK, 11th–22nd July 2019

• If i ă k, Ii and Hi are unchanged, and minti, Hn u “ i both before and after the coin flip,
so tpiq is unchanged.

• If i ą k, minti, Hn u “ Hn both before and after the coin flip, and both Hn and Hi change
by the same amount, so tpiq is unchanged.

• If i “ k and the coin is heads, Ii goes down by 1, as do both minti, Hn u “ Hn and Hi ; so


tpiq goes down by 1.

• If i “ k and the coin is tails, Ii goes up by 1, minti, Hn u “ i is unchanged and Hi goes


up by 1; so tpiq goes down by 1.
We now need to compute the average value of
n
ÿ n
ÿ n
ÿ n
ÿ
tpiq “ Ii ` 2 minti, Hn u ´ 2 Hi .
i“1 i“1 i“1 i“1

The average value of the first term is 21 n, and that of the third term is ´ 21 npn ` 1q. To compute
the second term, we sum over choices for the total number of heads, and then over the possible
values of i, getting
ÿn ˆ ˙ÿn ÿn ˆ ˙ˆ ˆ ˙˙
1´n n 1´n n j
2 minti, ju “ 2 nj ´ .
j“0
j i“1 j“0
j 2

Now, in terms of trinomial coefficients,

ÿn ˆ ˙ ÿ n ˆ ˙ ÿ ˆn ´ 1˙
n´1
n n
j “ “n “ 2n´1 n
j“0
j j“1
n ´ j, j ´ 1, 1 j“0
j

and
n ˆ ˙ˆ ˙
ÿ n ˆ
ÿ ˙ ˆ ˙ n´2 ˆ ˙ ˆ ˙
j n n n ÿ n´2 n´2 n
“ “ “2 .
j“0
2 j j“2
n ´ j, j ´ 2, 2 2 j“0 j 2
So the second term above is
ˆ ˆ ˙˙
1´n n´1 2 n´2 n npn ´ 1q
2 2 n ´2 “ n2 ´ ,
2 4
and the required average is
1 npn ´ 1q 1 npn ` 1q
Epnq “ n ` n2 ´ ´ npn ` 1q “ .
2 4 2 4

Solution 4. Harry has built a Turing machine to flip the coins for him. The machine is
initially positioned at the k th coin, where there are k heads (and the position before the first
coin is considered to be the 0th coin). The machine then moves according to the following rules,
stopping when it reaches the position before the first coin: if the coin at its current position
is H, it flips the coin and moves to the previous coin, while if the coin at its current position
is T , it flips the coin and moves to the next position.
Consider the maximal sequences of consecutive moves in the same direction. Suppose the
machine has a consecutive moves to the next coin, before a move to the previous coin. After
those a moves, the a coins flipped in those moves are all heads, as is the coin the machine
is now at, so at least the next a ` 1 moves will all be moves to the previous coin. Similarly,
a consecutive moves to the previous coin are followed by at least a ` 1 consecutive moves to
Shortlisted problems – solutions 35

the next coin. There cannot be more than n consecutive moves in the same direction, so this
proves that the process terminates (with a move from the first coin to the position before the
first coin).
Thus we have a (possibly empty) sequence a1 ă ¨ ¨ ¨ ă at ď n giving the lengths of maximal
sequences of consecutive moves in the same direction, where the final at moves must be moves
to the previous coin, ending before the first coin. We claim there is a bijection between initial
configurations of the coins and such sequences. This gives
1 npn ` 1q
Epnq “ p1 ` 2 ` ¨ ¨ ¨ ` nq “
2 4
as required, since each i with 1 ď i ď n will appear in half of the sequences, and will contribute i
to the number of moves when it does.
To see the bijection, consider following the sequence of moves backwards, starting with the
machine just before the first coin and all coins showing tails. This certainly determines a unique
configuration of coins that could possibly correspond to the given sequence. Furthermore, every
coin flipped as part of the aj consecutive moves is also flipped as part of all subsequent sequences
of ak consecutive moves, for all k ą j, meaning that, as we follow the moves backwards, each
coin is always in the correct state when flipped to result in a move in the required direction.
(Alternatively, since there are 2n possible configurations of coins and 2n possible such ascending
sequences, the fact that the sequence of moves determines at most one configuration of coins,
and thus that there is an injection from configurations of coins to such ascending sequences, is
sufficient for it to be a bijection, without needing to show that coins are in the right state as
we move backwards.)

Solution 5. We explicitly describe what happens with an arbitrary sequence C of n coins.


Suppose that C contain k heads at positions 1 ď c1 ă c2 ă ¨ ¨ ¨ ă ck ď n.
Let i be the minimal index such that ci ě k. Then the first few steps will consist of turning
over the k th , pk ` 1qth , . . . , ci th , pci ´ 1qth , pci ´ 2qth , . . . , k th coins in this order. After that we
get a configuration with k ´ 1 heads at the same positions as in the initial one, except for ci .
This part of the process takes 2pci ´ kq ` 1 steps.
After that, the process acts similarly; by induction on the number of heads we deduce that
the process ends. Moreover, if the ci disappear in order ci1 , . . . , cik , the whole process takes
k
ÿ k
ÿ k
ÿ k
ÿ
` ˘
ℓpCq “ 2pcij ´ pk ` 1 ´ jqq ` 1 “ 2 cj ´ 2 pk ` 1 ´ jq ` k “ 2 cj ´ k 2
j“1 j“1 j“1 j“1

steps. ` ˘
Now let us find the total value Sk of ℓpCq over all nk configurations with exactly k heads.
˘ above expression over those, notice that each number 1 ď i ď n appears as cj
To sum `up the
exactly n´1
k´1
times. Thus
ˆ ˙ n ˆ ˙
n´1 ÿ n 2 pn ´ 1q ¨ ¨ ¨ pn ´ k ` 1q npn ` 1q n ¨ ¨ ¨ pn ´ k ` 1q 2
Sk “ 2 i´ k “2 ¨ ´ k
k ´ 1 i“1 k pk ´ 1q! 2 k!
ˆ ˙ ˆ ˙
npn ´ 1q ¨ ¨ ¨ pn ´ k ` 1q ` ˘ n´2 n´1
“ pn ` 1q ´ k “ npn ´ 1q `n .
pk ´ 1q! k´1 k´1
Therefore, the total value of ℓpCq over all configurations is
ÿn ÿn ˆ ˙ n ˆ
ÿ ˙
n´2 n´1 npn ` 1q
Sk “ npn ´ 1q `n “ npn ´ 1q2n´2 ` n2n´1 “ 2n .
k“1 k“1
k´1 k“1
k´1 4
npn`1q
Hence the required average is Epnq “ 4
.
36 Bath — UK, 11th–22nd July 2019

C4. On a flat plane in Camelot, King Arthur builds a labyrinth L consisting of n walls,
each of which is an infinite straight line. No two walls are parallel, and no three walls have a
common point. Merlin then paints one side of each wall entirely red and the other side entirely
blue.
At the intersection of two walls there are four corners: two diagonally opposite corners
where a red side and a blue side meet, one corner where two red sides meet, and one corner
where two blue sides meet. At each such intersection, there is a two-way door connecting the
two diagonally opposite corners at which sides of different colours meet.
After Merlin paints the walls, Morgana then places some knights in the labyrinth. The
knights can walk through doors, but cannot walk through walls.
Let kpLq be the largest number k such that, no matter how Merlin paints the labyrinth L,
Morgana can always place at least k knights such that no two of them can ever meet. For
each n, what are all possible values for kpLq, where L is a labyrinth with n walls?
(Canada)

Answer: The only possible value of k is k “ n ` 1, no matter what shape the labyrinth is.

` ˘
Solution 1. First we show by induction that the n walls divide the plane into n`1 2
`1 regions.
The claim is true for n “ 0 as, when there are no walls, the plane forms a single region. When
placing the nth wall, it intersects each of the n´ 1 other walls exactly once and hence splits each
of n of the ``
regions
˘ ˘formed by those
`n`1 ˘ other walls into two regions. By the induction hypothesis,
n
this yields 2 ` 1 ` n “ 2 ` 1 regions, proving the claim.
` ˘
Now let G be the graph with vertices given by the n`1 2
` 1 regions, and with two regions
connected by an edge if there is a door between them.
We now show that no matter how Merlin paints the n walls, Morgana ` ˘ can place at least
n ` 1 knights. No matter how the walls are painted, there are exactly n2 intersection points,
each of which corresponds to a single edge in G. Consider adding the edges of G sequentially and
note that each edge reduces the number of connected ` components
˘ `n˘ by at most one. Therefore
the number of connected components of G is at least n`1 2
` 1 ´ 2
“ n ` 1. If Morgana places
a knight in regions corresponding to different connected components of G, then no two knights
can ever meet.
Now we give a construction showing that, no matter what shape the labyrinth is, Merlin
can colour it such that there are exactly n ` 1 connected components, allowing Morgana to
place at most n ` 1 knights.
First, we choose a coordinate system on the labyrinth so that none of the walls run due
north-south, or due east-west. We then have Merlin paint the west face of each wall red, and
the east face of each wall blue. We label the regions according to how many walls the region is
on the east side of: the labels are integers between 0 and n.
We claim that, for each i, the regions labelled i are connected by doors. First, we note that
for each i with 0 ď i ď n there is a unique region labelled i which is unbounded to the north.
Now, consider a knight placed in some region with label i, and ask them to walk north
(moving east or west by following the walls on the northern sides of regions, as needed). This
knight will never get stuck: each region is convex, and so, if it is bounded to the north, it has
a single northernmost vertex with a door northwards to another region with label i.
Eventually it will reach a region which is unbounded to the north, which will be the unique
such region with label i. Hence every region with label i is connected to this particular region,
and so all regions with label i are connected to each other.
As a result, there are exactly n ` 1 connected components, and Morgana can place at most
n ` 1 knights.
Shortlisted problems – solutions 37

Comment. Variations on this argument exist: some of them capture more information, and some of
them capture less information, about the connected components according to this system of numbering.
For example, it can be shown that the unbounded regions are numbered 0, 1, . . . , n´1, n, n´1, . . . , 1
as one cycles around them, that the regions labelled 0 and n are the only regions in their connected
components, and that each other connected component forms a single chain running between the two
unbounded ones. It is also possible to argue that the regions are acyclic without revealing much about
their structure.

Solution 2. We give another description of a strategy for Merlin to paint the walls so that
Morgana can place no more than n ` 1 knights.
Merlin starts by building a labyrinth of n walls of his own design. He places walls in turn
with increasing positive gradients, placing each so far to the right that all intersection points
of previously-placed lines lie to the left of it. He paints each in such a way that blue is on the
left and red is on the right.
For example, here is a possible sequence of four such lines ℓ1 , ℓ2 , ℓ3 , ℓ4 :

ℓ4

ℓ3

ℓ2

ℓ1

We say that a region is “on the right” if it has x-coordinate unbounded above (note that if
we only have one wall, then both regions are on the right). We claim inductively that, after
placing n lines, there are n ` 1 connected components in the resulting labyrinth, each of which
contains exactly one region on the right. This is certainly true after placing 0 lines, as then
there is only one region (and hence one connected component) and it is on the right.
When placing the nth line, it then cuts every one of the n ´ 1 previously placed lines, and
since it is to the right of all intersection points, the regions it cuts are exactly the n regions on
the right.
blue
red

1 2
blue
red 2 3
blue
red 3 4
blue
red 4 5

The addition of this line leaves all previous connected components with exactly one region on
the right, and creates a new connected component containing exactly one region, and that
region is also on the right. As a result, by induction, this particular labyrinth will have n ` 1
connected components.
Having built this labyrinth, Merlin then moves the walls one-by-one (by a sequence of
continuous translations and rotations of lines) into the proper position of the given labyrinth,
in such a way that no two lines ever become parallel.
38 Bath — UK, 11th–22nd July 2019

The only time the configuration is changed is when one wall is moved through an intersection
point of two others:

e
blu
red
red 3 2 blue
blue 2 3
red

1 3 4 1 2 4
red
blue
2 3 blue
red 3 2
e
blu
red

Note that all moves really do switch between two configurations like this: all sets of three lines
have this colour configuration initially, and the rules on rotations mean they are preserved (in
particular, we cannot create three lines creating a triangle with three red edges inwards, or
three blue edges inwards).
However, as can be seen, such a move preserves the number of connected components, so in
the painting this provides for Arthur’s actual labyrinth, Morgana can still only place at most
n ` 1 knights.

Comment. While these constructions are superficially distinct, they in fact result in the same colour-
ings for any particular labyrinth. In fact, using the methods of Solution 2, it is possible to show that
these are the only colourings that result in exactly n ` 1 connected components.
Shortlisted problems – solutions 39

C5. On a certain social network, there are 2019 users, some pairs of which are friends,
where friendship is a symmetric relation. Initially, there are 1010 people with 1009 friends each
and 1009 people with 1010 friends each. However, the friendships are rather unstable, so events
of the following kind may happen repeatedly, one at a time:
Let A, B, and C be people such that A is friends with both B and C, but B and C
are not friends; then B and C become friends, but A is no longer friends with them.
Prove that, regardless of the initial friendships, there exists a sequence of such events after
which each user is friends with at most one other user.
(Croatia)

Common remarks. The problem has an obvious rephrasing in terms of graph theory. One
is given a graph G with 2019 vertices, 1010 of which have degree 1009 and 1009 of which have
degree 1010. One is allowed to perform operations on G of the following kind:
Suppose that vertex A is adjacent to two distinct vertices B and C which are not
adjacent to each other. Then one may remove the edges AB and AC from G and
add the edge BC into G.
Call such an operation a refriending. One wants to prove that, via a sequence of such refriend-
ings, one can reach a graph which is a disjoint union of single edges and vertices.
All of the solutions presented below will use this reformulation.

Solution 1. Note that the given graph is connected, since the total degree of any two vertices
is at least 2018 and hence they are either adjacent or have at least one neighbour in common.
Hence the given graph satisfies the following condition:
Every connected component of G with at least three vertices is not complete
(1)
and has a vertex of odd degree.
We will show that if a graph G satisfies condition (1) and has a vertex of degree at least 2, then
there is a refriending on G that preserves condition (1). Since refriendings decrease the total
number of edges of G, by using a sequence of such refriendings, we must reach a graph G with
maximal degree at most 1, so we are done.

A
40 Bath — UK, 11th–22nd July 2019

Pick a vertex A of degree at least 2 in a connected component G1 of G. Since no component


of G with at least three vertices is complete we may assume that not all of the neighbours
of A are adjacent to one another. (For example, pick a maximal complete subgraph K of G1 .
Some vertex A of K has a neighbour outside K, and this neighbour is not adjacent to every
vertex of K by maximality.) Removing A from G splits G1 into smaller connected components
G1 , . . . , Gk (possibly with k “ 1), to each of which A is connected by at least one edge. We
divide into several cases.

Case 1: k ě 2 and A is connected to some Gi by at least two edges.


Choose a vertex B of Gi adjacent to A, and a vertex C in another component Gj adjacent
to A. The vertices B and C are not adjacent, and hence removing edges AB and AC and
adding in edge BC does not disconnect G1 . It is easy to see that this preserves the condition,
since the refriending does not change the parity of the degrees of vertices.

Case 2: k ě 2 and A is connected to each Gi by exactly one edge.


Consider the induced subgraph on any Gi and the vertex A. The vertex A has degree 1 in
this subgraph; since the number of odd-degree vertices of a graph is always even, we see that
Gi has a vertex of odd degree (in G). Thus if we let B and C be any distinct neighbours of A,
then removing edges AB and AC and adding in edge BC preserves the above condition: the
refriending creates two new components, and if either of these components has at least three
vertices, then it cannot be complete and must contain a vertex of odd degree (since each Gi
does).

Case 3: k “ 1 and A is connected to G1 by at least three edges.


By assumption, A has two neighbours B and C which are not adjacent to one another.
Removing edges AB and AC and adding in edge BC does not disconnect G1 . We are then done
as in Case 1.

Case 4: k “ 1 and A is connected to G1 by exactly two edges.


Let B and C be the two neighbours of A, which are not adjacent. Removing edges AB
and AC and adding in edge BC results in two new components: one consisting of a single
vertex; and the other containing a vertex of odd degree. We are done unless this second
component would be a complete graph on at least 3 vertices. But in this case, G1 would be a
complete graph minus the single edge BC, and hence has at least 4 vertices since G1 is not a
4-cycle. If we let D be a third vertex of G1 , then removing edges BA and BD and adding in
edge AD does not disconnect G1 . We are then done as in Case 1.

B C

Comment. In fact, condition 1 above precisely characterises those graphs which can be reduced to a
graph of maximal degree ď 1 by a sequence of refriendings.
Shortlisted problems – solutions 41

Solution 2. As in the previous solution, note that a refriending preserves the property that a
graph has a vertex of odd degree and (trivially) the property that it is not complete; note also
that our initial graph is connected. We describe an algorithm to reduce our initial graph to a
graph of maximal degree at most 1, proceeding in two steps.

Step 1: There exists a sequence of refriendings reducing the graph to a tree.


Proof. Since the number of edges decreases with each refriending, it suffices to prove the fol-
lowing: as long as the graph contains a cycle, there exists a refriending such that the resulting
graph is still connected. We will show that the graph in fact contains a cycle Z and vertices
A, B, C such that A and B are adjacent in the cycle Z, C is not in Z, and is adjacent to A but
not B. Removing edges AB and AC and adding in edge BC keeps the graph connected, so we
are done.

B C

To find this cycle Z and vertices A, B, C, we pursue one of two strategies. If the graph
contains a triangle, we consider a largest complete subgraph K, which thus contains at least
three vertices. Since the graph itself is not complete, there is a vertex C not in K connected
to a vertex A of K. By maximality of K, there is a vertex B of K not connected to C, and
hence we are done by choosing a cycle Z in K through the edge AB.

B C

If the graph is triangle-free, we consider instead a smallest cycle Z. This cycle cannot
be Hamiltonian (i.e. it cannot pass through every vertex of the graph), since otherwise by
minimality the graph would then have no other edges, and hence would have even degree at
every vertex. We may thus choose a vertex C not in Z adjacent to a vertex A of Z. Since the
graph is triangle-free, it is not adjacent to any neighbour B of A in Z, and we are done. l

Step 2: Any tree may be reduced to a disjoint union of single edges and vertices by a sequence
of refriendings.
Proof. The refriending preserves the property of being acyclic. Hence, after applying a sequence
of refriendings, we arrive at an acyclic graph in which it is impossible to perform any further
refriendings. The maximal degree of any such graph is 1: if it had a vertex A with two
neighbours B, C, then B and C would necessarily be nonadjacent since the graph is cycle-free,
and so a refriending would be possible. Thus we reach a graph with maximal degree at most 1
as desired. l
42 Bath — UK, 11th–22nd July 2019

C6. Let n ą 1 be an integer. Suppose we are given 2n points in a plane such that
no three of them are collinear. The points are to be labelled A1 , A2 , . . . , A2n in some order.
We then consider the 2n angles =A1 A2 A3 , =A2 A3 A4 , . . . , =A2n´2 A2n´1 A2n , =A2n´1 A2n A1 ,
=A2n A1 A2 . We measure each angle in the way that gives the smallest positive value (i.e.
between 0˝ and 180˝). Prove that there exists an ordering of the given points such that the
resulting 2n angles can be separated into two groups with the sum of one group of angles equal
to the sum of the other group.
(USA)

Comment. The first three solutions all use the same construction involving a line separating the
points into groups of n points each, but give different proofs that this construction works. Although
Solution 1 is very short, the Problem Selection Committee does not believe any of the solutions is easy
to find and thus rates this as a problem of medium difficulty.

Solution 1. Let ℓ be a line separating the points into two groups (L and R) with n points in
each. Label the points A1 , A2 , . . . , A2n so that L “ tA1 , A3 , . . . , A2n´1 u. We claim that this
labelling works.
Take a line s “ A2n A1 .

(a) Rotate s around A1 until it passes through A2 ; the rotation is performed in a direction
such that s is never parallel to ℓ.

(b) Then rotate the new s around A2 until it passes through A3 in a similar manner.
(c) Perform 2n ´ 2 more such steps, after which s returns to its initial position.

The total (directed) rotation angle Θ of s is clearly a multiple of 180˝ . On the other hand,
s was never parallel to ℓ, which is possible only if Θ “ 0. Now it remains to partition all the
2n angles into those where s is rotated anticlockwise, and the others.

Solution 2. When tracing a cyclic path through the Ai in order, with straight line segments
between consecutive points, let θi be the exterior angle at Ai , with a sign convention
ř2n that it
is positive if the path turns left and negative if the path turns right. Then i“1 θi “ 360k ˝
for some integer k. Let φi “ =Ai´1 Ai Ai`1 (indices mod 2n), defined as in the problem; thus
φi “ 180˝ ´ |θi |.
Let L be the set of ř i for which
ř the path turns left at Ai and let R be the set for which it
turns right. Then S “ iPL φi ´ iPR φi “ p180p|L| ´ |R|q ´ 360kq , which is a multiple of 360˝
˝

since the number of points is even. We will show that the points can be labelled such that
S “ 0, in which case L and R satisfy the required condition of the problem.
Note that the value of S is defined for a slightly larger class of configurations: it is OK
for two points to coincide, as long as they are not consecutive, and OK for three points to be
collinear, as long as Ai , Ai`1 and Ai`2 do not appear on a line in that order. In what follows
it will be convenient, although not strictly necessary, to consider such configurations.
Consider how S changes if a single one of the Ai is moved along some straight-line path
(not passing through any Aj and not lying on any line Aj Ak , but possibly crossing such lines).
Because S is a multiple of 360˝ , and the angles change continuously, S can only change when a
point moves between R and L. Furthermore, if φj “ 0 when Aj moves between R and L, S is
unchanged; it only changes if φj “ 180˝ when Aj moves between those sets.
For any starting choice of points, we will now construct a new configuration, with labels such
that S “ 0, that can be perturbed into the original one without any φi passing through 180˝ ,
so that S “ 0 for the original configuration with those labels as well.
Take some line such that there are n points on each side of that line. The new configuration
has n copies of a single point on each side of the line, and a path that alternates between
Shortlisted problems – solutions 43

sides of the line; all angles are 0, so this configuration has S “ 0. Perturbing the points into
their original positions, while keeping each point on its side of the line, no angle φi can pass
through 180˝, because no straight line can go from one side of the line to the other and back.
So the perturbation process leaves S “ 0.

Comment. More complicated variants of this solution are also possible; for example, a path defined
using four quadrants of the plane rather than just two half-planes.

Solution 3. First, let ℓ be a line in the plane such that there are n points on one side and the
other n points on the other side. For convenience, assume ℓ is horizontal (otherwise, we can
rotate the plane). Then we can use the terms “above”, “below”, “left” and “right” in the usual
way. We denote the n points above the line in an arbitrary order as P1 , P2 , . . . , Pn , and the
n points below the line as Q1 , Q2 , . . ., Qn .
If we connect Pi and Qj with a line segment, the line segment will intersect with the line ℓ.
Denote the intersection as Iij . If Pi is connected to Qj and Qk , where j ă k, then Iij and Iik
are two different points, because Pi , Qj and Qk are not collinear.
Now we define a “sign” for each angle =Qj Pi Qk . Assume j ă k. We specify that the sign is
positive for the following two cases:

• if i is odd and Iij is to the left of Iik ,

• if i is even and Iij is to the right of Iik .

Otherwise the sign of the angle is negative. If j ą k, then the sign of =Qj Pi Qk is taken to be
the same as for =Qk Pi Qj .
Similarly, we can define the sign of =Pj Qi Pk with j ă k (or equivalently =Pk Qi Pj ). For
example, it is positive when i is odd and Iji is to the left of Iki .
Henceforth, whenever we use the notation =Qj Pi Qk or =Pj Qi Pk for a numerical quantity,
it is understood to denote either the (geometric) measure of the angle or the negative of this
measure, depending on the sign as specified above.
We now have the following important fact for signed angle measures:

=Qi1 Pk Qi3 “ =Qi1 Pk Qi2 ` =Qi2 Pk Qi3 p1q

for all points Pk , Qi1 , Qi2 and Qi3 with i1 ă i2 ă i3 . The following figure shows a “natural”
arrangement of the points. Equation (1) still holds for any other arrangement, as can be easily
verified.

Pk

Qi2 Qi3
Qi1

Similarly, we have
=Pi1 Qk Pi3 “ =Pi1 Qk Pi2 ` =Pi2 Qk Pi3 , p2q

for all points Qk , Pi1 , Pi2 and Pi3 , with i1 ă i2 ă i3 .


44 Bath — UK, 11th–22nd July 2019

We are now ready to specify the desired ordering A1 , . . . , A2n of the points:

• if i ď n is odd, put Ai “ Pi and A2n`1´i “ Qi ;

• if i ď n is even, put Ai “ Qi and A2n`1´i “ Pi .

For example, for n “ 3 this ordering is P1 , Q2 , P3 , Q3 , P2 , Q1 . This sequence alternates between


P ’s and Q’s, so the above conventions specify a sign for each of the angles Ai´1 Ai Ai`1 . We
claim that the sum of these 2n signed angles equals 0. If we can show this, it would complete
the proof.
We prove the claim by induction. For brevity, we use the notation =Pi to denote whichever
of the 2n angles has its vertex at Pi , and =Qi similarly.
First let n “ 2. If the four points can be arranged to form a convex quadrilateral, then the
four line segments P1 Q1 , P1 Q2 , P2 Q1 and P2 Q2 constitute a self-intersecting quadrilateral. We
use several figures to illustrate the possible cases.
The following figure is one possible arrangement of the points.

P1
P2

I11 I21 I12 I22

Q1 Q2

Then =P1 and =Q1 are positive, =P2 and =Q2 are negative, and we have

|=P1 | ` |=Q1 | “ |=P2 | ` |=Q2 |.

With signed measures, we have

=P1 ` =Q1 ` =P2 ` =Q2 “ 0. p3q

If we switch the labels of P1 and P2 , we have the following picture:

P2
P1

I21 I11 I22 I12

Q1 Q2

Switching labels P1 and P2 has the effect of flipping the sign of all four angles (as well as swap-
ping the magnitudes on the relabelled points); that is, the new values of p=P1 , =P2 , =Q1 , =Q2 q
equal the old values of p´=P2 , ´=P1 , ´=Q1 , ´=Q2 q. Consequently, equation (3) still holds.
Similarly, when switching the labels of Q1 and Q2 , or both the P ’s and the Q’s, equation (3)
still holds.
Shortlisted problems – solutions 45

The remaining subcase of n “ 2 is that one point lies inside the triangle formed by the other
three. We have the following picture.

P1

P2

I11 I12
I21 I22

Q1 Q2

We have
|=P1 | ` |=Q1 | ` |=Q2 | “ |=P2 |.
and equation (3) holds.
Again, switching the labels for P ’s or the Q’s will not affect the validity of equation (3).
Also, if the point lying inside the triangle of the other three is one of the Q’s rather than
the P ’s, the result still holds, since our sign convention is preserved when we relabel Q’s as P ’s
and vice-versa and reflect across ℓ.
We have completed the proof of the claim for n “ 2.
Assume the claim holds for n “ k, and we wish to prove it for n “ k ` 1. Suppose we are
given our 2pk ` 1q points. First ignore Pk`1 and Qk`1 , and form 2k angles from P1 , . . . , Pk ,
Q1 , . . ., Qk as in the n “ k case. By the induction hypothesis we have
k
ÿ
p=Pi ` =Qi q “ 0.
i“1

When we add in the two points Pk`1 and Qk`1 , this changes our angles as follows:

• the angle at Pk changes from =Qk´1 Pk Qk to =Qk´1 Pk Qk`1 ;

• the angle at Qk changes from =Pk´1 Qk Pk to =Pk´1 Qk Pk`1 ;

• two new angles =Qk Pk`1Qk`1 and =Pk Qk`1 Pk`1 are added.

We need to prove the changes have no impact on the total sum. In other words, we need to
prove

p=Qk´1 Pk Qk`1 ´ =Qk´1 Pk Qk q ` p=Pk´1 Qk Pk`1 ´ =Pk´1 Qk Pk q ` p=Pk`1 ` =Qk`1 q “ 0. p4q

In fact, from equations (1) and (2), we have

=Qk´1 Pk Qk`1 ´ =Qk´1 Pk Qk “ =Qk Pk Qk`1 ,

and
=Pk´1 Qk Pk`1 ´ =Pk´1 Qk Pk “ =Pk Qk Pk`1.
Therefore, the left hand side of equation (4) becomes =Qk Pk Qk`1 `=Pk Qk Pk`1 `=Qk Pk`1 Qk`1 `
=Pk Qk`1 Pk`1, which equals 0, simply by applying the n “ 2 case of the claim. This completes
the induction.
46 Bath — UK, 11th–22nd July 2019

Solution 4. We shall think instead of the problem as asking us to assign a weight ˘1 to each
angle, such that the weighted sum of all the angles is zero.
Given an ordering A1 , . . . , A2n of the points, we shall assign weights according to the fol-
lowing recipe: walk in order from point to point, and assign the left turns `1 and the right
turns ´1. This is the same weighting as in Solution 3, and as in that solution, the weighted
sum is a multiple of 360˝ .
We now aim to show the following:
Lemma. Transposing any two consecutive points in the ordering changes the weighted sum by
˘360˝ or 0.
Knowing that, we can conclude quickly: if the ordering A1 , . . . , A2n has weighted angle
sum 360k ˝ , then the ordering A2n , . . . , A1 has weighted angle sum ´360k ˝ (since the angles
are the same, but left turns and right turns are exchanged). We can reverse the ordering of A1 ,
. . . , A2n by a sequence of transpositions of consecutive points, and in doing so the weighted
angle sum must become zero somewhere along the way.
We now prove that lemma:
Proof. Transposing two points amounts to taking a section Ak Ak`1 Ak`2 Ak`3 as depicted, re-
versing the central line segment Ak`1 Ak`2 , and replacing its two neighbours with the dotted
lines.

Ak`1 Ak`3 Ak`1 Ak`3

Ak`2 Ak`2
Ak Ak

Figure 1: Transposing two consecutive vertices: before (left) and afterwards (right)

In each triangle, we alter the sum by ˘180˝. Indeed, using (anticlockwise) directed angles
modulo 360˝ , we either add or subtract all three angles of each triangle.
Hence both triangles together alter the sum by ˘180 ˘ 180˝ , which is ˘360˝ or 0. l
Shortlisted problems – solutions 47

C7. There are 60 empty boxes B1 , . . . , B60 in a row on a table and an unlimited supply
of pebbles. Given a positive integer n, Alice and Bob play the following game.
In the first round, Alice takes n pebbles and distributes them into the 60 boxes as she
wishes. Each subsequent round consists of two steps:

(a) Bob chooses an integer k with 1 ď k ď 59 and splits the boxes into the two groups
B1 , . . . , Bk and Bk`1, . . . , B60 .

(b) Alice picks one of these two groups, adds one pebble to each box in that group, and removes
one pebble from each box in the other group.

Bob wins if, at the end of any round, some box contains no pebbles. Find the smallest n
such that Alice can prevent Bob from winning.
(Czech Republic)
XN \ PN T
Answer: n “ 960. In general, if there are N ą 1 boxes, the answer is n “ 2
`1 2
` 1 ´ 1.

CommonX N remarks.
\ PN T We present solutions for the general case of N ą 1 boxes, and write
M “ 2 ` 1 2 ` 1 ´ 1 for the claimed answer. For 1 ď k ă N, say that Bob makes a
k-move if he splits the boxes into a left group tB1 , . . . , Bk u and a right group tBk`1 , . . . , BN u.
Say that one configuration dominates another if it has at least as many pebbles in each box,
and say that it strictly dominates the other configuration if it also has more pebbles in at least
one box. (Thus, if Bob wins in some configuration, he also wins in every configuration that it
dominates.)
It is often convenient to consider ‘V-shaped’ configurations; for 1 ď i ď N, let Vi be the
configuration where Bj contains 1 ` |j ´ i| pebbles (i.e. where the ith box has a single pebble
and the numbers increase by one in both directions, so the first box has i pebbles and the last
box has N ` 1 P´ iT pebbles). Note that Vi contains 21 ipi ` 1q ` 21 pN ` 1 ´ iqpN ` 2 ´ iq ´ 1
pebbles. If i “ N2 , this number equals M.
Solutions split naturally into a strategy for Alice (starting with M pebbles and showing she
can prevent Bob from winning) and a strategy for Bob (showing he can win for any starting
configuration with at most M ´ 1 pebbles). The following observation is also useful to simplify
the analysis of strategies for Bob.
Observation A. Consider two consecutive rounds. Suppose that in the first round Bob made
a k-move and Alice picked the left group, and then in the second round Bob makes an ℓ-move,
with ℓ ą k. We may then assume, without loss of generality, that Alice again picks the left
group.
Proof. Suppose Alice picks the right group in the second round. Then the combined effect of
the two rounds is that each of the boxes Bk`1 , . . . , Bℓ lost two pebbles (and the other boxes
are unchanged). Hence this configuration is strictly dominated by that before the first round,
and it suffices to consider only Alice’s other response. l

Solution 1 (Alice). Alice initially distributes pebbles according to Vr N s . Suppose the current
2
configuration of pebbles dominates Vi . If Bob makes a k-move with k ě i then Alice picks the
left group, which results in a configuration that dominates Vi`1 . Likewise, if Bob makes a
k-move with k ă i then Alice picks the right group, which results in a configuration that
dominates Vi´1 . Since none of V1 , . . . , VN contains an empty box, Alice can prevent Bob from
ever winning.
48 Bath — UK, 11th–22nd July 2019

Solution 1 (Bob). The key idea in this solution is the following claim.
Claim. If there exist a positive integer k such that there are at least 2k boxes that have at
most k pebbles each then Bob can force a win.
Proof. We ignore the other boxes. First, Bob makes a k-move (splits the 2k boxes into two
groups of k boxes each). Without loss of generality, Alice picks the left group. Then Bob makes
a pk ` 1q-move, . . . , a p2k ´ 1q-move. By Observation A, we may suppose Alice always picks
the left group. After Bob’s p2k ´ 1q-move, the rightmost box becomes empty and Bob wins.
l
Now, we claim that if n ă M then either there already exists an empty box, or there exist
a positive integer k and 2k boxes with at most k pebbles each (and thus Bob can Xforce \ a win).
N
Otherwise, assume each box contains at least 1 pebble, and for each 1 ď k ď 2 , at least
N ´ p2k ´ 1q “ N ` 1 ´ 2k boxes contain at least k ` 1 pebbles. Summing, there are at least
as many pebbles in total as in Vr N s ; that is, at least M pebbles, as desired.
2

XN \
Solution 2 (Alice). Let K “ 2 ` 1 . Alice starts with the boxes in the configuration VK .
For each of Bob’s N ´ 1 possible choices, consider the subset of rounds in which he makes that
choice. In that subset of rounds, Alice alternates between picking the left group and picking the
right group; the first time Bob makes that choice, Alice picks the group containing the K th box.
Thus, at any time during the game, the number of pebbles in each box depends only on which
choices Bob has made an odd number of times. This means that the number of pebbles in a
box could decrease by at most the number of choices for which Alice would have started by
removing a pebble from the group containing that box. These numbers are, for each box,
XN \ XN \ P T
2
, 2 ´ 1 , . . . , 1, 0, 1, . . . , N2 ´ 1 .

These are pointwise less than the numbers of pebbles the boxes started with, meaning that no
box ever becomes empty with this strategy.
X \
Solution 2 (Bob). Let K “ N2 ` 1 . For Bob’s strategy, we consider a configuration X with
at most M ´ 1 pebbles, and we make use of Observation A. Consider two configurations with
M pebbles: VK and VN `1´K (if n is odd, they are the same configuration; if n is even, one is
the reverse of the other). The configuration X has fewer pebbles than VK in at least one box,
and fewer pebbles than VN `1´K in at least one box.
Suppose first that, with respect to one of those configurations (without loss ofP generality
T VK ),
X has fewer pebbles in one of the boxes in the half where they have 1, 2, . . . , N2 pebbles (the
right half in VK if N is even; if N is odd, we can take it to be the right half, without loss of
generality, as the configuration is symmetric). Note that the number cannot be fewer in the
box with 1 pebble in VK , because then it would have 0 pebbles. Bob then does a K-move.
If Alice picks the right group, the total number of pebbles goes down and we restart Bob’s
strategy with a smaller number of pebbles. If Alice picks the left group, Bob follows with a
pK ` 1q-move, a pK ` 2q-move, and so on; by Observation A we may assume Alice always picks
the left group. But whichever box in the right half had fewer pebbles in X than in VK ends up
with 0 pebbles at some point in this sequence of moves.
Otherwise, N is even, and for both of those configurations, there are fewer pebbles in X
only on the 2, 3, . . . , N2 ` 1 side. That is, the numbers of pebbles in X are at least
N N
,
2 2
´ 1, . . . , 1, 1, . . . , N2 pCq

with equality occurring at least once on each side. Bob does an N2 -move. Whichever group
Alice chooses, the total number of pebbles is unchanged, and the side from which pebbles are
removed now has a box with fewer pebbles than in (C), so the previous case of Bob’s strategy
can now be applied.
Shortlisted problems – solutions 49

Solution 3 (Bob). For any configuration C, define LpCq to be the greatest integer such that,
for all 0 ď i ď N ´ 1, the box Bi`1 contains at least LpCq ´ i pebbles. Similarly, define RpCq
to be greatest integer such that, for all 0 ď i ď N ´ 1, the box BN ´i contains at least
RpCq ´ i pebbles. (Thus, C dominates the ‘left half’ of VLpCq and the ‘right half’ of VN `1´RpCq .)
Then C dominates a ‘V-shaped’ configuration if and only if LpCq ` RpCq ě N ` 1. Note that
if C dominates a V-shaped configuration, it has at least M pebbles.
Now suppose that there are fewer than M pebbles, so we have LpCq ` RpCq ď N. Then
Bob makes an LpCq-move (or more generally any move with at least LpCq boxes on the left and
RpCq boxes on the right). Let C 1 be the new configuration, and suppose that no box becomes
empty (otherwise Bob has won). If Alice picks the left group, we have LpC 1 q “ LpCq ` 1 and
RpC 1 q “ RpCq ´ 1. Otherwise, we have LpC 1 q “ LpCq ´ 1 and RpC 1 q “ RpCq ` 1. In either
case, we have LpC 1 q ` RpC 1 q ď N.
Bob then repeats this strategy, until one of the boxes becomes empty. Since the condition
in Observation A holds, we may assume that Alice picks a group on the same side each time.
Then one of L and R is strictly decreasing; without loss of generality assume that L strictly
decreases. At some point we reach L “ 1. If B2 is still nonempty, then B1 must contain a
single pebble. Bob makes a 1-move, and by Observation A, Alice must (eventually) pick the
right group, making this box empty.
50 Bath — UK, 11th–22nd July 2019

C8. Alice has a map of Wonderland, a country consisting of n ě 2 towns. For every
pair of towns, there is a narrow road going from one town to the other. One day, all the roads
are declared to be “one way” only. Alice has no information on the direction of the roads, but
the King of Hearts has offered to help her. She is allowed to ask him a number of questions.
For each question in turn, Alice chooses a pair of towns and the King of Hearts tells her the
direction of the road connecting those two towns.
Alice wants to know whether there is at least one town in Wonderland with at most one
outgoing road. Prove that she can always find out by asking at most 4n questions.

Comment. This problem could be posed with an explicit statement about points being awarded for
weaker bounds cn for some c ą 4, in the style of IMO 2014 Problem 6.
(Thailand)

Solution. We will show Alice needs to ask at most 4n ´ 7 questions. Her strategy has the
following phases. In what follows, S is the set of towns that Alice, so far, does not know to
have more than one outgoing road (so initially |S| “ n).
Phase 1. Alice chooses any two towns, say A and B. Without loss of generality, suppose
that the King of Hearts’ answer is that the road goes from A to B.
At the end of this phase, Alice has asked 1 question.
Phase 2. During this phase there is a single (variable) town T that is known to have at
least one incoming road but not yet known to have any outgoing roads. Initially, T is B. Alice
does the following n ´ 2 times: she picks a town X she has not asked about before, and asks
the direction of the road between T and X. If it is from X to T , T is unchanged; if it is
from T to X, X becomes the new choice of town T , as the previous T is now known to have
an outgoing road.
At the end of this phase, Alice has asked a total of n ´ 1 questions. The final town T is not
yet known to have any outgoing roads, while every other town has exactly one outgoing road
known. The undirected graph of roads whose directions are known is a tree.
Phase 3. During this phase, Alice asks about the directions of all roads between T and
another town she has not previously asked about, stopping if she finds two outgoing roads
from T . This phase involves at most n ´ 2 questions. If she does not find two outgoing roads
from T , she has answered her original question with at most 2n ´ 3 ď 4n ´ 7 questions, so in
what follows we suppose that she does find two outgoing roads, asking a total of k questions in
this phase, where 2 ď k ď n ´ 2 (and thus n ě 4 for what follows).
For every question where the road goes towards T , the town at the other end is removed
from S (as it already had one outgoing road known), while the last question resulted in T being
removed from S. So at the end of this phase, |S| “ n ´ k ` 1, while a total of n ` k ´ 1 questions
have been asked. Furthermore, the undirected graph of roads within S whose directions are
known contains no cycles (as T is no longer a member of S, all questions asked in this phase
involved T and the graph was a tree before this phase started). Every town in S has exactly
one outgoing road known (not necessarily to another town in S).
Phase 4. During this phase, Alice repeatedly picks any pair of towns in S for which she
does not know the direction of the road between them. Because every town in S has exactly
one outgoing road known, this always results in the removal of one of those two towns from S.
Because there are no cycles in the graph of roads of known direction within S, this can continue
until there are at most 2 towns left in S.
If it ends with t towns left, n ´ k ` 1 ´ t questions were asked in this phase, so a total of
2n ´ t questions have been asked.
Phase 5. During this phase, Alice asks about all the roads from the remaining towns
in S that she has not previously asked about. She has definitely already asked about any road
between those towns (if t “ 2). She must also have asked in one of the first two phases about
Shortlisted problems – solutions 51

at least one other road involving one of those towns (as those phases resulted in a tree with
n ą 2 vertices). So she asks at most tpn ´ tq ´ 1 questions in this phase.
At the end of this phase, Alice knows whether any town has at most one outgoing road.
If t “ 1, at most 3n ´ 3 ď 4n ´ 7 questions were needed in total, while if t “ 2, at most
4n ´ 7 questions were needed in total.

Comment 1. The version of this problem originally submitted asked only for an upper bound
of 5n, which is much simpler to prove. The Problem Selection Committee preferred a version with an
asymptotically optimal constant. In the following comment, we will show that the constant is optimal.

Comment 2. We will show that Alice cannot always find out by asking at most 4n ´ 3plog2 nq ´
15 questions, if n ě 8.
To show this, we suppose the King of Hearts is choosing the directions as he goes along, only
picking the direction of a road when Alice asks about it for the first time. We provide a strategy for
the King of Hearts that ensures that, after the given number of questions, the map is still consistent
both with the existence of a town with at most one outgoing road, and with the nonexistence of such
a town. His strategy has the following phases. When describing how the King of Hearts’ answer to
a question is determined below, we always assume he is being asked about a road for the first time
(otherwise, he just repeats his previous answer for that road). This strategy is described throughout
in graph-theoretic terms (vertices and edges rather than towns and roads).
Phase 1. In this phase, we consider the undirected graph formed by edges whose directions are
known. The phase terminates when there are exactly 8 connected components whose undirected graphs
are trees. The following invariant is maintained: in a component with k vertices whose undirected graph
is a tree, every vertex has at most tlog2 ku edges into it.

• If the King of Hearts is asked about an edge between two vertices in the same component, or
about an edge between two components at least one of which is not a tree, he chooses any
direction for that edge arbitrarily.

• If he is asked about an edge between a vertex in component A that has a vertices and is a tree
and a vertex in component B that has b vertices and is a tree, suppose without loss of generality
that a ě b. He then chooses the edge to go from A to B. In this case, the new number of edges
into any vertex is at most maxttlog2 au, tlog2 bu ` 1u ď tlog2 pa ` bqu.

In all cases, the invariant is preserved, and the number of tree components either remains unchanged
or goes down by 1. Assuming Alice does not repeat questions, the process must eventually terminate
with 8 tree components, and at least n ´ 8 questions having been asked.
Note that each tree component contains at least one vertex with no outgoing edges. Colour one
such vertex in each tree component red.
Phase 2. Let V1 , V2 and V3 be the X three
\ of the red vertices whose components are smallest
X (so\their
components together have at most 38 n vertices, with each component having at most 38 n ´ 2 ver-
tices). Let sets C1 , C2 , . . . be the connected components after removing the Vj . By construction,
there are no edges with known direction between Ci and Cj for i ‰ j, and there are at least five such
components.
If at any point during this phase, the King of Hearts is asked about an edge within one of the Ci ,
he chooses an arbitrary direction. If he is asked about an edge between Ci and Cj for i ‰ j, he answers
so that all edges go from Ci to Ci`1 and Ci`2 , with indices taken modulo the number of components,
and chooses arbitrarily for other pairs. This ensures that all vertices other than the Vj will have more
than one outgoing edge.
For edges involving one of the Vj he answers as follows, so as to remain consistent for as long
as possible with both possibilities for whether one of those vertices has at most one outgoing edge.
Note that as they were red vertices, they have no outgoing edges at the start of this phase. For edges
between two of the Vj , he answers that the edges go from V1 to V2 , from V2 to V3 and from V3 to V1 .
For edges between Vj and some other vertex, he always answers that the edge goes into Vj , except for
the last such edge for which he is asked the question for any given Vj , for which he answers that the
52 Bath — UK, 11th–22nd July 2019

edge goes out of Vj . Thus, as long as at least one of the Vj has not had the question answered for all
the vertices that are not among the Vj , his answers are still compatible both with all vertices having
more than one outgoing edge, and with that Vj having only one X outgoing
X edge.
\\
At the start of this phase, each of the Vj has at most log2 83 n ´ 2 ă plog2 nq ´ 1 incoming
edges. Thus, Alice cannot determine whether some vertex has only one outgoing edge within 3pn ´
3 ´ pplog2 nq ´ 1qq ´ 1 questions in this phase; that is, 4n ´ 3plog 2 nq ´ 15 questions total.

Comment 3. We can also improve the upper bound slightly, to 4n ´ 2plog2 nq ` 1. (We do not know
where the precise minimum number of questions lies between 4n ´ 3plog2 nq` Op1q and 4n ´ 2plog2 nq`
Op1q.) Suppose n ě 5 (otherwise no questions are required at all).
To do this, we replace Phases 1 and 2 of the given solution with a different strategy that also
results in a spanning tree where one vertex V is not known to have any outgoing edges, and all other
vertices have exactly one outgoing edge known, but where there is more control over the numbers of
incoming edges. In Phases 3 and 4 we then take more care about the order in which pairs of towns are
chosen, to ensure that each of the remaining towns has already had a question asked about at least
log2 n ` Op1q edges.
Define trees Tm with 2m vertices, exactly one of which (the root) has no outgoing edges and the rest
of which have exactly one outgoing edge, as follows: T0 is a single vertex, while Tm is constructed by
joining the roots of two copies of Tm´1 with an edge in either direction. If n “ 2m we can readily ask
n ´ 1 questions, resulting in a tree Tm for the edges with known direction: first ask about 2m´1 disjoint
pairs of vertices, then about 2m´2 disjoint pairs of the roots of the resulting T1 trees, X and \ so on. For
k
the general case, where n is not a power of 2, after k stages of this process we have n{2 trees, each
of which is like Tk but may have some extra vertices (but, however, a unique root). If there are an
even number of trees, then ask about pairs of their roots. If there are an odd number (greater than 1)
of trees, when a single Tk is left over, ask about its root together with that of one of the Tk`1 trees.
Say m “ tlog2 nu. The result of that process is a single Tm tree, possibly with some extra vertices
but still a unique root V . That root has at least m incoming edges, and we may list vertices V0 ,
. . . , Vm´1 with edges to V , such that, for all 0 ď i ă m, vertex Vi itself has at least i incoming edges.
Now divide the vertices other than V into two parts: A has all vertices at an odd distance from V
and B has all the vertices at an even distance from B. Both A and B are nonempty; A contains the Vi ,
while B contains a sequence of vertices with at least 0, 1, . . . , m ´ 2 incoming edges respectively,
similar to the Vi . There are no edges with known direction within A or within B.
In Phase 3, then ask about edges between V and other vertices: first those in B, in order of
increasing number of incoming edges to the other vertex, then those in A, again in order of increasing
number of incoming edges, which involves asking at most n ´ 1 ´ m questions in this phase. If two
outgoing edges are not found from V , at most 2n ´ 2 ´ m ď 4n ´ 2plog2 nq ` 1 questions needed
to be asked in total, so we suppose that two outgoing edges were found, with k questions asked in
this phase, where 2 ď k ď n ´ 1 ´ m. The state of S is as described in the solution above, with
the additional property that, since S must still contain all vertices with edges to V , it contains the
vertices Vi described above.
In Phase 4, consider the vertices left in B, in increasing order of number of edges incoming to a
vertex. If s is the least number of incoming edges to such a vertex, then, for any s ď t ď m ´ 2, there
are at least m ´ t ´ 2 vertices with more than t incoming edges. Repeatedly asking about the pair of
vertices left in B with the least numbers of incoming edges results in a single vertex left over (if any
were in B at all at the start of this phase) with at least m ´ 2 incoming edges. Doing the same with A
(which must be nonempty) leaves a vertex with at least m ´ 1 incoming edges.
Thus if only A is nonempty we ask at most n ´ m questions in Phase 5, so in total at most
3n ´ m ´ 1 questions, while if both are nonempty we ask at most 2n ´ 2m ` 1 questions in Phase 5,
so in total at most 4n ´ 2m ´ 1 ă 4n ´ 2plog2 nq ` 1 questions.
Shortlisted problems – solutions 53

This page is intentionally left blank


54 Bath — UK, 11th–22nd July 2019

C9. For any two different real numbers x and y, we define Dpx, yq to be the unique
integer d satisfying 2d ď |x ´ y| ă 2d`1 . Given a set of reals F , and an element x P F , we say
that the scales of x in F are the values of Dpx, yq for y P F with x ‰ y.
Let k be a given positive integer. Suppose that each member x of F has at most k different
scales in F (note that these scales may depend on x). What is the maximum possible size of F ?
(Italy)

Answer: The maximum possible size of F is 2k .

Common remarks. For convenience, we extend the use of the word scale: we say that the
scale between two reals x and y is Dpx, yq.

Solution. We first construct a set F with 2k members, each member having at most k different
scales in F . Take F “ t0, 1, 2, . . . , 2k ´ 1u. The scale between any two members of F is in the
set t0, 1, . . . , k ´ 1u.
We now show that 2k is an upper bound on the size of F . For every finite set S of real
numbers, and every real x, let rS pxq denote the number of different scales of x in S. That
is, rS pxq “ |tDpx, yq : x ‰ y P Su|. Thus, for every element x of the set F in the problem
statement, we have rF pxq ď k. The condition |F | ď 2k is an immediate consequence of the
following lemma.
Lemma. Let S be a finite set of real numbers, and define
ÿ
wpSq “ 2´rS pxq .
xPS

Then wpSq ď 1.
Proof. Induction on n “ |S|. If S “ txu, then rS pxq “ 0, so wpSq “ 1.
Assume now n ě 2, and let x1 ă ¨ ¨ ¨ ă xn list the members of S. Let d be the minimal scale
between two distinct elements of S; then there exist neighbours xt and xt`1 with Dpxt , xt`1 q “ d.
Notice that for any two indices i and j with j ´ i ą 1 we have Dpxi , xj q ą d, since

|xi ´ xj | “ |xi`1 ´ xi | ` |xj ´ xi`1 | ě 2d ` 2d “ 2d`1 .

Now choose the minimal i ď t and the maximal j ě t ` 1 such that Dpxi , xi`1 q “
Dpxi`1 , xi`2 q “ ¨ ¨ ¨ “ Dpxj´1 , xj q “ d.
Let E be the set of all the xs with even indices i ď s ď j, O be the set of those with
odd indices i ď s ď j, and R be the rest of the elements (so that S is the disjoint union of
E, O and R). Set SO “ R Y O and SE “ R Y E; we have |SO | ă |S| and |SE | ă |S|, so
wpSO q, wpSE q ď 1 by the inductive hypothesis.
Clearly, rSO pxq ď rS pxq and rSE pxq ď rS pxq for any x P R, and thus
ÿ 1 ÿ ´rS pxq
2´rS pxq “ p2 ` 2´rS pxq q
xPR
2 xPR
1 ÿ ´rS pxq
ď p2 O ` 2´rSE pxq q .
2 xPR

On the other hand, for every x P O, there is no y P SO such that DSO px, yq “ d (as all
candidates from S were in E). Hence, we have rSO pxq ď rS pxq ´ 1, and thus
ÿ 1 ÿ ´rS pxq
2´rS pxq ď 2 O .
xPO
2 xPO
Shortlisted problems – solutions 55

Similarly, for every x P E, we have


ÿ 1 ÿ ´rS pxq
2´rS pxq ď 2 E .
xPE
2 xPE

We can then combine these to give


ÿ ÿ ÿ
wpSq “ 2´rS pxq ` 2´rS pxq ` 2´rS pxq
xPR xPO xPE
1 ÿ ´rS pxq 1 ÿ ´rS pxq 1 ÿ ´rS pxq
ď p2 O ` 2´rSE pxq q ` 2 O ` 2 E
2 xPR 2 xPO 2 xPE
˜ ¸
1 ÿ ÿ
“ 2´rSO pxq ` 2´rSE pxq (since SO “ O Y R and SE “ E Y R)
2 xPS xPS
O E

1
“ pwpSO q ` wpSE qqq (by definition of wp¨q)
2
ď1 (by the inductive hypothesis)

which completes the induction. l

Comment 1. The sets O and E above are not the only ones we could have chosen. Indeed, we could
instead have used the following definitions:
Let d be the maximal scale between two distinct elements of S; that is, d “ Dpx1 , xn q. Let
O “ tx P S : Dpx, xn q “ du (a ‘left’ part of the set) and let E “ tx P S : Dpx1 , xq “ du (a ‘right’
part of the set). Note that these two sets are disjoint, and nonempty (since they contain x1 and xn
respectively). The rest of the proof is then the same as in Solution 1.

Comment 2. Another possible set F containing 2k members could arise from considering a binary
tree of height k, allocating a real number to each leaf, and trying to make the scale between the values
of two leaves dependent only on the (graph) distance between them. The following construction makes
this more precise.
We build up sets Fk recursively. Let F0 “ t0u, and then let Fk`1 “ Fk Y tx ` 3 ¨ 4k : x P Fk u (i.e.
each half of Fk`1 is a copy of Fk ). We have that Fk is contained in the interval r0, 4k`1 q, and so it
follows by induction on k that every member of Fk`1 has k different scales in its own half of Fk`1 (by
the inductive hypothesis), and only the single scale 2k ` 1 in the other half of Fk`1 .
Both of the constructions presented here have the property that every member of F has exactly k
different scales in F. Indeed, it can be seen that this must hold (up to a slight perturbation) for any
such maximal set. Suppose there were some element x with only k ´ 1 different scales in F (and every
other element had at most k different scales). Then we take some positive real ǫ, and construct a new
set F 1 “ ty : y P F, y ď xu Y ty ` ǫ : y P F, y ě xu. We have |F 1 | “ |F| ` 1, and if ǫ is sufficiently
small then F 1 will also satisfy the property that no member has more than k different scales in F 1 .
This observation might be used to motivate the idea of weighting members of an arbitrary set S
of reals according to how many different scales they have in S.
56 Bath — UK, 11th–22nd July 2019

Geometry
G1. Let ABC be a triangle. Circle Γ passes through A, meets segments AB and AC
again at points D and E respectively, and intersects segment BC at F and G such that F lies
between B and G. The tangent to circle BDF at F and the tangent to circle CEG at G meet
at point T . Suppose that points A and T are distinct. Prove that line AT is parallel to BC.
(Nigeria)

Solution. Notice that =T F B “ =F DA because F T is tangent to circle BDF , and moreover


=F DA “ =CGA because quadrilateral ADF G is cyclic. Similarly, =T GB “ =GEC because
GT is tangent to circle CEG, and =GEC “ =CF A. Hence,

=T F B “ =CGA and =T GB “ =CF A. p1q

T A

E
Γ

B F G C
Triangles F GA and GF T have a common side F G, and by p1q their angles at F, G are the
same. So, these triangles are congruent. So, their altitudes starting from A and T , respectively,
are equal and hence AT is parallel to line BF GC.

Comment. Alternatively, we can prove first that T lies on Γ. For example, this can be done by
showing that =AF T “ =AGT using p1q. Then the statement follows as =T AF “ =T GF “ =GF A.
Shortlisted problems – solutions 57

G2. Let ABC be an acute-angled triangle and let D, E, and F be the feet of altitudes
from A, B, and C to sides BC, CA, and AB, respectively. Denote by ωB and ωC the incircles
of triangles BDF and CDE, and let these circles be tangent to segments DF and DE at M
and N, respectively. Let line MN meet circles ωB and ωC again at P ‰ M and Q ‰ N,
respectively. Prove that MP “ NQ.
(Vietnam)

Solution. Denote the centres of ωB and ωC by OB and OC , let their radii be rB and rC , and
let BC be tangent to the two circles at T and U, respectively.
A

F
E

ωB
P
ϕ ωC
M
ϕ N ψ
rB
ψ rC
OB
OC
ϕ ψ Q

B T D U C
From the cyclic quadrilaterals AF DC and ABDE we have
1 1 1
=MDOB “ =F DB “ =BAC “ =CDE “ =OC DN,
2 2 2
so the right-angled triangles DMOB and DNOC are similar. The ratio of similarity between
the two triangles is
DN OC N rC
“ “ .
DM OB M rB
Let ϕ “ =DMN and ψ “ =MND. The lines F M and EN are tangent to ωB and ωC ,
respectively, so
=MT P “ =F MP “ =DMN “ ϕ and =QUN “ =QNE “ =MND “ ψ.
(It is possible that P or Q coincides with T or U, or lie inside triangles DMT or DUN,
respectively. To reduce case-sensitivity, we may use directed angles or simply ignore angles
MT P and QUN.)
In the circles ωB and ωC the lengths of chords MP and NQ are
MP “ 2rB ¨ sin =MT P “ 2rB ¨ sin ϕ and NQ “ 2rC ¨ sin =QUN “ 2rC ¨ sin ψ.
By applying the sine rule to triangle DNM we get
DN sin =DMN sin ϕ
“ “ .
DM sin =MND sin ψ
Finally, putting the above observations together, we get
MP 2rB sin ϕ rB sin ϕ DM sin ϕ sin ψ sin ϕ
“ “ ¨ “ ¨ “ ¨ “ 1,
NQ 2rC sin ψ rC sin ψ DN sin ψ sin ϕ sin ψ
so MP “ NQ as required.
58 Bath — UK, 11th–22nd July 2019

G3. In triangle ABC, let A1 and B1 be two points on sides BC and AC, and let P and Q
be two points on segments AA1 and BB1 , respectively, so that line P Q is parallel to AB. On
ray P B1 , beyond B1 , let P1 be a point so that =P P1 C “ =BAC. Similarly, on ray QA1 ,
beyond A1 , let Q1 be a point so that =CQ1 Q “ =CBA. Show that points P , Q, P1 , and Q1
are concyclic.
(Ukraine)

Solution 1. Throughout the solution we use oriented angles.


Let rays AA1 and BB1 intersect the circumcircle of △ACB at A2 and B2 , respectively. By

=QP A2 “ =BAA2 “ =BB2 A2 “ =QB2 A2 ,

points P, Q, A2, B2 are concyclic; denote the circle passing through these points by ω. We shall
prove that P1 and Q1 also lie on ω.
Q1
ω
P1

A2
B2
B1 A1

P Q
A B

By
=CA2 A1 “ =CA2 A “ =CBA “ =CQ1 Q “ =CQ1 A1 ,
points C, Q1, A2 , A1 are also concyclic. From that we get

=QQ1 A2 “ =A1 Q1 A2 “ =A1 CA2 “ =BCA2 “ =BAA2 “ =QP A2 ,

so Q1 lies on ω.
It follows similarly that P1 lies on ω.

Solution 2. First consider the case when lines P P1 and QQ1 intersect each other at some
point R.
Let line P Q meet the sides AC and BC at E and F , respectively. Then

=P P1 C “ =BAC “ =P EC,

so points C, E, P, P1 lie on a circle; denote that circle by ωP . It follows analogously that points
C, F, Q, Q1 lie on another circle; denote it by ωQ .
Let AQ and BP intersect at T . Applying Pappus’ theorem to the lines AA1 P and BB1 Q
provides that points C “ AB1 X BA1 , R “ A1 Q X B1 P and T “ AQ X BP are collinear.
Let line RCT meet P Q and AB at S and U, respectively. From AB k P Q we obtain

SP UB SF
“ “ ,
SQ UA SE
so
SP ¨ SE “ SQ ¨ SF.
Shortlisted problems – solutions 59

R ωQ

ωP Q1
P1

A1
B1

E S F
P Q
T

A U B
So, point S has equal powers with respect to ωP and ωQ , hence line RCS is their radical
axis; then R also has equal powers to the circles, so RP ¨ RP1 “ RQ ¨ RQ1 , proving that points
P, P1 , Q, Q1 are indeed concyclic.
Now consider the case when P P1 and QQ1 are parallel. Like in the previous case, let AQ
and BP intersect at T . Applying Pappus’ theorem again to the lines AA1 P and BB1 Q, in this
limit case it shows that line CT is parallel to P P1 and QQ1 .
Let line CT meet P Q and AB at S and U, as before. The same calculation as in the
previous case shows that SP ¨ SE “ SQ ¨ SF , so S lies on the radical axis between ωP and ωQ .
ωQ
Q1
P1
ωP

C ℓ

A1
B1

E S F
P Q
T

A U B
Line CST , that is the radical axis between ωP and ωQ , is perpendicular to the line ℓ of centres
of ωP and ωQ . Hence, the chords P P1 and QQ1 are perpendicular to ℓ. So the quadrilateral
P P1 Q1 Q is an isosceles trapezium with symmetry axis ℓ, and hence is cyclic.

Comment. There are several ways of solving the problem involving Pappus’ theorem. For example,
one may consider the points K “ P B1 X BC and L “ QA1 X AC. Applying Pappus’ theorem to the
lines AA1 P and QB1 B we get that K, L, and P Q X AB are collinear, i.e. that KL k AB. Therefore,
cyclicity of P , Q, P1 , and Q1 is equivalent to that of K, L, P1 , and Q1 . The latter is easy after noticing
that C also lies on that circle. Indeed, e.g. =pLK, LCq “ =pAB, ACq “ =pP1 K, P1 Cq shows that K
lies on circle KLC.
This approach also has some possible degeneracy, as the points K and L may happen to be ideal.
60 Bath — UK, 11th–22nd July 2019

G4. Let P be a point inside triangle ABC. Let AP meet BC at A1 , let BP meet CA
at B1 , and let CP meet AB at C1 . Let A2 be the point such that A1 is the midpoint of P A2 ,
let B2 be the point such that B1 is the midpoint of P B2 , and let C2 be the point such that
C1 is the midpoint of P C2 . Prove that points A2 , B2 , and C2 cannot all lie strictly inside the
circumcircle of triangle ABC.
(Australia)

C2

C3 B

C1
A3
A1 A2

B1
C

B2

B3

Solution 1. Since
=AP B ` =BP C ` =CP A “ 2π “ pπ ´ =ACBq ` pπ ´ =BACq ` pπ ´ =CBAq,
at least one of the following inequalities holds:
=AP B ě π ´ =ACB, =BP C ě π ´ =BAC, =CP A ě π ´ =CBA .
Without loss of generality, we assume that =BP C ě π ´ =BAC. We have =BP C ą =BAC
because P is inside △ABC. So =BP C ě maxp=BAC, π ´ =BACq and hence
sin =BP C ď sin =BAC . p˚q
Let the rays AP , BP , and CP cross the circumcircle Ω again at A3 , B3 , and C3 , respectively.
We will prove that at least one of the ratios BP1BB13 and CP1CC13 is at least 1, which yields that one
of the points B2 and C2 does not lie strictly inside Ω.
Because A, B, C, B3 lie on a circle, the triangles CB1 B3 and BB1 A are similar, so
CB1 BB1
“ .
B1 B3 B1 A
Applying the sine rule we obtain
P B1 P B1 CB1 P B1 BB1 sin =ACP sin =BAC
“ ¨ “ ¨ “ ¨ .
B1 B3 CB1 B1 B3 CB1 B1 A sin =BP C sin =P BA
Similarly,
P C1 sin =P BA sin =BAC
“ ¨ .
C1 C3 sin =BP C sin =ACP
Multiplying these two equations we get
P B1 P C1 sin2 =BAC
¨ “ ě1
B1 B3 C1 C3 sin2 =BP C
using p˚q, which yields the desired conclusion.
Shortlisted problems – solutions 61

Comment. It also cannot happen that all three points A2 , B2 , and C2 lie strictly outside Ω. The same
proof works almost literally, starting by assuming without loss of generality that =BP C ď π ´ =BAC
and using =BP C ą =BAC to deduce that sin =BP C ě sin =BAC. It is possible for A2 , B2 , and C2
all to lie on the circumcircle; from the above solution we may derive that this happens if and only if P
is the orthocentre of the triangle ABC, (which lies strictly inside ABC if and only if ABC is acute).

Solution 2. Define points A3 , B3 , and C3 as in Solution 1. Assume for the sake of contradiction
that A2 , B2 , and C2 all lie strictly inside circle ABC. It follows that P A1 ă A1 A3 , P B1 ă B1 B3 ,
and P C1 ă C1 C3 .
Observe that △P BC3 „ △P CB3. Let X be the point on side P B3 that corresponds to
point C1 on side P C3 under this similarity. In other words, X lies on segment P B3 and satisfies
P X : XB3 “ P C1 : C1 C3 . It follows that

=XCP “ =P BC1 “ =B3 BA “ =B3 CB1 .

Hence lines CX and CB1 are isogonal conjugates in △P CB3.

α B3

C3 B1

α
Y
α C1 X
P

y
x y
y x

B A1 C

A3

Let Y be the foot of the bisector of =B3 CP in △P CB3. Since P C1 ă C1 C3 , we have


P X ă XB3 . Also, we have P Y ă Y B3 because P B1 ă B1 B3 and Y lies between X and B1 .
By the angle bisector theorem in △P CB3 , we have P Y : Y B3 “ P C : CB3 . So P C ă CB3
and it follows that =P B3 C ă =CP B3 . Now since =P B3 C “ =BB3 C “ =BAC, we have

=BAC ă =CP B3 .

Similarly, we have

=CBA ă =AP C3 and =ACB ă =BP A3 “ =B3 P A .

Adding these three inequalities yields π ă π, and this contradiction concludes the proof.
62 Bath — UK, 11th–22nd July 2019

Solution 3. Choose coordinates such that the circumcentre of △ABC is at the origin and
the circumradius is 1. Then we may think of A, B, and C as vectors in R2 such that
|A|2 “ |B|2 “ |C|2 “ 1 .
P may be represented as a convex combination αA`βB`γC where α, β, γ ą 0 and α`β`γ “ 1.
Then
βB ` γC 1 α
A1 “ “ P´ A,
β`γ 1´α 1´α
so
1`α 2α
A2 “ 2A1 ´ P “ P´ A.
1´α 1´α
Hence ˆ ˙2 ˆ ˙2
2 1`α 2 2α 4αp1 ` αq
|A2 | “ |P | ` |A|2 ´ A¨P .
1´α 1´α p1 ´ αq2
Using |A|2 “ 1 we obtain
p1 ´ αq2 1`α 2 2α2
|A2 |2 “ |P | ` ´ 2αA ¨ P. (1)
2p1 ` αq 2 1`α
Likewise
p1 ´ βq2 1`β 2 2β 2
|B2 |2 “ |P | ` ´ 2βB ¨ P (2)
2p1 ` βq 2 1`β
and
p1 ´ γq2 1`γ 2 2γ 2
|C2 |2 “ |P | ` ´ 2γC ¨ P. (3)
2p1 ` γq 2 1`γ
Summing (1), (2) and (3) we obtain on the LHS the positive linear combination
p1 ´ αq2 p1 ´ βq2 p1 ´ γq2
LHS “ |A2 |2 ` |B2 |2 ` |C2 |2
2p1 ` αq 2p1 ` βq 2p1 ` γq
and on the RHS the quantity
ˆ ˙ ˆ ˙
1`α 1`β 1`γ 2 2α2 2β 2 2γ 2
` ` |P | ` ` ` ´ 2pαA ¨ P ` βB ¨ P ` γC ¨ P q .
2 2 2 1`α 1`β 1`γ
The first term is 2|P |2 and the last term is ´2P ¨ P , so
ˆ ˙
2α2 2β 2 2γ 2
RHS “ ` `
1`α 1`β 1`γ
3α ´ 1 p1 ´ αq2 3β ´ 1 p1 ´ βq2 3γ ´ 1 p1 ´ γq2
“ ` ` ` ` `
2 2p1 ` αq 2 2p1 ` βq 2 2p1 ` γq
2 2 2
p1 ´ αq p1 ´ βq p1 ´ γq
“ ` ` .
2p1 ` αq 2p1 ` βq 2p1 ` γq
Here we used the fact that
3α ´ 1 3β ´ 1 3γ ´ 1
` ` “ 0.
2 2 2
We have shown that a linear combination of |A1 |2 , |B1 |2 , and |C1 |2 with positive coefficients is
equal to the sum of the coefficients. Therefore at least one of |A1 |2 , |B1 |2 , and |C1 |2 must be at
least 1, as required.
Comment. This proof also works when P is any point for which α, β, γ ą ´1, α ` β ` γ “ 1, and
α, β, γ ‰ 1. (In any cases where α “ 1 or β “ 1 or γ “ 1, some points in the construction are not
defined.)
Shortlisted problems – solutions 63

This page is intentionally left blank


64 Bath — UK, 11th–22nd July 2019

G5. Let ABCDE be a convex pentagon with CD “ DE and =EDC ‰ 2 ¨ =ADB.


Suppose that a point P is located in the interior of the pentagon such that AP “ AE and
BP “ BC. Prove that P lies on the diagonal CE if and only if areapBCDq ` areapADEq “
areapABDq ` areapABP q.
(Hungary)

Solution 1. Let P 1 be the reflection of P across line AB, and let M and N be the midpoints of
P 1 E and P 1 C respectively. Convexity ensures that P 1 is distinct from both E and C, and hence
from both M and N. We claim that both the area condition and the collinearity condition in
the problem are equivalent to the condition that the (possibly degenerate) right-angled triangles
AP 1 M and BP 1 N are directly similar (equivalently, AP 1 E and BP 1 C are directly similar).

E D

M C
B
A
N

P1

For the equivalence with the collinearity condition, let F denote the foot of the perpendicular
from P 1 to AB, so that F is the midpoint of P P 1 . We have that P lies on CE if and only if F lies
on MN, which occurs if and only if we have the equality =AF M “ =BF N of signed angles
modulo π. By concyclicity of AP 1F M and BF P 1 N, this is equivalent to =AP 1 M “ =BP 1 N,
which occurs if and only if AP 1 M and BP 1 N are directly similar.

M
B
A
F N

P1

For the other equivalence with the area condition, we have the equality of signed areas
areapABDq ` areapABP q “ areapAP 1 BDq “ areapAP 1 Dq ` areapBDP 1 q. Using the identity
areapADEq ´ areapAP 1Dq “ areapADEq ` areapADP 1 q “ 2 areapADMq, and similarly for B,
we find that the area condition is equivalent to the equality
areapDAMq “ areapDBNq.
Now note that A and B lie on the perpendicular bisectors of P 1E and P 1C, respectively. If
we write G and H for the feet of the perpendiculars from D to these perpendicular bisectors
respectively, then this area condition can be rewritten as
MA ¨ GD “ NB ¨ HD.
(In this condition, we interpret all lengths as signed lengths according to suitable conventions:
for instance, we orient P 1 E from P 1 to E, orient the parallel line DH in the same direction, and
orient the perpendicular bisector of P 1 E at an angle π{2 clockwise from the oriented segment
P 1 E – we adopt the analogous conventions at B.)
Shortlisted problems – solutions 65

E D

H
G
C
M
A B
N

P1

To relate the signed lengths GD and HD to the triangles AP 1 M and BP 1 N, we use the
following calculation.
Claim. Let Γ denote the circle centred on D with both E and C on the circumference, and
h the power of P 1 with respect to Γ. Then we have the equality
1
GD ¨ P 1 M “ HD ¨ P 1 N “ h ‰ 0.
4

Proof. Firstly, we have h ‰ 0, since otherwise P 1 would lie on Γ, and hence the internal angle
bisectors of =EDP 1 and =P 1 DC would pass through A and B respectively. This would violate
the angle inequality =EDC ‰ 2 ¨ =ADB given in the question.
Next, let E 1 denote the second point of intersection of P 1E with Γ, and let E 2 denote the
point on Γ diametrically opposite E 1 , so that E 2 E is perpendicular to P 1 E. The point G lies
on the perpendicular bisectors of the sides P 1 E and EE 2 of the right-angled triangle P 1 EE 2 ;
it follows that G is the midpoint of P 1 E 2 . Since D is the midpoint of E 1 E 2 , we have that
GD “ 21 P 1E 1 . Since P 1 M “ 21 P 1 E, we have GD ¨ P 1 M “ 14 P 1 E 1 ¨ P 1 E “ 41 h. The other equality
HD ¨ P 1 N follows by exactly the same argument.

Γ E2

D
E

G
E1
M

P1

l
From this claim, we see that the area condition is equivalent to the equality

pMA : P 1 Mq “ pNB : P 1 Nq

of ratios of signed lengths, which is equivalent to direct similarity of AP 1 M and BP 1 N, as


desired.
66 Bath — UK, 11th–22nd July 2019

Solution 2. Along the perpendicular bisector of CE, define the linear function

f pXq “ areapBCXq ` areapAXEq ´ areapABXq ´ areapABP q,

where, from now on, we always use signed areas. Thus, we want to show that C, P, E are
collinear if and only if f pDq “ 0.

D C

A B

Let P 1 be the reflection of P across line AB. The point P 1 does not lie on the line CE.
To see this, we let A2 and B 2 be the points obtained from A and B by dilating with scale
factor 2 about P 1 , so that P is the orthogonal projection of P 1 onto A2 B 2 . Since A lies on the
perpendicular bisector of P 1E, the triangle A2 EP 1 is right-angled at E (and B 2 CP 1 similarly).
If P 1 were to lie on CE, then the lines A2 E and B 2 C would be perpendicular to CE and A2
and B 2 would lie on the opposite side of CE to D. It follows that the line A2 B 2 does not meet
triangle CDE, and hence point P does not lie inside CDE. But then P must lie inside ABCE,
and it is clear that such a point cannot reflect to a point P 1 on CE.
We thus let O be the centre of the circle CEP 1 . The lines AO and BO are the perpendicular
bisectors of EP 1 and CP 1, respectively, so

areapBCOq ` areapAOEq “ areapOP 1Bq ` areapP 1 OAq “ areapP 1 BOAq


“ areapABOq ` areapBAP 1 q “ areapABOq ` areapABP q,

and hence f pOq “ 0.


Notice that if point O coincides with D then points A, B lie in angle domain CDE and
=EOC “ 2 ¨ =AOB, which is not allowed. So, O and D must be distinct. Since f is linear and
vanishes at O, it follows that f pDq “ 0 if and only if f is constant zero – we want to show this
occurs if and only if C, P, E are collinear.
C T
C

E E
P O P

A B
A
B

P′

In the one direction, suppose firstly that C, P, E are not collinear, and let T be the centre
of the circle CEP . The same calculation as above provides

areapBCT q ` areapAT Eq “ areapP BT Aq “ areapABT q ´ areapABP q

so
f pT q “ ´2 areapABP q ‰ 0.
Shortlisted problems – solutions 67

Hence, the linear function f is nonconstant with its zero is at O, so that f pDq ‰ 0.
In the other direction, suppose that the points C, P, E are collinear. We will show that f is
constant zero by finding a second point (other than O) at which it vanishes.
E
P

C
A B

A′ Q B′

Let Q be the reflection of P across the midpoint of AB, so P AQB is a parallelogram. It


is easy to see that Q is on the perpendicular bisector of CE; for instance if A1 and B 1 are the
points produced from A and B by dilating about P with scale factor 2, then the projection
of Q to CE is the midpoint of the projections of A1 and B 1 , which are E and C respectively.
The triangles BCQ and AQE are indirectly congruent, so
` ˘ ` ˘
f pQq “ areapBCQq ` areapAQEq ´ areapABQq ´ areapBAP q “ 0 ´ 0 “ 0.

The points O and Q are distinct. To see this, consider the circle ω centred on Q with P 1 on
the circumference; since triangle P P 1 Q is right-angled at P 1 , it follows that P lies outside ω.
On the other hand, P lies between C and E on the line CP E. It follows that C and E cannot
both lie on ω, so that ω is not the circle CEP 1 and Q ‰ O.
Since O and Q are distinct zeroes of the linear function f , we have f pDq “ 0 as desired.

Comment 1. The condition =EDC ‰ 2¨=ADB cannot be omitted. If D is the centre of circle CEP 1 ,
then the condition on triangle areas is satisfied automatically, without having P on line CE.

Comment 2. The “only if” part of this problem is easier than the “if” part. For example, in
the second part of Solution 2, the triangles EAQ and QBC are indirectly congruent, so the sum
of their areas is 0, and DCQE is a kite. Now one can easily see that =pAQ, DEq “ =pCD, CBq
and =pBQ, DCq “ =pED, EAq, whence areapBCDq “ areapAQDq ` areapEQAq and areapADEq “
areapBDQq ` areapBQCq, which yields the result.
68 Bath — UK, 11th–22nd July 2019

Comment 3. The origin of the problem is the following observation. Let ABDH be a tetrahedron
and consider the sphere S that is tangent to the four face planes, internally to planes ADH and BDH
and externally to ABD and ABH (or vice versa). It is known that the sphere S exists if and only
if areapADHq ` areapBDHq ‰ areapABHq ` areapABDq; this relation comes from the usual formula
for the volume of the tetrahedron.
Let T, Ta , Tb , Td be the points of tangency between the sphere and the four planes, as shown in the
picture. Rotate the triangle ABH inward, the triangles BDH and ADH outward, into the triangles
ABP , BDC and ADE, respectively, in the plane ABD. Notice that the points Td , Ta , Tb are rotated
to T , so we have HTa “ HTb “ HTd “ P T “ CT “ ET . Therefore, the point T is the centre of the
circle CEP . Hence, if the sphere exists then C, E, P cannot be collinear.
If the condition =EDC ‰ 2 ¨ =ADB is replaced by the constraint that the angles =EDA, =ADB
and =BDC satisfy the triangle inequality, it enables reconstructing the argument with the tetrahedron
and the tangent sphere.
H

C
D P
B
A T
E

Ta

Tb

Td
Shortlisted problems – solutions 69

G6. Let I be the incentre of acute-angled triangle ABC. Let the incircle meet BC, CA,
and AB at D, E, and F , respectively. Let line EF intersect the circumcircle of the triangle
at P and Q, such that F lies between E and P . Prove that =DP A ` =AQD “ =QIP .
(Slovakia)

Solution 1. Let N and M be the midpoints of the arcs BC Ŋ of the circumcircle, containing
and opposite vertex A, respectively. By =F AE “ =BAC “ =BNC, the right-angled kites
AF IE and NBMC are similar. Consider the spiral similarity ϕ (dilation in case of AB “ AC)
that moves AF IE to NBMC. The directed angle in which ϕ changes directions is =pAF, NBq,
same as =pAP, NP q and =pAQ, NQq; so lines AP and AQ are mapped to lines NP and NQ,
respectively. Line EF is mapped to BC; we can see that the intersection points P “ EF X AP
and Q “ EF X AQ are mapped to points BC X NP and BC X NQ, respectively. Denote these
points by P 1 and Q1 , respectively.
N
Γ A

P
F

E
Q
I

P′ B L D C Q′ Z

M
Let L be the midpoint of BC. We claim that points P, Q, D, L are concyclic (if D “ L
then line BC is tangent to circle P QD). Let P Q and BC meet at Z. By applying Menelaus’
theorem to triangle ABC and line EF Z, we have
BD BF AE BZ
“ ¨ “´ ,
DC F A EC ZC
so the pairs B, C and D, Z are harmonic. It is well-known that this implies ZB ¨ZC “ ZD ¨ZL.
(The inversion with pole Z that swaps B and C sends Z to infinity and D to the midpoint
of BC, because the cross-ratio is preserved.) Hence, ZD ¨ ZL “ ZB ¨ ZC “ ZP ¨ ZQ by the
power of Z with respect to the circumcircle; this proves our claim.
By =MP P 1 “ =MQQ1 “ =MLP 1 “ =MLQ1 “ 90˝ , the quadrilaterals MLP P 1 and
MLQQ1 are cyclic. Then the problem statement follows by

=DP A ` =AQD “ 360˝ ´ =P AQ ´ =QDP “ 360˝ ´ =P NQ ´ =QLP


“ =LP N ` =NQL “ =P 1 ML ` =LMQ1 “ =P 1 MQ1 “ =P IQ.
70 Bath — UK, 11th–22nd July 2019

Solution 2. Define the point M and the same spiral similarity ϕ as in the previous solution.
(The point N is not necessary.) It is well-known that the centre of the spiral similarity that
maps F, E to B, C is the Miquel point of the lines F E, BC, BF and CE; that is, the second
intersection of circles ABC and AEF . Denote that point by S.
By ϕpF q “ B and ϕpEq “ C the triangles SBF and SCE are similar, so we have

SB BF BD
“ “ .
SC CE CD
By the converse of the angle bisector theorem, that indicates that line SD bisects =BSC and
hence passes through M.
Let K be the intersection point of lines EF and SI. Notice that ϕ sends points S, F, E, I
to S, B, C, M, so ϕpKq “ ϕpF E X SIq “ BC X SM “ D. By ϕpIq “ M, we have KD k IM.
Γ A

S
P
F
K
E
Q
I

B D C
L
M
We claim that triangles SP I and SDQ are similar, and so are triangles SP D and SIQ.
Let ray SI meet the circumcircle again at L. Note that the segment EF is perpendicular to
the angle bisector AM. Then by =AML “ =ASL “ =ASI “ 90˝ , we have ML k P Q. Hence,
PŇL “ MQ
Ŋ and therefore =P SL “ =MSQ “ =DSQ. By =QP S “ =QMS, the triangles
SP K and SMQ are similar. Finally,
SP SP SK SM SD SD
“ ¨ “ ¨ “
SI SK SI SQ SM SQ
shows that triangles SP I and SDQ are similar. The second part of the claim can be proved
analogously.
Now the problem statement can be proved by

=DP A ` =AQD “ =DP S ` =SQD “ =QIS ` =SIP “ =QIP .


Shortlisted problems – solutions 71

Solution 3. Denote the circumcircle of triangle ABC by Γ, and let rays P D and QD meet Γ
again at V and U, respectively. We will show that AU K IP and AV K IQ. Then the problem
statement will follow as

=DP A ` =AQD “ =V UA ` =AV U “ 180˝ ´ =UAV “ =QIP .

Let M be the midpoint of arc BUVŔC and let N be the midpoint of arc CAB;
Ő the lines AIM
and AN being the internal and external bisectors of angle BAC, respectively, are perpendicular.
Let the tangents drawn to Γ at B and C meet at R; let line P Q meet AU, AI, AV and BC at
X, T , Y and Z, respectively.
As in Solution 1, we observe that the pairs B, C and D, Z are harmonic. Projecting these
points from Q onto the circumcircle, we can see that B, C and U, P are also harmonic. Anal-
ogously, the pair V, Q is harmonic with B, C. Consider the inversion about the circle with
centre R, passing through B and C. Points B and C are fixed points, so this inversion ex-
changes every point of Γ by its harmonic pair with respect to B, C. In particular, the inversion
maps points B, C, N, U, V to points B, C, M, P, Q, respectively.
Combine the inversion with projecting Γ from A to line P Q; the points B, C, M, P, Q are
projected to F, E, T, P, Q, respectively.
N
A
Γ

P
F
X
T Y E
Q
I

Z
B D C

V
U
M

R
The combination of these two transformations is projective map from the lines AB, AC,
AN, AU, AV to IF , IE, IT , IP , IQ, respectively. On the other hand, we have AB K IF ,
AC K IE and AN K AT , so the corresponding lines in these two pencils are perpendicular.
This proves AU K IP and AV K IQ, and hence completes the solution.
72 Bath — UK, 11th–22nd July 2019

G7. The incircle ω of acute-angled scalene triangle ABC has centre I and meets sides BC,
CA, and AB at D, E, and F , respectively. The line through D perpendicular to EF meets ω
again at R. Line AR meets ω again at P . The circumcircles of triangles P CE and P BF meet
again at Q ‰ P . Prove that lines DI and P Q meet on the external bisector of angle BAC.
(India)

Common remarks. Throughout the solution, =pa, bq denotes the directed angle between
lines a and b, measured modulo π.

Solution 1.
Step 1. The external bisector of =BAC is the line through A perpendicular to IA. Let DI
meet this line at L and let DI meet ω at K. Let N be the midpoint of EF , which lies on IA
and is the pole of line AL with respect to ω. Since AN ¨ AI “ AE 2 “ AR ¨ AP , the points R,
N, I, and P are concyclic. As IR “ IP , the line NI is the external bisector of =P NR, so P N
meets ω again at the point symmetric to R with respect to AN – i.e. at K.
Let DN cross ω again at S. Opposite sides of any quadrilateral inscribed in the circle ω
meet on the polar line of the intersection of the diagonals with respect to ω. Since L lies on
the polar line AL of N with respect to ω, the line P S must pass through L. Thus it suffices to
prove that the points S, Q, and P are collinear.
A

L K
K
K
K
F
A N
N
N
N
I
E
Q
Q
Q
Q
M
M
M
M
S
S
S
S
F K
K
K
K ω P
P
P
P
R B
D C
N
N
ω I
E
Γ

P
P
C T
D

Step 2. Let Γ be the circumcircle of △BIC. Notice that

=pBQ, QCq “ =pBQ, QP q ` =pP Q, QCq “ =pBF, F P q ` =pP E, ECq


“ =pEF, EP q ` =pF P, F Eq “ =pF P, EP q “ =pDF, DEq “ =pBI, ICq,
so Q lies on Γ. Let QP meet Γ again at T . It will now suffice to prove that S, P , and T
are collinear. Notice that =pBI, IT q “ =pBQ, QT q “ =pBF, F P q “ =pF K, KP q. Note
F D K F K and F D K BI so F K k BI and hence IT is parallel to the line KNP . Since
DI “ IK, the line IT crosses DN at its midpoint M.
Step 3. Let F 1 and E 1 be the midpoints of DE and DF , respectively. Since DE 1 ¨E 1 F “ DE 12 “
BE 1 ¨E 1 I, the point E 1 lies on the radical axis of ω and Γ; the same holds for F 1 . Therefore, this
radical axis is E 1 F 1 , and it passes through M. Thus IM ¨ MT “ DM ¨ MS, so S, I, D, and T
are concyclic. This shows =pDS, ST q “ =pDI, IT q “ =pDK, KP q “ =pDS, SP q, whence the
points S, P , and T are collinear, as desired.
Shortlisted problems – solutions 73

S
S
S
S
F
F
F
F K
K
K
K
N
N
N
N

I
E
E
E
E
M
M

ω P
P
B
D C

Comment. Here is a longer alternative proof in step 1 that P , S, and L are collinear, using a circular
inversion instead of the fact that opposite sides of a quadrilateral inscribed in a circle ω meet on the
polar line with respect to ω of the intersection of the diagonals. Let G be the foot of the altitude from
N to the line DIKL. Observe that N, G, K, S are concyclic (opposite right angles) so

=DIP “ 2=DKP “ =GKN ` =DSP “ =GSN ` =N SP “ =GSP ,

hence I, G, S, P are concyclic. We have IG ¨ IL “ IN ¨ IA “ r 2 since △IGN „ △IAL. Inverting the


circle IGSP in circle ω, points P and S are fixed and G is taken to L so we find that P, S, and L are
collinear.
74 Bath — UK, 11th–22nd July 2019

Solution 2. We start as in Solution 1. Namely, we introduce the same points K, L, N, and S,


and show that the triples pP, N, Kq and pP, S, Lq are collinear. We conclude that K and R are
symmetric in AI, and reduce the problem statement to showing that P , Q, and S are collinear.
Step 1. Let AR meet the circumcircle Ω of ABC again at X. The lines AR and AK are
isogonal in the angle BAC; it is well known that in this case X is the tangency point of Ω with
the A-mixtilinear circle. It is also well known that for this point X, the line XI crosses Ω again
at the midpoint M 1 of arc BAC.
Step 2. Denote the circles BF P and CEP by ΩB and ΩC , respectively. Let ΩB cross AR
and EF again at U and Y , respectively. We have

=pUB, BF q “ =pUP, P F q “ =pRP, P F q “ =pRF, F Aq,

so UB k RF .
M′

ΩB
F R
R
YY
YY
E
Ω ω VV
VV Z
Z
Z
Z
IIII
ΩC

P
P
P
P W
W
W
W
B
D C
U
U

X
X

Next, we show that the points B, I, U, and X are concyclic. Since

=pUB, UXq “ =pRF, RXq “ =pAF, ARq ` =pF R, F Aq “ =pM 1 B, M 1 Xq ` =pDR, DF q,

it suffices to prove =pIB, IXq “ =pM 1 B, M 1 Xq ` =pDR, DF q, or =pIB, M 1 Bq “ =pDR, DF q.


But both angles equal =pCI, CBq, as desired. (This is where we used the fact that M 1 is the
midpoint of arc BAC of Ω.)
It follows now from circles BUIX and BP UF Y that
π ´ =A
=pIU, UBq “ =pIX, BXq “ =pM 1 X, BXq “
2
“ =pEF, AF q “ =pY F, BF q “ =pY U, BUq ,

so the points Y , U, and I are collinear.


Let EF meet BC at W . We have

=pIY, Y W q “ =pUY, F Y q “ =pUB, F Bq “ =pRF, AF q “ =pCI, CW q,

so the points W , Y , I, and C are concyclic.


Shortlisted problems – solutions 75

Similarly, if V and Z are the second meeting points of ΩC with AR and EF , we get that
the 4-tuples pC, V, I, Xq and pB, I, Z, W q are both concyclic.
Step 3. Let Q1 “ CY X BZ. We will show that Q1 “ Q.
First of all, we have

=pQ1 Y, Q1 Bq “ =pCY, ZBq “ =pCY, ZY q ` =pZY, BZq


π ´ =A
“ =pCI, IW q ` =pIW, IBq “ =pCI, IBq “ “ =pF Y, F Bq,
2
so Q1 P ΩB . Similarly, Q1 P ΩC . Thus Q1 P ΩB X ΩC “ tP, Qu and it remains to prove that
Q1 ‰ P . If we had Q1 “ P , we would have =pP Y, P Zq “ =pQ1 Y, Q1 Zq “ =pIC, IBq. This
would imply

=pP Y, Y F q ` =pEZ, ZP q “ =pP Y, P Zq “ =pIC, IBq “ =pP E, P F q,

so circles ΩB and ΩC would be tangent at P . That is excluded in the problem conditions, so


Q1 “ Q.

S
ΩB F R
R
R
R
YY
YY N
N
N
N
E
Ω ω VV
VV Z
Z
Z
Z
IIII
Q′′′′′ =
Q
Q
Q =
=Q
= Q
Q
Q ΩC

P
P
P
P W
W
W
W
B
D C
U
U
U
U

X
X
X
X

Step 4. Now we are ready to show that P , Q, and S are collinear.


Notice that A and D are the poles of EW and DW with respect to ω, so W is the pole
of AD. Hence, W I K AD. Since CI K DE, this yields =pIC, W Iq “ =pDE, DAq. On the
other hand, DA is a symmedian in △DEF , so =pDE, DAq “ =pDN, DF q “ =pDS, DF q.
Therefore,

=pP S, P F q “ =pDS, DF q “ =pDE, DAq “ =pIC, IW q


“ =pY C, Y W q “ =pY Q, Y F q “ =pP Q, P F q,

which yields the desired collinearity.


76 Bath — UK, 11th–22nd July 2019

G8. Let L be the set of all lines in the plane and let f be a function that assigns to each
line ℓ P L a point f pℓq on ℓ. Suppose that for any point X, and for any three lines ℓ1 , ℓ2 , ℓ3
passing through X, the points f pℓ1 q, f pℓ2 q, f pℓ3 q and X lie on a circle.
Prove that there is a unique point P such that f pℓq “ P for any line ℓ passing through P .
(Australia)

Common remarks. The condition on f is equivalent to the following: There is some func-
tion g that assigns to each point X a circle gpXq passing through X such that for any line ℓ
passing through X, the point f pℓq lies on gpXq. (The function g may not be uniquely defined
for all points, if some points X have at most one value of f pℓq other than X; for such points,
an arbitrary choice is made.)
If there were two points P and Q with the given property, f pP Qq would have to be both
P and Q, so there is at most one such point, and it will suffice to show that such a point exists.

Solution 1. We provide a complete characterisation of the functions satisfying the given


condition.
Write =pℓ1 , ℓ2 q for the directed angle modulo 180˝ between the lines ℓ1 and ℓ2 . Given a
point P and an angle α P p0, 180˝ q, for each line ℓ, let ℓ1 be the line through P satisfying
=pℓ1 , ℓq “ α, and let hP,α pℓq be the intersection point of ℓ and ℓ1 . We will prove that there is
some pair pP, αq such that f and hP,α are the same function. Then P is the unique point in
the problem statement.
Given an angle α and a point P , let a line ℓ be called pP, αq-good if f pℓq “ hP,α pℓq. Let
a point X ‰ P be called pP, αq-good if the circle gpXq passes through P and some point
Y ‰ P, X on gpXq satisfies =pP Y, Y Xq “ α. It follows from this definition that if X is pP, αq-
good then every point Y ‰ P, X of gpXq satisfies this angle condition, so hP,α pXY q “ Y for
every Y P gpXq. Equivalently, f pℓq P tX, hP,α pℓqu for each line ℓ passing through X. This
shows the following lemma.
Lemma 1. If X is pP, αq-good and ℓ is a line passing through X then either f pℓq “ X or ℓ is
pP, αq-good.
Lemma 2. If X and Y are different pP, αq-good points, then line XY is pP, αq-good.
Proof. If XY is not pP, αq-good then by the previous Lemma, f pXY q “ X and similarly
f pXY q “ Y , but clearly this is impossible as X ‰ Y . l
Lemma 3. If ℓ1 and ℓ2 are different pP, αq-good lines which intersect at X ‰ P , then either
f pℓ1 q “ X or f pℓ2 q “ X or X is pP, αq-good.
Proof. If f pℓ1 q, f pℓ2 q ‰ X, then gpXq is the circumcircle of X, f pℓ1 q and f pℓ2 q. Since ℓ1 and ℓ2
are pP, αq-good lines, the angles

=pP f pℓ1 q, f pℓ1 qXq “ =pP f pℓ2 q, f pℓ2 qXq “ α,

so P lies on gpXq. Hence, X is pP, αq-good. l


Lemma 4. If ℓ1 , ℓ2 and ℓ3 are different pP, αq-good lines which intersect at X ‰ P , then X is
pP, αq-good.
Proof. This follows from the previous Lemma since at most one of the three lines ℓi can satisfy
f pℓi q “ X as the three lines are all pP, αq-good. l
Lemma 5. If ABC is a triangle such that A, B, C, f pABq, f pACq and f pBCq are all different
points, then there is some point P and some angle α such that A, B and C are pP, αq-good
points and AB, BC and CA are pP, αq-good lines.
Shortlisted problems – solutions 77

A
gpAq
E
gpCq
gpBq P
F
B C
D

Proof. Let D, E, F denote the points f pBCq, f pACq, f pABq, respectively. Then gpAq,
gpBq and gpCq are the circumcircles of AEF , BDF and CDE, respectively. Let P ‰ F
be the second intersection of circles gpAq and gpBq (or, if these circles are tangent at F , then
P “ F ). By Miquel’s theorem (or an easy angle chase), gpCq also passes through P . Then by
the cyclic quadrilaterals, the directed angles
=pP D, DCq “ =pP F, F Bq “ =pP E, EAq “ α,
for some angle α. Hence, lines AB, BC and CA are all pP, αq-good, so by Lemma 3, A, B and C
are pP, αq-good. (In the case where P “ D, the line P D in the equation above denotes the line
which is tangent to gpBq at P “ D. Similar definitions are used for P E and P F in the cases
where P “ E or P “ F .) l
Consider the set Ω of all points px, yq with integer coordinates 1 ď x, y ď 1000, and consider
the set LΩ of all horizontal, vertical and diagonal lines passing through at least one point in Ω.
A simple counting argument shows that there are 5998 lines in LΩ . For each line ℓ in LΩ we
colour the point f pℓq red. Then there are at most 5998 red points. Now we partition the points
in Ω into 10000 ten by ten squares. Since there are at most 5998 red points, at least one of
these squares Ω10 contains no red points. Let pm, nq be the bottom left point in Ω10 . Then the
triangle with vertices pm, nq, pm ` 1, nq and pm, n ` 1q satisfies the condition of Lemma 5, so
these three vertices are all pP, αq-good for some point P and angle α, as are the lines joining
them. From this point on, we will simply call a point or line good if it is pP, αq-good for this
particular pair pP, αq. Now by Lemma 1, the line x “ m ` 1 is good, as is the line y “ n ` 1.
Then Lemma 3 implies that pm`1, n`1q is good. By applying these two lemmas repeatedly, we
can prove that the line x ` y “ m ` n ` 2 is good, then the points pm, n ` 2q and pm ` 2, nq then
the lines x “ m`2 and y “ n`2, then the points pm`2, n`1q, pm`1, n`2q and pm`2, n`2q
and so on until we have prove that all points in Ω10 are good.
Now we will use this to prove that every point S ‰ P is good. Since gpSq is a circle, it
passes through at most two points of Ω10 on any vertical line, so at most 20 points in total.
Moreover, any line ℓ through S intersects at most 10 points in Ω10 . Hence, there are at least
eight lines ℓ through S which contain a point Q in Ω10 which is not on gpSq. Since Q is not
on gpSq, the point f pℓq ‰ Q. Hence, by Lemma 1, the line ℓ is good. Hence, at least eight good
lines pass through S, so by Lemma 4, the point S is good. Hence, every point S ‰ P is good,
so by Lemma 2, every line is good. In particular, every line ℓ passing through P is good, and
therefore satisfies f pℓq “ P , as required.
Solution 2. Note that for any distinct points X, Y , the circles gpXq and gpY q meet on XY
at the point f pXY q P gpXq X gpY q X pXY q. We write spX, Y q for the second intersection point
of circles gpXq and gpY q.
Lemma 1. Suppose that X, Y and Z are not collinear, and that f pXY q R tX, Y u and similarly
for Y Z and ZX. Then spX, Y q “ spY, Zq “ spZ, Xq.
Proof. The circles gpXq, gpY q and gpZq through the vertices of triangle XY Z meet pairwise on
the corresponding edges (produced). By Miquel’s theorem, the second points of intersection of
any two of the circles coincide. (See the diagram for Lemma 5 of Solution 1.) l
78 Bath — UK, 11th–22nd July 2019

Now pick any line ℓ and any six different points Y1 , . . . , Y6 on ℓ z tf pℓqu. Pick a point X
not on ℓ or any of the circles gpYi q. Reordering the indices if necessary, we may suppose that
Y1 , . . . , Y4 do not lie on gpXq, so that f pXYi q R tX, Yi u for 1 ď i ď 4. By applying the above
lemma to triangles XYi Yj for 1 ď i ă j ď 4, we find that the points spYi , Yj q and spX, Yi q are
all equal, to point O say. Note that either O does not lie on ℓ, or O “ f pℓq, since O P gpYiq.
Now consider an arbitrary point X 1 not on ℓ or any of the circles gpYi q for 1 ď i ď 4. As
above, we see that there are two indices 1 ď i ă j ď 4 such that Yi and Yj do not lie on gpX 1q.
By applying the above lemma to triangle X 1 Yi Yj we see that spX 1 , Yi q “ O, and in particular
gpX 1 q passes through O.
We will now show that f pℓ1 q “ O for all lines ℓ1 through O. By the above note, we may
assume that ℓ1 ‰ ℓ. Consider a variable point X 1 P ℓ1 z tOu not on ℓ or any of the circles gpYi q
for 1 ď i ď 4. We know that f pℓ1 q P gpX 1q X ℓ1 “ tX 1 , Ou. Since X 1 was suitably arbitrary, we
have f pℓ1 q “ O as desired.

Solution 3. Notice that, for any two different points X and Y , the point f pXY q lies on both
gpXq and gpY q, so any two such circles meet in at least one point. We refer to two circles as
cutting only in the case where they cross, and so meet at exactly two points, thus excluding
the cases where they are tangent or are the same circle.
Lemma 1. Suppose there is a point P such that all circles gpXq pass through P . Then P has
the given property.
Proof. Consider some line ℓ passing through P , and suppose that f pℓq ‰ P . Consider some X P ℓ
with X ‰ P and X ‰ f pℓq. Then gpXq passes through all of P , f pℓq and X, but those three
points are collinear, a contradiction. l
Lemma 2. Suppose that, for all ǫ ą 0, there is a point Pǫ with gpPǫq of radius at most ǫ. Then
there is a point P with the given property.
Proof. Consider a sequence ǫi “ 2´i and corresponding points Pǫi . Because the two ř circles
1´i 1´j
gpPǫi q and gpPǫj q meet, the distance between Pǫi and Pǫj is at most 2 ` 2 . As i ǫi con-
verges, these points converge to some point P . For all ǫ ą 0, the point P has distance at
most 2ǫ from Pǫ , and all circles gpXq pass through a point with distance at most 2ǫ from Pǫ ,
so distance at most 4ǫ from P . A circle that passes distance at most 4ǫ from P for all ǫ ą 0
must pass through P , so by Lemma 1 the point P has the given property. l
Lemma 3. Suppose no two of the circles gpXq cut. Then there is a point P with the given
property.
Proof. Consider a circle gpXq with centre Y . The circle gpY q must meet gpXq without cutting
it, so has half the radius of gpXq. Repeating this argument, there are circles with arbitrarily
small radius and the result follows by Lemma 2. l
Lemma 4. Suppose there are six different points A, B1 , B2 , B3 , B4 , B5 such that no three
are collinear, no four are concyclic, and all the circles gpBi q cut pairwise at A. Then there is a
point P with the given property.
Proof. Consider some line ℓ through A that does not pass through any of the Bi and is not
tangent to any of the gpBi q. Fix some direction along that line, and let Xǫ be the point on ℓ
that has distance ǫ from A in that direction. In what follows we consider only those ǫ for which
Xǫ does not lie on any gpBi q (this restriction excludes only finitely many possible values of ǫ).
Consider the circle gpXǫ q. Because no four of the Bi are concyclic, at most three of them
lie on this circle, so at least two of them do not. There must be some sequence of ǫ Ñ 0 such
that it is the same two of the Bi for all ǫ in that sequence, so now restrict attention to that
sequence, and suppose without loss of generality that B1 and B2 do not lie on gpXǫ q for any ǫ
in that sequence.
Shortlisted problems – solutions 79

Then f pXǫ B1 q is not B1 , so must be the other point of intersection of Xǫ B1 with gpB1 q,
and the same applies with B2 . Now consider the three points Xǫ , f pXǫ B1 q and f pXǫ B2 q. As
ǫ Ñ 0, the angle at Xǫ tends to =B1 AB2 or 180˝ ´ =B1 AB2 , which is not 0 or 180˝ because
no three of the points were collinear. All three distances between those points are bounded
above by constant multiples of ǫ (in fact, if the triangle is scaled by a factor of 1{ǫ, it tends to
a fixed triangle). Thus the circumradius of those three points, which is the radius of gpXǫ q, is
also bounded above by a constant multiple of ǫ, and so the result follows by Lemma 2. l

Lemma 5. Suppose there are two points A and B such that gpAq and gpBq cut. Then there is
a point P with the given property.
Proof. Suppose that gpAq and gpBq cut at C and D. One of those points, without loss of
generality C, must be f pABq, and so lie on the line AB. We now consider two cases, according
to whether D also lies on that line.

Case 1: D does not lie on that line.


In this case, consider a sequence of Xǫ at distance ǫ from D, tending to D along some line
that is not a tangent to either circle, but perturbed slightly (by at most ǫ2 ) to ensure that no
three of the points A, B and Xǫ are collinear and no four are concyclic.
Consider the points f pXǫ Aq and f pXǫ Bq, and the circles gpXǫ q on which they lie. The
point f pXǫ Aq might be either A or the other intersection of Xǫ A with the circle gpAq, and the
same applies for B. If, for some sequence of ǫ Ñ 0, both those points are the other point of
intersection, the same argument as in the proof of Lemma 4 applies to find arbitrarily small
circles. Otherwise, we have either infinitely many of those circles passing through A, or infinitely
many passing through B; without loss of generality, suppose infinitely many through A.
We now show we can find five points Bi satisfying the conditions of Lemma 4 (together
with A). Let B1 be any of the Xǫ for which gpXǫ q passes through A. Then repeat the following
four times, for 2 ď i ď 5.
Consider some line ℓ “ Xǫ A (different from those considered for previous i) that is not
tangent to any of the gpBj q for j ă i, and is such that f pℓq “ A, so gpY q passes through A
for all Y on that line. If there are arbitrarily small circles gpY q we are done by Lemma 2, so
the radii of such circles must be bounded below. But as Y Ñ A, along any line not tangent
to gpBj q, the radius of a circle through Y and tangent to gpBj q at A tends to 0. So there must
be some Y such that gpY q cuts gpBj q at A rather than being tangent to it there, for all of the
previous Bj , and we may also pick it such that no three of the Bi and A are collinear and no
four are concyclic. Let Bi be this Y . Now the result follows by Lemma 4.

Case 2: D does lie on that line.


In this case, we follow a similar argument, but the sequence of Xǫ needs to be slightly
different. C and D both lie on the line AB, so one must be A and the other must be B.
Consider a sequence of Xǫ tending to B. Rather than tending to B along a straight line (with
small perturbations), let the sequence be such that all the points are inside the two circles, with
the angle between Xǫ B and the tangent to gpBq at B tending to 0.
Again consider the points f pXǫ Aq and f pXǫ Bq. If, for some sequence of ǫ Ñ 0, both those
points are the other point of intersection with the respective circles, we see that the angle at Xǫ
tends to the angle between AB and the tangent to gpBq at B, which is not 0 or 180˝ , while the
distances tend to 0 (although possibly slower than any multiple of ǫ), so we have arbitrarily
small circumradii and the result follows by Lemma 2. Otherwise, we have either infinitely many
of the circles gpXǫ q passing through A, or infinitely many passing through B, and the same
argument as in the previous case enables us to reduce to Lemma 4. l
Lemmas 3 and 5 together cover all cases, and so the required result is proved.
80 Bath — UK, 11th–22nd July 2019

Comment. From the property that all circles gpXq pass through the same point P , it is possible to
deduce that the function f has the form given in Solution 1. For any line ℓ not passing through P we
may define a corresponding angle αpℓq, which we must show is the same for all such lines. For any
point X ‰ P , with at least one line ℓ through X and not through P , such that f pℓq ‰ X, this angle
must be equal for all such lines through X (by (directed) angles in the same segment of gpXq).
Now consider all horizontal and all vertical lines not through P . For any pair consisting of a
horizontal line ℓ1 and a vertical line ℓ2 , we have αpℓ1 q “ αpℓ2 q unless f pℓ1 q or f pℓ2 q is the point of
intersection of those lines. Consider the bipartite graph whose vertices are those lines and where an
edge joins a horizontal and a vertical line with the same value of α. Considering a subgraph induced
by n horizontal and n vertical lines, it must have at least n2 ´ 2n edges, so some horizontal line has
edges to at least n ´ 2 of the vertical lines. Thus, in the original graph, all but at most two of the
vertical lines have the same value of α, and likewise all but at most two of the horizontal lines have
the same value of α, and, restricting attention to suitable subsets of those lines, we see that this value
must be the same for the vertical lines and for the horizontal lines.
But now we can extend this to all vertical and horizontal lines not through P (and thus to lines
in other directions as well, since the only requirement for ‘vertical’ and ‘horizontal’ above is that they
are any two nonparallel directions). Consider any horizontal line ℓ1 not passing through P , and we
wish to show that αpℓ1 q has the same value α it has for all but at most two lines not through P in any
direction. Indeed, we can deduce this by considering the intersection with any but at most five of the
vertical lines: the only ones to exclude are the one passing through P , the one passing through f pℓ1 q,
at most two such that αpℓq ‰ α, and the one passing through hP,α pℓ1 q (defined as in Solution 1). So
all lines ℓ not passing through P have the same value of αpℓq.

Solution 4. For any point X, denote by tpXq the line tangent to gpXq at X; notice that
f ptpXqq “ X, so f is surjective.

Step 1: We find a point P for which there are at least two different lines p1 and p2 such that
f ppi q “ P .
Choose any point X. If X does not have this property, take any Y P gpXq z tXu; then
f pXY q “ Y . If Y does not have the property, tpY q “ XY , and the circles gpXq and gpY q meet
again at some point Z. Then f pXZq “ Z “ f pY Zq, so Z has the required property.

We will show that P is the desired point. From now on, we fix two different lines p1
and p2 with f pp1 q “ f pp2 q “ P . Assume for contradiction that f pℓq “ Q ‰ P for some line ℓ
through P . We fix ℓ, and note that Q P gpP q.

Step 2: We prove that P P gpQq.


Take an arbitrary point X P ℓ z tP, Qu. Two cases are possible for the position of tpXq
in relation to the pi ; we will show that each case (and subcase) occurs for only finitely many
positions of X, yielding a contradiction.

Case 2.1: tpXq is parallel to one of the pi ; say, to p1 .


Let tpXq cross p2 at R. Then gpRq is the circle pP RXq, as f pRP q “ P and f pRXq “ X.
Let RQ cross gpRq again at S. Then f pRQq P tR, Su X gpQq, so gpQq contains one of the
points R and S.
If R P gpQq, then R is one of finitely many points in the intersection gpQq X p2 , and each of
them corresponds to a unique position of X, since RX is parallel to p1 .
If S P gpQq, then =pQS, SP q “ =pRS, SP q “ =pRX, XP q “ =pp1 , ℓq, so =pQS, SP q is
constant for all such points X, and all points S obtained in such a way lie on one circle γ
passing through P and Q. Since gpQq does not contain P , it is different from γ, so there are
only finitely many points S. Each of them uniquely determines R and thus X.
Shortlisted problems – solutions 81

p2


X tpXq
Q
P
gpXq

p1

gpRq

So, Case 2.1 can occur for only finitely many points X.
Case 2.2: tpXq crosses p1 and p2 at R1 and R2 , respectively.
Clearly, R1 ‰ R2 , as tpXq is the tangent to gpXq at X, and gpXq meets ℓ only at X and Q.
Notice that gpRi q is the circle pP XRi q. Let Ri Q meet gpRi q again at Si ; then Si ‰ Q, as gpRi q
meets ℓ only at P and X. Then f pRi Qq P tRi , Si u, and we distinguish several subcases.

p2

R2
S1

X
Q
gpXq
P
S2
gpR2 q

R1
p1

tpXq
gpR1 q

Subcase 2.2.1: f pR1 Qq “ S1 , f pR2 Qq “ S2 ; so S1 , S2 P gpQq.


In this case we have 0 “ =pR1 X, XP q ` =pXP, R2 Xq “ =pR1 S1 , S1 P q ` =pS2 P, S2R2 q “
=pQS1 , S1 P q ` =pS2 P, S2 Qq, which shows P P gpQq.
Subcase 2.2.2: f pR1 Qq “ R1 , f pR2 Qq “ R2 ; so R1 , R2 P gpQq.
This can happen for at most four positions of X – namely, at the intersections of ℓ with a
line of the form K1 K2 , where Ki P gpQq X pi .
82 Bath — UK, 11th–22nd July 2019

Subcase 2.2.3: f pR1 Qq “ S1 , f pR2 Qq “ R2 (the case f pR1 Qq “ R1 , f pR2 Qq “ S2 is similar).


In this case, there are at most two possible positions for R2 – namely, the meeting points
of gpQq with p2 . Consider one of them. Let X vary on ℓ. Then R1 is the projection of X to p1
via R2 , S1 is the projection of R1 to gpQq via Q. Finally, =pQS1 , S1 Xq “ =pR1 S1 , S1 Xq “
=pR1 P, P Xq “ =pp1 , ℓq ‰ 0, so X is obtained by a fixed projective transform gpQq Ñ ℓ from S1 .
So, if there were three points X satisfying the conditions of this subcase, the composition of the
three projective transforms would be the identity. But, if we apply it to X “ Q, we successively
get some point R11 , then R2 , and then some point different from Q, a contradiction.
Thus Case 2.2 also occurs for only finitely many points X, as desired.

Step 3: We show that f pP Qq “ P , as desired.


The argument is similar to that in Step 2, with the roles of Q and X swapped. Again, we
show that there are only finitely many possible positions for a point X P ℓ z tP, Qu, which is
absurd.
Case 3.1: tpQq is parallel to one of the pi ; say, to p1 .
Let tpQq cross p2 at R; then gpRq is the circle pP RQq. Let RX cross gpRq again at S. Then
f pRXq P tR, Su X gpXq, so gpXq contains one of the points R and S.
p2
R

Q
X
P tpQq

S
p1
gpRq
gpQq

Subcase 3.1.1: S “ f pRXq P gpXq.


We have =ptpXq, QXq “ =pSX, SQq “ =pSR, SQq “ =pP R, P Qq “ =pp2 , ℓq. Hence
tpXq k p2 . Now we recall Case 2.1: we let tpXq cross p1 at R1 , so gpR1 q “ pP R1 Xq, and let R1 Q
meet gpR1 q again at S 1 ; notice that S 1 ‰ Q. Excluding one position of X, we may assume that
R1 R gpQq, so R1 ‰ f pR1 Qq. Therefore, S 1 “ f pR1 Qq P gpQq. But then, as in Case 2.1, we get
=ptpQq, P Qq “ =pQS 1 , S 1P q “ =pR1 X, XP q “ =pp2 , ℓq. This means that tpQq is parallel to p2 ,
which is impossible.
Subcase 3.1.2: R “ f pRXq P gpXq.
In this case, we have =ptpXq, ℓq “ =pRX, RQq “ =pRX, p1 q. Again, let R1 “ tpXqXp1 ; this
point exists for all but at most one position of X. Then gpR1 q “ pR1 XP q; let R1 Q meet gpR1q
again at S 1 . Due to =pR1 X, XRq “ =pQX, QRq “ =pℓ, p1 q, R1 determines X in at most two
ways, so for all but finitely many positions of X we have R1 R gpQq. Therefore, for those
positions we have S 1 “ f pR1 Qq P gpQq. But then =pRX, p1 q “ =pR1 X, XP q “ =pR1 S 1 , S 1 P q “
=pQS 1 , S 1 P q “ =ptpQq, QP q is fixed, so this case can hold only for one specific position of X
as well.
Thus, in Case 3.1, there are only finitely many possible positions of X, yielding a contra-
diction.
Shortlisted problems – solutions 83

Case 3.2: tpQq crosses p1 and p2 at R1 and R2 , respectively.


By Step 2, R1 ‰ R2 . Notice that gpRi q is the circle pP QRi q. Let Ri X meet gpRi q at Si ;
then Si ‰ X. Then f pRi Xq P tRi , Si u, and we distinguish several subcases.

gpR2 q
p2

R2
S1 ℓ
Q
X
P
S2

gpQq
R1
p1

tpQq

gpR1 q

Subcase 3.2.1: f pR1 Xq “ S1 and f pR2 Xq “ S2 , so S1 , S2 P gpXq.


As in Subcase 2.2.1, we have 0 “ =pR1 Q, QP q`=pQP, R2 Qq “ =pXS1 , S1 P q`=pS2 P, S2Xq,
which shows P P gpXq. But X, Q P gpXq as well, so gpXq meets ℓ at three distinct points,
which is absurd.
Subcase 3.2.2: f pR1 Xq “ R1 , f pR2 Xq “ R2 , so R1 , R2 P gpXq.
Now three distinct collinear points R1 , R2 , and Q belong to gpXq, which is impossible.
Subcase 3.2.3: f pR1 Xq “ S1 , f pR2 Xq “ R2 (the case f pR1 Xq “ R1 , f pR2 Xq “ S2 is similar).
We have =pXR2 , R2 Qq “ =pXS1 , S1 Qq “ =pR1 S1 , S1 Qq “ =pR1 P, P Qq “ =pp1 , ℓq, so this
case can occur for a unique position of X.
Thus, in Case 3.2, there is only a unique position of X, again yielding the required contra-
diction.
84 Bath — UK, 11th–22nd July 2019

Number Theory
N1. Find all pairs pm, nq of positive integers satisfying the equation

p2n ´ 1qp2n ´ 2qp2n ´ 4q ¨ ¨ ¨ p2n ´ 2n´1 q “ m! p1q

(El Salvador)

Answer: The only such pairs are p1, 1q and p3, 2q.

Common remarks. In all solutions, for any prime p and positive integer N, we will denote
by vp pNq the exponent of the largest power of p that divides N. The left-hand side of p1q will
be denoted by Ln ; that is, Ln “ p2n ´ 1qp2n ´ 2qp2n ´ 4q ¨ ¨ ¨ p2n ´ 2n´1 q.

Solution 1. We will get an upper bound on n from the speed at which v2 pLn q grows.

From

Ln “ p2n ´ 1qp2n ´ 2q ¨ ¨ ¨ p2n ´ 2n´1 q “ 21`2`¨¨¨`pn´1q p2n ´ 1qp2n´1 ´ 1q ¨ ¨ ¨ p21 ´ 1q

we read
npn ´ 1q
v2 pLn q “ 1 ` 2 ` ¨ ¨ ¨ ` pn ´ 1q “ .
2
On the other hand, v2 pm!q is expressed by the Legendre formula as
8 Y
ÿ m]
v2 pm!q “ .
i“1
2i

As usual, by omitting the floor functions,


8
ÿ m
v2 pm!q ă “ m.
i“1
2i

Thus, Ln “ m! implies the inequality

npn ´ 1q
ă m. p2q
2

In order to obtain an opposite estimate, observe that


2
Ln “ p2n ´ 1qp2n ´ 2q ¨ ¨ ¨ p2n ´ 2n´1 q ă p2n qn “ 2n .

We claim that ˆ ˙
n2 npn ´ 1q
2 ă ! for n ě 6. p3q
2
` ˘
For n “ 6 the estimate p3q is true because 26 ă 6.9 ¨ 1010 and npn´1q
2
2
! “ 15! ą 1.3 ¨ 1012 .
For n ě 7 we prove p3q by the following inequalities:
ˆ ˙
npn ´ 1q npn ´ 1q npn´1q
! “ 15! ¨ 16 ¨ 17 ¨ ¨ ¨ ą 236 ¨ 16 2 ´15
2 2
2 2
“ 22npn´1q´24 “ 2n ¨ 2npn´2q´24 ą 2n .
Shortlisted problems – solutions 85

Putting together p2q and p3q, for n ě 6 we get a contradiction, since


ˆ ˙
n2 npn ´ 1q
Ln ă 2 ă ! ă m! “ Ln .
2

Hence n ě 6 is not possible.


Checking manually the cases n ď 5 we find

L1 “ 1 “ 1!, L2 “ 6 “ 3!, 5! ă L3 “ 168 ă 6!,


7! ă L4 “ 20 160 ă 8! and 10! ă L5 “ 9 999 360 ă 11!.

So, there are two solutions: (


pm, nq P p1, 1q, p3, 2q .

Solution 2. Like in the previous solution, the cases n “ 1, 2, 3, 4 are checked manually. We
will exclude n ě 5 by considering the exponents of 3 and 31 in p1q.
For odd primes p and distinct integers a, b, coprime to p, with p | a ´ b, the Lifting The
Exponent lemma asserts that

vp pak ´ bk q “ vp pa ´ bq ` vp pkq.

Notice that 3 divides 2k ´ 1 if only if k is even; moreover, by the Lifting The Exponent lemma
we have
v3 p22k ´ 1q “ v3 p4k ´ 1q “ 1 ` v3 pkq “ v3 p3kq.
Hence, ÿ ÿ
v3 pLn q “ v3 p4k ´ 1q “ v3 p3kq.
2kďn kďt n
2
u
` ˘
Notice that the last expression is precisely the exponent of 3 in the prime factorisation of 3t n2 u !.
Therefore
ˆ´ ˙
X n \¯
v3 pm!q “ v3 pLn q “ v3 3 2 !
Z ^ Z ^
n n
3 ďmď3 ` 2. (4)
2 2

Suppose that n ě 5. Note that every fifth factor in Ln is divisible by 31 “ 25 ´ 1, and hence
we have v31 pLn q ě t n5 u. Then

n Yn] ÿ8 Y
m] ÿ m
8
m
ď ď v31 pLn q “ v31 pm!q “ k
ă k
“ . p5q
10 5 k“1
31 k“1
31 30

By combining p4q and p5q,


3n
3n ă m ď `2
2
4
so n ă 3
which is inconsistent with the inequality n ě 5.

Comment 1. There are many combinations of the ideas above; for example combining p2q and p4q
also provides n ă 5. Obviously, considering the exponents of any two primes in p1q, or considering one
prime and the magnitude orders lead to an upper bound on n and m.
86 Bath — UK, 11th–22nd July 2019

Comment 2. This problem has a connection to group theory. Indeed, the left-hand side is the
order of the group GLn pF2 q of invertible n-by-n matrices with entries modulo 2, while the right-hand
side is the order of the symmetric group Sm on m elements. The result thus shows that the only
possible isomorphisms between these groups are GL1 pF2 q – S1 and GL2 pF2 q – S3 , and there are in
fact isomorphisms in both cases. In general, GLn pF2 q is a simple group for n ě 3, as it is isomorphic
to P SLn pF2 q.
There is also a near-solution of interest: the left-hand side for n “ 4 is half of the right-hand side
when m “ 8; this turns out to correspond to an isomorphism GL4 pF2 q – A8 with the alternating group
on eight elements.
However, while this indicates that the problem is a useful one, knowing group theory is of no use
in solving it!
Shortlisted problems – solutions 87

N2. Find all triples pa, b, cq of positive integers such that a3 ` b3 ` c3 “ pabcq2 .
(Nigeria)

Answer: The solutions are p1, 2, 3q and its permutations.

Common remarks. Note that the equation is symmetric. In all solutions, we will assume
without loss of generality that a ě b ě c, and prove that the only solution is pa, b, cq “ p3, 2, 1q.
The first two solutions all start by proving that c “ 1.

Solution 1. We will start by proving that c “ 1. Note that

3a3 ě a3 ` b3 ` c3 ą a3 .

So 3a3 ě pabcq2 ą a3 and hence 3a ě b2 c2 ą a. Now b3 ` c3 “ a2 pb2 c2 ´ aq ě a2 , and so

18b3 ě 9pb3 ` c3 q ě 9a2 ě b4 c4 ě b3 c5 ,

so 18 ě c5 which yields c “ 1.
Now, note that we must have a ą b, as otherwise we would have 2b3 ` 1 “ b4 which has no
positive integer solutions. So
a3 ´ b3 ě pb ` 1q3 ´ b3 ą 1
and
2a3 ą 1 ` a3 ` b3 ą a3 ,
which implies 2a3 ą a2 b2 ą a3 and so 2a ą b2 ą a. Therefore

4p1 ` b3 q “ 4a2 pb2 ´ aq ě 4a2 ą b4 ,

so 4 ą b3 pb ´ 4q; that is, b ď 4.


Now, for each possible value of b with 2 ď b ď 4 we obtain a cubic equation for a with
constant coefficients. These are as follows:

b“2: a3 ´ 4a2 ` 9 “ 0
b“3: a3 ´ 9a2 ` 28 “ 0
b“4: a3 ´ 16a2 ` 65 “ 0.

The only case with an integer solution for a with b ď a is b “ 2, leading to pa, b, cq “ p3, 2, 1q.

Comment 1.1. Instead of writing down each cubic equation explicitly, we could have just observed
that a2 | b3 ` 1, and for each choice of b checked each square factor of b3 ` 1 for a2 .
We could also have observed that, with c “ 1, the relation 18b3 ě b4 c4 becomes b ď 18, and we
can simply check all possibilities for b (instead of working to prove that b ď 4). This check becomes
easier after using the factorisation b3 ` 1 “ pb ` 1qpb2 ´ b ` 1q and observing that no prime besides 3
can divide both of the factors.

Comment 1.2. Another approach to finish the problem after establishing that c ď 1 is to set
k “ b2 c2 ´ a, which is clearly an integer and must be positive as it is equal to pb3 ` c3 q{a2 . Then we
divide into cases based on whether k “ 1 or k ě 2; in the first case, we have b3 ` 1 “ a2 “ pb2 ´ 1q2
whose only positive root is b “ 2, and in the second case we have b2 ď 3a, and so
9 9
b4 ď p3aq2 ď pka2 q “ pb3 ` 1q,
2 2
which implies that b ď 4.
88 Bath — UK, 11th–22nd July 2019

Solution 2. Again, we will start by proving that c “ 1. Suppose otherwise a that c ě 2. We


have a3 ` b3 ` c3 ď 3a3 , so b2 c2 ď 3a. Since c ě 2, this tells us that b ď 3a{4. As the
right-hand side of the original equation is a multiple of a2 , we have a2 ď 2b3 ď 2p3a{4q3{2 . In
other words, a ď 27 16
ă 2, which contradicts the assertion that a ě c ě 2. So there are no
solutions in this case, and so we must have c “ 1.
Now, the original equation becomes a3 ` b3 ` 1 “ a2 b2 . Observe that a ě 2, since otherwise
a “ b “ 1 as a ě b.
The right-hand side is a multiple of a2 , so the left-hand side must be as well. Thus, b3 ` 1 ě
a2 . Since a ě b, we also have
b3 ` 1 1
b2 “ a ` ď 2a `
a2 a2
and so b2 ď 2a since b2 is an integer. Thus p2aq3{2 ` 1 ě b3 ` 1 ě a2 , from which we deduce
a ď 8.
Now, for each possible value of a with 2 ď a ď 8 we obtain a cubic equation for b with
constant coefficients. These are as follows:

a“2: b3 ´ 4b2 ` 9 “ 0
a“3: b3 ´ 9b2 ` 28 “ 0
a“4: b3 ´ 16b2 ` 65 “ 0
a“5: b3 ´ 25b2 ` 126 “ 0
a“6: b3 ´ 36b2 ` 217 “ 0
a“7: b3 ´ 49b2 ` 344 “ 0
a“8: b3 ´ 64b2 ` 513 “ 0.

The only case with an integer solution for b with a ě b is a “ 3, leading to pa, b, cq “ p3, 2, 1q.

Comment 2.1. As in Solution 1, instead of writing down each cubic equation explicitly, we could
have just observed that b2 | a3 ` 1, and for each choice of a checked each square factor of a3 ` 1 for b2 .

Comment 2.2. This solution does not require initially proving that c “ 1, in which case the bound
would become a ď 108. The resulting cases could, in principle, be checked by a particularly industrious
student.

Solution 3. Set k “ pb3 ` c3 q{a2 ď 2a, and rewrite the original equation as a ` k “ pbcq2 .
Since b3 and c3 are positive integers, we have pbcq3 ě b3 ` c3 ´ 1 “ ka2 ´ 1, so

a ` k ě pka2 ´ 1q2{3 .

As in Comment 1.2, k is a positive integer; for each value of k ě 1, this gives us a polynomial
inequality satisfied by a:

k 2 a4 ´ a3 ´ 5ka2 ´ 3k 2 a ´ pk 3 ´ 1q ď 0.

We now prove that a ď 3. Indeed,

k 2 a4 ´ a3 ´ 5ka2 ´ 3k 2 a ´ pk 3 ´ 1q
0ě ě a4 ´ a3 ´ 5a2 ´ 3a ´ k ě a4 ´ a3 ´ 5a2 ´ 5a,
k2
which fails when a ě 4.
This leaves ten triples with 3 ě a ě b ě c ě 1, which may be checked manually to give
pa, b, cq “ p3, 2, 1q.
Shortlisted problems – solutions 89

Solution 4. Again, observe that b3 ` c3 “ a2 pb2 c2 ´ aq, so b ď a ď b2 c2 ´ 1.


We consider the function f pxq “ x2 pb2 c2 ´ xq. It can be seen that that on the interval
r0, b2 c2 ´ 1s the function f is increasing if x ă 32 b2 c2 and decreasing if x ą 23 b2 c2 . Consequently,
it must be the case that
´ ¯
b3 ` c3 “ f paq ě min f pbq, f pb2 c2 ´ 1q .

First, suppose that b3 ` c3 ě f pb2 c2 ´ 1q. This may be written b3 ` c3 ě pb2 c2 ´ 1q2 , and so

2b3 ě b3 ` c3 ě pb2 c2 ´ 1q2 ą b4 c4 ´ 2b2 c2 ě b4 c4 ´ 2b3 c4 .

Thus, pb ´ 2qc4 ă 2, and the only solutions to this inequality have pb, cq “ p2, 2q or b ď 3 and
c “ 1. It is easy to verify that the only case giving a solution for a ě b is pa, b, cq “ p3, 2, 1q.
Otherwise, suppose that b3 ` c3 “ f paq ě f pbq. Then, we have

2b3 ě b3 ` c3 “ a2 pb2 c2 ´ aq ě b2 pb2 c2 ´ bq.

Consequently bc2 ď 3, with strict inequality in the case that b ‰ c. Hence c “ 1 and b ď 2.
Both of these cases have been considered already, so we are done.

Comment 4.1. Instead of considering which of f pbq and f pb2 c2 ´ 1q is less than f paq, we may also
proceed by explicitly dividing into cases based on whether a ě 32 b2 c2 or a ă 32 b2 c2 . The first case may
now be dealt with as follows. We have b3 c3 ` 1 ě b3 ` c3 as b3 and c3 are positive integers, so we have
4
b3 c3 ` 1 ě b3 ` c3 ě a2 ě b4 c4 .
9
This implies bc ď 2, and hence c “ 1 and b ď 2.
90 Bath — UK, 11th–22nd July 2019

N3. We say that a set S of integers is rootiful if, for any positive integer n and any
a0 , a1 , . . . , an P S, all integer roots of the polynomial a0 ` a1 x ` ¨ ¨ ¨ ` an xn are also in S. Find
all rootiful sets of integers that contain all numbers of the form 2a ´ 2b for positive integers
a and b.
(Czech Republic)

Answer: The set Z of all integers is the only such rootiful set.

Solution 1. The set Z of all integers is clearly rootiful. We shall prove that any rootiful set S
containing all the numbers of the form 2a ´ 2b for a, b P Zą0 must be all of Z.
First, note that 0 “ 21 ´ 21 P S and 2 “ 22 ´ 21 P S. Now, ´1 P S, since it is a root of
2x ` 2, and 1 P S, since it is a root of 2x2 ´ x ´ 1. Also, if n P S then ´n is a root of x ` n, so
it suffices to prove that all positive integers must be in S.
Now, we claim that any positive integer n has a multiple in S. Indeed, suppose that n “ 2α ¨t
for α P Zě0 and t odd. Then t | 2φptq ´ 1, so n | 2α`φptq`1 ´ 2α`1 . Moreover, 2α`φptq`1 ´ 2α`1 P S,
and so S contains a multiple of every positive integer n.
We will now prove by induction that all positive integers are in S. Suppose that 0, 1, . . . , n´
1 P S; furthermore, let N be a multiple of n in S. Consider the base-n expansion of N, say
N “ ak nk `ak´1 nk´1 `¨ ¨ ¨`a1 n`a0 . Since 0 ď ai ă n for each ai , we have that all the ai are in S.
Furthermore, a0 “ 0 since N is a multiple of n. Therefore, ak nk ` ak´1nk´1 ` ¨ ¨ ¨ ` a1 n ´ N “ 0,
so n is a root of a polynomial with coefficients in S. This tells us that n P S, completing the
induction.

Solution 2. As in the previous solution, we can prove that 0, 1 and ´1 must all be in any
rootiful set S containing all numbers of the form 2a ´ 2b for a, b P Zą0 .
We show that, in fact, every integer k with |k| ą 2 can be expressed as a root of a polynomial
whose coefficients are of the form 2a ´ 2b . Observe that it suffices to consider the case where k
is positive, as if k is a root of an xn ` ¨ ¨ ¨ ` a1 x ` a0 “ 0, then ´k is a root of p´1qn an xn ` ¨ ¨ ¨ ´
a1 x ` a0 “ 0.
Note that
p2an ´ 2bn qk n ` ¨ ¨ ¨ ` p2a0 ´ 2b0 q “ 0
is equivalent to
2an k n ` ¨ ¨ ¨ ` 2a0 “ 2bn k n ` ¨ ¨ ¨ ` 2b0 .
Hence our aim is to show that two numbers of the form 2an k n ` ¨ ¨ ¨ ` 2a0 are equal, for a
fixed value of n. We consider such polynomials where every term 2ai k i is at most 2k n ; in other
words, where 2 ď 2ai ď 2k n´i , or, equivalently, 1 ď ai ď 1 ` pn ´ iq log2 k. Therefore, there
must be 1 ` tpn ´ iq log2 ku possible choices for ai satisfying these constraints.
The number of possible polynomials is then
n
ź n´1
ź
p1 ` tpn ´ iq log2 kuq ě pn ´ iq log2 k “ n!plog2 kqn
i“0 i“0

where the inequality holds as 1 ` txu ě x.


As there are pn ` 1q such terms in the polynomial, each at most 2k n , such a polynomial
must have value at most 2k n pn ` 1q. However, for large n, we have n!plog2 kqn ą 2k n pn ` 1q.
Therefore there are more polynomials than possible values, so some two must be equal, as
required.
Shortlisted problems – solutions 91

N4. Let Zą0 be the set of positive integers. A positive integer constant C is given. Find
all functions f : Zą0 Ñ Zą0 such that, for all positive integers a and b satisfying a ` b ą C,

a ` f pbq | a2 ` b f paq. (˚)

(Croatia)

Answer: The functions satisfying (˚) are exactly the functions f paq “ ka for some constant
k P Zą0 (irrespective of the value of C).

Common remarks. It is easy to verify that the functions f paq “ ka satisfy (˚). Thus, in the
proofs below, we will only focus on the converse implication: that condition (˚) implies that
f “ ka.
A common minor part of these solutions is the derivation of some relatively easy bounds on
the function f . An upper bound is easily obtained by setting a “ 1 in (˚), giving the inequality

f pbq ď b ¨ f p1q

for all sufficiently large b. The corresponding lower bound is only marginally more difficult to
obtain: substituting b “ 1 in the original equation shows that

a ` f p1q | pa2 ` f paqq ´ pa ´ f p1qq ¨ pa ` f p1qq “ f p1q2 ` f paq

for all sufficiently large a. It follows from this that one has the lower bound

f paq ě a ` f p1q ¨ p1 ´ f p1qq,

again for all sufficiently large a.


Each of the following proofs makes use of at least one of these bounds.

Solution 1. First, we show that b | f pbq2 for all b. To do this, we choose a large positive
integer n so that nb ´ f pbq ě C. Setting a “ nb ´ f pbq in (˚) then shows that

nb | pnb ´ f pbqq2 ` bf pnb ´ f pbqq

so that b | f pbq2 as claimed.


Now in particular we have that p | f ppq for every prime p. If we write f ppq “ kppq ¨ p, then
the bound f ppq ď f p1q ¨ p (valid for p sufficiently large) shows that some value k of kppq must
be attained for infinitely many p. We will show that f paq “ ka for all positive integers a. To
do this, we substitute b “ p in (˚), where p is any sufficiently large prime for which kppq “ k,
obtaining
a ` kp | pa2 ` pf paqq ´ apa ` kpq “ pf paq ´ pka.
For suitably large p we have gcdpa ` kp, pq “ 1, and hence we have

a ` kp | f paq ´ ka.

But the only way this can hold for arbitrarily large p is if f paq ´ ka “ 0. This concludes the
proof.

Comment. There are other ways to obtain the divisibility p | f ppq for primes p, which is all that
is needed in this proof. For instance, if f ppq were not divisible by p then the arithmetic progression
p2 ` bf ppq would attain prime values for infinitely many b by Dirichlet’s Theorem: hence, for these
pairs p, b, we would have p ` f pbq “ p2 ` bf ppq. Substituting a ÞÑ b and b ÞÑ p in (˚) then shows that
pf ppq2 ´ p2 qpp ´ 1q is divisible by b ` f ppq and hence vanishes, which is impossible since p ∤ f ppq by
assumption.
92 Bath — UK, 11th–22nd July 2019

Solution 2. First, we substitute b “ 1 in (˚) and rearrange to find that


f paq ` f p1q2 a2 ` f paq
“ f p1q ´ a `
a ` f p1q a ` f p1q
is a positive integer for sufficiently large a. Since f paq ď af p1q, for all sufficiently large a, it
p1q2 p1q2
follows that f paq`f
a`f p1q
ď f p1q also and hence there is a positive integer k such that f paq`f
a`f p1q
“k
for infinitely many values of a. In other words,
f paq “ ka ` f p1q ¨ pk ´ f p1qq
for infinitely many a.
Fixing an arbitrary choice of a in (˚), we have that
a2 ` bf paq
a ` kb ` f p1q ¨ pk ´ f p1qq
is an integer for infinitely many b (the same b as above, maybe with finitely many exceptions).
On the other hand, for b taken sufficiently large, this quantity becomes arbitrarily close to f paq
k
;
f paq
this is only possible if k is an integer and
a2 ` bf paq f paq

a ` kb ` f p1q ¨ pk ´ f p1qq k
for infinitely many b. This rearranges to
f paq ` ˘
¨ a ` f p1q ¨ pk ´ f p1qq “ a2 . (˚˚)
k
Hence a2 is divisible by a ` f p1q ¨ pk ´ f p1qq, and hence so is f p1q2 pk ´ f p1qq2 . The only way
this can occur for all a is if k “ f p1q, in which case (˚˚) provides that f paq “ ka for all a, as
desired.
Solution 3. Fix any two distinct positive integers a and b. From (˚) it follows that the two
integers
pa2 ` cf paqq ¨ pb ` f pcqq and pb2 ` cf pbqq ¨ pa ` f pcqq
are both multiples of pa ` f pcqq ¨ pb ` f pcqq for all sufficiently large c. Taking an appropriate
linear combination to eliminate the cf pcq term, we find after expanding out that the integer
“ 2 ‰ “ ‰ “ ‰
a f pbq ´ b2 f paq ¨ f pcq ` pb ´ aqf paqf pbq ¨ c ` abpaf pbq ´ bf paqq (:)
is also a multiple of pa ` f pcqq ¨ pb ` f pcqq.
But as c varies, (:) is bounded above by a positive multiple of c while pa ` f pcqq ¨ pb ` f pcqq
is bounded below by a positive multiple of c2 . The only way that such a divisibility can hold
is if in fact
“ 2 ‰ “ ‰ “ ‰
a f pbq ´ b2 f paq ¨ f pcq ` pb ´ aqf paqf pbq ¨ c ` abpaf pbq ´ bf paqq “ 0 (::)
for sufficiently large c. Since the coefficient of c in this linear relation is nonzero, it follows that
there are constants k, ℓ such that f pcq “ kc ` ℓ for all sufficiently large c; the constants k and ℓ
are necessarily integers.
The value of ℓ satisfies
“ 2 ‰ “ ‰
a f pbq ´ b2 f paq ¨ ℓ ` abpaf pbq ´ bf paqq “ 0 (:::)
and hence b | ℓa2 f pbq for all a and b. Taking b sufficiently large so that f pbq “ kb ` ℓ, we thus
have that b | ℓ2 a2 for all sufficiently large b; this implies that ℓ “ 0. From (:::) it then follows
that f paq
a
“ f pbq
b
for all a ‰ b, so that there is a constant k such that f paq “ ka for all a (k is
equal to the constant defined earlier).
Shortlisted problems – solutions 93

Solution 4. Let Γ denote the set of all points pa, f paqq, so that Γ is an infinite subset of
the upper-right quadrant of the plane. For a point A “ pa, f paqq in Γ, we define a point
A1 “ p´f paq, ´f paq2 {aq in the lower-left quadrant of the plane, and let Γ1 denote the set of all
such points A1 .

C
A
B
O
B1

C1
A1

Claim. For any point A P Γ, the set Γ is contained in finitely many lines through the point A1 .
Proof. Let A “ pa, f paqq. The functional equation (with a and b interchanged) can be rewritten
as b ` f paq | af pbq ´ bf paq, so that all but finitely many points in Γ are contained in one of the
lines with equation
ay ´ f paqx “ mpx ` f paqq
for m an integer. Geometrically, these are the lines through A1 “ p´f paq, ´f paq2{aq with
gradient f paq`m
a
. Since Γ is contained, with finitely many exceptions, in the region 0 ď y ď
f p1q ¨ x and the point A1 lies strictly in the lower-left quadrant of the plane, there are only
finitely many values of m for which this line meets Γ. This concludes the proof of the claim.
l
1 1
Now consider any distinct points A, B P Γ. It is clear that A and B are distinct. A line
through A1 and a line through B 1 only meet in more than one point if these two lines are equal
to the line A1 B 1 . It then follows from the above claim that the line A1 B 1 must contain all but
finitely many points of Γ. If C is another point of Γ, then the line A1 C 1 also passes through all
but finitely many points of Γ, which is only possible if A1 C 1 “ A1 B 1 .
We have thus seen that there is a line ℓ passing through all points of Γ1 and through all
but finitely many points of Γ. We claim that this line passes through the origin O and passes
through every point of Γ. To see this, note that by construction A, O, A1 are collinear for every
point A P Γ. Since ℓ “ AA1 for all but finitely many points A P Γ, it thus follows that O P ℓ.
Thus any A P Γ lies on the line ℓ “ A1 O.
Since Γ is contained in a line through O, it follows that there is a real constant k (the
gradient of ℓ) such that f paq “ ka for all a. The number k is, of course, a positive integer.

Comment. Without the a ` b ą C condition, this problem is approachable by much more naive
methods. For instance, using the given divisibility for a, b P t1, 2, 3u one can prove by a somewhat
tedious case-check that f p2q “ 2f p1q and f p3q “ 3f p1q; this then forms the basis of an induction
establishing that f pnq “ nf p1q for all n.
94 Bath — UK, 11th–22nd July 2019

` ˘
N5. Let a be a positive integer. We say that a positive integer b is a-good if anb
´ 1 is
divisible by an ` 1 for all positive integers n with an ě b. Suppose b is a positive integer such
that b is a-good, but b ` 2 is not a-good. Prove that b ` 1 is prime.
(Netherlands)

Solution 1. For p a prime and n a nonzero integer, we write vp pnq for the p-adic valuation
of n: the largest integer t such that pt | n.
We first show that b is a-good if and only `if b˘ is even, and p | a for all primes p ď b.
To start with, the condition that an ` 1 | anb
´ 1 can be rewritten as saying that

anpan ´ 1q ¨ ¨ ¨ pan ´ b ` 1q
” 1 pmod an ` 1q. (1)
b!
Suppose, on the one hand, there is a prime p ď b with p ∤ a. Take t “ vp pb!q. Then there
exist positive integers c such that ac ” 1 pmod pt`1 q. If we take c big enough, and then take
n “ pp ´ 1qc, then an “ app ´ 1qc ” p ´ 1 pmod pt`1 q and an ě b. Since p ď b, one of the terms
of the numerator anpan ´ 1q ¨ ¨ ¨ pan ´ b ` 1q is an ´ p ` 1, which is divisible by pt`1 . Hence
the p-adic valuation of
` the `an˘ is at least t ` 1, but that of the denominator
˘ numerator `an˘ is exactly t.
This means that p | an b
, so p ∤ b
´ 1. As p | an ` 1, we get that an ` 1 ∤ b
, so b is not
a-good.
On the other hand, if for all primes p ď b we have p | a, then every factor of b! is coprime
to an ` 1, and hence invertible modulo an ` 1: hence b! is also invertible modulo an ` 1. Then
equation (1) reduces to:

anpan ´ 1q ¨ ¨ ¨ pan ´ b ` 1q ” b! pmod an ` 1q.

However, we can rewrite the left-hand side as follows:

anpan ´ 1q ¨ ¨ ¨ pan ´ b ` 1q ” p´1qp´2q ¨ ¨ ¨ p´bq ” p´1qb b! pmod an ` 1q.

Provided that an ą 1, if b is even we deduce p´1qb b! ” b! as needed. On the other hand, if b is


odd, and we take an ` 1 ą 2pb!q, then we will not have p´1qb b! ” b!, so b is not a-good. This
completes the claim.
To conclude from here, suppose that b is a-good, but b ` 2 is not. Then b is even, and p | a
for all primes p ď b, but there is a prime q ď b ` 2 for which q ∤ a: so q “ b ` 1 or q “ b ` 2.
We cannot have q “ b ` 2, as that is even too, so we have q “ b ` 1: in other words, b ` 1 is
prime.

Solution 2. We show only half of the claim of the previous solution: we show that if b is
a-good, then p | a for all primes p ď b. We do this with Lucas’ theorem.
Suppose that we have p ď b with p ∤ a. Then consider the expansion of b in base p; there
will be some digit (not the final digit) which is nonzero, because p ď b. Suppose it is the pt digit
for t ě 1.
Now, as n varies over the integers, an ` 1 runs over all residue classes modulo pt`1 ; in
particular, there is a choice of n (with an ą b) such that the p0 `digit ˘ of an is p ´ 1 (so
t an
p | an `` 1)˘ and the p digit of an is 0. Consequently, p | an ` 1 but p | b (by Lucas’ theorem)
so p ∤ an b
´ 1. Thus b is not a-good.
Now we show directly that if b is a-good but b ` 2 fails to be so, then there must be a prime
` an ˘
dividing an ` 1 for some n, which also divides pb ` 1qpb ` 2q. Indeed, the ratio between b`2
` ˘
and an b
is pb ` 1qpb ` 2q{pan ´ bqpan ´ b ´ 1q. We know that there must be a choice of an ` 1
such that the former binomial coefficient is 1 modulo an ` 1 but the latter is not, which means
that the given ratio must not be 1 mod an` 1. If b` 1 and b` 2 are both coprime to an` 1 then
Shortlisted problems – solutions 95

the ratio is 1, so that must not be the case. In particular, as any prime less than b divides a,
it must be the case that either b ` 1 or b ` 2 is prime.
However, we can observe that b must be` even ˘ by insisting that an ` 1 is prime (which is
an b
possible by Dirichlet’s theorem) and hence b ” p´1q “ 1. Thus b ` 2 cannot be prime, so
b ` 1 must be prime.
96 Bath — UK, 11th–22nd July 2019

X? \ (
N6. Let H “ i 2 : i P Zą0 “ t1, 2, 4, 5, 7, . . .u, and let n be a positive?integer. Prove
that there exists a constant C such that, if A Ă t1, 2, . . . , nu satisfies |A| ě C n, then there
exist a, b P A such that a ´ b P H. (Here Zą0 is the set of positive integers, and tzu denotes the
greatest integer less than or equal to z.)
(Brazil)

Common remarks. In all solutions, we will ? assume that A is a set such that ta ´ b : a, b P Au
is disjoint from H, and prove that |A| ă C n.

Solution 1. First, observe that if n is a positive integer, then n P H exactly when


" *
n 1
? ą1´ ? . (1)
2 2
?
?observe?that n P H if and only if 0 ă i 2 ´ n ă 1 for some i P Zą0 . In other words,
To see why,
0 ă i ´ n{ 2 ă 1{ 2, which is equivalent to (1).
Now, write A “ ta1 ă a2 ă ¨ ¨ ¨ ă ak u, where k “ |A|. Observe that the set of differences is
not altered by shifting A, so we?may assume ? that A Ď t0, 1, . . . , n ´ 1u with a1 “ 0.
From (1), we learn
? that ta?
i { 2u ă 1 ´ 1{ 2 for each i ą 1 since ai ´ a1 R H. Furthermore,
we must have tai { 2u ă taj { 2u whenever i ă j; otherwise, we would have
ˆ ˙ " * " *
1 aj ai
´ 1´ ? ă ? ´ ? ă 0.
2 2 2
? ? ? ? ?
tpaj ´ ai q{ 2u “ taj { 2u ´ tai { 2u ` 1, this implies that tpaj ´ ai q{ 2u ą 1{ 2 ą
Since ?
1 ´ 1{ 2, contradicting (1).
Now, we have a sequence 0 “ a1 ă a2 ă ¨ ¨ ¨ ă ak ă n, with
" * " * " *
a1 a2 ak 1
0“ ? ă ? ă ¨¨¨ ă ? ă1´ ? .
2 2 2 2
We use the following fact: for any d P Z, we have
" *
d 1
? ą ? . (2)
2 2d 2
X ? \ ? ( ?
To see why this is the case, let h “ d{ 2 , so d{ 2 “ d{ 2 ´ h. Then
" *ˆ ˙
d d d2 ´ 2h2 1
? ? `h “ ě ,
2 2 2 2
? ?
since the numerator is a positive integer. Because?d{ 2 ` h?ă 2d{ 2, ? inequality (2) follows.
Let di “ ai`1 ´ ai , for 1 ď i ă k. Then tai`1 { 2u ´ tai { 2u “ tdi { 2u, and we have
1 ÿ " di * 1 ÿ 1 pk ´ 1q2 1 pk ´ 1q2 1
1´ ? ą ? ą ? ě ? ř ą ? ¨ . (3)
2 i 2 2 2 i
d i 2 2 i d i 2 2 n
? ?
Here, the first inequality holds because tak { 2u ă 1 ´ 1{ 2, the second follows from (2), the
third follows from an easy application
ř of the AM–HM inequality (or Cauchy–Schwarz), and the
fourth follows from the fact that i di “ ak ă n.
Rearranging this, we obtain
b ?
?
2 2 ´ 2 ¨ n ą k ´ 1,

which provides the required bound on k.


Shortlisted problems – solutions 97

? ? (
Solution 2. Let α “ 2 ` 2, so p1{αq ` p1{ 2q “ 1. Thus, J “ tiαu : i P Zą0 is the
complementary Beatty sequence to H (in other words, H and J are disjoint with H Y J “ Zą0 ).
Write A “ ta1 ă a2 ă ¨ ¨ ¨ ă ak u. Suppose that A has no differences in H, so all its differences
are in J and we can set ai ´ a1 “ tαbi u for bi P Zą0 .
For any j ą i, we have aj ´ai “ tαbj u´tαbi u. Because aj ´ai P J, we also have aj ´ai “ tαtu
for some positive integer t. Thus, tαtu “ tαbj u ´ tαbi u. The right hand side must equal either
tαpbj ´ bi qu or tαpbj ´ bi qu ´ 1, the latter of which is not a member of J as α ą 2. Therefore,
t “ bj ´ bi and so we have tαbj u ´ tαbi u “ tαpbj ´ bi qu.
For 1 ď i ă k we now put di “ bi`1 ´ bi , and we have
[ _
ÿ ÿ
α di “ tαbk u “ tαdi u ;
i i
ř
that is, i tαdi u ă 1. We also have
[ _
ÿ
1` α di “ 1 ` ak ´ a1 ď ak ď n
i
ř
so di ď n{α.
i
?With the above
? inequalities, an argument similar to (3)` (which2 uses ˘ fact that tαdu “
? the
td 2u ą 1{p2d 2q for positive integers d) proves that 1 ą pk ´ 1q {p2 2q pα{nq, which again
rearranges to give b ?
?
2 2 ´ 2 ¨ n ą k ´ 1.

Comment. The use of Beatty? sequences in Solution 2 is essentially a way to bypass (1).?Both Solutions
1 and 2 use the fact that 2 ă 2; the statement in the question would still be true if 2 did not have
this property (for instance, if it were replaced with α), but any argument along the lines of Solutions
1 or 2 would be more complicated.

Solution 3. Again, define J “ Zą0 z H, so all differences between elements of A are in J. We


start by making the following observation. Suppose we have a set B Ď t1, 2, . . . , nu such that
all of the differences between elements of B are in H. Then |A| ¨ |B| ď 2n.
To see why, observe that any two sums of the form a ` b with a P A, b P B are different;
otherwise, we would have a1 ` b1 “ a2 ` b2 , and so |a1 ´ a2 | “ |b2 ´ b1 |. However, then the left
hand side is in J whereas the right hand side is in H. Thus, ta ` b : a P A, b P Bu is a set of
size |A| ¨ |B| all of whose elements are no greater than 2n, yielding the claimed inequality.
With this in mind, it ? suffices to construct a1 set B, all of whose differences are in H and
1
whose size is at least C n for some constant C ą 0.
To do so, we will use well-known facts about the negative Pell equation X 2 ´ 2Y 2 “ ´1;
in particular, that there are infinitely many solutions and the values of X are given by the
recurrence X1?“ 1, X2 “ 7 ? and Xm “ 6Xm´1 ´ Xm´2 . Therefore, we may choose X to be a
solution with n{6 ă X ď n. ?
Now, we claim that we may choose B “ tX, 2X, . . . , tp1{3q nuXu. Indeed, we have
ˆ ˙ˆ ˙
X X ´1
? ´Y ? `Y “
2 2 2
and so
˙ ˆ
X ´3
0ą ? ´Y ě ? ,
2 2n
? ?
from which it follows that tX{ 2u ą 1 ´ p3{ 2nq. Combined with (1), this shows that all
differences between elements of B are in H.
98 Bath — UK, 11th–22nd July 2019

a ?
Comment. Some of the ideas behind Solution 3 may be used to prove that the constant C “ 2 2 ´ 2
(from Solutions 1 and 2) is optimal, in the sense that there are arbitrarily large values of n and sets
?
An Ď t1, 2, . . . , nu of size roughly C n, all of whose differences are contained in J.
To
? see why, choose ? X to come from a sufficiently large solution
? to?the Pell equation X 2 ´2Y 2 “ 1,?so
tX{ 2u « 1{p2X 2q. In particular, tXu, t2Xu, . . . , tt2X 2p1 ´ ? 1{ 2quXu?are all less than 1 ´ 1{ 2.
Thus, by (1) any ? positive integer
? of the form iX for 1 ď i ď t2X 2p1 ´ 1{? 2qu lies in
? J.
Set n «?2X 2 2p1?´ 1{ 2q. We now have a set A “ tiX : i ď t2X 2p1 ´ 1{ 2quu containing
roughly 2X 2p1 ´ 1{ 2q elements lessathan or equal to n such that all of the differences lie in J, and
? ?
we can see that |A| « C n with C “ 2 2 ´ 2.

Solution 4. As in Solution 3, we will provide a construction of a large set B Ď t1, 2, . . . , nu,


all of whose differences are in H.
Choose Y to be a solution to the Pell-like equation X 2 ´ 2Y 2 “ ˘1; such solutions are given
? recurrence Y?1 “ 1, Y2 “ 2 and Ym “ 2Ym´1 ` Ym´2 , and so we can choose Y such that
by the
n{p3 2q ă Y ď n{ 2. Furthermore, it is known that for such a Y and for 1 ď x ă Y ,
? ? ?
tx 2u ` tpY ´ xq 2u “ tY { 2u (4)

if X 2 ´ 2Y 2 “ 1, and ? ? ?
tx 2u ` tpY ´ xq 2u “ 1 ` tY { 2u (5)
if X 2 ´ 2Y ?
2
“ ´1. Indeed, this is a statement of the fact that X{Y is a best rational approxi-
mation to 2, from below in the ? first case
? and from above ? in the second.
Now, consider the sequence t 2u, t2 2u, . . . , tpY ´ 1q 2u. The Erdős–Szekeres
? theorem
?
tells us that this sequence has a monotone subsequence with at least Y ´ 2 ` 1 ą Y
elements; if that subsequence is decreasing,
? we?may reflect?(using (4) or ? (5)) to ensure that it
subsequence ty1 2u, ty2 2u, . . .?, tyt 2u ?
is increasing. Call the ? for t ą Y . ?
Now, set B “ ttyi 2u : 1 ď i ď tu. We have tyj 2u ´ tyi 2u “ tpyj ´ yi q 2u for i ă j
(because the
? corresponding inequality for the fractional parts holds by the ordering assumption
on the tyi 2u), which means that all differences between elements of B are indeed in H. Since
? ? a ?
|B| ą Y ą n{ 3 2, this is the required set.
?
Comment. Any solution to this problem will need to use the fact that 2 cannot be approximated
well by rationals, either
? directly or implicitly (for example, by using facts about solutions to Pell-
like equations). If 2 were replaced by a value of θ with very good rational approximations (from
below), then an argument along the lines of Solution 3 would give long arithmetic progressions in
ttiθu : 0 ď i ă nu (with initial term 0) for certain values of n.
Shortlisted problems – solutions 99

N7. Prove that there is a constant c ą 0 and infinitely many positive integers n with the
following property: there are infinitely many positive integers that cannot be expressed as the
sum of fewer than cn logpnq pairwise coprime nth powers.
(Canada)

Solution 1. Suppose, for an integer n, that we can find another integer N satisfying the
following property:

n is divisible by ϕppe q for every prime power pe exactly dividing N. (:)

This property ensures that all nth powers are congruent to 0 or 1 modulo each such prime
power pe , and hence that any sum of m pairwise coprime nth powers is congruent to m or m ´ 1
modulo pe , since at most one of the nth powers is divisible by p. Thus, if k denotes the number
of distinct prime factors of N, we find by the Chinese Remainder Theorem at most 2k m residue
classes modulo N which are sums of at most m pairwise coprime nth powers. In particular, if
N ą 2k m then there are infinitely many positive integers not expressible as a sum of at most
m pairwise coprime nth powers.
It thus suffices to prove that there are arbitrarily large pairs pn, Nq of integers satisfying (:)
such that
N ą c ¨ 2k n logpnq

for some positive constant c.


We construct such pairs as follows. Fix a positive integer t and choose (distinct) prime
t´1 t
numbers p | 22 ` 1 and q | 22 ` 1; we set N “ pq. It is well-known that 2t | p ´ 1 and
2t`1 | q ´ 1, hence
pp ´ 1qpq ´ 1q
n“
2t
is an integer and the pair pn, Nq satisfies (:).
Estimating the size of N and n is now straightforward. We have

N
log2 pnq ď 2t´1 ` 2t ´ t ă 2t`1 ă 2 ¨ ,
n
which rearranges to
1 2
Ną ¨ 2 n log2 pnq
8
1
and so we are done if we choose c ă 8 logp2q
« 0.18.

Comment 1. The trick in the above solution was to find prime numbers p and q congruent to 1
modulo some d “ 2t and which are not too large. An alternative way to do this is via Linnik’s Theorem,
which says that there are absolute constants b and L ą 1 such that for any coprime integers a and d,
there is a prime congruent to a modulo d and of size ď bdL . If we choose some d not divisible by 3 and
choose two distinct primes p, q ď b ¨ p3dqL congruent to 1 modulo d (and, say, distinct modulo 3), then
we obtain a pair pn, N q satisfying (:) with N “ pq and n “ pp´1qpq´1q
d . A straightforward computation
shows that
1
N ą Cn1` 2L´1

for some constant C, which is in particular larger than any c¨22 n logpnq for p large. Thus, the statement
of the problem is true for any constant c. More strongly, the statement of the problem is still true
when cn logpnq is replaced by n1`δ for a sufficiently small δ ą 0.
100 Bath — UK, 11th–22nd July 2019

Solution 2, obtaining better bounds. As in the preceding solution, we seek arbitrarily


large pairs of integers n and N satisfying (:) such that N ą c2k n logpnq.
This time, to construct such pairs, we fix an integer x ě 4, set N to be the lowest common
multiple of 1, 2, . . . , 2x, and set n to be twice the lowest common multiple of 1, 2, . . . , x. The
pair pn, Nq does indeed satisfy the condition, since if pe is a prime power divisor of N then
ϕppe q
2
ď x is a factor of n2 “ lcmrďx prq.
Now 2N{n is the product of all primes having a power lying in the interval px, 2xs, and
hence 2N{n ą xπp2xq´πpxq . Thus for sufficiently large x we have
ˆ ˙
2N
log ą pπp2xq ´ πpxqq logpxq ´ logp2qπp2xq „ x,
2πp2xq n
using the Prime Number Theorem πptq „ t{ logptq.
On the other hand, n is a product of at most πpxq prime powers less than or equal to x,
and so we have the upper bound
logpnq ď πpxq logpxq „ x,
again by the Prime Number Theorem. Combined with the above inequality, we find that for
any ǫ ą 0, the inequality ˆ ˙
N
log ą p1 ´ ǫq logpnq
2πp2xq n
holds for sufficiently large x. Rearranging this shows that
N ą 2πp2xq n2´ǫ ą 2πp2xq n logpnq
for all sufficiently large x and we are done.
Comment 2. The stronger bound N ą 2πp2xq n2´ǫ obtained in the above proof of course shows
that infinitely many positive integers cannot be written as a sum of at most n2´ǫ pairwise coprime
nth powers.
By refining the method in Solution 2, these bounds can be improved further to show that infinitely
many positive integers cannot be written as a sum of at most nα pairwise coprime nth powers for any
positive α ą 0. To do this, one fixes a positive integer d, sets N equal to the product of the primes
at most dx which are congruent to 1 modulo d, and n “ d lcmrďx prq. It follows as in Solution 2 that
pn, N q satisfies (:).
d
Now the Prime Number Theorem in arithmetic progressions provides the estimates logpN q „ ϕpdq x,
dx
logpnq „ x and πpdxq „ logpxq for any fixed d. Combining these provides a bound

N ą 2πpdxq nd{ϕpdq´ǫ
d
for any positive ǫ, valid for x sufficiently large. Since the ratio ϕpdq can be made arbitrarily large by a
judicious choice of d, we obtain the nα bound claimed.

Comment 3. While big results from analytic number theory such as the Prime Number Theorem
or Linnik’s Theorem certainly can be used in this problem, they do not seem to substantially simplify
matters: all known solutions involve first reducing to condition (:), and even then analytic results do
not make it clear how to proceed. For this reason, we regard this problem as suitable for the IMO.
Rather than simplifying the problem, what nonelementary results from analytic number theory
allow one to achieve is a strengthening of the main bound, typically replacing the n logpnq growth with
a power n1`δ . However, we believe that such stronger bounds are unlikely to be found by students in
the exam.
The strongest bound we know how to achieve using purely elementary methods is a bound of the
form N ą 2k n logpnqM for any positive integer M . This is achieved by a variant ofśthe argument
t`i´1
in Solution
ś 1, choosing primes p0 , . . . , pM with pi | 22 ` 1 and setting N “ i pi and n “
´tM
2 i ppi ´ 1q.
Shortlisted problems – solutions 101

N8. Let a and b be two positive integers. Prove that the integer
R 2V
2 4a
a `
b

is not a square. (Here rzs denotes the least integer greater than or equal to z.)
(Russia)

Solution 1. Arguing indirectly, assume that


R 2V R V
2 4a p2aq2
a ` “ pa ` kq2 , or “ p2a ` kqk.
b b

Clearly, k ě 1. In other words, the equation


R 2V
c
“ pc ` kqk p1q
b

has a positive integer solution pc, kq, with an even value of c.


Choose a positive integer solution of p1q with minimal possible value of k, without regard
to the parity of c. From R 2V
c2 c
ą ´ 1 “ ck ` k 2 ´ 1 ě ck
b b
and R 2V
pc ´ kqpc ` kq c2 c
ă ď “ pc ` kqk
b b b
it can be seen that c ą bk ą c ´ k, so

c “ kb ` r with some 0 ă r ă k.

By substituting this in p1q we get


R 2V R V R 2V
c pbk ` rq2 2 r
“ “ k b ` 2kr `
b b b

and
pc ` kqk “ pkb ` r ` kqk “ k 2 b ` 2kr ` kpk ´ rq,
so R V
r2
“ kpk ´ rq. p2q
b
Notice that relation p2q provides another positive integer solution of p1q, namely c1 “ r and
k 1 “ k ´ r, with c1 ą 0 and 0 ă k 1 ă k. That contradicts the minimality of k, and hence finishes
the solution.
102 Bath — UK, 11th–22nd July 2019

Solution 2. Suppose that R V


2 4a2
a ` “ c2
b
with some positive integer c ą a, so

4a2
c2 ´ 1 ă a2 ` ď c2 ,
b
0 ď c2 b ´ a2 pb ` 4q ă b. (3)

x`y x´y
Let d “ c2 b ´ a2 pb ` 4q, x “ c ` a and y “ c ´ a; then we have c “ and a “ , and
2 2
p3q can be re-written as follows:
´ x ` y ¯2 ´ x ´ y ¯2
b´ pb ` 4q “ d,
2 2
x2 ´ pb ` 2qxy ` y 2 ` d “ 0; 0 ď d ă b. (4)

So, by the indirect assumption, the equation p4q has some positive integer solution px, yq.
Fix b and d, and take a pair px, yq of positive integers, satisfying p4q, such that x ` y is
minimal. By the symmetry in p4q we may assume that x ě y ě 1.
Now we perform a usual “Vieta jump”. Consider p4q as a quadratic equation in variable x,
and let z be its second root. By the Vieta formulas,

x ` z “ pb ` 2qy, and zx “ y 2 ` d,

so
y2 ` d
z “ pb ` 2qy ´ x “ .
x
The first formula shows that z is an integer, and by the second formula z is positive. Hence
pz, yq is another positive integer solution of p4q. From

px ´ 1qpz ´ 1q “ xz ´ px ` zq ` 1 “ py 2 ` dq ´ pb ` 2qy ` 1
ă py 2 ` bq ´ pb ` 2qy ` 1 “ py ´ 1q2 ´ bpy ´ 1q ď py ´ 1q2 ď px ´ 1q2

we can see that z ă x and therefore z ` y ă x ` y. But this contradicts the minimality of x ` y
among the positive integer solutions of p4q.
Shortlisted
Problems
(with solutions)

61st International Mathematical Olympiad


Saint-Petersburg — Russia, 18th–28th September 2020
Note of Confidentiality

The Shortlist has to be kept strictly confidential


until the conclusion of the following
International Mathematical Olympiad.
IMO General Regulations §6.6

Contributing Countries

The Organising Committee and the Problem Selection Committee of IMO 2020 thank the
following 39 countries for contributing 149 problem proposals:

Armenia, Australia, Austria, Belgium, Brazil, Canada, Croatia, Cuba,


Cyprus, Czech Republic, Denmark, Estonia, France, Georgia, Germany,
Hong Kong, Hungary, India, Iran, Ireland, Israel, Kosovo, Latvia,
Luxembourg, Mongolia, Netherlands, North Macedonia, Philippines, Poland,
Slovakia, Slovenia, South Africa, Taiwan, Thailand, Trinidad and Tobago,
Ukraine, United Kingdom, USA, Venezuela

Problem Selection Committee

Ilya I. Bogdanov, Sergey Berlov, Alexander Gaifullin, Alexander S. Golovanov, Géza Kós,
Pavel Kozhevnikov, Dmitry Krachun, Ivan Mitrofanov, Fedor Petrov, Paul Vaderlind
4 Saint-Petersburg — Russia, 18th–28th September 2020

Problems
Algebra
A1. Version 1. Let n be a positive integer, and set N “ 2n . Determine the smallest real
number an such that, for all real x,
c
2N ` 1
N x
ď an px ´ 1q2 ` x.
2

Version 2. For every positive integer N, determine the smallest real number bN such that,
for all real x, c
2N ` 1
N x
ď bN px ´ 1q2 ` x.
2
(Ireland)
A2. Let A denote the set of all polynomials in three variables x, y, z with integer
coefficients. Let B denote the subset of A formed by all polynomials which can be expressed as

px ` y ` zqP px, y, zq ` pxy ` yz ` zxqQpx, y, zq ` xyzRpx, y, zq

with P, Q, R P A. Find the smallest non-negative integer n such that xi y j z k P B for all non-
negative integers i, j, k satisfying i ` j ` k ě n.
(Venezuela)
A3. Suppose that a, b, c, d are positive real numbers satisfying pa ` cqpb ` dq “ ac ` bd.
Find the smallest possible value of
a b c d
` ` ` .
b c d a
(Israel)
A4. Let a, b, c, d be four real numbers such that a ě b ě c ě d ą 0 and a ` b ` c ` d “ 1.
Prove that
pa ` 2b ` 3c ` 4dq aa bb cc dd ă 1.
(Belgium)
A5. A magician intends to perform the following trick. She announces a positive integer
n, along with 2n real numbers x1 ă . . . ă x2n , to the audience. A member of the audience then
secretly chooses a polynomial P pxq of degree n with real coefficients, computes the 2n values
P px1 q, . . . , P px2n q, and writes down these 2n values on the blackboard in non-decreasing order.
After that the magician announces the secret polynomial to the audience.
Can the magician find a strategy to perform such a trick?
(Luxembourg)
A6. Determine all functions f : Z Ñ Z such that
2 `b2
fa pa ` bq “ af paq ` bf pbq for every a, b P Z.

Here, f n denotes the nth iteration of f , i.e., f 0 pxq “ x and f n`1pxq “ f pf n pxqq for all n ě 0.
(Slovakia)
Shortlisted problems 5

A7. Let n and k be positive integers. Prove that for a1 , . . . , an P r1, 2k s one has
n ?
ÿ ai
a
2 2
ď 4 kn.
i“1 a1 ` . . . ` ai

(Iran)
A8. Let R` be the set of positive real numbers. Determine all functions f : R` Ñ R`
such that, for all positive real numbers x and y,
` ˘
f x ` f pxyq ` y “ f pxqf pyq ` 1.

(Ukraine)
6 Saint-Petersburg — Russia, 18th–28th September 2020

Combinatorics
C1. Let n be a positive integer. Find the number of permutations a1 , a2 , . . . , an of the
sequence 1, 2, . . . , n satisfying

a1 ď 2a2 ď 3a3 ď . . . ď nan .

(United Kingdom)
C2. In a regular 100-gon, 41 vertices are colored black and the remaining 59 vertices are
colored white. Prove that there exist 24 convex quadrilaterals Q1 , . . . , Q24 whose corners are
vertices of the 100-gon, so that

• the quadrilaterals Q1 , . . . , Q24 are pairwise disjoint, and

• every quadrilateral Qi has three corners of one color and one corner of the other color.

(Austria)
C3. Let n be an integer with n ě 2. On a slope of a mountain, n2 checkpoints are
marked, numbered from 1 to n2 from the bottom to the top. Each of two cable car companies,
A and B, operates k cable cars numbered from 1 to k; each cable car provides a transfer from
some checkpoint to a higher one. For each company, and for any i and j with 1 ď i ă j ď k,
the starting point of car j is higher than the starting point of car i; similarly, the finishing point
of car j is higher than the finishing point of car i. Say that two checkpoints are linked by some
company if one can start from the lower checkpoint and reach the higher one by using one or
more cars of that company (no movement on foot is allowed).
Determine the smallest k for which one can guarantee that there are two checkpoints that
are linked by each of the two companies.
(India)
C4. The Fibonacci numbers F0 , F1 , F2 , . . . are defined inductively by F0 “ 0, F1 “ 1, and
Fn`1 “ Fn ` Fn´1 for n ě 1. Given an integer n ě 2, determine the smallest size of a set S of
integers such that for every k “ 2, 3, . . . , n there exist some x, y P S such that x ´ y “ Fk .
(Croatia)
C5. Let p be an odd prime, and put N “ 41 pp3 ´ pq ´ 1. The numbers 1, 2, . . . , N are
painted arbitrarily in two colors, red and blue. For any positive integer n ď N, denote by rpnq
the fraction of integers in t1, 2, . . . , nu that are red.
Prove that there exists a positive integer a P t1, 2, . . . , p ´ 1u such that rpnq ‰ a{p for all
n “ 1, 2, . . . , N.
(Netherlands)
C6. 4n coins of weights 1, 2, 3, . . . , 4n are given. Each coin is colored in one of n colors
and there are four coins of each color. Show that all these coins can be partitioned into two
sets with the same total weight, such that each set contains two coins of each color.
(Hungary)
Shortlisted problems 7

C7. Consider any rectangular table having finitely many rows and columns, with a real
number apr, cq in the cell in row r and column c. A pair pR, Cq, where R is a set of rows and
C a set of columns, is called a saddle pair if the following two conditions are satisfied:
piq For each row r 1 , there is r P R such that apr, cq ě apr 1 , cq for all c P C;
piiq For each column c1 , there is c P C such that apr, cq ď apr, c1 q for all r P R.
A saddle pair pR, Cq is called a minimal pair if for each saddle pair pR1 , C 1 q with R1 Ď R
and C 1 Ď C, we have R1 “ R and C 1 “ C.
Prove that any two minimal pairs contain the same number of rows.
(Thailand)
C8. Players A and B play a game on a blackboard that initially contains 2020 copies
of the number 1. In every round, player A erases two numbers x and y from the blackboard,
and then player B writes one of the numbers x ` y and |x ´ y| on the blackboard. The game
terminates as soon as, at the end of some round, one of the following holds:
(1) one of the numbers on the blackboard is larger than the sum of all other numbers;
(2) there are only zeros on the blackboard.
Player B must then give as many cookies to player A as there are numbers on the blackboard.
Player A wants to get as many cookies as possible, whereas player B wants to give as few as
possible. Determine the number of cookies that A receives if both players play optimally.
(Austria)
8 Saint-Petersburg — Russia, 18th–28th September 2020

Geometry
G1. Let ABC be an isosceles triangle with BC “ CA, and let D be a point inside side
AB such that AD ă DB. Let P and Q be two points inside sides BC and CA, respectively,
such that =DP B “ =DQA “ 90˝ . Let the perpendicular bisector of P Q meet line segment
CQ at E, and let the circumcircles of triangles ABC and CP Q meet again at point F , different
from C.
Suppose that P, E, F are collinear. Prove that =ACB “ 90˝ .
(Luxembourg)
G2. Let ABCD be a convex quadrilateral. Suppose that P is a point in the interior of
ABCD such that

=P AD : =P BA : =DP A “ 1 : 2 : 3 “ =CBP : =BAP : =BP C.

The internal bisectors of angles ADP and P CB meet at a point Q inside the triangle ABP .
Prove that AQ “ BQ.
(Poland)
G3. Let ABCD be a convex quadrilateral with =ABC ą 90˝ , =CDA ą 90˝ , and
=DAB “ =BCD. Denote by E and F the reflections of A in lines BC and CD, respectively.
Suppose that the segments AE and AF meet the line BD at K and L, respectively. Prove that
the circumcircles of triangles BEK and DF L are tangent to each other.
(Slovakia)
G4. In the plane, there are n ě 6 pairwise disjoint disks D1 , D2 , . . . , Dn with radii
R1 ě R2 ě . . . ě Rn . For every i “ 1, 2, . . . , n, a point Pi is chosen in disk Di . Let O be an
arbitrary point in the plane. Prove that

OP1 ` OP2 ` . . . ` OPn ě R6 ` R7 ` . . . ` Rn .

(A disk is assumed to contain its boundary.)


(Iran)
G5. Let ABCD be a cyclic quadrilateral with no two sides parallel. Let K, L, M, and N
be points lying on sides AB, BC, CD, and DA, respectively, such that KLMN is a rhombus
with KL k AC and LM k BD. Let ω1 , ω2 , ω3 , and ω4 be the incircles of triangles ANK,
BKL, CLM, and DMN, respectively. Prove that the internal common tangents to ω1 and ω3
and the internal common tangents to ω2 and ω4 are concurrent.
(Poland)
G6. Let I and IA be the incenter and the A-excenter of an acute-angled triangle ABC
with AB ă AC. Let the incircle meet BC at D. The line AD meets BIA and CIA at E
and F , respectively. Prove that the circumcircles of triangles AID and IA EF are tangent to
each other.
(Slovakia)
Shortlisted problems 9

G7. Let P be a point on the circumcircle of an acute-angled triangle ABC. Let D,


E, and F be the reflections of P in the midlines of triangle ABC parallel to BC, CA, and AB,
respectively. Denote by ωA , ωB , and ωC the circumcircles of triangles ADP , BEP , and CF P ,
respectively. Denote by ω the circumcircle of the triangle formed by the perpendicular bisectors
of segments AD, BE and CF .
Show that ωA , ωB , ωC , and ω have a common point.
(Denmark)
G8. Let Γ and I be the circumcircle and the incenter of an acute-angled triangle ABC.
Two circles ωB and ωC passing through B and C, respectively, are tangent at I. Let ωB meet
the shorter arc AB of Γ and segment AB again at P and M, respectively. Similarly, let ωC
meet the shorter arc AC of Γ and segment AC again at Q and N, respectively. The rays P M
and QN meet at X, and the tangents to ωB and ωC at B and C, respectively, meet at Y .
Prove that the points A, X, and Y are collinear.
(Netherlands)
G9. Prove that there exists a positive constant c such that the following statement is
true:
Assume that n is an integer with n ě 2, and let S be a set of n points in the plane such
that the distance between any two distinct points in S is at least 1. Then there is a line ℓ
separating S such that the distance from any point of S to ℓ is at least cn´1{3 .
(A line ℓ separates a point set S if some segment joining two points in S crosses ℓ.)
(Taiwan)
10 Saint-Petersburg — Russia, 18th–28th September 2020

Number Theory
N1. Given a positive integer k, show that there exists a prime p such that one can choose
distinct integers a1 , a2 , . . . , ak`3 P t1, 2, . . . , p ´ 1u such that p divides ai ai`1 ai`2 ai`3 ´ i for all
i “ 1, 2, . . . , k.
(South Africa)
N2. For each prime p, there is a kingdom of p-Landia consisting of p islands numbered
1, 2, . . . , p. Two distinct islands numbered n and m are connected by a bridge if and only if
p divides pn2 ´ m ` 1qpm2 ´ n ` 1q. The bridges may pass over each other, but cannot cross.
Prove that for infinitely many p there are two islands in p-Landia not connected by a chain of
bridges.
(Denmark)
N3. Let n be an integer with n ě 2. Does there exist a sequence pa1 , . . . , an q of positive
integers with not all terms being equal such that the arithmetic mean of every two terms is
equal to the geometric mean of some (one or more) terms in this sequence?
(Estonia)
N4. For any odd prime p and any integer n, let dp pnq P t0, 1, . . . , p ´ 1u denote the
remainder when n is divided by p. We say that pa0 , a1 , a2 , . . .q is a p-sequence, if a0 is a positive
integer coprime to p, and an`1 “ an ` dp pan q for n ě 0.
(a) Do there exist infinitely many primes p for which there exist p-sequences pa0 , a1 , a2 , . . .q and
pb0 , b1 , b2 , . . .q such that an ą bn for infinitely many n, and bn ą an for infinitely many n?
(b) Do there exist infinitely many primes p for which there exist p-sequences pa0 , a1 , a2 , . . .q and
pb0 , b1 , b2 , . . .q such that a0 ă b0 , but an ą bn for all n ě 1?
(United Kingdom)
N5. Determine all functions f defined on the set of all positive integers and taking
non-negative integer values, satisfying the three conditions:
piq f pnq ‰ 0 for at least one n;
piiq f pxyq “ f pxq ` f pyq for every positive integers x and y;
piiiq there are infinitely many positive integers n such that f pkq “ f pn ´ kq for all k ă n.
(Croatia)
N6. For a positive integer n, let dpnq be the number of positive divisors of n, and let
ϕpnq be the number of positive integers not exceeding n which are coprime to n. Does there
exist a constant C such that
ϕpdpnqq
ďC
dpϕpnqq
for all n ě 1?
(Cyprus)
N7. Let S be a set consisting of n ě 3 positive integers, none of which is a sum of two
other distinct members of S. Prove that the elements of S may be ordered as a1 , a2 , . . . , an so
that ai does not divide ai´1 ` ai`1 for all i “ 2, 3, . . . , n ´ 1.
(Ukraine)
Shortlisted problems 11
12 Saint-Petersburg — Russia, 18th–28th September 2020

Solutions

Algebra
A1. Version 1. Let n be a positive integer, and set N “ 2n . Determine the smallest real
number an such that, for all real x,
c
2N ` 1
N x
ď an px ´ 1q2 ` x.
2

Version 2. For every positive integer N, determine the smallest real number bN such that,
for all real x, c
2N ` 1
N x
ď bN px ´ 1q2 ` x.
2
(Ireland)

Answer for both versions : an “ bN “ N{2.

Solution 1 (for Version 1). First of all, assume that an ă N{2 satisfies the condition. Take
x “ 1 ` t for t ą 0, we should have
p1 ` tq2N ` 1
ď p1 ` t ` an t2 qN .
2
Expanding the brackets we get
p1 ` tq2N ` 1 N2 2
ˆ ˙
2 N
p1 ` t ` an t q ´ “ Nan ´ t ` c3 t3 ` . . . ` c2N t2N (1)
2 2
with some coefficients c3 , . . . , c2N . Since an ă N{2, the right hand side of (1) is negative for
sufficiently small t. A contradiction.
It remains to prove the following inequality
c
N 1 ` x
2N N
ď x ` px ´ 1q2 , IpN, xq
2 2
where N “ 2n .
Use induction in n. The base case n “ 0 is trivial: N “ 1 and both sides of IpN, xq are
equal to p1 ` x2 q{2. For completing the induction we prove Ip2N, xq assuming that IpN, yq is
established for all real y. We have
˘2 px ` 1q2 ´ px ´ 1q2
x ` Npx ´ 1q2 “ x2 ` N 2 px ´ 1q4 ` Npx ´ 1q2
`
2 c
ˆ ˙
N 1 ` x
N N N 4N
“ x2 ` px2 ´ 1q2 ` N 2 ´ px ´ 1q4 ě x2 ` px2 ´ 1q2 ě ,
2 2 2 2
where the last inequality is IpN, x2 q. Since
px ´ 1q2 x2 ` 1
x ` Npx ´ 1q2 ě x ` “ ě 0,
2 2
taking square root we get Ip2N, xq. The inductive step is complete.
Shortlisted problems – solutions 13

Solution 2.1 (for Version 2). Like in Solution 1 of Version 1, we conclude that bN ě N{2.
It remains to prove the inequality IpN, xq for an arbitrary positive integer N.
First of all, IpN, 0q is obvious. Further, if x ą 0, then the left hand sides of IpN, ´xq and
IpN, xq coincide, while the right hand side of IpN, ´xq is larger than that of IpN, ´xq (their
difference equals 2pN ´ 1qx ě 0). Therefore, IpN, ´xq follows from IpN, xq. So, hereafter we
suppose that x ą 0.
Divide IpN, xq by x and let t “ px ´ 1q2 {x “ x ´ 2 ` 1{x; then Ipn, xq reads as
˙N
xN ` x´N
ˆ
N
fN :“ ď 1` t . (2)
2 2
The key identity is the expansion of fN as a polynomial in t:
Lemma.
N ˆ ˙
ÿ 1 N `k k
fN “ N t . (3)
k“0
N `k 2k

Proof. Apply induction on N. We will make use of the straightforward recurrence relation

fN `1 ` fN ´1 “ px ` 1{xqfN “ p2 ` tqfN . (4)

The base cases N “ 1, 2 are straightforward:


t 1
f1 “ 1 ` , f2 “ t2 ` 2t ` 1.
2 2
For the induction step from N ´ 1 and N to N ` 1, we compute the coefficient of tk in fN `1
using the formula fN `1 “ p2 ` tqfN ´ fN ´1 . For k “ 0 that coefficient equals 1, for k ą 0 it
equals
ˆ ˙ ˆ ˙ ˆ ˙
N N `k N N `k´1 N ´1 N `k´1
2 ` ´
N `k 2k N `k´1 2k ´ 2 N `k´1 2k
ˆ ˙
pN ` k ´ 1q! 2kp2k ´ 1qN pN ´ 1qpN ´ kq
“ 2N ` ´
p2kq!pN ´ kq! pN ` k ´ 1qpN ´ k ` 1q N `k´1
`N `k`1˘
pN ` k ´ 1q! ` 2
˘ 2k
“ 2NpN ´ k ` 1q ` 3kN ` k ´ N ´ N “ pN ` 1q,
p2kq!pN ´ k ` 1q! pN ` k ` 1q
that completes the induction. l
Turning back to the problem, in order to prove (2) we write
ˆ ˙N ˆ ˙N N ˆ ˙ N
N N ÿ 1 N `k k ÿ
1` t ´ fN “ 1 ` t ´N t “ αk tk ,
2 2 k“0
N ` k 2k k“0

where
ˆ ˙k ˆ ˙ ˆ ˙
N N N N `k
αk “ ´
2 k N `k 2k
ˆ ˙k ˆ ˙ ˆ ˙
N N k p1 ` 1{Nqp1 ` 2{Nq ¨ . . . ¨ p1 ` pk ´ 1q{Nq
“ 1´2
2 k pk ` 1q ¨ . . . ¨ p2kq
ˆ ˙k ˆ ˙ ˆ ˙ ˆ ˙k ˆ ˙ ˜ k
¸
N N 2 ¨ 3 ¨ . . . ¨ k N N ź 2j
ě 1 ´ 2k “ 1´ ě 0,
2 k pk ` 1q ¨ . . . ¨ p2kq 2 k j“1
k ` j

and (2) follows.


14 Saint-Petersburg — Russia, 18th–28th September 2020

Solution 2.2 (for Version 2). Here we present another proof of the inequality (2) for x ą 0,
or, equivalently, for t “ px ´ 1q2 {x ě 0. Instead of finding the coefficients of the polynomial
fN “ fN ptq we may find its roots, which is in a sense more straightforward. Note that the
recurrence (4) and the initial conditions f0 “ 1, f1 “ 1 ` t{2 imply that fN is a polynomial in t
of degree N. It also follows by induction that fN p0q “ 1, fN1 p0q “ N 2 {2: the recurrence relations
read as fN `1 p0q ` fN ´1 p0q “ 2fN p0q and fN1 `1 p0q ` fN1 ´1 p0q “ 2fN1 p0q ` fN p0q, respectively.
Next, if xk “ expp iπp2k´1q
2N
q for k P t1, 2, . . . , Nu, then

1 πp2k ´ 1q πp2k ´ 1q
´tk :“ 2 ´ xk ´ “ 2 ´ 2 cos “ 4 sin2 ą0
xk 2N 4N
and ´ ¯ ´ ¯
iπp2k´1q
xN x´N
` exp 2
` exp ´ iπp2k´1q
2
k k
fN ptk q “ “ “ 0.
2 2
So the roots of fN are t1 , . . . , tN and by the AM–GM inequality we have
ˆ ˙ˆ ˙ ˆ ˙ ˆ ˆ ˙˙N
t t t t 1 1
fN ptq “ 1 ´ 1´ ... 1 ´ ď 1´ ` ...` “
t1 t2 tN N t1 tn
˙N ˆ ˙N
tfN1 p0q
ˆ
N
1` “ 1` t .
N 2

Comment. The polynomial fN ptq equals to 21 TN pt ` 2q, where Tn is the nth Chebyshev polynomial of
the first kind: Tn p2 cos sq “ 2 cos ns, Tn px ` 1{xq “ xn ` 1{xn .

Solution 2.3 (for Version 2). Here we solve the problem when N ě 1 is an arbitrary real
number. For a real number a let
ˆ 2N ˙1
x `1 N
f pxq “ ´ apx ´ 1q2 ´ x.
2

Then f p1q “ 0,
˙ N1 ´1
x2N ` 1
ˆ
1
f pxq “ x2N ´1 ´ 2apx ´ 1q ´ 1 and f 1 p1q “ 0;
2
ˆ 2N ˙ 1 ´2 ˆ 2N ˙ 1 ´1
2 x ` 1 N 4N ´2 x ` 1 N 2N ´2
f pxq “ p1´Nq x `p2N ´1q x ´2a and f 2 p1q “ N ´2a.
2 2
So if a ă N2 , the function f has a strict local minimum at point 1, and the inequality f pxq ď
0 “ f p1q does not hold. This proves bN ě N{2.
For a “ N2 we have f 2 p1q “ 0 and
#
1
1 ´ 2N
¯ N
´3 ą 0 if 0 ă x ă 1 and
f 3 pxq “ p1 ´ Nqp1 ´ 2Nq x 2`1 x2N ´3 p1 ´ x2N q
2 ă 0 if x ą 1.

Hence, f 2 pxq ă 0 for x ‰ 1; f 1 pxq ą 0 for x ă 1 and f 1 pxq ă 0 for x ą 1, finally f pxq ă 0 for
x ‰ 1.

Comment. Version 2 is much more difficult, of rather A5 or A6 difficulty. The induction in Version
1 is rather straightforward, while all three above solutions of Version 2 require some creativity.
Shortlisted problems – solutions 15

This page is intentionally left blank


16 Saint-Petersburg — Russia, 18th–28th September 2020

A2. Let A denote the set of all polynomials in three variables x, y, z with integer
coefficients. Let B denote the subset of A formed by all polynomials which can be expressed as

px ` y ` zqP px, y, zq ` pxy ` yz ` zxqQpx, y, zq ` xyzRpx, y, zq

with P, Q, R P A. Find the smallest non-negative integer n such that xi y j z k P B for all non-
negative integers i, j, k satisfying i ` j ` k ě n.
(Venezuela)

Answer: n “ 4.

Solution. We start by showing that n ď 4, i.e., any monomial f “ xi y j z k with i ` j ` k ě 4


belongs to B. Assume that i ě j ě k, the other cases are analogous.
Let x ` y ` z “ p, xy ` yz ` zx “ q and xyz “ r. Then

0 “ px ´ xqpx ´ yqpx ´ zq “ x3 ´ px2 ` qx ´ r,

therefore x3 P B. Next, x2 y 2 “ xyq ´ px ` yqr P B.


If k ě 1, then r divides f , thus f P B. If k “ 0 and j ě 2, then x2 y 2 divides f , thus we
have f P B again. Finally, if k “ 0, j ď 1, then x3 divides f and f P B in this case also.
In order to prove that n ě 4, we show that the monomial x2 y does not belong to B. Assume
the contrary:
x2 y “ pP ` qQ ` rR (1)
for some polynomials P, Q, R. If polynomial P contains the monomial x2 (with nonzero coeffi-
cient), then pP ` qQ ` rR contains the monomial x3 with the same nonzero coefficient. So P
does not contain x2 , y 2 , z 2 and we may write

x2 y “ px ` y ` zqpaxy ` byz ` czxq ` pxy ` yz ` zxqpdx ` ey ` f zq ` gxyz,

where a, b, c; d, e, f ; g are the coefficients of xy, yz, zx; x, y, z; xyz in the polynomials P ;
Q; R, respectively (the remaining coefficients do not affect the monomials of degree 3 in
pP ` qQ ` rR). By considering the coefficients of xy 2 we get e “ ´a, analogously e “ ´b,
f “ ´b, f “ ´c, d “ ´c, thus a “ b “ c and f “ e “ d “ ´a, but then the coefficient of x2 y
in the right hand side equals a ` d “ 0 ‰ 1.

Comment 1. The general question is the following. Call a polynomial f px1 , . . . , xn q with integer
coefficients nice, if f p0, 0, . . . , 0q “ 0 and f pxπ1 , . . . , xπn q “ f px1 , . . . , xn q for any permutation π of
1, . . . , n (in other words, f is symmetric and its constant term is zero.) Denote by I the set of
polynomials of the form
p1 q 1 ` p2 q 2 ` . . . ` pm q m , (2)
where m is an integer, q1 , . . . , qm are polynomials with integer coefficients, and p1 , . . . , pm are nice
polynomials. Find the least N for which any monomial of degree at least N belongs to I.
The answer is npn ´ 1q{2 ` 1. The lower bound follows from the following claim: the polynomial

F px1 , . . . , xn q “ x2 x23 x34 ¨ . . . ¨ xnn´1

does not belong to I. ř


Assume that F “ pi qi , according to (2). By taking only the monomials of degree npn ´ 1q{2, we
can additionally assume that every pi and every qi is homogeneous, deg pi ą 0, and deg pi ` deg qi “
deg F “ npn ´ 1q{2 for all i.
Consider the alternating sum
ÿ m
ÿ ÿ
signpπqF pxπ1 , . . . , xπn q “ pi signpπqqi pxπ1 , . . . , xπn q :“ S, (3)
π i“1 π
Shortlisted problems – solutions 17

where the summation is done over all permutations π of 1, . . . n, and signpπq denotes the sign of the
permutation π. Since deg qi “ npn ´ 1q{2 ´ deg pi ă npn ´ 1q{2, in anyřmonomial Q of qi , there are at
least two variables, say xα and xβ , with equal exponents. Therefore π signpπqQpxπ1 , . . . , xπn q “ 0,
because each pair of terms that corresponds to permutations which differ by the transposition of α
and β, cancels out. This holds for any i “ 1, . . . , m and any monomial of qi , so S “ 0. But the left
hand side of (3) is a non-zero polynomial. This is a contradiction.
Let us now prove, using induction on n, that any monomial h “ xc11 . . . xcnn of degree npn ´ 1q{2 ` 1
belongs to I, and additionally all pi , qi in the representation (2) can be chosen homogeneous with sum
of degrees equal to npn ´ 1q{2 ` 1. (Obviously, any monomial of degree at least npn ´ 1q{2 ` 1 is
divisible by a monomial of degree exactly npn ´ 1q{2 ` 1, thus this suffices.) The proposition is true
for n “ 1, so assume that n ą 1 and that the proposition is proved for smaller values of n.
We proceed by an internal induction on S :“ |ti : ci “ 0u|. In the base case S “ 0 the monomial
h is divisible by the nice polynomial x1 ¨ . . . ¨ xn , therefore h P I. Now assume that S ą 0 and that
the claim holds for smaller values of S. Let T “ n ´ S. We may assume that cT `1 “ . . . “ cn “ 0
and h “ x1 ¨ . . . ¨ xT gpx1 , . . . , xn´1 q, where deg g “ npn ´ 1q{2 ´ T ` 1 ě pn ´ 1qpn ´ 2q{2 ` 1. Using
the outer induction hypothesis we represent g as p1 q1 ` . . . ` pm qm , where pi px1 , . . . , xn´1 q are nice
polynomials in n ´ 1 variables. There exist nice homogeneous polynomials Pi px1 , . . . , xn q such that
Pi px1 , . . . , xn´1 , 0q “ pi px1 , . . . , xn´1 q. In other words, ∆i :“ pi px1 , . . . , xn´1 q ´ Pi px1 , . . . , xn´1 , xn q is
divisible by xn , let ∆i “ xn gi . We get
ÿ ÿ ÿ ÿ
h “ x1 ¨ . . . ¨ xT pi qi “ x1 ¨ . . . ¨ xT pPi ` xn gi qqi “ px1 ¨ . . . ¨ xT xn q gi qi ` Pi qi P I.

The first term belongs to I by the inner induction hypothesis. This completes both inductions.

Comment 2. The solutions above work smoothly for the versions of the original problem and its
extensions to the case of n variables, where all polynomials are assumed to have real coefficients. In
the version with integer coefficients, the argument showing that x2 y R B can be simplified: it is not
hard to show that in every polynomial f P B, the sum of the coefficients of x2 y, x2 z, y 2 x, y 2 z, z 2 x and
z 2 y is even. A similar fact holds for any number of variables and also implies that N ě npn ´ 1q{2 ` 1
in terms of the previous comment.
18 Saint-Petersburg — Russia, 18th–28th September 2020

A3. Suppose that a, b, c, d are positive real numbers satisfying pa ` cqpb ` dq “ ac ` bd.
Find the smallest possible value of

a b c d
S“ ` ` ` .
b c d a
(Israel)

Answer: The smallest possible value is 8.

Solution 1. To show that S ě 8, apply the AM–GM inequality twice as follows:


´a c ¯ ˆb d˙ c c ? ?
ac bd 2pac ` bdq 2pa ` cqpb ` dq 2 ac ¨ 2 bd
` ` ` ě2 `2 “ ? “ ? ě 2¨ ? “ 8.
b d c a bd ac abcd abcd abcd
The above inequalities turn into equalities when a “ c and b “ d. Then the condition ?
pa ` cqpb ` dq “ ac ` bd can be rewritten as 4ab “ a2 ` b2 . So it is
? satisfied when a{b “ 2 ˘ 3.
Hence, S attains value 8, e.g., when a “ c “ 1 and b “ d “ 2 ` 3.

Solution 2. By homogeneity we may suppose that abcd “ 1. Letaab “ C, bc “ aA and


ca “ B. aThen a, b, c can be reconstructed from A, B and C as a “ BC{A, b “ AC{B
and c “ AB{C. Moreover, the condition pa ` cqpb ` dq “ ac ` bd can be written in terms of
A, B, C as
1 1 1
A` ` C ` “ bc ` ad ` ab ` cd “ pa ` cqpb ` dq “ ac ` bd “ B ` .
A C B
We then need to minimize the expression
ˆ ˙ ˆ ˙
ad ` bc ab ` cd 1 1 1
S :“ ` “ A` B` C`
bd ac A C B
ˆ ˙ˆ ˙ ˆ ˙
1 1 1 1 1
“ A` B´ ` A` `C `
A B A C B
ˆ ˙ˆ ˙ ˆ ˙
1 1 1 1
“ A` B´ ` B` .
A B B B

Without loss of generality assume that B ě 1 (otherwise, we may replace B by 1{B and swap
A and C, this changes neither the relation nor the function to be maximized). Therefore, we
can write ˆ ˙ ˆ ˙ ˆ ˙2
1 1 1 1
Sě2 B´ ` B` “ 2B ` 1 ´ “: f pBq.
B B B B
Clearly, f increases on r1, 8q. Since

1 1 1
B` “ A ` ` C ` ě 4,
B A C
?
we have B ě B 1 , where B 1 “ 2 ` 3 is the unique root greater than 1 of the equation
B 1 ` 1{B 1 “ 4. Hence,
ˆ ˙ ˆ ˙
1 1 1 1 1 1 1 2 4
S ě f pBq ě f pB q “ 2 B ´ 1 ` B ` 1 “ 2B ´ ` “ 8.
B B B1 B1 B1

It remains to note that when A “ C “ 1 and B “ B 1 we have the equality S “ 8.


Shortlisted problems – solutions 19

Solution 3. We present another proof of the inequality S ě 8. We start with the estimate
´a c ¯ ˆb d˙ c c
ac bd
` ` ` ě2 `2 .
b d c a bd ac
? ?
Let y “ ac and z “ bd, and assume, without loss of generality, that ac ě bd. By the
AM–GM inequality, we have
? ?
y 2 ` z 2 “ ac ` bd “ pa ` cqpb ` dq ě 2 ac ¨ 2 bd “ 4yz.
?
Substituting x “ y{z, we get 4x ď x2 ` 1. For x ě 1, this holds if and only if x ě 2 ` 3.
Now we have c c ˆ ˙
ac bd 1
2 `2 “2 x` .
bd ac x
?
Clearly, this is minimized by ? 1q as close to 1 as possible, i.e., by taking x “ 2 ` 3.
? setting xpě
Then 2px ` 1{xq “ 2pp2 ` 3q ` p2 ´ 3qq “ 8, as required.
20 Saint-Petersburg — Russia, 18th–28th September 2020

A4. Let a, b, c, d be four real numbers such that a ě b ě c ě d ą 0 and a ` b ` c ` d “ 1.


Prove that
pa ` 2b ` 3c ` 4dq aa bb cc dd ă 1.
(Belgium)
Solution 1. The weighted AM–GM inequality with weights a, b, c, d gives
aa bb cc dd ď a ¨ a ` b ¨ b ` c ¨ c ` d ¨ d “ a2 ` b2 ` c2 ` d2 ,
so it suffices to prove that pa ` 2b ` 3c ` 4dqpa2 ` b2 ` c2 ` d2 q ă 1 “ pa ` b ` c ` dq3 . This can
be done in various ways, for example:
pa ` b ` c ` dq3 ą a2 pa ` 3b ` 3c ` 3dq ` b2 p3a ` b ` 3c ` 3dq
` c2 p3a ` 3b ` c ` 3dq ` d2 p3a ` 3b ` 3c ` dq
ě pa2 ` b2 ` c2 ` d2 q ¨ pa ` 2b ` 3c ` 4dq.

Solution 2. From b ě d we get


a ` 2b ` 3c ` 4d ď a ` 3b ` 3c ` 3d “ 3 ´ 2a.
If a ă 21 , then the statement can be proved by
pa ` 2b ` 3c ` 4dq aa bb cc dd ď p3 ´ 2aqaa ab ac ad “ p3 ´ 2aqa “ 1 ´ p1 ´ aqp1 ´ 2aq ă 1.
1
From now on we assume 2
ď a ă 1.
By b, c, d ă 1 ´ a we have
bb cc dd ă p1 ´ aqb ¨ p1 ´ aqc ¨ p1 ´ aqd “ p1 ´ aq1´a .
Therefore,
pa ` 2b ` 3c ` 4dqaa bb cc dd ă p3 ´ 2aq aa p1 ´ aq1´a .
For 0 ă x ă 1, consider the functions
f pxq “ p3 ´ 2xqxx p1 ´ xq1´x and gpxq “ log f pxq “ logp3 ´ 2xq ` x log x ` p1 ´ xq logp1 ´ xq;
hereafter, log denotes the natural logarithm. It is easy to verify that
2 4 1 1 1 ` 8p1 ´ xq2
g pxq “ ´ ` ` “ ą 0,
p3 ´ 2xq2 x 1 ´ x xp1 ´ xqp3 ´ 2xq2
` 1 ˘ convex on1p0, 1q.
so g is strictly
By g 2 “ log 2 ` 2 ¨ 2 log 21 “ 0 and lim gpxq “ 0, we have gpxq ď 0 (and hence f pxq ď 1)
“ ˘ xÑ1´
for all x P 12 , 1 , and therefore
pa ` 2b ` 3c ` 4dqaa bb cc dd ă f paq ď 1.
ř
Comment. For a large number of variables a1 ě a2 ě . . . ě an ą 0 with i ai “ 1, the inequality
˜ ¸
ÿ ź a
iai ai i ď 1
i i

does not necessarily hold. Indeed, let a2 “ a3 “ . . . “ an “ ε and a1 “ 1 ´ pn ´ 1qε, where n and
ε P p0, 1{nq will be chosen later. Then
˜ ¸ ˆ ˙
ÿ ź a npn ´ 1q
iai ai i “ 1 ` ε εpn´1qε p1 ´ pn ´ 1qεq1´pn´1qε . p1q
i i
2

If ε “ C{n2 with an arbitrary fixed C ą 0 and n Ñ 8, then the factors εpn´1qε “ expppn ´ 1qε log εq
and p1 ´ pn ´ 1qεq1´pn´1qε tend to 1, so the limit of p1q in this set-up equals 1 ` C{2. This is not
simply greater than 1, but it can be arbitrarily large.
Shortlisted problems – solutions 21

A5. A magician intends to perform the following trick. She announces a positive integer
n, along with 2n real numbers x1 ă . . . ă x2n , to the audience. A member of the audience then
secretly chooses a polynomial P pxq of degree n with real coefficients, computes the 2n values
P px1 q, . . . , P px2n q, and writes down these 2n values on the blackboard in non-decreasing order.
After that the magician announces the secret polynomial to the audience.
Can the magician find a strategy to perform such a trick?
(Luxembourg)

Answer: No, she cannot.

Solution. Let x1 ă x2 ă . . . ă x2n be real numbers chosen by the magician. We will construct
two distinct polynomials P pxq and Qpxq, each of degree n, such that the member of audience
will write down the same sequence for both polynomials. This will mean that the magician
cannot distinguish P from Q.
Claim. There exists a polynomial P pxq of degree n such that P px2i´1 q ` P px2i q “ 0 for i “
1, 2, . . . , n.
Proof. We want to find a polynomial an xn ` . . . ` a1 x ` a0 satisfying the following system of
equations:

px1 ` xn2 qan ` px1n´1 ` x2n´1 qan´1 ` . . . ` 2a0 “ 0


$ n


&pxn ` xn qa ` pxn´1 ` xn´1 qa

3 4 n 3 4 n´1 ` . . . ` 2a0 “ 0


’ ¨¨¨
% n n´1 n´1
px2n´1 ` xn2n qan ` px2n´1 ` x2n qan´1 ` . . . ` 2a0 “ 0
We use the well known fact that a homogeneous system of n linear equations in n ` 1
variables has a nonzero solution. (This fact can be proved using induction on n, via elimination
of variables.) Applying this fact to the above system, we find a nonzero polynomial P pxq
of degree not exceeding n such that its coefficients a0 , . . . , an satisfy this system. Therefore
P px2i´1 q ` P px2i q “ 0 for all i “ 1, 2, . . . , n. Notice that P has a root on each segment
rx2i´1 , x2i s by the Intermediate Value theorem, so n roots in total. Since P is nonzero, we get
deg P “ n. l
Now consider a polynomial P pxq provided by the Claim, and take Qpxq “ ´P pxq. The
properties of P pxq yield that P px2i´1 q “ Qpx2i q and Qpx2i´1 q “ P px2i q for all i “ 1, 2, . . . , n.
It is also clear that P ‰ ´P “ Q and deg Q “ deg P “ n.

Comment. It can be shown that for any positive integer n the magician can choose 2n ` 1 distinct
real numbers so as to perform such a trick. Moreover, she can perform such a trick with almost all (in
a proper sense) p2n ` 1q-tuples of numbers.
22 Saint-Petersburg — Russia, 18th–28th September 2020

A6. Determine all functions f : Z Ñ Z such that


2 `b2
fa pa ` bq “ af paq ` bf pbq for every a, b P Z.

Here, f n denotes the nth iteration of f , i.e., f 0 pxq “ x and f n`1pxq “ f pf n pxqq for all n ě 0.
(Slovakia)

Answer: Either f pxq “ 0 for all x P Z, or f pxq “ x ` 1 for all x P Z.

Solution. Refer to the main equation as Epa, bq.


2
Ep0, bq reads as f b pbq “ bf pbq. For b “ ´1 this gives f p´1q “ 0.
Now Epa, ´1q reads as
2 2
f a `1 pa ´ 1q “ af paq “ f a paq. p1q
(
For x P Z define the orbit of x by Opxq “ x, f pxq, f pf pxqq, . . . Ď Z. We see that the orbits
Opa ´ 1q and Opaq differ by finitely many terms. Hence, any two orbits differ by finitely many
terms. In particular, this implies that either all orbits are finite or all orbits are infinite.
Case 1: All orbits are finite.
Then Op0q is finite. Using Epa, ´aq we get
2
a f paq ´ f p´aq “ af paq ´ af p´aq “ f 2a p0q P Op0q.
` ˘

2
For |a| ą max |z|, this yields f paq “ f p´aq and f 2a p0q “ 0. Therefore, the sequence
zPOp0q
` k ˘
f p0q : k “ 0, 1, . . . is purely periodic with a `minimal period
˘ T which divides 2a2 . Anal-
ogously, T divides 2pa ` 1q2 , therefore, T | gcd 2a2 , 2pa ` 1q2 “ 2, i.e., f pf p0qq “ 0 and
` ˘ 2
a f paq ´ f p´aq “ f 2a p0q “ 0 for all a. Thus,

f paq “ f p´aq for all a ‰ 0; (♣)


in particular, f p1q “ f p´1q “ 0. (♠)

Next, for each n P Z, by Epn, 1 ´ nq we get


2 `p1´nq2 2 ´2n
nf pnq ` p1 ´ nqf p1 ´ nq “ f n p1q “ f 2n p0q “ 0. p♥q

Assume that there exists some m ‰ 0 such that f pmq ‰ 0. Choose such an m for which |m| is
minimal possible. Then |m| ą 1 due to p♠q; f p|m|q ‰ 0 due to p♣q; and f p1 ´ |m|q ‰ 0 due
to p♥q for n “ |m|. This contradicts to the minimality assumption.
So, f pnq “ 0 for n ‰ 0. Finally, f p0q “ f 3 p0q “ f 4 p2q “ 2f p2q “ 0. Clearly, the function
f pxq ” 0 satisfies the problem condition, which provides the first of the two answers.
Case 2: All orbits are infinite.
Since the orbits Opaq and Opa ´ 1q differ by finitely many terms for all a P Z, each two
orbits Opaq and Opbq have infinitely many common terms for arbitrary a, b P Z.
For a minute, fix any a, b P Z. We claim that all pairs pn, mq of nonnegative integers such
that f n paq “ f m pbq have the same difference n ´ m. Arguing indirectly, we have f n paq “ f m pbq
and f p paq “ f q pbq with, say, n ´ m ą p ´ q, then f p`m`k pbq “ f p`n`k paq “ f q`n`k pbq, for all
nonnegative integers k.` This˘means that f ℓ`pn´mq´pp´qq pbq “ f ℓ pbq for all sufficiently large ℓ,
i.e., that the sequence f n pbq is eventually periodic, so Opbq is finite, which is impossible.
Now, for every a, b P Z, denote the common difference n ´ m defined above by Xpa, bq.
We have Xpa ´ 1, aq “ 1 by (1). Trivially, Xpa, bq ` Xpb, cq “ Xpa, cq, as if f n paq “ f m pbq
and f p pbq “ f q pcq, then f p`n paq “ f p`mpbq “ f q`m pcq. These two properties imply that
Xpa, bq “ b ´ a for all a, b P Z.
Shortlisted problems – solutions 23

2 `1 2
But (1) yields f a pf pa ´ 1qq “ f a pf paqq, so
` ˘
1 “ X f pa ´ 1q, f paq “ f paq ´ f pa ´ 1q for all a P Z.

Recalling that f p´1q “ 0, we conclude by (two-sided) induction on x that f pxq “ x ` 1 for all
x P Z.
Finally, the obtained function also satisfies the assumption. Indeed, f n pxq “ x ` n for all
n ě 0, so
2 2
f a `b pa ` bq “ a ` b ` a2 ` b2 “ af paq ` bf pbq.

Comment. There are many possible variations of the solution above, but it seems that finiteness of
orbits seems to be a crucial distinction in all solutions. However, the case distinction could be made
in different ways; in particular, there exist some versions of Case 1 which work whenever there is at
least one finite orbit.
We believe that Case 2 is conceptually harder than Case 1.
24 Saint-Petersburg — Russia, 18th–28th September 2020

A7. Let n and k be positive integers. Prove that for a1 , . . . , an P r1, 2k s one has
n ?
ÿ ai
a ď 4 kn.
i“1 a21 ` . . . ` a2i
(Iran)
Solution 1. Partition the set of indices t1, 2, . . . , nu into disjoint subsets M1 , M2 , . . . , Mk so
that aℓ P r2j´1, 2j s for ℓ P Mj . Then, if |Mj | “: pj , we have
pj pj
ÿ aℓ ÿ 2j ÿ 1
a ď ? “2 ? ,
ℓPMj a21 ` . . . ` a2ℓ i“1 2
j´1 i
i“1 i

aℓ ď 2j and in the denominator every index from Mj contributes at least


where we used that ?
j´1 2
?
p2 q . Now, using i ´ i ´ 1 “ ?i`1?i´1 ě 2? 1
i
, we deduce that
pj pj
ÿ aℓ ÿ 1 ÿ ? ? ?
a ď 2 ? ď 2 2p i ´ i ´ 1q “ 4 pj .
2 2
ℓPMj a1 ` . . . ` aℓ i“1 i i“1

Therefore, summing over j “ 1, . . . , k and using the QM–AM inequality, we obtain


g
n k f k
?
aℓ
ÿ ÿ b f ÿ
a ď 4 |Mj | ď 4 ek |Mj | “ 4 kn.
ℓ“1 a21 ` . . . ` a2ℓ j“1 j“1

řn ai
Comment. Consider the function f pa1 , . . . , an q “ i“1
? . One can see that rearranging the
a21 `...`a2i
variables in increasing order can only increase the value of f pa1 , . . . , an q. Indeed, if aj ą aj`1 for some
index j then we have
a b b a
f pa1 , . . . , aj´1 , aj`1 , aj , aj`2 , . . . , an q ´ f pa1 , . . . , an q “ `? ´ ´?
S 2
S ´a2 S S ´ b2
2
b
where a “ aj , b “ aj`1 , and S “ a21 ` . . . ` a2j`1 . The positivity of the last expression above follows
from
b b a2 b ab2 a a
? ´ “ ? ? ą ? ? “? ´ .
2
S ´a 2 S 2 2
S S ´ a ¨ pS ` S ´ a q 2 2 2 2
S S ´ b ¨ pS ` S ´ b q2 2 2
S ´b 2 S

Comment. If k ă n, the example am :“ 2kpm´1q{n shows that the problem statement is sharp up to
a multiplicative constant. For k ě n the trivial upper bound n becomes sharp up to a multiplicative
constant.

? 2. Apply induction on n. The base n ď 16 is clear: our sum does not exceed
Solution
n ď 4 nk. For the inductive step from 1, . . . , n ´ 1 to n ě 17 consider two similar cases.
Case 1: n “ 2t.
Let xℓ “ ? 2 aℓ . We have
a1 `...`a2ℓ

a2 ` . . . ` a2t 1
expp´x2t`1 ´ . . . ´ x22t q ě 1 ´ x2t`1 . . . 1 ´ x22t “ 21
` ˘ ` ˘
2
ě ,
a1 ` . . . ` a2t 1 ` 4k
where we used that the product is telescopic and then an estimate at`i ď 2k ai for i “ 1, . . . , t.
Therefore, x2t`1 ` . . . ` x22t?ď logp4k ` 1q ď 2k, where log denotes the natural logarithm. This
implies xt`1 ` . . . ` x2t ď 2kt. Hence, using the inductive hypothesis for n “ t we get
2t
ÿ ? ? ?
xℓ ď 4 kt ` 2kt ď 4 2kt.
ℓ“1
Shortlisted problems – solutions 25

Case 2: n “ 2t ` 1.
Analogously, we get x2t`2 ` . . . ` x22t`1 ď logp4k ` 1q ď 2k and
2t`1
ÿ a ? a
xℓ ď 4 kpt ` 1q ` 2kt ď 4 kp2t ` 1q.
ℓ“1

The last inequality is true for all t ě 8 since


? ? ? ? ? ?
4 2t ` 1 ´ 2t ě 3 2t “ 18t ě 16t ` 16 “ 4 t ` 1.
26 Saint-Petersburg — Russia, 18th–28th September 2020

A8. Let R` be the set of positive real numbers. Determine all functions f : R` Ñ R`
such that, for all positive real numbers x and y,
` ˘
f x ` f pxyq ` y “ f pxqf pyq ` 1. p˚q

(Ukraine)

Answer: f pxq “ x ` 1.

Solution 1. A straightforward check shows that f pxq “ x ` 1 satisfies p˚q. We divide the
proof of the converse statement into a sequence of steps.
Step 1: f is injective.
Put x “ 1 in p˚q and rearrange the terms to get
` ˘
y “ f p1qf pyq ` 1 ´ f 1 ` f pyq .

Therefore, if f py1q “ f py2 q, then y1 “ y2 .


Step 2: f is (strictly) monotone increasing.
For any fixed y P R` , the function
` ˘
gpxq :“ f x ` f pxyq “ f pxqf pyq ` 1 ´ y

is injective by Step 1. Therefore, x1 ` f px1 yq ‰ x2 ` f px2 yq for all y, x1 , x2 P R` with x1 ‰ x2 .


Plugging in zi “ xi y, we arrive at
z1 ´ z2 1 f pz2 q ´ f pz1 q
‰ f pz2 q ´ f pz1 q, or ‰
y y z1 ´ z2
for all y, z1, z2 P R` with z1 ‰ z2 . This means that the right-hand side of the rightmost relation
is always non-positive, i.e., f is monotone non-decreasing. Since f is injective, it is strictly
monotone.
Step 3: There exist constants a and b such that f pyq “ ay ` b for all y P R` .
Since f is monotone and bounded from below by 0, for each x0 ě 0, there exists a right
limit limxŒx0 f pxq ě 0. Put p “ limxŒ0 f pxq and q “ limxŒp f pxq.
` Fix an arbitrary
˘ y and take the limit of p˚q as x Œ 0. We have f pxyq Œ p and hence
f x ` f pxyq Πq; therefore, we obtain
q`y´1
q ` y “ pf pyq ` 1, or f pyq “ .
p
(Notice that p ‰ 0, otherwise q ` y “ 1 for all y, which is absurd.) The claim is proved.
Step 4: f pxq “ x ` 1 for all x P R` .
Based on the previous step, write f pxq “ ax ` b. Putting this relation into p˚q we get
a px ` axy ` bq ` b ` y “ pax ` bqpay ` bq ` 1,

which can be rewritten as

pa ´ abqx ` p1 ´ abqy ` ab ` b ´ b2 ´ 1 “ 0 for all x, y P R` .


This identity may hold only if all the coefficients are 0, i.e.,

a ´ ab “ 1 ´ ab “ ab ` b ´ b2 ´ 1 “ 0.

Hence, a “ b “ 1.
Shortlisted problems – solutions 27

Solution 2. We provide another proof that f pxq “ x ` 1 is the only function satisfying p˚q.
Put a “ f p1q. Define the function φ : R` Ñ R by

φpxq “ f pxq ´ x ´ 1.

Then equation p˚q reads as

φpx ` f pxyqq “ f pxqf pyq ´ f pxyq ´ x ´ y. (1)

Since the right-hand side of (1) is symmetric under swapping x and y, we obtain
` ˘ ` ˘
φ x ` f pxyq “ φ y ` f pxyq .

In particular, substituting px, yq “ pt, 1{tq we get


ˆ ˙
1
φpa ` tq “ φ a ` , t P R` . (2)
t

Notice that the function f is bounded from below by a positive constant. Indeed, for each
y P R` , the relation p˚q yields f pxqf pyq ą y ´ 1, hence
y´1
f pxq ą for all x P R` .
f pyq
If y ą 1, this provides a desired positive lower bound for f pxq.
Now, let M “ inf` f pxq ą 0. Then, for all y P R` ,
xPR

y´1 y´1
Mě , or f pyq ě . (3)
f pyq M

Lemma 1. The function f pxq (and hence φpxq) is bounded on any segment rp, qs, where
0 ă p ă q ă `8.
Proof. f is bounded from below by M. It remains to show that f is bounded from above
on rp, qs. Substituting y “ 1 into p˚q, we get
` ˘
f x ` f pxq “ af pxq. (4)

Take z P rp, qs and put s “ f pzq. By (4), we have

f pz ` sq “ as and f pz ` s ` asq “ f z ` s ` f pz ` sq “ a2 s.
` ˘

Plugging in px, yq “ z, 1 ` zs to p˚q and using (3), we obtain


` ˘

` ˘ ´ s¯ s s2 s
f pz ` asq “ f z ` f pz ` sq “ sf 1 ` ´ ě ´ .
z z Mz z
z
` ˘
Now, substituting px, yq “ z ` as, z`as to p˚q and applying the above estimate and the
estimate f pyq ě M, we obtain
ˆ ˙
2
` ˘ z z
a s “ f pz ` s ` asq “ f z ` as ` f pzq “ f pz ` asqf `1´
z ` as z ` as
s2 Ms s2 Ms
ě Mf pz ` asq ě ´ ě ´ .
z z q p
`M ˘
This yields s ď q p
` a2 “: L, and f is bounded from above by L on rp, qs. l
28 Saint-Petersburg — Russia, 18th–28th September 2020

Applying Lemma 1 to the segment ra, a ` 1s, we see that φ is bounded on it. By (2) we get
that φ is also bounded on ra ` 1, `8q, and hence on ra, `8q. Put C “ maxta, 3u.
Lemma 2. For all x ě C, we have φpxq “ 0 (and hence f pxq “ x ` 1).
Proof. Substituting y “ x to (1), we obtain

φ x ` f px2 q “ f pxq2 ´ f px2 q ´ 2x,


` ˘

hence,
φ x ` f px2 q ` φpx2 q “ f pxq2 ´ px ` 1q2 “ φpxq f pxq ` x ` 1 .
` ˘ ` ˘
(5)
Since f pxq ` x ` 1 ě C ` 1 ě 4, we obtain that
1 `ˇˇ ` ˘ˇ ˇ ˇ˘
|φpxq| ď φ x ` f px2 q ˇ ` ˇφpx2 qˇ . (6)
4
Since C ě a, there exists a finite supremum S “ sup |φpxq|. For each x P rC, `8q, both
xěC
x ` f px2 q and x2 are greater than x; hence they also lie in rC, `8q. Therefore, taking the
supremum of the left-hand side of (6) over x P rC, `8q, we obtain S ď S{2 and hence S “ 0.
Thus, φpxq “ 0 for all x ě C. l
C
(
It remains to show that f pyq “ y ` 1 when 0 ă y ă C. For each y, choose x ą max C, y .
Then all three numbers x, xy, and x ` f pxyq are greater than C, so p˚q reads as

px ` xy ` 1q ` 1 ` y “ px ` 1qf pyq ` 1, hence f pyq “ y ` 1.

Comment 1. It may be useful to rewrite p˚q in the form


` ˘
φ x ` f pxyq ` φpxyq “ φpxqφpyq ` xφpyq ` yφpxq ` φpxq ` φpyq.

This general identity easily implies both (1) and (5).

Comment 2. There are other ways to prove that f pxq ě x ` 1. Once one has proved this, they can
use this stronger estimate instead of (3) in the proof of Lemma 1. Nevertheless, this does not make
this proof simpler. So proving that f pxq ě x ` 1 does not seem to be a serious progress towards the
solution of the problem. In what follows, we outline one possible proof of this inequality.
First of all, we improve inequality (3) by noticing that, in fact, f pxqf pyq ě y ´ 1 ` M , and hence
y´1
f pyq ě ` 1. (7)
M
Now we divide the argument into two steps.
Step 1: We show that M ď 1.
Suppose that M ą 1; recall the notation a “ f p1q. Substituting y “ 1{x in p˚q, we get
ˆ ˙
1 1
f px ` aq “ f pxqf ` 1 ´ ě M f pxq,
x x

provided that x ě 1. By a straightforward induction on rpx ´ 1q{as, this yields

f pxq ě M px´1q{a . (8)

Now choose an arbitrary x0 P R` and define a sequence x0 , x1 , . . . by xn`1 “ xn ` f pxn q ě xn ` M


for all n ě 0; notice that the sequence is unbounded. On the other hand, by (4) we get

axn`1 ą af pxn q “ f pxn`1 q ě M pxn`1 ´1q{a ,

which cannot hold when xn`1 is large enough.


Shortlisted problems – solutions 29

Step 2: We prove that f pyq ě y ` 1 for all y P R` .


Arguing indirectly, choose y P R` such that f pyq ă y ` 1, and choose µ with f pyq ă µ ă y ` 1. Define a
sequence x0 , x1 , . . . by choosing a large x0 ě 1 and setting xn`1 “ xn ` f pxn yq` ě xn ` M
˘ for all n ě 0
(this sequence is also unbounded). If x0 is large enough, then (7) implies that µ ´ f pyq f pxn q ě 1 ´ y
for all n. Therefore,
f pxn`1 q “ f pyqf pxn q ` 1 ´ y ď µf pxn q.
On the other hand, since M ď 1, inequality (7) implies that f pzq ě z, provided that z ě 1. Hence,
if x0 is large enough, we have xn`1 ě xn p1 ` yq for all n. Therefore,

x0 p1 ` yqn ď xn ď f pxn q ď µn f px0 q,

which cannot hold when n is large enough.


30 Saint-Petersburg — Russia, 18th–28th September 2020

Combinatorics
C1. Let n be a positive integer. Find the number of permutations a1 , a2 , . . . , an of the
sequence 1, 2, . . . , n satisfying

a1 ď 2a2 ď 3a3 ď . . . ď nan . p˚q

(United Kingdom)

Answer: The number of such permutations is Fn`1 , where Fk is the k th Fibonacci number:
F1 “ F2 “ 1, Fn`1 “ Fn ` Fn´1 .

Solution 1. Denote by Pn the number of permutations that satisfy p˚q. It is easy to see that
P1 “ 1 and P2 “ 2.
Lemma 1. Let n ě 3. If a permutation a1 , . . . , an satisfies p˚q then either an “ n, or an´1 “ n
and an “ n ´ 1.
Proof. Let k be the index for which ak “ n. If k “ n then we are done.
If k “ n ´ 1 then, by p˚q, we have npn ´ 1q “ pn ´ 1qan´1 ď nan , so an ě n ´ 1. Since
an ‰ an´1 “ n, the only choice for an is an “ n ´ 1.
Now suppose that k ď n ´ 2. For every k ă i ă n we have kn “ kak ď iai ă nai , so
ai ě k ` 1. Moreover, nan ě pn ´ 1qan´1 ě pn ´ 1qpk ` 1q “ nk ` pn ´ 1 ´ kq ą nk, so
an ě k ` 1. Now the n ´ k ` 1 numbers ak , ak`1 , . . . , an are all greater than k; but there are
only n ´ k such values; this is not possible. l
If an “ n then a1 , a2 , . . . , an´1 must be a permutation of the numbers 1, . . . , n ´ 1 satisfying
a1 ď 2a2 ď . . . ď pn ´ 1qan´1 ; there are Pn´1 such permutations. The last inequality in p˚q,
pn ´ 1qan´1 ď nan “ n2 , holds true automatically.
If pan´1 , an q “ pn, n ´ 1q, then a1 , . . . , an´2 must be a permutation of 1, . . . , n ´ 2 satisfying
a1 ď . . . ď pn ´ 2qan´2 ; there are Pn´2 such permutations. The last two inequalities in p˚q hold
true automatically by pn ´ 2qan´2 ď pn ´ 2q2 ă npn ´ 1q “ pn ´ 1qan´1 “ nan .
Hence, the sequence pP1 , P2 , . . .q satisfies the recurrence relation Pn “ Pn´1 `Pn´2 for n ě 3.
The first two elements are P1 “ F2 and P2 “ F3 , so by a trivial induction we have Pn “ Fn`1 .

Solution 2. We claim that all sought permutations are of the following kind. Split t1, 2, . . . , nu
into singletons and pairs of adjacent numbers. In each pair, swap the two numbers and keep
the singletons unchanged.
Such permutations correspond to tilings of a 1 ˆ n chessboard using dominoes and unit
squares; it is well-known that the number of such tilings is the Fibonacci number Fn`1 .
The claim follows by induction from
Lemma 2. Assume that a1 , . . . , an is a permutation satisfying p˚q, and k is an integer such that
1 ď k ď n and ta1 , a2 , . . . , ak´1 u “ t1, 2, . . . , k ´ 1u. (If k “ 1, the condition is empty.) Then
either ak “ k, or ak “ k ` 1 and ak`1 “ k.
Proof. Choose t with at “ k. Since k R ta1 , . . . , ak´1 u, we have either t “ k or t ą k. If t “ k
then we are done, so assume t ą k.
Notice that one of the numbers among the t ´ k numbers ak , ak`1 , . . . , at´1 is at least t,
because there are only t ´ k ´ 1 values between k and t. Let i be an index with k ď i ă t and
ai ě t; then kt “ tat ě iai ě it ě kt, so that all the inequalities turn into equalities, hence
i “ k and ak “ t. If t “ k ` 1, we are done.
Suppose that t ą k ` 1. Then the chain of inequalities kt “ kak ď . . . ď tat “ kt should
also turn into a chain of equalities. From this point we can find contradictions in several ways;
kt k
for example by pointing to at´1 “ t´1 “ k ` t´1 which cannot be an integer, or considering
Shortlisted problems – solutions 31

the product of the numbers pk ` 1qak`1 , . . . , pt ´ 1qat´1 ; the numbers ak`1 , . . . , at´1 are distinct
and greater than k, so
˘2
pktqt´k´1 “ pk ` 1qak`1 ¨ pk ` 2qak`2 ¨ . . . ¨ pt ´ 1qat´1 ě pk ` 1qpk ` 2q ¨ . . . ¨ pt ´ 1q .
`

Notice that pk `iqpt´iq “ kt`ipt´k ´iq ą kt for 1 ď i ă t´k. This leads to the contradiction

˘2 t´k´1
ź
pktqt´k´1 ě pk ` 1qpk ` 2q ¨ . . . ¨ pt ´ 1q “ pk ` iqpt ´ iq ą pktqt´k´1 .
`
i“1

Therefore, the case t ą k ` 1 is not possible. l


32 Saint-Petersburg — Russia, 18th–28th September 2020

C2. In a regular 100-gon, 41 vertices are colored black and the remaining 59 vertices are
colored white. Prove that there exist 24 convex quadrilaterals Q1 , . . . , Q24 whose corners are
vertices of the 100-gon, so that

• the quadrilaterals Q1 , . . . , Q24 are pairwise disjoint, and

• every quadrilateral Qi has three corners of one color and one corner of the other color.

(Austria)

Solution. Call a quadrilateral skew-colored, if it has three corners of one color and one corner
of the other color. We will prove the following
Claim. If the vertices of a convex p4k ` 1q-gon P are colored black and white such that each
color is used at least k times, then there exist k pairwise disjoint skew-colored quadrilaterals
whose vertices are vertices of P . (One vertex of P remains unused.)
The problem statement follows by removing 3 arbitrary vertices of the 100-gon and applying
the Claim to the remaining 97 vertices with k “ 24.
Proof of the Claim. We prove by induction. For k “ 1 we have a pentagon with at least
one black and at least one white vertex. If the number of black vertices is even then remove
a black vertex; otherwise remove a white vertex. In the remaining quadrilateral, there are an
odd number of black and an odd number of white vertices, so the quadrilateral is skew-colored.
For the induction step, assume k ě 2. Let b and w be the numbers of black and white
vertices, respectively; then b, w ě k and b ` w “ 4k ` 1. Without loss of generality we may
assume w ě b, so k ď b ď 2k and 2k ` 1 ď w ď 3k ` 1.
We want to find four consecutive vertices such that three of them are white, the fourth one
is black. Denote the vertices by V1 , V2 , . . . , V4k`1 in counterclockwise order, such that V4k`1 is
black, and consider the following k groups of vertices:

pV1 , V2 , V3 , V4 q, pV5 , V6 , V7 , V8 q, . . . , pV4k´3, V4k´2 , V4k´1 , V4k q

In these groups there are w white and b ´ 1 black vertices. Since w ą b ´ 1, there is a group,
pVi , Vi`1 , Vi`2 , Vi`3 q that contains more white than black vertices. If three are white and one
is black in that group, we are done. Otherwise, if Vi , Vi`1 , Vi`2 , Vi`3 are all white then let Vj
be the first black vertex among Vi`4 , . . . , V4k`1 (recall that V4k`1 is black); then Vj´3, Vj´2 and
Vj´1 are white and Vj is black.
Now we have four consecutive vertices Vi , Vi`1 , Vi`2, Vi`3 that form a skew-colored quadri-
lateral. The remaining vertices form a convex p4k ´ 3q-gon; w ´ 3 of them are white and b ´ 1
are black. Since b ´ 1 ě k ´ 1 and w ´ 3 ě p2k ` 1q ´ 3 ą k ´ 1, we can apply the Claim
with k ´ 1. l

Comment. It is not true that the vertices of the 100-gon can be split into 25 skew-colored quadri-
laterals. A possible counter-example is when the vertices V1 , V3 , V5 , . . . , V81 are black and the other
vertices, V2 , V4 , . . . , V80 and V82 , V83 , . . . , V100 are white. For having 25 skew-colored quadrilaterals,
there should be 8 containing three black vertices. But such a quadrilateral splits the other 96 vertices
into four sets in such a way that at least two sets contain odd numbers of vertices and therefore they
cannot be grouped into disjoint quadrilaterals.
odd
odd
Shortlisted problems – solutions 33

C3. Let n be an integer with n ě 2. On a slope of a mountain, n2 checkpoints are


marked, numbered from 1 to n2 from the bottom to the top. Each of two cable car companies,
A and B, operates k cable cars numbered from 1 to k; each cable car provides a transfer from
some checkpoint to a higher one. For each company, and for any i and j with 1 ď i ă j ď k,
the starting point of car j is higher than the starting point of car i; similarly, the finishing point
of car j is higher than the finishing point of car i. Say that two checkpoints are linked by some
company if one can start from the lower checkpoint and reach the higher one by using one or
more cars of that company (no movement on foot is allowed).
Determine the smallest k for which one can guarantee that there are two checkpoints that
are linked by each of the two companies.
(India)

Answer: k “ n2 ´ n ` 1.

Solution. We start with showing that for any k ď n2 ´ n there may be no pair of checkpoints
linked by both companies. Clearly, it suffices to provide such an example for k “ n2 ´ n.
Let company A connect the pairs of checkpoints of the form pi, i ` 1q, where n ∤ i. Then all
pairs of checkpoints pi, jq linked by A satisfy ri{ns “ rj{ns.
Let company B connect the pairs of the form pi, i ` nq, where 1 ď i ď n2 ´ n. Then pairs
of checkpoints pi, jq linked by B satisfy i ” j pmod nq. Clearly, no pair pi, jq satisfies both
conditions, so there is no pair linked by both companies.
Now we show that for k “ n2 ´ n ` 1 there always exist two required checkpoints. Define
an A-chain as a sequence of checkpoints a1 ă a2 ă . . . ă at such that company A connects ai
with ai`1 for all 1 ď i ď t ´ 1, but there is no A-car transferring from some checkpoint to a1
and no A-car transferring from at to any other checkpoint. Define B-chains similarly. Moving
forth and back, one easily sees that any checkpoint is included in a unique A-chain (possibly
consisting of that single checkpoint), as well as in a unique B-chain. Now, put each checkpoint
into a correspondence to the pair of the A-chain and the B-chain it belongs to.
All finishing points of A-cars are distinct, so there are n2 ´ k “ n ´ 1 checkpoints that are
not such finishing points. Each of them is a starting point of a unique A-chain, so the number of
A-chains is n ´ 1. Similarly, the number of B-chains also equals n ´ 1. Hence, there are pn ´ 1q2
pairs consisting of an A- and a B-chain. Therefore, two of the n2 checkpoints correspond to
the same pair, so that they belong to the same A-chain, as well as to the same B-chain. This
means that they are linked by both companies, as required.

Comment 1. The condition that the ith car starts and finishes lower than the j th one is used only
in the “moving forth and back” argument and in the counting of starting points of the chains. In both
cases, the following weaker assumption suffices: No two cars of the same company start at the same
checkpoint, and no two such cars finish at the same checkpoint.
Thus, the problem conditions could be weakened in this way„ with no affect on the solution.
P? T
Comment 2. If the number of checkpoints were N , then the answer would be N ´ N ` 1. The
solution above works verbatim for this generalization.
34 Saint-Petersburg — Russia, 18th–28th September 2020

C4. The Fibonacci numbers F0 , F1 , F2 , . . . are defined inductively by F0 “ 0, F1 “ 1, and


Fn`1 “ Fn ` Fn´1 for n ě 1. Given an integer n ě 2, determine the smallest size of a set S of
integers such that for every k “ 2, 3, . . . , n there exist some x, y P S such that x ´ y “ Fk .
(Croatia)

Answer: rn{2s ` 1.

Solution. First we show that if a set S Ă Z satisfies the conditions then |S| ě n2 ` 1.
Let d “ rn{2s, so n ď 2d ď n ` 1. In order to prove that |S| ě d ` 1, construct a graph
as follows. Let the vertices of the graph be the elements of S. For each 1 ď k ď d, choose two
elements x, y P S such that x ´ y “ F2k´1 , and add the pair px, yq to the graph as edge. (Note
that by the problem’s constraints, there must be a pair px, yq with x ´ y “ F2k´1 for every
3 ď 2k ´ 1 ď 2d ´ 1 ď n; moreover, due to F1 “ F2 we have a pair with x ´ y “ F1 as well.)
We will say that the length of the edge px, yq is |x ´ y|.
We claim that the graph contains no cycle. For the sake of contradiction, suppose that
the graph contains a cycle px1 , . . . , xℓ q, and let the longest edge in the cycle be px1 , xℓ q with
length F2m`1 . The other edges px1 , x2 q, . . . , pxℓ´1 , xℓ q in the cycle are shorter than F2m`1 and
distinct, their lengths form a subset of tF1 , F3 , . . . , F2m´1 u. But this is not possible because
ℓ´1
ÿ
F2m`1 “ |xℓ ´ x1 | ď |xi`1 ´ xi | ď F1 ` F3 ` F5 ` . . . ` F2m´1
i“1
“ F2 ` pF4 ´ F2 q ` pF6 ´ F4 q ` . . . ` pF2m ´ F2m´2 q “ F2m ă F2m`1 .

Hence, the graph has d edges and cannot contain a cycle, therefore it must contain at least
d ` 1 vertices, so |S| ě d ` 1.

Now we show a suitable set with d ` 1 elements. Let

S “ tF0 , F2 , F4 , F5 , . . . , F2d u.

For 1 ď k ď d we have F0 , F2k´2 , F2k P S with differences F2k ´F2k´2 “ F2k´1 and F2k ´F0 “ F2k ,
so each of F1 , F2 , . . . , F2d occurs as difference between two elements in S. So this set containing
d ` 1 numbers is suitable.
Shortlisted problems – solutions 35

This page is intentionally left blank


36 Saint-Petersburg — Russia, 18th–28th September 2020

C5. Let p be an odd prime, and put N “ 41 pp3 ´ pq ´ 1. The numbers 1, 2, . . . , N are
painted arbitrarily in two colors, red and blue. For any positive integer n ď N, denote by rpnq
the fraction of integers in t1, 2, . . . , nu that are red.
Prove that there exists a positive integer a P t1, 2, . . . , p ´ 1u such that rpnq ‰ a{p for all
n “ 1, 2, . . . , N.
(Netherlands)

Solution. Denote by Rpnq the number of red numbers in t1, 2, . . . , nu, i.e., Rpnq “ nrpnq.
Similarly, denote by Bpnq and bpnq “ Bpnq{n the number and proportion of blue numbers
in t1, 2, . . . , nu, respectively. Notice that Bpnq ` Rpnq “ n and bpnq ` rpnq “ 1. Therefore, the
statement of the problem does not change after swapping the colors.
Arguing indirectly, for every a P t1, 2, . . . , p ´ 1u choose some positive integer na such that
rpna q “ a{p and, hence, Rpna q “ ana {p. Clearly, p | na , so that na “ pma for some positive
integer ma , and Rpna q “ ama . Without loss of generality, we assume that m1 ă mp´1 , as
otherwise one may swap the colors. Notice that

N p2 ´ 1
ma ď ă for all a “ 1, 2, . . . , p ´ 1. (1)
p 4

The solution is based on a repeated application of the following simple observation.


Claim. Assume that ma ă mb for some a, b P t1, 2, . . . , p ´ 1u. Then
a p´a
mb ě ma and mb ě ma .
b p´b

Proof. The first inequality follows from bmb “ Rpnb q ě Rpna q “ ama . The second inequality is
obtained by swapping colors . l
Let q “ pp ´ 1q{2. We distinguish two cases.
Case 1: All q numbers m1 , m2 , . . . , mq are smaller than mp´1 .
Let ma be the maximal number among m1 , m2 , . . . , mq ; then ma ě q ě a. Applying the Claim,
we get
p´a p2 ´ 1
mp´1 ě ma ě pp ´ qqq “ ,
p ´ pp ´ 1q 4
which contradicts (1).
Case 2: There exists k ď q such that mk ą mp´1 .
Choose k to be the smallest index satisfying mk ą mp´1 ; by our assumptions, we have 1 ă k ď
q ă p ´ 1.
Let ma be the maximal number among m1 , m2 , . . . , mk´1 ; then a ď k ´ 1 ď ma ă mp´1 .
Applying the Claim, we get

p´1 p´1 p´a


mk ě mp´1 ě ¨ ma
k k p ´ pp ´ 1q
p´1 k´1 1 p2 ´ 1
ě ¨ pp ´ k ` 1qpk ´ 1q ě ¨ pp ´ 1qpp ´ qq ě ¨
k k 2 2
which contradicts (1) again.

Comment 1. The argument in Case 2, after a slight modification of estimates at the end, applies
as soon as there exists k ă 3pp`1q
4 with ak ă ap´1 . However, this argument does not seem to work if
there is no such k.
Shortlisted problems – solutions 37

Comment 2. If p is small enough, then one can color t1, 2, . . . , N `1u so that there exist numbers m1 ,
m2 , . . . , mp´1 satisfying rppma q “ a{p. For p “ 3, 5, 7, one can find colorings providing the following
sequences:

pm1 , m2 q “ p1, 2q, pm1 , m2 , m3 , m4 q “ p1, 2, 3, 6q, and pm1 , . . . , , m6 q “ p1, 2, 3, 4, 6, 12q,

respectively.
Thus, for small values of p, the number N in the problem statement cannot be increased. However,
a careful analysis of the estimates shows that this number can be slightly increased for p ě 11.
38 Saint-Petersburg — Russia, 18th–28th September 2020

C6. 4n coins of weights 1, 2, 3, . . . , 4n are given. Each coin is colored in one of n colors
and there are four coins of each color. Show that all these coins can be partitioned into two
sets with the same total weight, such that each set contains two coins of each color.
(Hungary)
Solution 1. Let us pair the coins with weights summing up to 4n ` 1, resulting in the set S
of 2n pairs: t1, 4nu, t2, 4n ´ 1u, . . . , t2n, 2n ` 1u. It suffices to partition S into two sets, each
consisting of n pairs, such that each set contains two coins of each color.
Introduce a multi-graph G (i.e., a graph with loops and multiple edges allowed) on n vertices,
so that each vertex corresponds to a color. For each pair of coins from S, we add an edge between
the vertices corresponding to the colors of those coins. Note that each vertex has degree 4. Also,
a desired partition of the coins corresponds to a coloring of the edges of G in two colors, say
red and blue, so that each vertex has degree 2 with respect to each color (i.e., each vertex has
equal red and blue degrees).
To complete the solution, it suffices to provide such a coloring for each component G1 of G.
Since all degrees of the vertices are even, in G1 there exists an Euler circuit C (i.e., a circuit
passing through each edge of G1 exactly once). Note that the number of edges in C is even (it
equals twice the number of vertices in G1 ). Hence all the edges can be colored red and blue so
that any two edges adjacent in C have different colors (one may move along C and color the
edges one by one alternating red and blue colors). Thus in G1 each vertex has equal red and
blue degrees, as desired.
Comment 1. To complete Solution 1, any partition of the edges of G into circuits of even lengths
could be used. In the solution above it was done by the reference to the well-known Euler Circuit
Lemma: Let G be a connected graph with all its vertices of even degrees. Then there exists a circuit
passing through each edge of G exactly once.

Solution 2. As in Solution 1, we will show that it is possible to partition 2n pairs t1, 4nu,
t2, 4n ´ 1u, . . . , t2n, 2n ` 1u into two sets, each consisting of n pairs, such that each set contains
two coins of each color.
Introduce a multi-graph (i.e., a graph with multiple edges allowed) Γ whose vertices corre-
spond to coins; thus we have 4n vertices of n colors so that there are four vertices of each color.
Connect pairs of vertices t1, 4nu, t2, 4n ´ 1u, . . . , t2n, 2n ` 1u by 2n black edges.
Further, for each monochromatic quadruple of vertices i, j, k, ℓ we add a pair of grey edges
forming a matching, e.g., pi, jq and pk, ℓq. In each of n colors of coins we can choose one of
three possible matchings; this results in 3n ways of constructing grey edges. Let us call each of
3n possible graphs Γ a cyclic graph. Note that in a cyclic graph Γ each vertex has both black
and grey degrees equal to 1. Hence Γ is a union of disjoint cycles, and in each cycle black and
grey edges alternate (in particular, all cycles have even lengths).
It suffices to find a cyclic graph with all its cycle lengths divisible by 4. Indeed, in this case,
for each cycle we start from some vertex, move along the cycle and recolor the black edges
either to red or to blue, alternating red and blue colors. Now blue and red edges define the
required partition, since for each monochromatic quadruple of vertices the grey edges provide
a bijection between the endpoints of red and blue edges.
Among all possible cyclic graphs, let us choose graph Γ0 having the minimal number of
components (i.e., cycles). The following claim completes the solution.
Claim. In Γ0 , all cycle lengths are divisible by 4.
Proof. Assuming the contrary, choose a cycle C1 with an odd number of grey edges. For some
color c the cycle C1 contains exactly one grey edge joining two vertices i, j of color c, while the
other edge joining two vertices k, ℓ of color c lies in another cycle C2 . Now delete edges pi, jq
and pk, ℓq and add edges pi, kq and pj, ℓq. By this switch we again obtain a cyclic graph Γ10 and
decrease the number of cycles by 1. This contradicts the choice of Γ0 . l
Shortlisted problems – solutions 39

Comment 2. Use of an auxiliary graph and reduction to a new problem in terms of this graph is one
of the crucial steps in both solutions presented. In fact, graph G from Solution 1 could be obtained
from any graph Γ from Solution 2 by merging the vertices of the same color.
40 Saint-Petersburg — Russia, 18th–28th September 2020

C7. Consider any rectangular table having finitely many rows and columns, with a real
number apr, cq in the cell in row r and column c. A pair pR, Cq, where R is a set of rows and
C a set of columns, is called a saddle pair if the following two conditions are satisfied:
piq For each row r 1 , there is r P R such that apr, cq ě apr 1 , cq for all c P C;
piiq For each column c1 , there is c P C such that apr, cq ď apr, c1 q for all r P R.
A saddle pair pR, Cq is called a minimal pair if for each saddle pair pR1 , C 1 q with R1 Ď R
and C 1 Ď C, we have R1 “ R and C 1 “ C.
Prove that any two minimal pairs contain the same number of rows.
(Thailand)

Solution 1. We say that a pair pR1 , C 1 q of nonempty sets is a subpair of a pair pR, Cq if
R1 Ď R and C 1 Ď C. The subpair is proper if at least one of the inclusions is strict.
Let pR1 , C1 q and pR2 , C2 q be two saddle pairs with |R1 | ą |R2 |. We will find a saddle
subpair pR1 , C 1 q of pR1 , C1 q with |R1 | ď |R2 |; clearly, this implies the desired statement.
Step
` 1: We ˘ construct
` maps
˘ ρ : R1 Ñ R1 and σ : C1 Ñ C1 such that |ρpR1 q| ď |R2 |, and
a ρpr1 q, c1 ě a r1 , σpc1 q for all r1 P R1 and c1 P C1 .
Since pR1 , C1 q is a saddle pair, for each r2 P R2 there is r1 P R1 such that apr1 , c1 q ě apr2 , c1 q
for all c1 P C1 ; denote one such an r1 by ρ1 pr2 q. Similarly, we define four functions
` ˘
ρ1 : R2 Ñ R1 such that a ρ1 pr2 q, c1 ě apr2 , c1 q for all r2 P R2 , c1 P C1 ;
` ˘
ρ2 : R1 Ñ R2 such that a ρ2 pr1 q, c2 ě apr1 , c2 q for all r1 P R1 , c2 P C2 ;
` ˘ (1)
σ1 : C2 Ñ C1 such that a r1 , σ1 pc2 q ď apr1 , c2 q for all r1 P R1 , c2 P C2 ;
` ˘
σ2 : C1 Ñ C2 such that a r2 , σ2 pc1 q ď apr2 , c1 q for all r2 P R2 , c1 P C1 .
Set now ρ “ ρ1 ˝ ρ2 : R1 Ñ R1 and σ “ σ1 ˝ σ2 : C1 Ñ C1 . We have
|ρpR1 q| “ |ρ1 pρ2 pR1 qq| ď |ρ1 pR2 q| ď |R2 |.
Moreover, for all r1 P R1 and c1 P C1 , we get
` ˘ ` ˘ ` ˘ ` ˘
a ρpr1 q, c1 “ a ρ1 pρ2 pr1 qq, c1 ě a ρ2 pr1 q, c1 ě a ρ2 pr1 q, σ2 pc1 q
` ˘ ` ˘ ` ˘
ě a r1 , σ2 pc1 q ě a r1 , σ1 pσ2 pc1 qq “ a r1 , σpc1 q , (2)
as desired.
Step 2: Given maps ρ and σ, we construct a proper saddle subpair pR1 , C 1 q of pR1 , C1 q.
The properties of ρ and σ yield that
a ρi pr1 q, c1 ě a ρi´1 pr1 q, σpc1 q ě . . . ě a r1 , σ i pc1 q ,
` ˘ ` ˘ ` ˘

for each positive integer i and all r1 P R1 , c1 P C1 .


Consider the images Ri “ ρi pR1 q and C i “ σ i pC1 q. Clearly, R1 “ R0 Ě R1 Ě R2 Ě . . . and
C1 “ C 0 Ě C 1 Ě C 2 Ě . . .. Since both chains consist of finite sets, there is an index n such
that Rn “ Rn`1 “ . . . and C n “ C n`1 “ . . .. Then ρn pRn q “ R2n “ Rn , so ρn restricted to Rn
is a bijection. Similarly, σ n restricted to C n is a bijection from C n to itself. Therefore, there
exists a positive integer k such that ρnk acts identically on Rn , and σ nk acts identically on C n .
We claim now that pRn , C n q is a saddle subpair of pR1 , C1 q, with |Rn | ď |R1 | “ |ρpR1 q| ď
|R2 |, which is what we needed. To check that this is a saddle pair, take any row r 1 ; since
pR1 , C1 q is a saddle pair, there exists r1 P R1 such that apr1 , c1 q ě apr 1 , c1 q for all c1 P C1 . Set
now r˚ “ ρnk pr1 q P Rn . Then, for each c P C n we have c “ σ nk pcq and hence
apr˚ , cq “ a ρnk pr1 q, c ě a r1 , σ nk pcq “ apr1 , cq ě apr 1 , cq,
` ˘ ` ˘

which establishes condition piq. Condition piiq is checked similarly.


Shortlisted problems – solutions 41

Solution 2. Denote by R and C the set of all rows and the set of all columns of the table,
respectively. Let T denote the given table; for a set R of rows and a set C of columns, let
T rR, Cs denote the subtable obtained by intersecting rows from R and columns from C.
We say that row r1 exceeds row r2 in range of columns C (where C Ď C) and write r1 ľC r2
or r2 ĺC r1 , if apr1 , cq ě apr2 , cq for all c P C. We say that a row r1 is equal to a row r2 in
range of columns C and write r1 ”C r2 , if apr1 , cq “ apr2 , cq for all c P C. We introduce similar
notions, and use the same notation, for columns. Then conditions (i ) and (ii ) in the definition
of a saddle pair can be written as (i ) for each r 1 P R there exists r P R such that r ľC r 1 ; and
(ii ) for each c1 P C there exists c P C such that c ĺR c1 .
Lemma. Suppose that pR, Cq is a minimal pair. Remove from the table several rows outside
of R and/or several columns outside of C. Then pR, Cq remains a minimal pair in the new
table.
Proof. Obviously, pR, Cq remains a saddle pair. Suppose pR1 , C 1 q is a proper subpair of pR, Cq.
Since pR, Cq is a saddle pair, for each row r ˚ of the initial table, there is a row r P R such that
r ľC r ˚ . If pR1 , C 1 q became saddle after deleting rows not in R and/or columns not in C, there
would be a row r 1 P R1 satisfying r 1 ľC 1 r. Therefore, we would obtain that r 1 ľC 1 r ˚ , which is
exactly condition piq for the pair pR1 , C 1 q in the initial table; condition pii) is checked similarly.
Thus, pR1 , C 1 q was saddle in the initial table, which contradicts the hypothesis that pR, Cq was
minimal. Hence, pR, Cq remains minimal after deleting rows and/or columns. l
By the Lemma, it suffices to prove the statement of the problem in the case R “ R1 YR2 and
C “ C1 Y C2 . Further, suppose that there exist rows that belong both to R1 and R2 . Duplicate
every such row, and refer one copy of it to the set R1 , and the other copy to the set R2 . Then
pR1 , C1 q and pR2 , C2 q will remain minimal pairs in the new table, with the same numbers of
rows and columns, but the sets R1 and R2 will become disjoint. Similarly duplicating columns
in C1 X C2 , we make C1 and C2 disjoint. Thus it is sufficient to prove the required statement
in the case R1 X R2 “ ∅ and C1 X C2 “ ∅.
The rest of the solution is devoted to the proof of the following claim including the statement
of the problem.
Claim. Suppose that pR1 , C1 q and pR2 , C2 q are minimal pairs in table T such that R2 “ R z R1
and C2 “ C z C1 . Then |R1 | “ |R2 |, |C1 | “ |C2 |; moreover, there are four bijections
ρ1 : R2 Ñ R1 such that ρ1 pr2 q ”C1 r2 for all r2 P R2 ;
ρ2 : R1 Ñ R2 such that ρ2 pr1 q ”C2 r1 for all r1 P R1 ;
(3)
σ1 : C2 Ñ C1 such that σ1 pc2 q ”R1 c2 for all c2 P C 2 ;
σ2 : C1 Ñ C2 such that σ2 pc1 q ”R2 c1 for all c1 P C 1 .
We prove the Claim by induction on |R| ` |C|. In the base case we have |R1 | “ |R2 | “
|C1 | “ |C2 | “ 1; let Ri “ tri u and Ci “ tci u. Since pR1 , C1q and pR2 , C2 q are saddle pairs,
we have apr1 , c1 q ě apr2 , c1 q ě apr2 , c2 q ě apr1 , c2 q ě apr1 , c1 q, hence, the table consists of four
equal numbers, and the statement follows.
To prove the inductive step, introduce the maps ρ1 , ρ2 , σ1 , and σ2 as in Solution 1, see (1).
Suppose first that all four maps are surjective. Then, in fact, we have |R1 | “ |R2 |, |C1 | “ |C2 |,
and all maps are bijective. Moreover, for all r2 P R2 and c2 P C2 we have

apr2 , c2 q ď a r2 , σ2´1 pc2 q ď a ρ1 pr2 q, σ2´1 pc2 q ď a ρ1 pr2 q, σ1´1 ˝ σ2´1 pc2 q
` ˘ ` ˘ ` ˘

ď a ρ2 ˝ ρ1 pr2 q, σ1´1 ˝ σ2´1 pc2 q . (4)


` ˘

Summing up, we get


ÿ ÿ
a ρ2 ˝ ρ1 pr2 q, σ1´1 ˝ σ2´1 pc2 q .
` ˘
apr2 , c2 q ď
r2 PR2 r2 PR2
c2 PC2 c2 PC2
42 Saint-Petersburg — Russia, 18th–28th September 2020

Since ρ1 ˝ ρ2 and σ1´1 ˝ σ2´1 are permutations of R2 and C2 , respectively, this inequality is in fact
equality. Therefore, all inequalities in (4) turn into equalities, which establishes the inductive
step in this case.
It remains to show that all four maps are surjective. For the sake of contradiction, we
assume that ρ1 is not surjective. Now let R11 “ ρ1 pR2 q and C11 “ σ1 pC2 q, and set R˚ “ R1 z R11
and C ˚ “ C1 z C11 . By our assumption, R˚ ‰ ∅.
Let Q be the table obtained from T by removing the rows in R˚ and the columns in C ˚ ;
in other words, Q “ T rR11 Y R2 , C11 Y C2 s. By the definition of ρ1 , for each r2 P R2 we have
ρ1 pr2 q ľC1 r2 , so a fortiori ρ1 pr2 q ľC11 r2 ; moreover, ρ1 pr2 q P R11 . Similarly, C11 Q σ1 pc2 q ĺR11 c2
for each c2 P C2 . This means that pR11 , C11 q is a saddle pair in Q. Recall that pR2 , C2 q remains
a minimal pair in Q, due to the Lemma.
Therefore, Q admits a minimal pair pR1 , C 1 q such that R1 Ď R11 and C 1 Ď C11 . For a
minute, confine ourselves to the subtable Q “ QrR1 Y R2 , C 1 Y C2 s. By the Lemma, the
pairs pR1 , C 1 q and pR2 , C2 q are also minimal in Q. By the inductive hypothesis, we have
|R2 | “ |R1 | ď |R11 | “ |ρ1 pR2 q| ď |R2 |, so all these inequalities are in fact equalities. This
implies that R2 “ R21 and that ρ1 is a bijection R2 Ñ R11 . Similarly, C 1 “ C11 , and σ1 is a
bijection C2 Ñ C11 . In particular, pR11 , C11 q is a minimal pair in Q.
Now, by inductive hypothesis again, we have |R11 | “ |R2 |, |C11 | “ |C2 |, and there exist four
bijections
ρ11 : R2 Ñ R11 such that ρ11 pr2 q ”C11 r2 for all r2 P R2 ;
ρ12 : R11Ñ R2 such that ρ12 pr1 q ”C2 r1 for all r1 P R11 ;
σ11 : C2 Ñ C11 such that σ11 pc2 q ”R11 c2 for all c2 P C2 ;
σ21 : C11 Ñ C2 such that σ21 pc1 q ”R2 c1 for all c1 P C11 .
Notice here that σ1 and σ11 are two bijections C2 Ñ C11 satisfying σ11 pc2 q ”R11 c2 ľR1 σ1 pc2 q for
all c2 P C2 . Now, if σ11 pc2 q ‰ σ1 pc2 q for some c2 P C2˘, then we could remove column σ11 pc2 q
from C11 obtaining another saddle pair R11 , C11 ztσ11 pc2 qu in Q. This is impossible for a minimal
`

pair pR11 , C11 q; hence the maps σ1 and σ11 coincide.


Now we are prepared to show that pR11 , C11 q is a saddle pair in T , which yields a desired
contradiction (since pR1 , C1q is not minimal). By symmetry, it suffices to find, for each r 1 P R,
a row r1 P R11 such that r1 ľC11 r 1 . If r 1 P R2 , then we may put r1 “ ρ1 pr 1 q; so, in the sequel we
assume r 1 P R1 .
There exists r2 P R2 such that r 1 ĺC2 r2 ; set r1 “ pρ12 q´1 pr2 q P R11 and recall that r1 ”C2
r2 ľC2 r 1 . Therefore, implementing the bijection σ1 “ σ11 , for each c1 P C11 we get
apr 1 , c1 q ď a r 1 , σ1´1 pc1 q ď a r1 , σ1´1 pc1 q “ a r1 , σ11 ˝ σ1´1 pc1 q “ a r1 , c1 ,
` ˘ ` ˘ ` ˘ ` ˘

which shows r 1 ĺC11 r1 , as desired. The inductive step is completed.


Comment 1. For two minimal pairs pR1 , C1 q and pR2 , C2 q, Solution 2 not only proves the required
equalities |R1 | “ |R2 | and |C1 | “ |C2 |, but also shows the existence of bijections (3). In simple
words, this means that the four subtables T rR1 , C1 s, T rR1 , C2 s, T rR2 , C1 s, and T rR2 , C2 s differ only
by permuting rows/columns. Notice that the existence of such bijections immediately implies that
pR1 , C2 q and pR2 , C1 q are also minimal pairs.
This stronger claim may also be derived directly from the arguments in Solution 1, even without
the assumptions R1 X R2 “ ∅ and C1 X C2 “ ∅. Indeed, if |R1 | “ |R2 | and |C1 | “ |C2 |, then similar
arguments show that Rn “ R1 , C n “ C1 , and for any r P Rn and c P C n we have
apr, cq “ a ρnk prq, c ě a ρnk´1 prq, σpcq ě . . . ě a r, σ nk pcq “ apr, cq.
` ˘ ` ˘ ` ˘

This yields that all above inequalities turn into equalities. Moreover, this yields that all inequalities
in (2) turn into equalities. Hence ρ1 , ρ2 , σ1 , and σ2 satisfy (3).
It is perhaps worth mentioning that one cannot necessarily find the maps in (3) so as to satisfy
ρ1 “ ρ´1 ´1
2 and σ1 “ σ2 , as shown by the table below.
Shortlisted problems – solutions 43

1 0 0 1
0 1 1 0
1 0 1 0
0 1 0 1

Comment 2. One may use the following, a bit more entertaining formulation of the same problem.
On a specialized market, a finite number of products are being sold, and there are finitely many retailers
each selling all the products by some prices. Say that retailer r1 dominates retailer r2 with respect to
a set of products P if r1 ’s price of each p P P does not exceed r2 ’s price of p. Similarly, product p1
exceeds product p2 with respect to a set of retailers R, if r’s price of p1 is not less than r’s price of p2 ,
for each r P R.
Say that a set R of retailers and a set P of products form a saddle pair if for each retailer r 1 there
is r P R dominating r 1 with respect to P , and for each product p1 there is p P P exceeding p1 with
respect to R. A saddle pair pR, P q is called a minimal pair if for each saddle pair pR1 , P 1 q with R1 Ď R
and P 1 Ď P , we have R1 “ R and P 1 “ P .
Prove that any two minimal pairs contain the same number of retailers.
44 Saint-Petersburg — Russia, 18th–28th September 2020

C8. Players A and B play a game on a blackboard that initially contains 2020 copies
of the number 1. In every round, player A erases two numbers x and y from the blackboard,
and then player B writes one of the numbers x ` y and |x ´ y| on the blackboard. The game
terminates as soon as, at the end of some round, one of the following holds:
(1) one of the numbers on the blackboard is larger than the sum of all other numbers;
(2) there are only zeros on the blackboard.
Player B must then give as many cookies to player A as there are numbers on the blackboard.
Player A wants to get as many cookies as possible, whereas player B wants to give as few as
possible. Determine the number of cookies that A receives if both players play optimally.
(Austria)
Answer: 7.
Solution. For a positive integer n, we denote by S2 pnq the sum of digits in its binary represen-
tation. We prove that, in fact, if a board initially contains an even number n ą 1 of ones, then
A can guarantee to obtain S2 pnq, but not more, cookies. The binary representation of 2020 is
2020 “ 111111001002 , so S2 p2020q “ 7, and the answer follows.
A strategy for A. At any round, while possible, A chooses two equal nonzero numbers on
the board. Clearly, while A can make such choice, the game does not terminate. On the other
hand, A can follow this strategy unless the game has already terminated. Indeed, if A always
chooses two equal numbers, then each number appearing on the board is either 0 or a power of 2
with non-negative integer exponent, this can be easily proved using induction on the number
of rounds. At the moment when A is unable to follow the strategy all nonzero numbers on the
board are distinct powers of 2. If the board contains at least one such power, then the largest
of those powers is greater than the sum of the others. Otherwise there are only zeros on the
blackboard, in both cases the game terminates.
For every number on the board, define its range to be the number of ones it is obtained from.
We can prove by induction on the number of rounds that for any nonzero number k written by
B its range is k, and for any zero written by B its range is a power of 2. Thus at the end of each
round all the ranges are powers of two, and their sum is n. Since S2 pa ` bq ď S2 paq ` S2 pbq for
any positive integers a and b, the number n cannot be represented as a sum of less than S2 pnq
powers of 2. Thus at the end of each round the board contains at least S2 pnq numbers, while
A follows the above strategy. So A can guarantee at least S2 pnq cookies for himself.
Comment. There are different proofs of the fact that the presented strategy guarantees at least S2 pnq
cookies for A. For instance, one may denote by Σ the sum of numbers on the board, and by z the
number of zeros. Then the board contains at least S2 pΣq ` z numbers; on the other hand, during the
game, the number S2 pΣq ` z does not decrease, and its initial value is S2 pnq. The claim follows.

A strategy for B. Denote s “ S2 pnq.


Let x1 , . . . , xk be the numbers on the board at some moment of the game after B’s turn or
at the beginning of the game. Say that a collection of k signs ε1 , . . . , εk P t`1, ´1u is balanced if
k
ÿ
εi xi “ 0.
i“1

We say that a situation on the board is good if 2s`1 does not divide the number of balanced
collections. An appropriate strategy for B can be explained as follows: Perform a move so that
the situation remains good, while it is possible. We intend to show that in this case B will not
lose more than S2 pnq cookies. For this purpose, we prove several lemmas.
For a positive integer k, denote by ν2 pkq the exponent of the largest power of 2 that divides k.
Recall that, by Legendre’s formula, ν2 pn!q “ n ´ S2 pnq for every positive integer n.
Shortlisted problems – solutions 45

Lemma 1. The initial situation is good.


`n˘
Proof. In the initial configuration, the number of balanced collections is equal to n{2 . We have
˜ˆ ˙¸
n ` ˘ ` ˘ ´n ¯
ν2 “ ν2 pn!q ´ 2ν2 pn{2q! “ n ´ S2 pnq ´ 2 ´ S2 pn{2q “ S2 pnq “ s.
n{2 2

Hence 2s`1 does not divide the number of balanced collections, as desired. l
Lemma 2. B may play so that after each round the situation remains good.
Proof. Assume that the situation px1 , . . . , xk q before a round is good, and that A erases two
numbers, xp and xq .
Let N be the number of all balanced collections, N` be the number of those having εp “ εq ,
and N´ be the number of other balanced collections. Then N “ N` ` N´ . Now, if B replaces
xp and xq by xp ` xq , then the number of balanced collections will become N` . If B replaces
xp and xq by |xp ´ xq |, then this number will become N´ . Since 2s`1 does not divide N, it
does not divide one of the summands N` and N´ , hence B can reach a good situation after
the round. l
Lemma 3. Assume that the game terminates at a good situation. Then the board contains at
most s numbers.
Proof. Suppose, one of the numbers is greater than the sum of the other numbers. Then the
number of balanced collections is 0 and hence divisible by 2s`1 . Therefore, the situation is not
good.
Then we have only zeros on the blackboard at the moment when the game terminates. If
there are k of them, then the number of balanced collections is 2k . Since the situation is good,
we have k ď s. l
By Lemmas 1 and 2, B may act in such way that they keep the situation good. By Lemma 3,
when the game terminates, the board contains at most s numbers. This is what we aimed to
prove.

Comment 1. If the initial situation had some odd number n ą 1 of ones on the blackboard, player A
would still get S2 pnq cookies, provided that both players act optimally. The proof of this fact is similar
to the solution above, after one makes some changes in the definitions. Such changes are listed below.
Say that a collection of k signs ε1 , . . . , εk P t`1, ´1u is positive if
k
ÿ
εi xi ą 0.
i“1

For every index i “ 1, 2, . . . , k, we denote by Ni the number of positive collections such that εi “ 1.
Finally, say that a situation on the board is good if 2s´1 does not divide at least one of the numbers Ni .
Now, a strategy for B again consists in preserving the situation good, after each round.

Comment 2. There is an easier strategy for B, allowing, in the game starting with an even number
n of ones, to lose no more than d “ tlog2 pn ` 2qu ´ 1 cookies. If the binary representation of n contains
at most two zeros, then d “ S2 pnq, and hence the strategy is optimal in that case. We outline this
approach below.
First of all, we can assume that A never erases zeros from the blackboard. Indeed, A may skip
such moves harmlessly, ignoring the zeros in the further process; this way, A’s win will just increase.
We say that a situation on the blackboard is pretty if the numbers on the board can be partitioned
into two groups with equal sums. Clearly, if the situation before some round is pretty, then B may
play so as to preserve this property after the round. The strategy for B is as follows:
‚ B always chooses a move that leads to a pretty situation.
46 Saint-Petersburg — Russia, 18th–28th September 2020

‚ If both possible moves of B lead to pretty situations, then B writes the sum of the two numbers
erased by A.
Since the situation always remains pretty, the game terminates when all numbers on the board are
zeros.
Suppose that, at the end of the game, there are m ě d ` 1 “ tlog2 pn ` 2qu zeros on the board; then
2m ´ 1 ą n{2.
Now we analyze the whole process of the play. Let us number the zeros on the board in order
of appearance. During the play, each zero had appeared after subtracting two equal numbers. Let
n1 , . . . , nm be positive integers such that the first zero appeared after subtracting n1 from n1 , the
second zero appeared after subtracting n2 from n2 , and so on. Since the sum of the numbers on the
blackboard never increases, we have 2n1 ` . . . ` 2nm ď n, hence

n1 ` . . . ` nm ď n{2 ă 2m ´ 1.
m the set t1, 2, . . . , mu. For I Ď t1, 2, . . . , mu, denote by f pIq the sum
ř There are 2 subsets of m
iPI n i . There are less than 2 possible values for f pIq, so there are two distinct subsets I and J with
f pIq “ f pJq. Replacing I and J with I z J and J z I, we assume that I and J are disjoint.
Let i0 be the smallest number in I Y J; without loss of generality, i0 P I. Consider the round when
A had erased two numbers equal to ni0 , and B had put the i0 th zero instead, and the situation before
that round.
For each nonzero number z which is on the blackboard at this moment, we can keep track of it
during the further play until it enters one of the numbers ni , i ě i0 , which then turn into zeros. For
every i “ i0 , i0 ` 1, . . . , m, we denote by Xi the collection of all numbers on the blackboard that finally
enter the first copy of ni , and by Yi the collection of those finally entering the second copy of ni . Thus,
each of Xi0 and Yi0 consists of a single number. Since A never erases zeros, the 2pm ´ i0 ` 1q defined
sets are pairwise disjoint.
Clearly, for either of the collections Xi and Yi , a signed sum of its elements equals ni , for a proper
choice of the signs. Therefore, for every i “ i0 , i0 ` 1, . . . , m one can endow numbers in Xi Y Yi with
signs so that their sum becomes any of the numbers ´2ni , 0, or 2ni . Perform such endowment so as
to get 2ni from each collection Xi Y Yi with i P I, ´2nj from each collection Xj Y Yj with j P J, and
0 from each remaining collection. The obtained signed sum of all numbers on the blackboard equals
ÿ ÿ
2ni ´ 2ni “ 0,
iPI iPJ

and the numbers in Xi0 and Yi0 have the same (positive) sign.
This means that, at this round, B could add up the two numbers ni0 to get a pretty situation.
According to the strategy, B should have performed that, instead of subtracting the numbers. This
contradiction shows that m ď d, as desired.
Shortlisted problems – solutions 47

This page is intentionally left blank


48 Saint-Petersburg — Russia, 18th–28th September 2020

Geometry
G1. Let ABC be an isosceles triangle with BC “ CA, and let D be a point inside side
AB such that AD ă DB. Let P and Q be two points inside sides BC and CA, respectively,
such that =DP B “ =DQA “ 90˝ . Let the perpendicular bisector of P Q meet line segment
CQ at E, and let the circumcircles of triangles ABC and CP Q meet again at point F , different
from C.
Suppose that P, E, F are collinear. Prove that =ACB “ 90˝ .
(Luxembourg)

Solution 1. Let ℓ be the perpendicular bisector of P Q, and denote by ω the circle CF P Q.


By DP K BC and DQ K AC, the circle ω passes through D; moreover, CD is a diameter of ω.
The lines QE and P E are symmetric about ℓ, and ℓ is a symmetry axis of ω as well; it
follows that the chords CQ and F P are symmetric about ℓ, hence C and F are symmetric
about ℓ. Therefore, the perpendicular bisector of CF coincides with ℓ. Thus ℓ passes through
the circumcenter O of ABC.
Let M be the midpoint of AB. Since CM K DM, M also lies on ω. By =ACM “ =BCM,
the chords MP and MQ of ω are equal. Then, from MP “ MQ it follows that ℓ passes
through M.
ℓ C
ω

F E
P

A D M =O B

Finally, both O and M lie on lines ℓ and CM, therefore O “ M, and =ACB “ 90˝ follows.

Solution 2. Like in the first solution, we conclude that points C, P , Q, D, F and the midpoint
M of AB lie on one circle ω with diameter CD, and M lies on ℓ, the perpendicular bisector
of P Q.
Let BF and CM meet at G and let α “ =ABF . Then, since E lies on ℓ, and the
quadrilaterals F CBA and F CP Q are cyclic, we have
=CQP “ =F P Q “ =F CQ “ =F CA “ =F BA “ α.
Since points P , E, F are collinear, we have
=F EM “ =F EQ ` =QEM “ 2α ` p90˝ ´ αq “ 90˝ ` α.
But =F GM “ 90˝ ` α, so F EGM is cyclic. Hence
=EGC “ =EF M “ =P F M “ =P CM.
Thus GE k BC. It follows that =F AC “ =CBF “ =EGF , so F EGA is cyclic, too. Hence
=ACB “ =AF B “ =AF G “ 180˝ ´ =AMG “ 90˝ , that completes the proof.
Shortlisted problems – solutions 49

ℓ C
ω α

F E
α P
α

G
α
Q

α
A D M B

Comment 1. The converse statement is true: if =ACB “ 90˝ then points P , E and F are collinear.
This direction is easier to prove.

Comment 2. The statement of the problem remains true if the projection P of D onto BC lies outside
line segment BC. The restriction that P lies inside line segment BC is given to reduce case-sensitivity.
50 Saint-Petersburg — Russia, 18th–28th September 2020

G2. Let ABCD be a convex quadrilateral. Suppose that P is a point in the interior of
ABCD such that

=P AD : =P BA : =DP A “ 1 : 2 : 3 “ =CBP : =BAP : =BP C.

The internal bisectors of angles ADP and P CB meet at a point Q inside the triangle ABP .
Prove that AQ “ BQ.
(Poland)

Solution 1. Let ϕ “ =P AD and ψ “ =CBP ; then we have =P BA “ 2ϕ, =DP A “ 3ϕ,


=BAP “ 2ψ and =BP C “ 3ψ. Let X be the point on segment AD with =XP A “ ϕ. Then

=P XD “ =P AX ` =XP A “ 2ϕ “ =DP A ´ =XP A “ =DP X.

It follows that triangle DP X is isosceles with DX “ DP and therefore the internal angle
bisector of =ADP coincides with the perpendicular bisector of XP. Similarly, if Y is a point
on BC such that =BP Y “ ψ, then the internal angle bisector of =P CB coincides with the
perpendicular bisector of P Y . Hence, we have to prove that the perpendicular bisectors of XP ,
P Y , and AB are concurrent.
C
D

P
2ϕ 2ψ
ϕ ψ


X
2ϕ Y

O
ϕ ψ
2ψ 2ϕ
A B

Notice that

=AXP “ 180˝ ´ =P XD “ 180˝ ´ 2ϕ “ 180˝ ´ =P BA.

Hence the quadrilateral AXP B is cyclic; in other words, X lies on the circumcircle of trian-
gle AP B. Similarly, Y lies on the circumcircle of triangle AP B. It follows that the perpen-
dicular bisectors of XP , P Y , and AB all pass through the center of circle pABY P Xq. This
finishes the proof.

Comment. Introduction of points X and Y seems to be the key step in the solution above. Note that
the same point X could be introduced in different ways, e.g., as the point on the ray CP beyond P
such that =P BX “ ϕ, or as a point where the circle pAP Bq meets again AB. Different definitions of
X could lead to different versions of the further solution.

Solution 2. We define the angles ϕ “ =P AD, ψ “ =CBP and use =P BA “ 2ϕ, =DP A “
3ϕ, =BAP “ 2ψ and =BP C “ 3ψ again. Let O be the circumcenter of △AP B.
Notice that =ADP “ 180˝ ´ =P AD ´ =DP A “ 180˝ ´ 4ϕ, which, in particular, means
that 4ϕ ă 180˝ . Further, =P OA “ 2=P BA “ 4ϕ “ 180˝ ´ =ADP , therefore the quadrilateral
ADP O is cyclic. By AO “ OP , it follows that =ADO “ =ODP . Thus DO is the internal
bisector of =ADP . Similarly, CO is the internal bisector of =P CB.
Shortlisted problems – solutions 51

P
3ϕ 3ψ

4ϕ 4ψ
ϕ O ψ
2ψ 2ϕ
A B

Finally, O lies on the perpendicular bisector of AB as it is the circumcenter of △AP B.


Therefore the three given lines in the problem statement concur at point O.
52 Saint-Petersburg — Russia, 18th–28th September 2020

G3. Let ABCD be a convex quadrilateral with =ABC ą 90˝ , =CDA ą 90˝ , and
=DAB “ =BCD. Denote by E and F the reflections of A in lines BC and CD, respectively.
Suppose that the segments AE and AF meet the line BD at K and L, respectively. Prove that
the circumcircles of triangles BEK and DF L are tangent to each other.
(Slovakia)

Solution 1. Denote by A1 the reflection of A in BD. We will show that that the quadrilaterals
A1 BKE and A1 DLF are cyclic, and their circumcircles are tangent to each other at point A1 .
From the symmetry about line BC we have =BEK “ =BAK, while from the symmetry in
BD we have =BAK “ =BA1 K. Hence =BEK “ =BA1 K, which implies that the quadrilateral
A1 BKE is cyclic. Similarly, the quadrilateral A1 DLF is also cyclic.

K L
B D
F
E

A′ C

For showing that circles A1 BKE and A1 DLF are tangent it suffices to prove that

=A1 KB ` =A1 LD “ =BA1 D.

Indeed, by AK K BC, AL K CD, and again the symmetry in BD we have

=A1 KB ` =A1 LD “ 180˝ ´ =KA1 L “ 180˝ ´ =KAL “ =BCD “ =BAD “ =BA1 D,

as required.

Comment 1. The key to the solution above is introducing the point A1 ; then the angle calculations
can be done in many different ways.

Solution 2. Note that =KAL “ 180˝ ´ =BCD, since AK and AL are perpendicular to BC
and CD, respectively. Reflect both circles pBEKq and pDF Lq in BD. Since =KEB “ =KAB
and =DF L “ =DAL, the images are the circles pKABq and pLADq, respectively; so they meet
at A. We need to prove that those two reflections are tangent at A.
For this purpose, we observe that

=AKB ` =ALD “ 180˝ ´ =KAL “ =BCD “ =BAD.

Thus, there exists a ray AP inside angle =BAD such that =BAP “ =AKB and =DAP “
=DLA. Hence the line AP is a common tangent to the circles pKABq and pLADq, as desired.

Comment 2. The statement of the problem remains true for a more general configuration, e.g., if
line BD intersect the extension of segment AE instead of the segment itself, etc. The corresponding
restrictions in the statement are given to reduce case sensitivity.
Shortlisted problems – solutions 53

G4. In the plane, there are n ě 6 pairwise disjoint disks D1 , D2 , . . . , Dn with radii
R1 ě R2 ě . . . ě Rn . For every i “ 1, 2, . . . , n, a point Pi is chosen in disk Di . Let O be an
arbitrary point in the plane. Prove that

OP1 ` OP2 ` . . . ` OPn ě R6 ` R7 ` . . . ` Rn .

(A disk is assumed to contain its boundary.)


(Iran)

Solution. We will make use of the following lemma.


Lemma. Let D1 , . . . , D6 be disjoint disks in the plane with radii R1 , . . . , R6 . Let Pi be a point
in Di , and let O be an arbitrary point. Then there exist indices i and j such that OPi ě Rj .
Proof. Let Oi be the center of Di . Consider six rays OO1, . . . , OO6 (if O “ Oi , then the ray
OOi may be assumed to have an arbitrary direction). These rays partition the plane into six
angles (one of which may be non-convex) whose measures sum up to 360˝ ; hence one of the
angles, say =Oi OOj , has measure at most 60˝ . Then Oi Oj cannot be the unique largest side
in (possibly degenerate) triangle OOiOj , so, without loss of generality, OOi ě Oi Oj ě Ri ` Rj .
Therefore, OPi ě OOi ´ Ri ě pRi ` Rj q ´ Ri “ Rj , as desired. l
Now we prove the required inequality by induction on n ě 5. The base case n “ 5 is trivial.
For the inductive step, apply the Lemma to the six largest disks, in order to find indices i and j
such that 1 ď i, j ď 6 and OPi ě Rj ě R6 . Removing Di from the configuration and applying
the inductive hypothesis, we get ÿ ÿ
OPk ě Rℓ .
k‰i ℓě7

Adding up this inequality with OPi ě R6 we establish the inductive step.

Comment 1. It is irrelevant to the problem whether the disks contain their boundaries or not. This
condition is included for clarity reasons only. The problem statement remains true, and the solution
works verbatim, if the disks are assumed to have disjoint interiors.

Comment 2. There are several variations of the above solution. In particular, while performing
the inductive step, one may remove the disk with the largest value of OPi and apply the inductive
hypothesis to the remaining disks (the Lemma should still be applied to the six largest disks).

Comment 3. While proving the Lemma, one may reduce it to a particular case when the disks are
congruent, as follows: Choose the smallest radius r of the disks in the Lemma statement, and then
replace, for each i, the ith disk with its homothetic copy, using the homothety centered at Pi with
ratio r{Ri .
This argument shows that the Lemma is tightly connected to a circle packing problem, see, e.g.,
https://en.wikipedia.org/wiki/Circle_packing_in_a_circle. The known results on that prob-
lem provide versions of the Lemma for different numbers of disks, which lead to different ?inequalities
of the same kind. E.g., for 4 disks the best
? possible estimate in the Lemma is OPi ě p 2 ´ 1qRj ,
while for 13 disks it has the form OPi ě 5 Rj . Arguing as in the above solution, one obtains the
inequalities
ÿn ? ÿn ÿn ? ÿ n
OPi ě p 2 ´ 1q Rj and OPi ě 5 Rj .
i“1 j“4 i“1 j“13

However, there are some harder arguments which allow to improve these inequalities, meaning that
the Rj with large indices may be taken with much greater factors.
54 Saint-Petersburg — Russia, 18th–28th September 2020

G5. Let ABCD be a cyclic quadrilateral with no two sides parallel. Let K, L, M, and N
be points lying on sides AB, BC, CD, and DA, respectively, such that KLMN is a rhombus
with KL k AC and LM k BD. Let ω1 , ω2 , ω3 , and ω4 be the incircles of triangles ANK,
BKL, CLM, and DMN, respectively. Prove that the internal common tangents to ω1 and ω3
and the internal common tangents to ω2 and ω4 are concurrent.
(Poland)

Solution 1. Let Ii be the center of ωi , and let ri be its radius for i “ 1, 2, 3, 4. Denote by T1
and T3 the points of tangency of ω1 and ω3 with NK and LM, respectively. Suppose that the
internal common tangents to ω1 and ω3 meet at point S, which is the center of homothety h
r3
with negative ratio (namely, with ratio ´ ) mapping ω1 to ω3 . This homothety takes T1 to T3
r1
(since the tangents to ω1 and ω3 at T1 to T3 are parallel), hence S is a point on the segment
T1 T3 with T1 S : ST3 “ r1 : r3 .
Construct segments S1 S3 k KL and S2 S4 k LM through S with S1 P NK, S2 P KL,
S3 P LM, and S4 P MN. Note that h takes S1 to S3 , hence I1 S1 k I3 S3 , and S1 S : SS3 “ r1 : r3 .
We will prove that S2 S : SS4 “ r2 : r4 or, equivalently, KS1 : S1 N “ r2 : r4 . This will yield
the problem statement; indeed, applying similar arguments to the intersection point S 1 of the
internal common tangents to ω2 and ω4 , we see that S 1 satisfies similar relations, and there is
a unique point inside KLMN satisfying them. Therefore, S 1 “ S.
C
L′

B IC M′
B L
C IB
S2 S3 I3
X
K ′ ID
K
K
K
K T3
T1 S M
M IA

S1 S4 A D
I1
A N D N′

Further, denote by IA , IB , IC , ID and rA , rB , rC , rD the incenters and inradii of trian-


ÝÝÑ
gles DAB, ABC, BCD, and CDA, respectively. One can shift triangle CLM by LK to glue
it with triangle AKN into a quadrilateral AKC 1 N similar to ABCD. In particular, this shows
that r1 : r3 “ rA : rC ; similarly, r2 : r4 “ rB : rD . Moreover, the same shift takes S3 to S1 , and
it also takes I3 to the incenter I31 of triangle KC 1 N. Since I1 S1 k I3 S3 , the points I1 , S1 , I31 are
collinear. Thus, in order to complete the solution, it suffices to apply the following Lemma to
quadrilateral AKC 1 N.
Lemma 1. Let ABCD be a cyclic quadrilateral, and define IA , IC , rB , and rD as above. Let
IA IC meet BD at X; then BX : XD “ rB : rD .
Proof. Consider an inversion centered at X; the images under that inversion will be denoted by
primes, e.g., A1 is the image of A.
By properties of inversion, we have

=IC1 IA1 D 1 “ =XIA1 D 1 “ =XDIA “ =BDA{2 “ =BCA{2 “ =ACIB .

We obtain =IA1 IC1 D 1 “ =CAIB likewise; therefore, △IC1 IA1 D 1 „ △ACIB . In the same manner,
we get △IC1 IA1 B 1 „ △ACID , hence the quadrilaterals IC1 B 1 IA1 D 1 and AID CIB are also similar.
But the diagonals AC and IB ID of quadrilateral AID CIB meet at a point Y such that IB Y :
Shortlisted problems – solutions 55

Y ID “ rB : rD . By similarity, we get D 1 X : B 1 X “ rB : rD and hence BX : XD “ D 1 X :


B 1 X “ rB : rD . l

Comment 1. The solution above shows that the problem statement holds also for any parallel-
ogram KLM N whose sides are parallel to the diagonals of ABCD, as no property specific for a
rhombus has been used. This solution works equally well when two sides of quadrilateral ABCD are
parallel.

Comment 2. The problem may be reduced to Lemma 1 by using different tools, e.g., by using mass
point geometry, linear motion of K, L, M , and N , etc.
Lemma 1 itself also can be proved in different ways. We present below one alternative proof.
Proof. In the circumcircle of ABCD, let K 1 , L1 . M 1 , and N 1 be the midpoints of arcs AB, BC,
CD, and DA containing no other vertices of ABCD, respectively. Thus, K 1 “ CIB X DIA , etc. In
the computations below, we denote by rP s the area of a polygon P . We use similarities △IA BK 1 „
△IA DN 1 , △IB K 1 L1 „ △IB AC, etc., as well as congruences △IB K 1 L1 “ △BK 1 L1 and △ID M 1 N 1 “
△DM 1 N 1 (e.g., the first congruence holds because K 1 L1 is a common internal bisector of angles BK 1 IB
and BL1 IB ).
We have

BX rIA BIC s BIA ¨ BIC ¨ sin IA BIC BIA BIC sin N 1 BM 1


“ “ “ ¨ ¨
DX rIA DIC s DIA ¨ DIC ¨ sin IA DIC DIA DIC sin K 1 DL1
BK 1 BL1 sin N 1 DM 1 BK 1 ¨ BL1 ¨ sin K 1 BL1 sin2 N 1 DM 1
“ ¨ ¨ “ ¨
DN 1 DM 1 sin K 1 BL1 DN 1 ¨ DM 1 ¨ sin N 1 DM 1 sin2 K 1 BL1
A1 C 12
rK 1 BL1 s N 1 M 12 rK 1 IB L1 s ¨ K 1 L12 rAIB Cs rB
“ 1 1
¨ 1 12 “ 1 C 12 “ “ ,
rM DN s K L A
rM 1 ID N 1 s ¨ 1 12 rAID Cs rD
N M

as required. l

Solution 2. This solution is based on the following general Lemma.


Lemma 2. Let E and F be distinct points, and let ωi , i “ 1, 2, 3, 4, be circles lying in
the same halfplane with respect to EF . For distinct indices i, j P t1, 2, 3, 4u, denote by Oij`
(respectively, Oij´ ) the center of homothety with positive (respectively, negative) ratio taking
` ` ` ` ´ ´
ωi to ωj . Suppose that E “ O12 “ O34 and F “ O23 “ O41 . Then O13 “ O24 .
Proof. Applying Monge’s theorem to triples of circles ω1 , ω2 , ω4 and ω1 , ω3 , ω4 , we get that both
´ ´ ´
points O24 and O13 lie on line EO14 . Notice that this line is distinct from EF . Similarly we
´ ´ ´ ´ ´
obtain that both points O24 and O13 lie on F O34 . Since the lines EO14 and F O34 are distinct,
both points coincide with the meeting point of those lines. l
E
ω3




O−
O
O
O −

34 ω0
34
34
34
34
34 C
ω3
ω4 ω2
L
L
L
L
B

− ω1 ω2 M
O
O
O




O14
14
14
M
14
14

K
K
K
K

E F F A N D
56 Saint-Petersburg — Russia, 18th–28th September 2020

Turning back to the problem, let AB intersect CD at E and let BC intersect DA at F .


Assume, without loss of generality, that B lies on segments AE and CF . We will show that the
points E and F , and the circles ωi satisfy the conditions of Lemma 2, so the problem statement
follows. In the sequel, we use the notation of Oij˘ from the statement of Lemma 2, applied to
circles ω1 , ω2 , ω3 , and ω4 .
Using the relations △ECA „ △EBD, KN k BD, and MN k AC. we get

AN AN AD KN AC AC AE
“ ¨ “ ¨ “ “ .
ND AD ND BD NM BD ED
Therefore, by the angle bisector theorem, point N lies on the internal angle bisector of =AED.
We prove similarly that L also lies on that bisector, and that the points K and M lie on the
internal angle bisector of =AF B.
Since KLMN is a rhombus, points K and M are symmetric in line ELN. Hence, the
convex quadrilateral determined by the lines EK, EM, KL, and ML is a kite, and therefore it
`
has an incircle ω0 . Applying Monge’s theorem to ω0 , ω2 , and ω3 , we get that O23 lies on KM.
`
On the other hand, O23 lies on BC, as BC is an external common tangent to ω2 and ω3 . It
` ` ` `
follows that F “ O23 . Similarly, E “ O12 “ O34 , and F “ O41 .

Comment 3. The reduction to Lemma 2 and the proof of Lemma 2 can be performed with the use of
different tools, e.g., by means of Menelaus theorem, by projecting harmonic quadruples, by applying
Monge’s theorem in some other ways, etc.
Shortlisted problems – solutions 57

This page is intentionally left blank


58 Saint-Petersburg — Russia, 18th–28th September 2020

G6. Let I and IA be the incenter and the A-excenter of an acute-angled triangle ABC
with AB ă AC. Let the incircle meet BC at D. The line AD meets BIA and CIA at E
and F , respectively. Prove that the circumcircles of triangles AID and IA EF are tangent to
each other.
(Slovakia)

Solution 1. Let ?pp, qq denote the directed angle between lines p and q.
The points B, C, I, and IA lie on the circle Γ with diameter IIA . Let ω and Ω denote the
circles pIA EF q and pAIDq, respectively. Let T be the second intersection point of ω and Γ.
Then T is the Miquel point of the complete quadrilateral formed by the lines BC, BIA , CIA ,
and DEF , so T also lies on circle pBDEq (as well as on circle pCDF q). We claim that T is a
desired tangency point of ω and Ω.
In order to show that T lies on Ω, use cyclic quadrilaterals BDET and BIIA T to write

?pDT, DAq “ ?pDT, DEq “ ?pBT, BEq “ ?pBT, BIA q “ ?pIT, IIA q “ ?pIT, IAq.

II

B C
D
D
D
D

E Γ

IA

To show that ω and Ω are tangent at T , let ℓ be the tangent to ω at T , so that ?pT IA , ℓq “
?pEIA , ET q. Using circles pBDET q and pBICIA q, we get

?pEIA , ET q “ ?pEB, ET q “ ?pDB, DT q.

Therefore,
?pT I, ℓq “ 90˝ ` ?pT IA , ℓq “ 90˝ ` ?pDB, DT q “ ?pDI, DT q,
which shows that ℓ is tangent to Ω at T .

Solution 2. We use the notation of circles Γ, ω, and Ω as in the previous solution.


Let L be the point opposite to I in circle Ω. Then =IAL “ =IDL “ 90˝ , which means
that L is the foot of the external bisector of =A in triangle ABC. Let LI cross Γ again at M.
Shortlisted problems – solutions 59

Let T be the foot of the perpendicular from I onto IA L. Then T is the second intersection
point of Γ and Γ. We will show that T is the desired tangency point.
First, we show that T lies on circle ω. Notice that

?pLT, LMq “ ?pAT, AIq and ?pMT, MLq “ ?pMT, MIq “ ?pIA T, IA Iq,

which shows that triangles T ML and T IA A are similar and equioriented. So there exists a
rotational homothety τ mapping T ML to T IA A.
Since ?pML, LDq “ ?pAI, ADq, we get τ pBCq “ AD. Next, since

?pMB, MLq “ ?pMB, MIq “ ?pIA B, IA Iq “ ?pIA E, IA Aq,

we get τ pBq “ E. Similarly, τ pCq “ F . Since the points M, B, C, and T are concyclic, so are
their τ -images, which means that T lies on ω “ τ pΓq.
A

IIII
M

B C
L D
D
D
D

Γ
E

T

IA

F
Finally, since τ pLq “ A and τ pBq “ E, triangles AT L and ET B are similar so that

?pAT, ALq “ ?pET, EBq “ ?pEIA , ET q.

This means that the tangents to Ω and ω at T make the same angle with the line IA T L, so the
circles are indeed tangent at T .

Comment. In both solutions above, a crucial step is a guess that the desired tangency point lies on Γ.
There are several ways to recognize this helpful property.
E.g. one may perform some angle chasing to see that the tangents to Ω at L and to ω at IA are
parallel (and the circles lie on different sides of the tangents). This yields that, under the assumption
that the circles are tangent externally, the tangency point must lie on IA L. Since IL is a diameter
in Ω, this, in turn, implies that T is the projection of I onto IA L.
Another way to see the same fact is to perform a homothety centered at A and mapping I to IA
(and D to some point D 1 ). The image Ω1 of Ω is tangent to ω at IA , because =BIA A`=CIAD 1 “ 180˝ .
This yields that the tangents to Ω at I and to ω at IA are parallel.
There are other ways to describe the tangency point. The next solution presents one of them.
60 Saint-Petersburg — Russia, 18th–28th September 2020

Solution 3. We also use the notation of circles ω, and Ω from the previous solutions.
Perform an inversion centered at D. The images of the points will be denoted by primes,
e.g., A1 is the image of A.
For convenience, we use the notation =BID “ β, =CID “ γ, and α “ 180˝ ´ β ´ γ “
90˝ ´ =BAI. We start with computing angles appearing after inversion. We get
=DB 1 I 1 “ β, =DC 1 I 1 “ γ, and hence =B 1 I 1 C 1 “ α;
=E 1 IA1 F 1 “ =E 1 IA1 D ´ =F 1 IA1 D “ =IA ED ´ =IA F D “ =EIA F “ 180˝ ´ α.
Next, we have
1 1 1 1 1 =DBA ˝ ˝ =E 1 A1 B 1
=A E B “ =DE B “ =DBE “ β “ 90 ´ “ 90 ´ ,
2 2
which yields that triangle A1 B 1 E 1 is isosceles with A1 B 1 “ A1 E 1 . Similarly, A1 F 1 “ A1 C 1 .
Finally, we get

=A1 B 1 I 1 “ =I 1 B 1 D ´ =A1 B 1 D “ β ´ =BAD “ β ´ p90˝ ´ αq ` =IAD


“ =ICD ` =IAD “ =C 1 I 1 D ` =A1 I 1 D “ =C 1 I 1 A1 ;
similarly, =A1 C 1 I 1 “ =A1 I 1 B 1 , so that triangles A1 B 1 I 1 and A1 I 1 C 1 are similar. Therefore,
A1 I 12 “ A1 B 1 ¨ A1 C 1 .
Recall that we need to prove the tangency of line A1 I 1 “ Ω1 with circle pE 1 F 1 IA1 q “ ω 1 . A
desired tangency point T 1 must satisfy A1 T 12 “ A1 E 1 ¨ A1 F 1 ; the relations obtained above yield
A1 E 1 ¨ A1 F 1 “ A1 B 1 ¨ A1 C 1 “ A1 I 12 ,
so that T 1 should be symmetric to I 1 with respect to A1 .
Thus, let us define a point T 1 as the reflection of I 1 in A1 , and show that T 1 lies on circle Ω1 ;
the equalities above will then imply that A1 T 1 is tangent to Ω1 , as desired.

Ω A
J III′′′′′

I Γ′
β γ
B C C∗
D
A′

E
α
α
α
α B′ C′
D
IA ′′′′′
IIIA
A
A
A A
F′′′′′
F
F
F
ω T′
F ω′
E′

The property that triangles B 1 A1 I 1 and I 1 A1 C 1 are similar means that quadrilateral B 1 I 1 C 1 T 1
is harmonic. Indeed, let C ˚ be the reflection of C 1 in the perpendicular bisector of I 1 T 1 ; then
C ˚ lies on B 1 A1 by =B 1 A1 I 1 “ =A1 I 1 C 1 “ =T 1 I 1 C ˚ , and then C ˚ lies on circle pI 1 B 1 T 1 q since
A1 B 1 ¨ A1 C ˚ “ A1 B 1 ¨ A1 C 1 “ A1 I 12 “ A1 I 1 ¨ A1 T 1 . Therefore, C 1 also lies on that circle (and
the circle is pB 1 I 1 C 1 q “ Γ1 ). Moreover, B 1 C ˚ is a median in triangle B 1 I 1 T 1 , so B 1 C 1 is its
symmedian, which establishes harmonicity.
Now we have =A1 B 1 T 1 “ =I 1 B 1 C 1 “ β “ =A1 B 1 E 1 ; which shows that E 1 lies on B 1 T 1 .
Similarly, F 1 lies on C 1 T 1 . Hence, =E 1 T 1 F 1 “ =B 1 I 1 C 1 “ 180˝ ´ =E 1 IA1 F 1 , which establishes
T 1 P ω1.
Shortlisted problems – solutions 61

Comment 2. The solution above could be finished without use of harmonicity. E.g., one may notice
that both triangles A1 T 1 F 1 and A1 E 1 T 1 are similar to triangle B 1 I 1 J, where J is the point symmetric to I 1
B1 I 1 B1 I 1
in the perpendicular bisector of B 1 C 1 ; indeed, we have =T 1 A1 E 1 “ γ ´ β “ =I 1 B 1 J 1 and B 1J 1 “ C1I 1 “
B 1 A1 A1 E 1 1 1 1 1 1 1 1 1 1 1 1 1 1
A1 I 1 “ A1 T 1 . This also allows to compute =E T F “ =E T A ´ =F T A “ =I JB ´ =JI B “ α.

Comment 3. Here we list several properties of the configuration in the problem, which can be derived
from the solutions above.
The quadrilateral IBT C (as well as I 1 B 1 T 1 C 1 ) is harmonic. Hence, line IT contains the meeting
point of tangents to Γ at B and C, i.e., the midpoint N of arc BAC in the circumcircle of △ABC.
62 Saint-Petersburg — Russia, 18th–28th September 2020

G7. Let P be a point on the circumcircle of an acute-angled triangle ABC. Let D,


E, and F be the reflections of P in the midlines of triangle ABC parallel to BC, CA, and AB,
respectively. Denote by ωA , ωB , and ωC the circumcircles of triangles ADP , BEP , and CF P ,
respectively. Denote by ω the circumcircle of the triangle formed by the perpendicular bisectors
of segments AD, BE and CF .
Show that ωA , ωB , ωC , and ω have a common point.
(Denmark)

Solution. Let AA1 , BB1 , and CC1 be the altitudes in triangle ABC, and let mA , mB , and mC
be the midlines parallel to BC, CA, and AB, respectively. We always denote by ?pp, qq the
directed angle from a line p to a line q, taken modulo 180˝ .

Step 1: Circles ωA , ωB , and ωC share a common point Q different from P .


Notice that mA is the perpendicular bisector of P D, so ωA is symmetric with respect to mA .
Since A and A1 are also symmetric to each other in mA , the point A1 lies on ωA . Similarly, B1
and C1 lie on ωB and ωC , respectively.
Let H be the orthocenter of △ABC. Quadrilaterals ABA1 B1 and BCB1 C1 are cyclic, so
AH ¨ HA1 “ BH ¨ HB1 “ CH ¨ HC1. This means that H lies on pairwise radical axes of ωA ,
ωB , and ωC . Point P also lies on those radical axes; hence the three circles have a common
radical axis ℓ “ P H, and the second meeting point Q of ℓ with ωA is the second common point
of the three circles. Notice here that H lies inside all three circles, hence Q ‰ P .
ωA
A QA ωA D ω

ωB mC
A
mB
D E
C1
mA
QB pA
P
P
P
P B
B
B11111
B

H
H
H
H Q
Q
Q
Q
ωB Q
Q
Q
Q
B C
A1
pB pC

ωC B C

F
E
E
F P
P

Step 2: Point Q lies on ω.


Let pA , pB , and pC denote the perpendicular bisectors of AD, BE, and CF , respectively;
denote by ∆ the triangle formed by those perpendicular bisectors. By Simson’s theorem, in
order to show that Q lies on the circumcircle ω of ∆, it suffices to prove that the projections
of Q onto the sidelines pA , pB , and pC are collinear. Alternatively, but equivalently, it suffices
to prove that the reflections QA , QB , and QC of Q in those lines, respectively, are collinear. In
fact, we will show that four points P , QA , QB , and QC are collinear.
Since pA is the common perpendicular bisector of AD and QQA , the point QA lies on ωA ,
and, moreover, ?pDA, DQA q “ ?pAQ, ADq. Therefore,
?pP A, P QA q “ ?pDA, DQA q “ ?pAQ, ADq “ ?pP Q, P Dq “ ?pP Q, BCq ` 90˝ .
Shortlisted problems – solutions 63

Similarly, we get ?pP B, P QB q “ ?pP Q, CAq ` 90˝ . Therefore,

?pP QA , P QB q “ ?pP QA , P Aq ` ?pP A, P Bq ` ?pP B, P QB q


“ ?pBC, P Qq ` 90˝ ` ?pCA, CBq ` ?pP Q, CAq ` 90˝ “ 0,

which shows that P , QA , and QB are collinear. Similarly, QC also lies on P QA .

Comment 1. There are several variations of Step 2. In particular, let OA , OB , and OC denote
the centers of ωA , ωB , and ωC , respectively; they lie on pA , pB , and pC , respectively. Moreover,
all those centers lie on the perpendicular bisector p of P Q. Now one can show that ?pQOA , pA q “
?pQOB , pB q “ ?pQOC , pC q, and then finish by applying generalized Simson’s theorem, Alternatively,
but equivalently, those relations show that Q is the Miquel point of the lines pA , pB , pC , and p.
To establish ?pQOA , pA q “ ?pQOC , pC q, notice that it is equivalent to ?pQOA , QOC q “ ?ppA , pC q
which may be obtained, e.g., as follows:

?pQOA , QOC q “ ?pQOA , pq ` ?pp, QOC q “ ?pAQ, AP q ` ?pCP, CQq


“ ?pAQ, CQq ` ?pCP, AP q “ ?pAQ, P Qq ` ?pP Q, CQq ` ?pCB, ABq
“ ?pAD, AA1 q ` ?pCC1 , CF q ` ?pAA1 , CC1 q “ ?pAD, CF q “ ?ppA , pC q.

ωA
A

D pA
pB C
C
C1111
C
ωC
O
O
OAA
A
A
A

OB ω
P
P
P
P
H
H
H
H Q
Q
Q
Q
p

B C
A1
OC
O C
C
C
C

pC

Comment 2. The inversion at H with (negative) power ´AH ¨HA1 maps P to Q, and the circumcircle
of △ABC to its Euler circle. Therefore, Q lies on that Euler circle.
64 Saint-Petersburg — Russia, 18th–28th September 2020

G8. Let Γ and I be the circumcircle and the incenter of an acute-angled triangle ABC.
Two circles ωB and ωC passing through B and C, respectively, are tangent at I. Let ωB meet
the shorter arc AB of Γ and segment AB again at P and M, respectively. Similarly, let ωC
meet the shorter arc AC of Γ and segment AC again at Q and N, respectively. The rays P M
and QN meet at X, and the tangents to ωB and ωC at B and C, respectively, meet at Y .
Prove that the points A, X, and Y are collinear.
(Netherlands)

Solution 1. Let AI, BI, and CI meet Γ again at D, E, and F , respectively. Let ℓ be the
common tangent to ωB and ωC at I. We always denote by ?pp, qq the directed angle from a
line p to a line q, taken modulo 180˝ .
Step 1: We show that Y lies on Γ.
Recall that any chord of a circle makes complementary directed angles with the tangents to the
circle at its endpoints. Hence,

?pBY, BIq ` ?pCI, CY q “ ?pIB, ℓq ` ?pℓ, ICq “ ?pIB, ICq.

Therefore,

?pBY, BAq ` ?pCA, CY q “ ?pBI, BAq ` ?pBY, BIq ` ?pCI, CY q ` ?pCA, CIq
“ ?pBC, BIq ` ?pIB, ICq ` ?pCI, CBq “ 0,

which yields Y P Γ.

F A

X=
X =X
X∗∗∗∗∗
P
M
M
M
M

N E
Q
Q
Q
Q
ωB
IIII
ωC


B C

Y
D

Step 2: We show that X “ ℓ X EF .


Let X˚ “ ℓ X EF . To prove our claim, it suffices to show that X˚ lies on both P M and QN;
this will yield X˚ “ X. Due to symmetry, it suffices to show X˚ P QN.
Notice that

?pIX˚ , IQq “ ?pCI, CQq “ ?pCF, CQq “ ?pEF, EQq “ ?pEX˚ , EQq;
Shortlisted problems – solutions 65

therefore, the points X˚ , I, Q, and E are concyclic (if Q “ E, then the direction of EQ is
supposed to be the direction of a tangent to Γ at Q; in this case, the equality means that the
circle pX˚ IQq is tangent to Γ at Q). Then we have

?pQX˚ , QIq “ ?pEX˚ , EIq “ ?pEF, EBq “ ?pCA, CF q “ ?pCN, CIq “ ?pQN, QIq,

which shows that X˚ P QN.


Step 3: We finally show that A, X, and Y are collinear.
Recall that I is the orthocenter of triangle DEF , and A is symmetric to I with respect to EF .
Therefore,

?pAX, AEq “ ?pIE, IXq “ ?pBI, ℓq “ ?pBY, BIq “ ?pBY, BEq “ ?pAY, AEq,

which yields the desired collinearity.

Comment 1. Step 2 in the above solution seems to be crucial. After it has been performed (even
without Step 1), there are different ways of finishing the solution.
E.g., one may involve the notion of isogonal conjugacy. Let X1 and Y1 be isogonal conjugates of X
and Y , respectively, with respect to triangle ABC. Since XA “ XI, triangle AIX is isosceles, and
hence the lines AX and XI form equal angles with the internal bisector AI of =BAC. This means
that AX1 k XI, or AX1 k ℓ.
On the other hand, the lines BY and ℓ form equal angles with BI, so that BY1 k ℓ. Similarly,
CY1 k ℓ. This means that Y1 is an ideal point, and AY1 k ℓ as well. Therefore, points A, X1 , and Y1
are collinear, and hence A, X, and Y are such.

Solution 2. Perform an inversion centered at I; the images of the points are denoted by
primes, e.g., A1 is the image of A.
On the inverted figure, I and Γ1 are the orthocenter and the circumcircle of triangle A1 B 1 C 1 ,
respectively. The points P 1 and Q1 lie on Γ1 such that B 1 P 1 k C 1 Q1 (since B 1 P 1 “ ωB1 and
C 1 Q1 “ ωC1 ). The points M 1 and N 1 are the second intersections of lines B 1 P 1 and C 1 Q1 with
the circumcircles γB and γC of triangles A1 IB 1 and A1 IC 1 , respectively. Notice here that γC is
ÝÝÑ
obtained from γB by the translation at B 1 C 1 ; the same translation maps line B 1 P 1 to C 1 Q1 , and
hence M 1 to N 1 . In other words, B 1 M 1 N 1 C 1 is a parallelogram, and P 1 Q1 partitions it into two
isosceles trapezoids.
Point X 1 is the second intersection point of circles pIP 1 M 1 q and pIQ1 N 1 q that is — the
reflection of I in their line of centers. But the centers lie on the common perpendicular bisector p
of P 1M 1 and Q1 N 1 , so p is that line of centers. Hence, IX 1 k B 1 P 1 , as both lines are perpendicular
to p.
Finally, the point Y satisfies ?pBY, BIq “ ?pP B, P Iq and ?pCY, CIq “ ?pQC, QIq, which
yields ?pY 1 B 1 , Y 1 Iq “ ?pB 1 P 1, B 1 Iq and ?pY 1 C 1 , Y 1 Iq “ ?pC 1 Q1 , C 1 Iq. Therefore,

?pY 1 B 1 , Y 1 C 1 q “ ?pB 1 P 1 , B 1 Iq ` ?pC 1 I, C 1 Q1 q “ ?pC 1 I, B 1 Iq “ ?pA1 B 1 , A1 C 1 q,

which shows that Y 1 P Γ1 .


In congruent circles Γ1 and γB , the chords A1 P 1 and A1 M 1 subtend the same angle =A1 B 1 P 1 ;
therefore, A1 P 1 “ A1 M 1 , and hence A1 P p. This yields A1 X 1 “ A1 I, and hence ?pIA1 , IX 1 q “
?pX 1 I, X 1 A1 q.
Finally, we have

?pY 1 I, Y 1 A1 q “ ?pY 1 I, Y 1 B 1 q ` ?pY 1 B 1 , Y 1 A1 q


“ ?pB 1 I, B 1 P 1 q ` ?pIA1 , IB 1 q “ ?pIA1 , B 1 P 1q “ ?pIA1 , IX 1 q “ ?pX 1 I, X 1 A1 q,

which yields that the points A1 , X 1 , Y 1 , and I are concyclic. This means exactly that A, X,
and Y are collinear.
66 Saint-Petersburg — Russia, 18th–28th September 2020

γB M′′′′′
M
M X′′′′′
X
X

N′
p
A′′′′′
A
A
A
Γ
A

X
X
X
X P′′′′′
P
P Q′
P
M
M
M
M IIII
N Q
Q
Q
Q
ωB B′ Γ′
IIII
ωC
Y′
B C
C ′ γC
Y

Comment 2. An inversion at I may also help in establishing Step 2 in Solution 1. Indeed, rela-
tion A1 X 1 “ A1 I yields XA “ XI, so that X P EF . On the other hand, IX 1 k B 1 P 1 yields IX k ℓ,
i.e., X P ℓ.
Shortlisted problems – solutions 67

G9. Prove that there exists a positive constant c such that the following statement is
true:
Assume that n is an integer with n ě 2, and let S be a set of n points in the plane such
that the distance between any two distinct points in S is at least 1. Then there is a line ℓ
separating S such that the distance from any point of S to ℓ is at least cn´1{3 .
(A line ℓ separates a point set S if some segment joining two points in S crosses ℓ.)
(Taiwan)

Solution. We prove that the desired statement is true with c “ 81 . Set δ “ 18 n´1{3 . For any
line ℓ and any point X, let Xℓ denote the projection of X to ℓ; a similar notation applies to
sets of points.
Suppose that, for some line ℓ, the set Sℓ contains two adjacent points X and Y with
XY “ 2d. Then the line perpendicular to ℓ and passing through the midpoint of segment XY
separates S, and all points in S are at least d apart from ℓ. Thus, if d ě δ, then a desired
line has been found. For the sake of contradiction, we assume that no such points exist, in any
projection.
Choose two points A and B in S with the maximal distance M “ AB (i.e., AB is a diameter
of S); by the problem condition, M ě 1. Denote by ℓ the line AB. The set S is contained
in the intersection of two disks DA and DB of radius M centered at A and B, respectively.
Hence, the projection Sℓ is contained in the segment AB. Moreover, the points in Sℓ divide
that segment into at most n ´ 1 parts, each of length less than 2δ. Therefore,

M ă n ¨ 2δ. (1)
B
DB

H h
Q
P T
A a
DA
Choose a point H on segment AB with AH “ 12 . Let P be a strip between the lines a and h
perpendicular to AB and passing through A and H, respectively; we assume that P contains its
P 1 a andTh. Set T “ P X S and let t “ |T |. By our assumption,
boundary, which consists of lines
segment AH contains at least 2 : p2δq points of Sℓ , which yields
1
tě . (2)

Notice that T is contained in Q “ P X DB . The set Q is a circular segment, and its
projection Qa is a line segment of length
d
?
ˆ ˙2
1
2 M2 ´ M ´ ă 2 M.
2

On the other hand,? for any two points X, Y P T , we have XY ě 1 and Xℓ Yℓ ď 21 , so Xa Ya “


a
XY 2 ´ Xℓ Yℓ2 ě 23 . To summarize, t points constituting Ta lie on the segment of?length less
? ? ?
3
than 2 M , and are at least 2 apart from each other. This yields 2 M ą pt ´ 1q 23 , or
?
4 M ?
t ă 1 ` ? ă 4 M, (3)
3
68 Saint-Petersburg — Russia, 18th–28th September 2020

as M ě 1.
Combining the estimates (1), (2), and (3), we finally obtain

1 ? ?
ď t ă 4 M ă 4 2nδ, or 512nδ 3 ą 1,

which does not hold for the chosen value of δ.

Comment 1. As the proposer mentions, the exponent ´1{3 in the problem statement is optimal. In
fact, for any n ě 2, there is a configuration S of n points in the plane such that any two points in S
are at least 1 apart, but every line ℓ separating S is at most c1 n´1{3 log n apart from some point in S;
here c1 is some absolute constant.
The original proposal suggested to prove the estimate of the form cn´1{2 . That version admits
1 ´1{2
much easier solutions. E.g., setting δ “ 16 n and applying (1), we see that S is contained in a
disk D of radius 8 n . On the other hand, for each point X of S, let DX be the disk of radius 21
1 1{2

centered at X; all these disks have disjoint interiors and lie within the disk concentric to D, of radius
1 1{2
16 n ` 12 ă 21 n1{2 . Comparing the areas, we get
˜ ¸2
π n1{2 1 πn
n¨ ďπ ` ă ,
4 16 2 4

which is a contradiction.
The Problem Selection Committee decided to choose a harder version for the Shortlist.

Comment 2. In this comment, we discuss some versions of the solution above, which avoid concen-
trating on the diameter of S. We start with introducing some terminology suitable for those versions.
Put δ “ cn´1{3 for a certain sufficiently small positive constant c. For the sake of contradiction,
suppose that, for some set S satisfying the conditions in the problem statement, there is no separating
line which is at least δ apart from each point of S.
Let C be the convex hull of S. A line is separating if and only if it meets C (we assume that a line
passing through a point of S is always separating). Consider a strip between two parallel separating
lines a and a1 which are, say, 41 apart from each other. Define a slice determined by the strip as the
intersection of S with the strip. The length of the slice is the diameter of the projection of the slice
to a.
In this terminology, the arguments used in the proofs of (2) and (3) show that for any slice T of
length L, we have
1 4
ď |T | ď 1 ` ? L. (4)
8δ 15
The key idea of the solution is to apply these estimates to a peel slice, where line a does not cross
the interior of C. In the above solution, this idea was applied to one carefully chosen peel slice. Here,
we outline some different approach involving many of them. We always assume that n is sufficiently
large.
Consider a peel slice determined by lines a and a1 , where a contains no interior points of C. We
orient a so that C lies to the left of a. Line a is called a supporting line of the slice, and the obtained
direction is the direction of the slice; notice that the direction determines uniquely the supporting line
and hence the slice. Fix some direction v0 , and for each α P r0, 2πq denote by Tα the peel slice whose
direction is v0 rotated by α counterclockwise.
When speaking about the slice, we always assume that the figure is rotated so that its direction is
vertical from the bottom to the top; then the points in T get a natural order from the bottom to the
top. In particular, we may speak about the top half TpT q consisting of t|T |{2u topmost points in T ,
and similarly about its bottom half BpT q. By (4), each half contains at least 10 points when n is large.
Claim. Consider two angles α, β P r0, π{2s with β ´ α ě 40δ “: φ. Then all common points of Tα and
Tβ lie in TpTα q X BpTβ q.
Shortlisted problems – solutions 69

β−α
Pk


C Pi

slice

a′
peel slice C

a

Proof. By symmetry, it suffices to show that all those points lie in TpTα q. Let a be the supporting
line of Tα , and let ℓ be a line perpendicular to the direction of Tβ . Let P1 , . . . , Pk list all points in Tα ,
numbered from the bottom to the top; by (4), we have k ě 18 δ´1 .
Introduce the Cartesian coordinates so that the (oriented) line?
a is the y-axis. Let Pi be any point
15
in BpTα q. The difference of ordinates of Pk and Pi is at least 4 pk ´ iq ą 31 k, while their abscissas
differ by at most 41 . This easily yields that the projections of those points to ℓ are at least

k 1 1 1 1
sin φ ´ ě ¨ 20δ ´ ą
3 4 24δ 4 4
apart from each other, and Pk is closer to the supporting line of Tβ than Pi , so that Pi does not belong
to Tβ . l
X 1 ´1 π \
Now, put αi “ 40δi, for i “ 0, 1, . . . , 40 δ ¨ 2 , and consider the slices Tαi . The Claim yields that
each point in S is contained in at most two such slices. Hence, the union U of those slices contains at
least
1 1 1 π λ
¨ ¨ ¨ “ 2
2 8δ 40δ 2 δ
1
points (for some constant λ), and each point in U is at most 4 apart from the boundary of C.
It is not hard now to reach a contradiction with (1). E.g., for each point X P U , consider a closest
point f pXq on the boundary of C. Obviously, f pXqf pY q ě XY ´ 21 ě 21 XY for all X, Y P U . This
yields that the perimeter of C is at least µδ´2 , for some constant µ, and hence the diameter of S is of
the same order.
Alternatively, one may show that the projection of U to the line at the angle of π{4 with v0 has
diameter at least µδ´2 for some constant µ.
70 Saint-Petersburg — Russia, 18th–28th September 2020

Number Theory
N1. Given a positive integer k, show that there exists a prime p such that one can choose
distinct integers a1 , a2 , . . . , ak`3 P t1, 2, . . . , p ´ 1u such that p divides ai ai`1 ai`2 ai`3 ´ i for all
i “ 1, 2, . . . , k.
(South Africa)

Solution. First we choose distinct positive rational numbers r1 , . . . , rk`3 such that

ri ri`1 ri`2 ri`3 “ i for 1 ď i ď k.

Let r1 “ x, r2 “ y, r3 “ z be some distinct primes greater than k; the remaining terms satisfy
r4 “ r1 r12 r3 and ri`4 “ i`1 r . It follows that if ri are represented as irreducible fractions, the
i i
numerators are divisible by x for i ” 1 pmod 4q, by y for i ” 2 pmod 4q, by z for i ” 3 pmod 4q
and by none for i ” 0 pmod 4q. Notice that ri ă ri`4 ; thus the sequences r1 ă r5 ă r9 ă . . .,
r2 ă r6 ă r10 ă . . ., r3 ă r7 ă r11 ă . . ., r4 ă r8 ă r12 ă . . . are increasing and have no common
terms, that is, all ri are distinct.
If each ri is represented by an irreducible fraction uvii , choose a prime p which divides neither
vi , 1 ď i ď k ` 1, nor vi vj pri ´ rj q “ vj ui ´ vi uj for i ă j, and define ai by the congruence
ai vi ” ui pmod pq. Since ri ri`1 ri`2 ri`3 “ i, we have

ivi vi`1 vi`2 vi`3 “ ri vi ri`1 vi`1 ri`2 vi`2 ri`3 vi`3
“ ui ui`1 ui`2 ui`3 ” ai vi ai`1 vi`1 ai`2 vi`2 ai`3 vi`3 pmod pq

and therefore ai ai`1 ai`2 ai`3 ” i pmod pq for 1 ď i ď k.


If ai ” aj pmod pq, then ui vj ” ai vi vj ” uj vi pmod pq, a contradiction.

Comment. One can explicitly express residues bi ” a1 a2 ¨ . . . ¨ ai pmod pq in terms of b1 , b2 , b3 and


b0 “ 1:
bi`3 “ ipi ´ 4qpi ´ 8q ¨ . . . ¨ pi ´ 4k ` 4qbr ,
where i ` 3 “ 4k ` r, 0 ď r ă 4. Then the numbers ai are found from the congruences bi´1 ai ” bi
pmod pq, and choosing p so that ai are not congruent modulo p is done in a way very similar to the
above solution.
Shortlisted problems – solutions 71

This page is intentionally left blank


72 Saint-Petersburg — Russia, 18th–28th September 2020

N2. For each prime p, there is a kingdom of p-Landia consisting of p islands numbered
1, 2, . . . , p. Two distinct islands numbered n and m are connected by a bridge if and only if
p divides pn2 ´ m ` 1qpm2 ´ n ` 1q. The bridges may pass over each other, but cannot cross.
Prove that for infinitely many p there are two islands in p-Landia not connected by a chain of
bridges.
(Denmark)

Solution 1. We prove that for each prime p ą 3 dividing a number of the form x2 ´ x ` 1
with integer x there are two unconnected islands in p-Landia.
For brevity’s sake, when a bridge connects the islands numbered m and n, we shall speak
simply that it connects m and n.
A bridge connects m and n if n ” m2 ` 1 pmod pq or m ” n2 ` 1 pmod pq. If m2 ` 1 ” n
pmod pq, we draw an arrow starting at m on the bridge connecting m and n. Clearly only
one arrow starts at m if m2 ` 1 ı m pmod pq, and no arrows otherwise. The total number of
bridges does not exceed the total number of arrows.
Suppose x2 ´ x ` 1 ” 0 pmod pq. We may assume that 1 ď x ď p; then there is no arrow
starting at x. Since p1 ´ xq2 ´ p1 ´ xq ` 1 “ x2 ´ x ` 1, pp ` 1 ´ xq2 ` 1 ” pp ` 1 ´ xq pmod pq,
and there is also no arrow starting at p ` 1 ´ x. If x “ p ` 1 ´ x, that is, x “ p`1 2
, then
4px2 ´ x ` 1q “ p2 ` 3 and therefore x2 ´ x ` 1 is not divisible by p. Thus the islands x and
p ` 1 ´ x are different, and no arrows start at either of them. It follows that the total number
of bridges in p-Landia does not exceed p ´ 2.
Let 1, 2, . . . , p be the vertices of a graph Gp , where an edge connects m and n if and only if
there is a bridge between m and n. The number of vertices of Gp is p and the number of edges
is less than p ´ 1. This means that the graph is not connected, which means that there are two
islands not connected by a chain of bridges.
It remains to prove that there are infinitely many primes p dividing x2 ´x`1 for some integer
x. Let p1 , p2 , . . . , pk be any finite set of such primes. The number pp1 p2 ¨. . .¨pk q2 ´p1 p2 ¨. . .¨pk `1
is greater than 1 and not divisible by any pi ; therefore it has another prime divisor with the
required property.

Solution 2. One can show, by using only arithmetical methods, that for infinitely many p, the
kingdom of p-Ladia contains two islands connected to no other island, except for each other.
Let arrows between islands have the same meaning as in the previous solution. Suppose
that positive a ă p satisfies the congruence x2 ´ x ` 1 ” 0 pmod pq. We have seen in the first
solution that b “ p`1´a satisfies it too, and b ‰ a when p ą 3. It follows that ab ” ap1´aq ” 1
pmod pq. If an arrow goes from t to a, then t must satisfy the congruence t2 ` 1 ” a ” a2 ` 1
pmod pq; the only such t ‰ a is p ´ a. Similarly, the only arrow going to b goes from p ´ b. If
one of the numbers p ´ a and p ´ b, say, p ´ a, is not at the end of any arrow, the pair a, p ´ a
is not connected with the rest of the islands. This is true if at least one of the congruences
x2 ` 1 ” ´a, x2 ` 1 ” ´b has no solutions, that is, either ´a ´ 1 or ´b ´ 1 is a quadratic
non-residue modulo p.
Note that x2 ´ x ` 1 ” x2 ´ pa ` bqx ` ab ” px ´ aqpx ´ bq pmod pq. Substituting x “ ´1
we get p´1 ´ aqp´1 ´ bq ” 3 pmod pq. If 3 is a quadratic non-residue modulo p, so is one of
the numbers ´1 ´ a and ´1 ´ b.
Thus it is enough to find infinitely many primes p ą 3 dividing x2 ´ x ` 1 for some integer
x and such that 3 is a quadratic non-residue modulo p.
If x2 ´ x ` 1 ” 0 pmod pq then p2x ´ 1q2 ” ´3 pmod pq, that is, ´3 is a quadratic residue
modulo p, so 3 is a quadratic non-residue if and only if ´1 is also a non-residue, in other words,
p ” ´1 pmod 4q.
Similarly to the first solution, let p1 , . . . , pk be primes congruent to ´1 modulo 4 and
dividing numbers of the form x2 ´ x ` 1. The number p2p1 ¨ . . . ¨ pk q2 ´ 2p1 ¨ . . . ¨ pk ` 1 is
Shortlisted problems – solutions 73

not divisible by any pi and is congruent to ´1 modulo 4, therefore, it has some prime divisor
p ” ´1 pmod 4q which has the required properties.
74 Saint-Petersburg — Russia, 18th–28th September 2020

N3. Let n be an integer with n ě 2. Does there exist a sequence pa1 , . . . , an q of positive
integers with not all terms being equal such that the arithmetic mean of every two terms is
equal to the geometric mean of some (one or more) terms in this sequence?
(Estonia)

Answer: No such sequence exists.

Solution 1. Suppose that a1 , . . . , an satisfy the required properties. Let d “ gcdpa1 . . . , an q.


If d ą 1 then replace the numbers a1 , . . . , an by ad1 , . . . , adn ; all arithmetic and all geometric
means will be divided by d, so we obtain another sequence satisfying the condition. Hence,
without loss of generality, we can assume that gcdpa1 . . . , an q “ 1.
We show two numbers, am and ak such that their arithmetic mean, am 2`ak is different from
the geometric mean of any (nonempty) subsequence of a1 . . . , an . That proves that there cannot
exist such a sequence.
Choose the index m P t1, . . . , nu such that am “ maxpa1 , . . . , an q. Note that am ě 2,
because a1 , . . . , an are not all equal. Let p be a prime divisor of am .
Let k P t1, . . . , nu be an index such that ak “ maxtai : p ∤ ai u. Due to gcdpa1 . . . , an q “ 1,
not all ai are divisible by p, so such a k exists. Note that am ą ak because am ě ak , p | am and
p ∤ ak .
Let b “ am `a 2
k
; we will show that b cannot be the geometric mean of any subsequence
of a1 , . . . , an .
?
Consider the geometric mean, g “ t ai1 ¨ . . . ¨ ait of an arbitrary subsequence of a1 , . . . , an .
If none of ai1 , . . . , ait is divisible by p, then they are not greater than ak , so
?t am ` ak
g“ ai1 ¨ . . . ¨ ait ď ak ă “ b,
2
and therefore g ‰ b.
?
Otherwise, if at least one of ai1 , . . . , ait is divisible by p, then 2g “ 2 t ai1 ¨ . . . ¨ ait is either
not an integer or is divisible by p, while 2b “ am ` ak is an integer not divisible by p, so g ‰ b
again.

Solution 2. Like in the previous solution, we assume that the numbers a1 , . . . , an have no
common divisor greater than 1. The arithmetic mean of any two numbers in the sequence is
half of an integer; on the other hand, it is a (some integer order) root of an integer. This
means each pair’s mean is an integer, so all terms in the (sequence must be of the same parity;
hence they all are odd. Let d “ min gcdpai , aj q : ai ‰ aj . By reordering the sequence we can
assume that gcdpa1 , a2 q “ d, the sum a1 ` a2 is maximal among such pairs, and a1 ą a2 .
We will show that a1 `a 2
2
cannot be the geometric mean of any subsequence of a1 . . . , an .
Let a1 “ xd and a2 “ yd where x, y are coprime, and suppose that there exist some
b1 , . . . , bt P ta1 , . . . , an u whose geometric mean is a1 `a
2
2
. Let di “ gcdpa1 , bi q for i “ 1, 2, . . . , t
and let D “ d1 d2 ¨ . . . ¨ dt . Then
´ a ` a ¯t ´ x ` y ¯t
1 2
D “ d1 d2 ¨ . . . ¨ dt | b1 b2 ¨ . . . ¨ bt “ “ dt .
2 2
We claim that D | dt . Consider an arbitrary prime divisor p of D. Let νp pxq denote the
exponent of p in the prime factorization of x. If p | x`y 2
, then p ∤ x, y, so p is coprime
ř with
x; hence, νp pdi q ď νp pa1 q “ νp pxdq “ νp pdq for every 1 ď i ď t, therefore νp pDq “ i νp pdi q ď
tνp pdq “ νp pdt q. Otherwise, if p is coprime to x`y2
, we have νp pDq ď νp pdt q trivially. The claim
has been proved.
Shortlisted problems – solutions 75

Notice that di “ gcdpbi , a1 q ě d for 1 ď i ď t: if bi ‰ a1 then this follows from the definition
of d; otherwise we have bi “ a1 , so di “ a1 ě d. Hence, D “ d1 ¨ . . . ¨ dt ě dt , and the claim
forces d1 “ . . . “ dt “ d.
Finally, by a1 `a2
2
ą a2 there must be some bk which is greater than a2 . From a1 ą a2 ě
d “ gcdpa1 , bk q it follows that a1 ‰ bk . Now the have a pair a1 , bk such that gcdpa1 , bk q “ d but
a1 ` bk ą a1 ` a2 ; that contradicts the choice of a1 and a2 .

Comment. The original problem proposal contained a second question asking if there exists a non-
constant sequence pa1 , . . . , an q of positive integers such that the geometric mean of every two terms is
equal the arithmetic mean of some terms.
For n ě 3 such a sequence is p4, 1, 1, . . . , 1q. The case n “ 2 can be done by the trivial estimates
? a1 ` a2
minpa1 , a2 q ă a1 a2 ă ă maxpa1 , a2 q.
2
The Problem Selection Committee found this variant less interesting and suggests using only the
first question.
76 Saint-Petersburg — Russia, 18th–28th September 2020

N4. For any odd prime p and any integer n, let dp pnq P t0, 1, . . . , p ´ 1u denote the
remainder when n is divided by p. We say that pa0 , a1 , a2 , . . .q is a p-sequence, if a0 is a positive
integer coprime to p, and an`1 “ an ` dp pan q for n ě 0.
(a) Do there exist infinitely many primes p for which there exist p-sequences pa0 , a1 , a2 , . . .q and
pb0 , b1 , b2 , . . .q such that an ą bn for infinitely many n, and bn ą an for infinitely many n?
(b) Do there exist infinitely many primes p for which there exist p-sequences pa0 , a1 , a2 , . . .q and
pb0 , b1 , b2 , . . .q such that a0 ă b0 , but an ą bn for all n ě 1?
(United Kingdom)

Answer: Yes, for both parts.

Solution. Fix some odd prime p, and let T be the smallest positive integer such that p | 2T ´ 1;
in other words, T is the multiplicative order of 2 modulo p.
Consider any p-sequence pxn q “ px0 , x1 , x2 , . . . q. Obviously, xn`1 ” 2xn pmod pq and there-
fore xn ” 2n x0 pmod pq. This yields xn`T ” xn pmod pq and therefore dpxn`T q “ dpxn q for all
n ě 0. It follows that the sum dpxn q ` dpxn`1 q ` . . . ` dpxn`T ´1 q does not depend on n and is
thus a function of x0 (and p) only; we shall denote this sum by Sp px0 q, and extend the func-
tion Sp p¨q to all (not necessarily positive) integers. Therefore, we have xn`kT “ xn ` kSp px0 q
for all positive integers n and k. Clearly, Sp px0 q “ Sp p2t x0 q for every integer t ě 0.
In both parts, we use the notation
´1
Tÿ ´1
Tÿ
Sp` “ Sp p1q “ dp p2i q and Sp´ “ Sp p´1q “ dp pp ´ 2i q.
i“0 i“0

(a) Let q ą 3 be a prime and p a prime divisor of 2q ` 1 that is greater than 3. We will show
that p is suitable for part (a). Notice that 9 ∤ 2q ` 1, so that such a p exists. Moreover, for any
two odd primes q ă r we have gcdp2q ` 1, 2r ` 1q “ 2gcdpq,rq ` 1 “ 3, thus there exist infinitely
many such primes p.
For the chosen p, we have T “ 2q. Since 2q ” ´1 pmod pq, we have Sp` “ Sp´ . Now consider
the p-sequences pan q and pbn q with a0 “ p ` 1 and b0 “ p ´ 1; we claim that these sequences
satisfy the required conditions. We have a0 ą b0 and a1 “ p ` 2 ă b1 “ 2p ´ 2. It follows then
that

ak¨2q “ a0 ` kSp` ą b0 ` kSp` “ bk¨2q and ak¨2q`1 “ a1 ` kSp` ă b1 ` kSp` “ bk¨2q`1

for all k “ 0, 1, . . ., as desired.


(b) Let q be an odd prime and p a prime divisor of 2q ´ 1; thus we have T “ q. We will show
that p is suitable for part (b). Notice that the numbers of the form 2q ´ 1 are pairwise coprime
(since gcdp2q ´ 1, 2r ´ 1q “ 2gcdpq,rq ´ 1 “ 1 for any two distinct primes q and r), thus there
exist infinitely many such primes p. Notice that dp pxq ` dp pp ´ xq “ p for all x with p ∤ x, so
that the sum Sp` ` Sp´ “ pq is odd, which yields Sp` “ Sp p1q ‰ Sp p´1q “ Sp´ .
Assume that pxn q and pyn q are two p-sequences with Sp px0 q ą Sp py0 q but x0 ă y0 . The first
condition yields that
` ˘
xM q`r ´ yM q`r “ pxr ´ yr q ` M Sp px0 q ´ Sp py0 q ě pxr ´ yr q ` M

for all nonnegative integers M and every r “ 0, 1,(. . . , q ´ 1. Thus, we have xn ą yn for
every n ě q ` q ¨ max yr ´ xr : r “ 0, 1, . . . , q ´ 1 . Now, since x0 ă y0 , there exists the
largest n0 with xn0 ă yn0 . In this case the p-sequences an “ xn´n0 and bn “ yn´n0 possess
the desired property (notice here that xn ‰ yn for all n ě 0, as otherwise we would have
Sp px0 q “ Sp pxn q “ Sp pyn q “ Sp py0 q).
Shortlisted problems – solutions 77

It remains to find p-sequences pxn q and pyn q satisfying the two conditions. Recall that
Sp` ‰ Sp´ . Now, if Sp` ą Sp´ , then we can put x0 “ 1 and y0 “ p ´ 1. Otherwise, if Sp` ă Sp´ ,
then we put x0 “ p ´ 1 and y0 “ p ` 1.
78 Saint-Petersburg — Russia, 18th–28th September 2020

This page is intentionally left blank


Shortlisted problems – solutions 79

N5. Determine all functions f defined on the set of all positive integers and taking
non-negative integer values, satisfying the three conditions:
piq f pnq ‰ 0 for at least one n;
piiq f pxyq “ f pxq ` f pyq for every positive integers x and y;
piiiq there are infinitely many positive integers n such that f pkq “ f pn ´ kq for all k ă n.
(Croatia)

Answer: The sought functions are those of the form f pnq “ c ¨ νp pnq, where p is some prime, c
is a nonnegative integer, and νp pnq denotes the exponent of p in the prime decomposition of n.

Solution 1. If a number n is a product of primes, n “ p1 p2 ¨ . . . ¨ pk , then

f pnq “ f pp1 q ` . . . ` f ppk q,

in particular, f p1q “ 0 (since f p1q “ f p1q ` f p1q).


It is also clear that f pnq “ 0 implies f ppq “ 0 for all primes p dividing n.
Let us call positive integer n good if f pkq “ f pn ´ kq for 0 ă k ă n. If n is good then each
its divisor d is also good; indeed, if n “ dm then

f pkq “ f pmkq ´ f pmq “ f pn ´ mkq ´ f pmq “ f pmpd ´ kqq ´ f pmq “ f pd ´ kq

for 0 ă k ă d. Thus, good numbers are products of good primes.


It follows immediately from (i) that there exists a prime p such that f ppq ‰ 0; let p be the
smallest such prime. Then f prq “ 0 for all r ă p (since all prime divisors of r ă p are less than
p). Now every good number n ą p must be divisible by p. Indeed, if n “ pk ` r is a good
number, k ą 0, 0 ă r ă p, then f ppq ď f ppkq “ f pn ´ pkq “ f prq “ 0, a contradiction. Since
any divisor of a good number is also good, this means that if a divisor r of a good number is
not divisible by p, it is less than p. Thus all good numbers have the form r ¨ pk with r ă p. The
condition (iii) implies that k can be arbitrarily large, consequently all powers of p are good.
If q ‰ p is a prime, pq´1 ´ 1 is divisible by q and pq´1 is good. Then f pqq ď f ppq´1 ´ 1q “
f p1q “ 0, that is, f pqq “ 0.
Now we see that f pnq “ νp pnq ¨ c, where c “ f ppq. The conditions (i) and (ii) for all such
functions with c ‰ 0 are obvious; the condition (iii) holds for all n “ pm , since νp ppm ´kq “ νp pkq
when 0 ă k ă pm .

Solution 2. We use the notion of a good number from the previous solution. As above, we
also denote by νp pnq the exponent of a prime p in the prime decomposition of n.
Say that a positive integer k is big if f pkq ą 0. Let B be the set of big primes, and let
p1 ă p2 ă . . . list the elements of B (this set might be either finite or infinite). By the problem
conditions, we have ÿ
f pnq “ νpi pnqf ppi q; (1)
i

thus, the big numbers are those divisible by at least one big prime.
For a positive integer k, define its essence epkq to be the largest product e of (not necessarily
different) big primes such that e | k. In other words,
νpi pnq
ź
epnq “ pi .
pi PB

This yields that k{epkq is not big, so f pkq “ f pepkqq ` f pk{epkqq “ f pepkqq.
Lemma. Assume that n is a good number. Then epkq “ epn ´ kq for all k ă n.
80 Saint-Petersburg — Russia, 18th–28th September 2020

Proof. Arguing indirectly, choose a minimal k for which the claim of the lemma is violated.
Clearly, k is big, as otherwise f pkq “ f pn ´ kq “ 0 and hence epkq “ epn ´ kq “ 1.
There are t “ k{epkq multiples of epkq in each of the segments r1, ks and rn ´ k, n ´ 1s.
On the other hand, there are t ´ 1 such multiples on r1, k ´ 1s — and, by minimality of k, on
rn ´ k ` 1, n ´ 1s as well. This yields that n ´ k is a multiple of epkq. Therefore,
ˆ ˙
n´k
f pepkqq “ f pkq “ f pn ´ kq “ f pepkqq ` f ,
epkq

so the last summand vanishes, hence n´k


epkq
has no big prime divisors, that is, epn ´ kq “ epkq.
This contradicts our choice. l
Back to the problem, assume that |B| ě 2. Take any good number n ą p1 p2 , and let
p1 be the largest power of p1 smaller than n, so that n ď pα`1
α
1 ă pα1 p2 . By the lemma,
epn ´ p1 q “ epp1 q “ p1 , which yields p1 | n. Similarly, p2 | n, so that n ě pα1 p2 . This
α α α α

contradiction shows that |B| ď 1, which by (1) yields that f is listed in the answer.

Solution 3. We have f p pαi i q “ αi f ppi q. Note that


ś ř

f pn ´ 1q ` f pn ´ 2q ` . . . ` . . . f pn ´ kq ě f p1q ` . . . ` f pkq
`n´1˘
for all k “ 1, 2, . . . , n´1, since the difference` LHS´RHS is just f p k
q. Assume that f ppq ą 0.
n´1
˘
If f pkq “ f pn ´ kq for all k, it implies that k is not divisible by p for all k “ 1, 2, . . . , n ´ 2.
It is well known that it implies n “ a ¨ ps , a ă p. If there are two primes p, q such that
f ppq ą 0, f pqq ą 0, there exist only finitely many n which are equal both to a ¨ ps , a ă p,
and b ¨ q t , b ă q. So there exists at most one such p, and therefore f pnq “ C ¨ νp pnq for some
constant C.

Solution 4. We call a function f : N Ñ N0 satisfying piiq additive. We call a pair pf, nq,
where f is an additive function and n P N, good, if for all k ă n it holds f pkq “ f pn ´ kq. For
an additive function f and a prime number p the number flnppqp is denoted by gpf, pq.
Let pf, nq be a good pair such that f ppq ą 0 for at least two primes less than n. Let p0 be
the prime with maximal gpf, pq among all primes p ă n. Let a0 be the maximal exponent such
that pa00 ă n. Then f pkq ă f ppa00 q for all k ă pa00 . Indeed, if k “ pa11 . . . pamm ă pa00 , then

f pkq “ a1 f pp1 q ` . . . ` am f ppm q “ gpf, p1qa1 ln p1 ` . . . ` gpf, pmqam ln am


ă gpf, p0 qa0 ln p0 “ f ppa00 q.

Let n “ bpa00 ` r, where 0 ă r ă pa00 . Then f prq “ f pbpa00 q ě f ppa00 q. This contradiction shows
ν pnq
that pa00 |n. Then n “ p0p0 n1 , where n1 ď p0 .
The functions f1 pmq :“ f pp0 qνp0 pmq and f2 :“ f ´ f1 are additive (obviously f pmq ě
νp0 pmq ν pmq
f pp0 q “ f1 pmq, since p0p0 divides m). For k ă n, νp pkq “ νp pn ´ kq. Hence the pair
pf2 , nq is also good. Note that f2 pp0 q “ 0.
Choose among all primes p ă n the prime q0 with maximal gpf2 , pq. As above we can prove
νq pnq
that n “ q0 0 n2 with n2 ă q0 . Since p0 ‰ q0 , we get a contradiction. Thus f pnq “ f ppq ¨νp pnq.
Shortlisted problems – solutions 81

N6. For a positive integer n, let dpnq be the number of positive divisors of n, and let
ϕpnq be the number of positive integers not exceeding n which are coprime to n. Does there
exist a constant C such that
ϕpdpnqq
ďC
dpϕpnqq
for all n ě 1?
(Cyprus)

Answer: No, such constant does not exist.

Solution 1. Fix N ą 1, let p1 , . . . , pk be all primes between 1 and N and pk`1 , . . . , pk`s be all
primes between N ` 1 and 2N. Since for j ď k ` s all prime divisors of pj ´ 1 do not exceed N,
we have
k`s
ź k
ź
ppj ´ 1q “ pci i ,
j“1 i“1

with some fixed exponents c1 , . . . , ck . Choose a huge prime number q and consider a number

n “ pp1 ¨ . . . ¨ pk qq´1 ¨ ppk`1 ¨ . . . ¨ pk`s q.

Then
ϕpdpnqq “ ϕpq k ¨ 2s q “ q k´1 pq ´ 1q2s´1
and ˆ k`s
ź ˙ k
ˆź ˙ źk
q´2 q´2`ci
dpϕpnqq “ d pp1 ¨ . . . ¨ pk q ppi ´ 1q “ d pi “ pq ´ 1 ` ci q,
i“1 i“1 i“1
so
k
ϕpdpnqq q k´1pq ´ 1q2s´1 s´1 q ´ 1
ź q
“ śk “2 ¨ ¨ ,
dpϕpnqq i“1 pq ´ 1 ` ci q
q i“1
q ´ 1 ` ci
which can be made arbitrarily close to 2s´1 by choosing q large enough. It remains to show
that s can be arbitrarily large, i.e. that there can be arbitrarily many primes between N and
2N.
This follows, for instance, from the well-known fact that 1p “ 8, where the sum is taken
ř
over the set P of prime numbers. Indeed, if, for some constant C, there were always at most C
primes between 2ℓ and 2ℓ`1 , we would have
ÿ1 8 8
ÿ ÿ 1 ÿC
“ ď ă 8,
pPP
p ℓ“0 pPP
p ℓ“0 2ℓ
pPr2ℓ ,2ℓ`1 q

which is a contradiction.

Comment 1. Here we sketch several alternative elementary self-contained ř 1 ways to perform the last
step of the solution above. In particular, they avoid using divergence of p.
Suppose that for some constant C and for every k “ 1, 2, . . . there exist at most C ś prime numbers
between 2k and 2k`1 . Consider the prime factorization of the factorial p2n q! “ pαp . We have
αp “ t2n {pu ` t2n {p2 u ` . . .. Thus, for p P r2k , 2k`1 q, we get αp ď 2n {2k ` 2n {2k`1 ` . . . “ 2n´k`1 ,
n´k`1
therefore pαp ď 2pk`1q2 . Combining this with the bound p2mq! ě mpm ` 1q ¨ . . . ¨ p2m ´ 1q ě mm
for m “ 2 n´1 we get
n´1
pn´1q¨2n´1 n´k`1
ź
n
2 ď p2 q! ď 2Cpk`1q2 ,
k“1
82 Saint-Petersburg — Russia, 18th–28th September 2020

or
n´1
ÿ n´1
Cpk ` 1q21´k ě
k“1
2
that fails for large n since Cpk ` 1´k ă
1{3 for all but finitely many k.
1q2
In fact, a much stronger inequality can be obtained in an `elementary way: Note that the formula
n
α
for νp pn!q implies that if p is the largest power of p dividing n{2 , then pα ď n. By looking at prime
˘
`n˘
factorization of n{2 we instantaneously infer that

log p2n {nq


ˆ ˙
n n
πpnq ě logn ě ě .
n{2 log n 2 log n
n
This, in particular, implies that for infinitely many n there are at least 3 log n primes between n and 2n.

Solution 2. In this solution we will use the Prime Number Theorem which states that
m
πpmq “ ¨ p1 ` op1qq,
log m
as m tends to infinity. Here and below πpmq denotes the number of primes not exceeding m,
and log the natural logarithm.
Let m ą 5 be a large positive integer and
` let ˘n :“ p1 p2 ¨ . . . ¨ pπpmq be the product of all
primes not exceeding m. Then ϕpdpnqq “ ϕ 2πpmq “ 2πpmq´1 . Consider the number
πpmq
ź πpm{2q
ź
ϕpnq “ ppk ´ 1q “ qsαs ,
k“1 s“1

where q1 , . . . , qπpm{2q are


? primes not exceeding
ś m{2. Note that every term pk ´ 1 contributes at
αs
most one prime qs ą m into the product s qs , so we have
ÿ ÿ
αs ď πpmq ùñ p1 ` αs q ď πpmq ` πpm{2q.
? ?
s : qs ą m s : qs ą m

Hence, applying the AM–GM inequality and the inequality pA{xqx ď eA{e , we obtain
ˆ ˙ℓ ˆ ˙
ź πpmq ` πpm{2q πpmq ` πpm{2q
pαs ` 1q ď ď exp ,
? ℓ e
s : qs ą m
?
where ℓ is the number of primes in the interval p m, ms.
m 2
? then use a trivial bound αi ď log2 pϕpnqq ď log2 n ă log2 pm q ă m for each i with
We
qi ă m to obtain ?
πpź mq
` 2 ˘?m ?
pαs ` 1q ď m “ m2 m .
s“1
Putting this together we obtain
πpm{2q
?
ˆ ˙
ź πpmq ` πpm{2q
dpϕpnqq “ pαs ` 1q ď exp 2 m ¨ log m ` .
s“1
e
The prime number theorem then implies that
?
log pdpϕpnqqq 2 m ¨ log m πpmq ` πpm{2q 3
lim sup ď lim sup ` lim sup “ .
mÑ8 m{ log m mÑ8 m{ log m mÑ8 e ¨ m{ log m 2e
Whereas, again by prime number theorem, we have
` ˘
log pϕpdpnqqq log 2πpmq´1
lim inf “ lim inf “ log 2.
mÑ8 m{ log m mÑ8 m{ log m
3 3
Since 2e
ă 5
ă log 2, this implies that ϕpdpnqq{dpϕpnqq can be arbitrarily large.
Shortlisted problems – solutions 83

Comment 2. The original formulation of the problem was asking whether dpϕpnqq ě ϕpdpnqq for all
but finitely many values of n. The Problem Selection Committee decided that the presented version
is better suited for the Shortlist.
84 Saint-Petersburg — Russia, 18th–28th September 2020

This page is intentionally left blank


Shortlisted problems – solutions 85

N7. Let S be a set consisting of n ě 3 positive integers, none of which is a sum of two
other distinct members of S. Prove that the elements of S may be ordered as a1 , a2 , . . . , an so
that ai does not divide ai´1 ` ai`1 for all i “ 2, 3, . . . , n ´ 1.
(Ukraine)

Common remarks. In all solutions, we call a set S of positive integers good if no its element
is a sum of two other distinct members of S. We will use the following simple observation.
Observation A. If a, b, and c are three distinct elements of a good set S with b ą a, c, then
b ∤ a ` c. Otherwise, since b ‰ a ` c, we would have b ď pa ` cq{2 ă maxta, cu.

Solution 1. We prove the following stronger statement.


Claim. Let S be a good set consisting of n ě 2 positive integers. Then the elements of S may
be ordered as a1 , a2 , . . . , an so that ai ∤ ai´1 ` ai`1 and ai ∤ ai´1 ´ ai`1 , for all i “ 2, 3, . . . , n ´ 1.
Proof. Say that the ordering a1 , . . . , an of S is nice if it satisfies the required property.
We proceed by induction on n. The base case n “ 2 is trivial, as there are no restrictions
on the ordering.
To perform the step of induction, suppose that n ě 3. Let a “ max S, and set T “ S z tau.
Use the inductive hypothesis to find a nice ordering b1 , . . . , bn´1 of T . We will show that a may
be inserted into this sequence so as to reach a nice ordering of S. In other words, we will show
that there exists a j P t1, 2, . . . , nu such that the ordering

Nj “ pb1 , . . . , bj´1 , a, bj , bj`1 , . . . , bn´1 q

is nice.
Assume that, for some j, the ordering Nj is not nice, so that some element x in it divides
either the sum or the difference of two adjacent ones. This did not happen in the ordering of T ,
hence x P tbj´1 , a, bj u (if, say, bj´1 does not exist, then x P ta, bj u; a similar agreement is applied
hereafter). But the case x “ a is impossible: a cannot divide bj´1 ´ bj , since 0 ă |bj´1 ´ bj | ă a,
while a ∤ bj´1 ` bj by Observation A. Therefore x P tbj´1 , bj u. In this case, assign the number
x to the index j.
Suppose now that none of the Nj is nice. Since there are n possible indices j, and only n ´ 1
elements in T , one of those elements (say, bk ) is assigned to two different indices, which then
should equal k and k ` 1. This means that bk divides the numbers bk´1 ` ε1 a and a ` ε2 bk`1 ,
for some signs ε1 , ε2 P t´1, 1u. But then

bk´1 ” ´ε1 a ” ε1 ε2 bk`1 pmod bk q,

and therefore bk | bk´1 ´ ε1 ε2 bk`1 , which means that the ordering of T was not nice. This
contradiction proves the step of induction. l

Solution 2. We again prove a stronger statement.


Claim. Let S be an arbitrary set of n ě 3 positive integers. Then its elements can be ordered
as a1 , . . . , an so that, if ai | ai´1 ` ai`1 , then ai “ max S.
The claim easily implies what we need to prove, due to Observation A.
To prove the Claim, introduce the function f which assigns to any two elements a, b P S
with a ă b the unique integer f pa, bq P t1, 2, . . . , au such that a | b ` f pa, bq. Hence, if b | a ` c
for some a, b, c P S with a ă b ă c, then a “ f pb, cq. Therefore, the Claim is a consequence of
the following combinatorial lemma.
86 Saint-Petersburg — Russia, 18th–28th September 2020

Lemma. Let S be a set of n ě 3 positive integers, and let f be a function which assigns to any
a, b P S with a ă b some integer from the range t1, . . . , au. Then the elements of S may be
ordered as a1 , a2 , . . . , an so as to satisfy the following two conditions simultaneously:
piq Unimodality: There exists a j P t1, 2, . . . , nu such that a1 ă a2 ă . . . ă aj ą aj`1 ą . . . ą
an ; and
piiq f -avoidance: If a ă b are two elements of S, which are adjacent in the ordering, then
f pa, bq is not adjacent to a.
Proof. We call an ordering of S satisfying piq and piiq f -nice. We agree that f px, yq “ x for
x ě y; this agreement puts no extra restriction.
We proceed by induction; for the base case n “ 3, it suffices to put the maximal element
in S onto the middle position.
To perform the step of induction, let p ă q be the two minimal elements of S, and set
T “ S z tpu. Define a function g by assigning to any elements a ă b of T the value
#
q, if f pa, bq “ p;
gpa, bq “ (1)
f pa, bq, otherwise.

Notice that gpa, bq ď a for all a, b P T .


Use the inductive hypothesis to get a g-nice ordering b1 , b2 , . . . , bn´1 of T . By unimodality,
either b1 or bn´1 equals q; these cases differ only by reverting the order, so we assume b1 “ q.
Notice that, according to (1), the number f pb2 , b3 q differs from both p and q. On the other
hand, the number f pbn´1 , bn´2 q differs from at least one of them — say, from r; set s “ p`q ´r,
so that tr, su “ tp, qu. Now, order S as

s, b2 , b3 , . . . , bn´1 , r.

By the induction hypothesis and the above choice, this ordering is nice. l

Comment. In the original proposal, the numbers in the set were assumed to be odd (which implies
that none is a sum of two others); moreover, the proposal requested to arrange in a row all numbers
but one.
On the other hand, Solution 2 shows that the condition of S being good may be relaxed to the
condition that the maximal element of S is not a sum of two other elements in S. On the other hand,
the set t1, 2, 3u shows that the condition cannot be merely omitted.
The Problem Selection Committee considered several versions of the problem and chose the best
version in their opinion for the Shortlist.
Shortlisted
Problems
(with solutions)

Confidential until
1:30pm on 12 July 2022
(Norwegian time)

62nd International Mathematical Olympiad


Saint-Petersburg — Russia, 16th–24th July 2021
Note of Confidentiality
The Shortlist has to be kept strictly confidential
until the conclusion of the following
International Mathematical Olympiad.
IMO General Regulations §6.6

Contributing Countries
The Organising Committee and the Problem Selection Committee of IMO 2021 thank the
following 51 countries for contributing 175 problem proposals:
Albania, Algeria, Armenia, Australia, Austria, Azerbaijan, Belgium,
Bangladesh, Canada, China, Colombia, Croatia, Czech Republic, Denmark,
Estonia, France, Germany, Greece, Hong Kong, Iceland, India, Iran,
Ireland, Israel, Japan, Kazakhstan, Kosovo, Luxembourg, Malaysia,
Mexico, Morocco, Myanmar, Netherlands, New Zealand, North Macedonia,
Poland, Romania, Singapore, Slovakia, Slovenia, South Africa, South Korea,
Spain, Switzerland, Taiwan, Thailand, U.S.A., Ukraine, United Kingdom,
Uzbekistan, Vietnam
Problem Selection Committee

Géza Kós, Gerhard Woeginger, Alexey Ustinov, Dmitry Krachun, Ivan Mitrofanov,
Sergey Berlov, Fedor Petrov, Ivan Frolov, Paul Vaderlind, Alexander Golovanov,
Ilya I. Bogdanov (chair)
Shortlisted problems 5

Problems
Algebra
A1. Let n be an integer, and let A be a subset of t0, 1, 2, 3, . . . , 5nu consisting of 4n ` 2
numbers. Prove that there exist a, b, c P A such that a ă b ă c and c ` 2a ą 3b.
A2.
Z ^
For every integer n ě 1 consider the n ˆ n table with entry ij
at the intersection
n`1
of row i and column j , for every i “ 1, . . . , n and j “ 1, . . . , n. Determine all integers n ě 1 for
which the sum of the n2 entries in the table is equal to 14 n2pn ´ 1q.

A3. Given a positive integer n, find the smallest value of


Ya ]
1
1
`
Ya ]
2
2
` ¨¨¨ `
Ya ]
n
n
over
all permutations pa1 , a2, . . . , an q of p1, 2, . . . , nq.

A4. Show that for all real numbers x1 , . . . , xn the following inequality holds:
ÿ n b
n ÿ ÿ n b
n ÿ
|xi ´ xj | ď |xi ` xj |.
“ “
i 1j 1 “ “
i 1j 1

A5. Let n ě 2 be an integer, and let a1 , a2, . . . , an be positive real numbers such that
a1 ` a2 ` ¨ ¨ ¨ ` an “ 1. Prove that
ÿ
n

1
ak
´ a
pa1 ` a2 ` ¨ ¨ ¨ ` ak´1q2 ă 13 .
k “1 k

A6. Let A be a finite set of (not necessarily positive) integers, and let m ě 2 be an integer.
Assume that there exist non-empty subsets B1 , B2, B3, . . . , Bm of A whose elements add up to
the sums m1 , m2 , m3, . . . , mm, respectively. Prove that A contains at least m{2 elements.

A7. Let n ě 1 be an integer, and let x0 , x1 , . . . , xn`1 be n ` 2 non-negative real numbers


that satisfy xi xi`1 ´ x2i´1 ě 1 for all i “ 1, 2, . . . , n. Show that
ˆ ˙3{2
x0 ` x1 ` ¨ ¨ ¨ ` xn ` xn`1 ą 2n
.
3

A8. Determine all functions f : R Ñ R that satisfy


` ˘` ˘` ˘
f paq ´ f pbq f pbq ´ f pcq f pcq ´ f paq “ f pab2 ` bc2 ` ca2 q ´ f pa2b ` b2 c ` c2aq
for all real numbers a, b, c.
6 Saint-Petersburg — Russia, 16th–24th July 2021

Combinatorics
C1. Let S be an infinite set of positive integers, such that there exist four pairwise distinct
a, b, c, d P S with gcdpa, bq ‰ gcdpc, dq. Prove that there exist three pairwise distinct x, y, z P S
such that gcdpx, y q “ gcdpy, zq ‰ gcdpz, xq.

C2. Let n ě 3 be an integer. An integer m ě n ` 1 is called n-colourful if, given infinitely


many marbles in each of n colours C1, C2, . . . , Cn , it is possible to place m of them around a
circle so that in any group of n ` 1 consecutive marbles there is at least one marble of colour
Ci for each i “ 1, . . . , n.
Prove that there are only finitely many positive integers which are not n-colourful. Find
the largest among them.
C3. A thimblerigger has 2021 thimbles numbered from 1 through 2021. The thimbles are
arranged in a circle in arbitrary order. The thimblerigger performs a sequence of 2021 moves;
in the kth move, he swaps the positions of the two thimbles adjacent to thimble k.
Prove that there exists a value of k such that, in the kth move, the thimblerigger swaps
some thimbles a and b such that a ă k ă b.
C4. The kingdom of Anisotropy consists of n cities. For every two cities there exists exactly
one direct one-way road between them. We say that a path from X to Y is a sequence of roads
such that one can move from X to Y along this sequence without returning to an already
visited city. A collection of paths is called diverse if no road belongs to two or more paths in
the collection.
Let A and B be two distinct cities in Anisotropy. Let NAB denote the maximal number of
paths in a diverse collection of paths from A to B . Similarly, let NBA denote the maximal num-
ber of paths in a diverse collection of paths from B to A. Prove that the equality NAB “ NBA
holds if and only if the number of roads going out from A is the same as the number of roads
going out from B .
C5. Let n and k be two integers with n ą k ě 1. There are 2n ` 1 students standing in
a circle. Each student S has 2k neighbours — namely, the k students closest to S on the right,
and the k students closest to S on the left.
Suppose that n ` 1 of the students are girls, and the other n are boys. Prove that there is
a girl with at least k girls among her neighbours.
C6. A hunter and an invisible rabbit play a game on an infinite square grid. First the
hunter fixes a colouring of the cells with finitely many colours. The rabbit then secretly chooses
a cell to start in. Every minute, the rabbit reports the colour of its current cell to the hunter,
and then secretly moves to an adjacent cell that it has not visited before (two cells are adjacent
if they share a side). The hunter wins if after some finite time either
• the rabbit cannot move; or

• the hunter can determine the cell in which the rabbit started.

Decide whether there exists a winning strategy for the hunter.


Shortlisted problems 7

C7. Consider a checkered 3m ˆ 3m square, where m is an integer greater than 1. A frog


sits on the lower left corner cell S and wants to get to the upper right corner cell F . The frog
can hop from any cell to either the next cell to the right or the next cell upwards.
Some cells can be sticky, and the frog gets trapped once it hops on such a cell. A set X of
cells is called blocking if the frog cannot reach F from S when all the cells of X are sticky. A
blocking set is minimal if it does not contain a smaller blocking set.
(a) Prove that there exists a minimal blocking set containing at least 3m2 ´ 3m cells.
(b) Prove that every minimal blocking set contains at most 3m2 cells.
Note. An example of a minimal blocking set for m “ 2 is shown below. Cells of the set X are marked
by letters x.
F
x x
x
x
x
S x

C8. Determine the largest N for which there exists a table T of integers with N rows and
100 columns that has the following properties:

(i) Every row contains the numbers 1, 2, . . . , 100 in some order.


(ii) For any two distinct rows r and s, there is a column c such that |T pr, cq ´ T ps, cq| ě 2.
Here T pr, cq means the number at the intersection of the row r and the column c.
8 Saint-Petersburg — Russia, 16th–24th July 2021

Geometry
G1. Let ABCD be a parallelogram such that AC “ BC . A point P is chosen on the
extension of the segment AB beyond B . The circumcircle of the triangle ACD meets the
segment P D again at Q, and the circumcircle of the triangle AP Q meets the segment P C
again at R. Prove that the lines CD, AQ, and BR are concurrent.
G2. Let ABCD be a convex quadrilateral circumscribed around a circle with centre I .
Let ω be the circumcircle of the triangle ACI . The extensions of BA and BC beyond A and
C meet ω at X and Z , respectively. The extensions of AD and CD beyond D meet ω at Y
and T , respectively. Prove that the perimeters of the (possibly self-intersecting) quadrilaterals
ADT X and CDY Z are equal.

G3.
Version 1. Let n be a fixed positive integer, and let S be the set of points px, y q on the
Cartesian plane such that both coordinates x and y are nonnegative integers smaller than 2n
(thus |S| “ 4n2 ). Assume that F is a set consisting of n2 quadrilaterals such that all their
vertices lie in S, and each point in S is a vertex of exactly one of the quadrilaterals in F .
Determine the largest possible sum of areas of all n2 quadrilaterals in F .
Version 2. Let n be a fixed positive integer, and let S be the set of points px, y q on the
Cartesian plane such that both coordinates x and y are nonnegative integers smaller than 2n
(thus |S| “ 4n2). Assume that F is a set of polygons such that all vertices of polygons in F lie
in S, and each point in S is a vertex of exactly one of the polygons in F .
Determine the largest possible sum of areas of all polygons in F .
G4. Let ABCD be a quadrilateral inscribed in a circle Ω. Let the tangent to Ω at D
intersect the rays BA and BC at points E and F , respectively. A point T is chosen inside the
triangle ABC so that T E k CD and T F k AD. Let K ‰ D be a point on the segment DF
such that T D “ T K . Prove that the lines AC , DT and BK intersect at one point.
G5. Let ABCD be a cyclic quadrilateral whose sides have pairwise different lengths. Let
O be the circumcentre of ABCD . The internal angle bisectors of =ABC and =ADC meet AC
at B1 and D1, respectively. Let OB be the centre of the circle which passes through B and is
tangent to AC at D1. Similarly, let OD be the centre of the circle which passes through D and
is tangent to AC at B1 .
Assume that BD1 k DB1. Prove that O lies on the line OB OD .

G6. Determine all integers n ě 3 satisfying the following property: every convex n-gon
whose sides all have length 1 contains an equilateral triangle of side length 1.
(Every polygon is assumed to contain its boundary.)
Shortlisted problems 9

G7. A point D is chosen inside an acute-angled triangle ABC with AB ą AC so that


=BAD “ =DAC . A point E is constructed on the segment AC so that =ADE “ =DCB .
Similarly, a point F is constructed on the segment AB so that =ADF “ =DBC . A point
X is chosen on the line AC so that CX “ BX . Let O1 and O2 be the circumcentres of the
triangles ADC and DXE . Prove that the lines BC , EF , and O1O2 are concurrent.
G8. Let ω be the circumcircle of a triangle ABC , and let ΩA be its excircle which is tangent
to the segment BC . Let X and Y be the intersection points of ω and ΩA . Let P and Q be the
projections of A onto the tangent lines to ΩA at X and Y , respectively. The tangent line at P
to the circumcircle of the triangle AP X intersects the tangent line at Q to the circumcircle of
the triangle AQY at a point R. Prove that AR K BC .
10 Saint-Petersburg — Russia, 16th–24th July 2021

Number Theory
N1. Determine all integers n ě 1 for which there exists a pair of positive integers pa, bq
such that no cube of a prime divides a2 ` b ` 3 and
ab ` 3b ` 8
a2 ` b ` 3
“ n.

N2. Let n ě 100 be an integer. The numbers n, n ` 1, . . . , 2n are written on n ` 1 cards,


one number per card. The cards are shuffled and divided into two piles. Prove that one of the
piles contains two cards such that the sum of their numbers is a perfect square.
N3. Find all positive integers n with the following property: the k positive divisors of n
have a permutation pd1, d2, . . . , dk q such that for every i “ 1, 2, . . . , k, the number d1 ` ¨ ¨ ¨ ` di
is a perfect square.
N4. Alice is given a rational number r ą 1 and a line with two points B ‰ R, where
point R contains a red bead and point B contains a blue bead. Alice plays a solitaire game by
performing a sequence of moves. In every move, she chooses a (not necessarily positive) integer
k , and a bead to move. If that bead is placed at point X , and the other bead is placed at Y ,
ÝÝÑ
then Alice moves the chosen bead to point X 1 with Y X 1 “ rk Ý ÝÑ
Y X.
Alice’s goal is to move the red bead to the point B . Find all rational numbers r ą 1 such
that Alice can reach her goal in at most 2021 moves.
N5. Prove that there are only finitely many quadruples pa, b, c, nq of positive integers such
that
n! “ an´1 ` bn´1 ` cn´1 .

N6. Determine all integers n ě 2 with the following property: every n pairwise distinct
integers whose sum is not divisible by n can be arranged in some order a1 , a2 , . . . , an so that
n divides 1 ¨ a1 ` 2 ¨ a2 ` ¨ ¨ ¨ ` n ¨ an .

N7. Let a1, a2 , a3, . . . be an infinite sequence of positive integers such that an`2m divides
an ` an`m for all positive integers n and m. Prove that this sequence is eventually periodic, i.e.
there exist positive integers N and d such that an “ an`d for all n ą N .
N8. For a polynomial P pxq with integer coefficients let P 1pxq “ P pxq and P k`1pxq “
P pP k pxqq for k ě 1. Find all positive integers n for which there exists a polynomial P pxq with
integer coefficients such that for every integer m ě 1, the numbers P mp1q, . . . , P mpnq leave
exactly rn{2m s distinct remainders when divided by n.
Shortlisted problems – solutions 11

This page is intentionally left blank


12 Saint-Petersburg — Russia, 16th–24th July 2021
Shortlisted problems – solutions 13

Solutions
Algebra
A1. Let n be an integer, and let A be a subset of t0, 1, 2, 3, . . . , 5nu consisting of 4n ` 2
numbers. Prove that there exist a, b, c P A such that a ă b ă c and c ` 2a ą 3b.
Solution 1. (By contradiction) Suppose that there exist 4n ` 2 non-negative integers x0 ă
x1 ă ¨ ¨ ¨ ă x4n`1 that violate the problem statement. Then in particular x4n`1 ` 2xi ď 3xi`1
for all i “ 0, . . . , 4n ´ 1, which gives
x4n`1 ´ xi ě 32 px4n`1 ´ xi`1q.
By a trivial induction we then get
ˆ ˙4n´i
x4n`1 ´ xi ě px4n`1 ´ x4nq,
3
2

which for i “ 0 yields the contradiction


ˆ ˙4n ˆ ˙n
x4n`1 ´ x0 ě px4n`1 ´ x4n q “ px4n`1 ´ x4n q ą 5n ¨ 1.
3 81
2 16

Solution 2. Denote the maximum element of A by c. For k “ 0, . . . , 4n ´ 1 let


(
Ak “ x P A : p1 ´ p2{3qk qc ď x ă p1 ´ p2{3qk`1qc .

Note that
p1 ´ p2{3q4nqc “ c ´ p16{81qnc ą c ´ p1{5qnc ě c ´ 1,
which shows that the sets A0, A1, . . . , A4n´1 form a partition of A ztcu. Since A ztcu has 4n ` 1
elements, by the pigeonhole principle some set Ak does contain at least two elements of A ztcu.
Denote these two elements a and b and assume a ă b, so that a ă b ă c. Then
c ` 2a ě c ` 2p1 ´ p2{3qk qc “ p3 ´ 2p2{3qk qc “ 3p1 ´ p2{3qk`1 qc ą 3b,

as desired.
14 Saint-Petersburg — Russia, 16th–24th July 2021

A2.
Z ^
For every integer n ě 1 consider the n ˆ n table with entry n ` 1 at the intersection ij

of row i and column j , for every i “ 1, . . . , n and j “ 1, . . . , n. Determine all integers n ě 1 for
which the sum of the n2 entries in the table is equal to 14 n2pn ´ 1q.
Answer: All integers n for which n ` 1 is a prime.
Solution 1. First, observe that every pair x, y of real numbers for which the sum x ` y is
integer satisfies
txu ` tyu ě x ` y ´ 1. (1)
The inequality is strict if x and y are integers, and it holds with equality otherwise.
We estimate the sum S as follows.
ˆZ ^ Z ^˙ ˆZ ^ Z ^˙

ÿ ij
` ij

ÿ ij pn ` 1 ´ iqj
` n`1
n`1 n`1 n`1
2S
ď ď
1 i,j n ď ď
1 i,j n

pj ´ 1q “ pn ´21qn
ÿ 2
ě .
ď ď
1 i,j n

The inequality in the last line follows from (1) by setting x “ ij {pn ` 1q and y “ pn ` 1 ´
iqj {pn ` 1q, so that x ` y “ j is integral.
Now S “ 14 n2pn ´ 1q if and only if the inequality in the last line holds with equality, which
means that none of the values ij {pn ` 1q with 1 ď i, j ď n may be integral.
Hence, if n ` 1 is composite with factorisation n ` 1 “ ab for 2 ď a, b ď n, one gets a
strict inequality for i “ a and j “ b. If n ` 1 is a prime, then ij {pn ` 1q is never integral and
S “ 14 n2 pn ´ 1q.

Solution 2. To simplify the calculation with indices, extend the table by adding a phantom
column of index 0 with zero entries (which will not change the sum of the table). Fix a row i
with 1 ď i ď n, and let d :“ gcdpi, n ` 1q and k :“ pn ` 1q{d. For columns j “ 0, . . . , n, define
the remainder rj :“ ij mod pn ` 1q. We first prove the following
Claim. For every integer g with 1 ď g ď d, the remainders rj with indices j in the range
pg ´ 1qk ď j ď gk ´ 1 (2)
form a permutation of the k numbers 0 ¨ d, 1 ¨ d, 2 ¨ d, . . . , pk ´ 1q ¨ d.
Proof. If rj 1 “ rj holds for two indices j 1 and j in (2), then ipj 1 ´j q ” 0 mod pn ` 1q, so that j 1 ´ j
is a multiple of k; since |j 1 ´ j | ď k ´ 1, this implies j 1 “ j . Hence, the k remainders are pairwise
distinct. Moreover, each remainder rj “ ij mod pn ` 1q is a multiple of d “ gcdpi, n ` 1q. This
proves the claim.
We then have
d pn`ÿ
1q{d´1 ˆ ˙
n`1 n`1
“ pn ` 1 ´2dqpn ` 1q .
ÿ
n ÿ
rj “ ℓd “ d 2
¨ 1
2 d
´1 d
(3)

j 0 “
g 1 “
ℓ 0

By using (3), compute the sum Si of row i as follows:


Z ^

ÿ
n
ij

ÿ
n
ij ´ rj “ i ÿ n

1 ÿ
n

n`1 n`1 n ` 1 j “0 n ` 1 j “0
Si rj

j 0 j “0

“ n `i 1 ¨ npn2` 1q ´ n `1 1 ¨ pn ` 1 ´2dqpn ` 1q “ pin ´ n 2´ 1 ` dq . (4)


Shortlisted problems – solutions 15

Equation (4) yields the following lower bound on the row sum Si, which holds with equality if
and only if d “ gcdpi, n ` 1q “ 1:

Si ě pin ´ n 2´ 1 ` 1q “ npi 2´ 1q . (5)


By summing up the bounds (5) for the rows i “ 1, . . . , n, we get the following lower bound for
the sum of all entries in the table
ÿ ÿ n pn ´ 1q
n n 2
Si ě n
2
p i ´ 1q “
4
. (6)

i 1 “
i 1

In (6) we have equality if and only if equality holds in (5) for each i “ 1, . . . , n, which happens
if and only if gcdpi, n ` 1q “ 1 for each i “ 1, . . . , n, which is equivalent to the fact that n ` 1
is a prime. Thus the sum of the table entries is 14 n2pn ´ 1q if and only if n ` 1 is a prime.
Comment. To simplify the answer, in the problem statement one can make a change of variables by
introducing m :“ n ` 1 and writing everything in terms of m. The drawback is that the expression for
the sum will then be 14 pm ´ 1q2 pm ´ 2q which seems more artificial.
16 Saint-Petersburg — Russia, 16th–24th July 2021

A3. Given a positive integer n, find the smallest value of


Ya ]
1
1
`
Ya ]
2
2
` ¨¨¨ `
Ya ]
n
n
over
all permutations pa1 , a2, . . . , an q of p1, 2, . . . , nq.
Answer: The minimum of such sums is tlog2 nu ` 1; so if 2k ď n ă 2k`1, the minimum is k ` 1.
Solution 1. Suppose that 2k ď n ă X2k`\1 with X a \some nonnegative
Xa \ integer k. First we show a
\ X a \ pa1 , a2X, .a. .\, an q such that 1 ` 2 ` ¨ ¨ ¨ ` n “ k ` 1; then we will prove that
Xpermutation
a 1 2 n

a
1
` 2 ` ¨ ¨ ¨ ` n ě k ` 1 for every permutation. Hence, the minimal possible value will
2 n

be k ` 1.
1

I. Consider the permutation


pa1 q “ p1q, pa2, a3 q “ p3, 2q, pa4 , a5, a6 , a7q “ p7, 4, 5, 6q, . . .
pa2 ´ , . . . , a2 ´1 q “ p2k ´ 1, 2k´1, 2k´1 ` 1, . . . , 2k ´ 2q,
k 1 k

pa2 , . . . , anq “ pn, 2k , 2k ` 1, . . . , n ´ 1q.


k

This permutation consists of k ` 1 cycles. In every cycle pap , . . . , aq q “ pq, p, p ` 1, . . . , q ´ 1q


we have q ă 2p, so q Z ^ Z ^ Z ^
ÿ ÿ i´1
q
ai
i
“ p `
q
i
“ 1;

i p “`
i p 1

The total sum over all cycles is precisely k ` 1.


II. In order to establish the lower bound, we prove a more general statement.
Claim. If b1 , . . . , b2 are distinct positive integers then
k

2k Z ^
ÿ bi
i
ě k ` 1.

i 1

n Y ]
ÿ 2 Y ]
ÿ
k

From the Claim it follows immediately that ai


i
ě ai
i
ě k ` 1.

i 1 “
i 1
Xb \
Proof of the Claim. Apply induction on k. For k “ 1 the claim is trivial, 1
ě 1. Suppose
the Claim holds true for some positive integer k, and consider k ` 1.
1

If there exists an index j such that 2k ă j ď 2k`1 and bj ě j then


k`1
2ÿ Z ^ 2k Z ^ Z ^
ÿ
bi
i
ě bi
i
` bj
j
ě pk ` 1q ` 1

i 1 i 1 “
by the induction hypothesis, so the Claim is satisfied.
Otherwise we have bj ă j ď 2k`1 for every 2k ă j ď 2k`1. Among the 2k`1 distinct numbers
b1 , . . . , b2 ` there is some bm which is at least 2k`1; that number must be among b1 . . . , b2 .
k 1 k

Hence, 1 ď m ď 2k and bm ě 2k`1.


We will apply the induction hypothesis to the numbers
c1 “ b1 , . . . , cm´1 “ bm´1 , cm “ b2 `1, k cm`1 “ bm`1 , . . . , c2 “ b2 ,k k

so take the first 2k numbers but replace bm with b2 `1. Notice that k

Z ^ Z ^ Z ^ Z ^ Z ^
2k`1 2k ` 2k b2k `1 ` m
bm
m
ě m
“ m
ě m
“ cm
m
` 1.
Shortlisted problems – solutions 17
Xb \ Xc \
For the other indices i with 1 ď i ď 2k , i ‰ m we have i
i
“ i
i
, so
k`1
2ÿ Z ^ 2k Z ^ 2k Z ^
ÿ ÿ
bi
i
“ bi
i
ě ci
i
` 1 ě pk ` 1q ` 1.

i 1 “
i 1 “
i 1

That proves the Claim and hence completes the solution. l


Solution 2. We present a different proof for the lower bound.
Assume again 2k ď n ă 2k`1, and let P “ t20 , 21, . . . , 2k u be the set of powers of 2 among
1, 2, . . . , n. Call an integer i P t1, 2, . . . , nu and the interval ri, ai s good if ai ě i.
Lemma 1. The good intervals cover the integers 1, 2, . . . , n.
Proof. Consider an arbitrary x P t1, 2 . . . , nu; we want to find a good interval ri, ai s that covers x;
i.e., i ď x ď ai. Take the cycle of the permutation that contains x, that is px, ax , aa , . . .q. In
this cycle, let i be the first element with ai ě x; then i ď x ď ai. l
x

X \
X a \ ˇ 2. If a good
Lemma ˇ interval ri, ais covers p distinct powers of 2 then ai ě p; more formally, i

i
i
ě ˇri, ais X P ˇ.
Proof. The ratio of the smallest and largest powers of 2 in the interval is at least 2p´1. By
Bernoulli’s inequality, ai ě 2p´1 ě p; that proves the lemma.
i
l
Now, by Lemma 1, the good intervals cover P . By applying Lemma 2 as well, we obtain
that n Z ^ Z ^ ˇ ˇ
ÿ ai n ÿ n ÿ ˇ ˇ
i
“ ai
i
ě ˇ
r
ˇ i, ai s X P ˇˇ ě ˇP ˇ “ k ` 1.

i 1 i is good i is good

Solution 3. We show yet another proof for the lower bound, based on the following inequality.
Lemma 3. Z ^
a
b
ě log2 a `b 1
for every pair a,X b\ of positive integers.
Proof. Let t “ ab , so t ď ab and a`b 1 ď t ` 1. By applying the inequality 2t ě t ` 1, we obtain
Z ^
a
b
“ t ě log2pt ` 1q ě log2 a `b 1 . l

By applying the lemma to each term, we get


n Z ^
ě log2 ai `i 1
ÿ ÿ
n ÿ
n ÿ
n
ai
i
“ log2 pai ` 1q ´ log2 i.

i 1 i“1 “
i 1 “
i 1

Notice that the numbers a1 ` 1, a2 ` 1, . . . , an ` 1 form a permutation of 2, 3, . . . , n ` 1. Hence,


in the last two sums all terms cancel out, except for log2pn ` 1q in the first sum and log2 1 “ 0
in the second sum. Therefore,
n Z ^
ÿ ai
i
ě log2pn ` 1q ą k.

i 1

As the left-hand side is an integer, it must be at least k ` 1.


18 Saint-Petersburg — Russia, 16th–24th July 2021

A4. Show that for all real numbers x1 , . . . , xn the following inequality holds:
ÿ n b
n ÿ ÿ n b
n ÿ
|xi ´ xj | ď |xi ` xj |.
“ “
i 1j 1 “ “
i 1j 1

Solution 1. If we add t to all the variables then the left-hand side remains constant and the
right-hand side becomes n b
ÿ
n ÿ
H ptq :“ |xi ` xj ` 2t|.
“ “
i 1j 1

Let T be large enough such that both H p´T q and H pT q are larger than the value L of the left-
hand side of the inequality we want to prove. Not necessarily distinct points pi,j :“ ´pxi ` xj q{2
together with T and ´T split the real line into segments and two rays a such that on each of
these segments and rays the function H ptq is concave since f ptq :“ |ℓ ` 2t| is concave on
both intervals p´8, ´ℓ{2s and r´ℓ{2, `8q. Let ra, bs be the segment containing zero. Then
concavity implies H p0q ě mintH paq, H pbqu and, since H p˘T q ą L, it suffices to prove the
inequalities H p´pxi ` xj q{2q ě L, that is to prove the original inequality in the case when all
numbers are shifted in such a way that two variables xi and xj add up to zero. In the following
we denote the shifted variables still by xi.
Ifři “aj , i.e. xi “ 0 for some index i, then we can remove xi which will decrease both sides
by 2 k |xk |. Similarly, if xi ` xj “ 0 for distinct i and j we can remove both xi and xj which
decreases both sides by
ˆ b ˙
a ÿ a
2 2|xi | ` 2 ¨ |xk ` xi | ` |xk ` xj | .

k i,j

In either case we reduced our inequality to the case of smaller n. It remains to note that for
n “ 0 and n “ 1 the inequality is trivial.
Solution 2. For real p consider the integral
ż8
1 ´ cosppxq
I ppq “ ? dx,
x x
0

a to a strictly positive number. By changing the variable y “ |p|x one


which clearly converges
notices that I ppq “ |p|I p1q. Hence, by using the trigonometric formula cospα ´ β q ´ cospα `
β q “ 2 sin α sin β we obtain
ż8 ż8
a a cosppa ´ bqxq ´ cosppa ` bqxq 2 sinpaxq sinpbxq
|a ` b|´ |a ´ b| “ 1
I p1q
?
x x
dx “
1
I p1q
?
x x
dx,
0 0

from which our inequality immediately follows:


ż 8 `řn ˘2
i“1 sinpxi xq
ÿ n b
n ÿ ÿ n b
n ÿ
|xi ` xj | ´ |xi ´ xj | “ 2
I p1q
?
x x
dx ě 0.
“ “
i 1j 1 “ “
i 1j 1 0

Comment 1. A more general inequality


ÿ
n ÿ
n ÿ
n ÿ
n
|x i ´ x j | ď
r
|x i ` x j |r
“ “
i 1j 1 “ “
i 1j 1

holds for any r P r0, 2s. The first solution can be repeated verbatim for ?
any r P r0, 1s but not for r ą 1.
r `
In the second solution, by putting x in the denominator in place of x x we can prove the inequality
1

for any r P p0, 2q and the cases r “ 0, 2 are easy to check by hand.
?
Comment 2. In fact, the integral from Solution 2 can be computed explicitly, we have I p1q “ 2π.
Shortlisted problems – solutions 19

A5. Let n ě 2 be an integer, and let a1 , a2, . . . , an be positive real numbers such that
a1 ` a2 ` ¨ ¨ ¨ ` an “ 1. Prove that

ÿ
n

1
ak
´ a
pa1 ` a2 ` ¨ ¨ ¨ ` ak´1q2 ă 13 .
k “1 k

Solution 1. For all k ď n, let


2
sk “ a1 ` a2 ` ¨ ¨ ¨ ` ak and bk “ a1k´ska´1 ,
k

with the convention that s0 “ 0. Note that bk is exactly a summand in the sum we need to
estimate. We shall prove the inequality
s3k ´ s3k´1
bk ă 3
. (1)
Indeed, it suffices to check that
` ˘
(1) ðñ 0 ă p1 ´ ak q psk´1 ` ak q3 ´ s3k´1 ´ 3ak s2k´1
` ˘
ðñ 0 ă p1 ´ ak q 3s2k´1 ` 3sk´1ak ` a2k ´ 3s2k´1
ðñ 0 ă ´3ak s2k´1 ` 3p1 ´ ak qsk´1ak ` p1 ´ ak qa2k
ðñ 0 ă 3p1 ´ ak ´ sk´1qsk´1ak ` p1 ´ ak qa2k
which holds since ak ` sk´1 “ sk ď 1 and ak P p0, 1q.
Thus, adding inequalities (1) for k “ 1, . . . , n, we conclude that

ă sn ´3 s0 “ 13 ,
3 3
b1 ` b2 ` ¨ ¨ ¨ ` bn

as desired.
Comment 1. There are many ways of proving (1) which can be written as
as2
´ pa ` sq3 ´ s3 ă 0, (2)
1´a 3

for non-negative a and s satisfying a ` s ď 1 and a ą 0.


E.g., note that for any fixed a the expression in (2) is quadratic in s with the leading coefficient
a{p1 ´ aq ´ a ą 0. Hence, it is convex as a function in s, so it suffices to check the inequality at s “ 0
and s “ 1 ´ a. The former case is trivial and in the latter case the inequality can be rewritten as
3aspa ` sq ` a3
as ´ ă 0,
3
which is trivial since a ` s “ 1.
Solution 2. First, let us define
ÿ
n
S pa1 , . . . , an q :“ pa1 ` a2 ` ¨ ¨ ¨ ` ak´1q2.
ak
k “1
1 ´ ak
20 Saint-Petersburg — Russia, 16th–24th July 2021

For some index i, denote a1 ` ¨ ¨ ¨ ` ai´1 by s. If we replace ai with two numbers ai {2 and
ai {2, i.e. replace the tuple pa1 , . . . , an q with pa1 , . . . , ai´1 , ai {2, ai {2, ai`1 , . . . , an q, the sum will
increase by
ai {2 ` 2 ˘
S pa1 , . . . , ai {2, ai {2, . . . , an q ´ S pa1 , . . . , an q “ s ` ps ` ai {2q2 ´
ai 2
1 ´ ai {2 1 ´ ai
s

“ ai p1 ´ ai qp2s p`2 ´saai `qp1ai´{4aq q´ p2 ´ ai qs


2 2 2

i i

“ ai p 1 ´ ai ´ sqsai ` p1 ´ ai qa2i {4
p2 ´ ai qp1 ´ ai q ,

which is strictly positive. So every such replacement strictly increases the sum. By repeating
this process and making maximal number in the tuple tend to zero, we keep increasing the sum
which will converge to ż 1
x2 dx “ .
1
0 3
This completes the proof.
Solution 3. We sketch a probabilistic version of the first solution. Let x1 , x2 , x3 be drawn
uniformly and independently at random from the segment r0, 1s. Let I1 Y I2 Y ¨ ¨ ¨ Y In be a
partition of r0, 1s into segments of length a1, a2 , . . . , an in this order. Let Jk :“ I1 Y ¨ ¨ ¨ Y Ik´1
for k ě 2 and J1 :“ H. Then
ÿ
n
1
3
“ Ptx1 ě x2 , x3; x1 P Ik u

k 1
ÿn ´
“ Ptx1 P Ik ; x2 , x3 P Jk u ` 2 ¨ Ptx1 ě x2 ; x1 , x2 P Ik ; x3 P Jk u

k 1
¯
` Ptx1 ě x2 , x3 ; x1 , x2 , x3 P Ik u
n ˆ
ÿ 2
˙
a3k
“ ak pa1 ` ¨ ¨ ¨ ` ak´1 q 2
` 2 ¨ a2k ¨ pa1 ` ¨ ¨ ¨ ` ak´1q ` 3

k 1
n ˆ ˙
ÿ a1 ` ¨ ¨ ¨ ` ak´1
ą ak pa1 ` ¨ ¨ ¨ ` ak´1 q 2
` pa1 ` ¨ ¨ ¨ ` ak´1q ¨
a2k
1 ´ ak
,

k 1

where for the last inequality we used that 1 ´ ak ě a1 ` ¨ ¨ ¨ ` ak´1. This completes the proof
since 2
ak ` “ 1 ´aka
ak
1 ´ ak
.
k
Shortlisted problems – solutions 21

A6. Let A be a finite set of (not necessarily positive) integers, and let m ě 2 be an integer.
Assume that there exist non-empty subsets B1 , B2, B3, . . . , Bm of A whose elements add up to
the sums m1 , m2 , m3, . . . , mm, respectively. Prove that A contains at least m{2 elements.
Solution. Let A “ ta1 , . . . , ak u. Assume that, on the contrary, k “ |A| ă m{2. Let
ÿ
s i :“ aj
j:aj BiP
be the sum of elements of Bi. We are given that si “ mi for i “ 1, . . . , m.
Now consider all mm expressions of the form
f pc 1 , . . . , c m q : “ c 1 s 1 ` c 2 s 2 ` . . . ` c m s m , c i P t0, 1, . . . , m ´ 1u for all i “ 1, 2, . . . , m.
Note that every number f pc1, . . . , cmq has the form
α1 a1 ` . . . ` αk ak , αi
P t0, 1, . . . , mpm ´ 1qu.
Hence, there are at most pmpm ´ 1q ` 1qk ă m2k ă mm distinct values of our expressions;
therefore, at least two of them coincide.
Since si “ mi , this contradicts the uniqueness of representation of positive integers in the
base-m system.
Comment 1. For other rapidly increasing sequences of sums of Bi’s the similar argument also
provides lower estimates on k “ |A|. For example, if the sums of Bi are equal to 1!, 2!, 3!, . . ., m!,
then for any fixed
ř
ε ą 0 and large enough m we get k ě p1{2 ´ εqm. The proof uses the fact that the
combinations ci i! with ci P t0, 1, . . . , iu are all distinct.
Comment 2. The problem statement holds also if A is a set of real numbers (not necessarily integers),
the above proofs work in the real case.
22 Saint-Petersburg — Russia, 16th–24th July 2021

A7. Let n ě 1 be an integer, and let x0 , x1 , . . . , xn`1 be n ` 2 non-negative real numbers


that satisfy xi xi`1 ´ x2i´1 ě 1 for all i “ 1, 2, . . . , n. Show that
ˆ ˙3{2
x0 ` x1 ` ¨ ¨ ¨ ` xn ` xn`1 ą 2n
.
3

Solution 1.
Lemma 1.1. If a, b, c are non-negative numbers such that ab ´ c2 ě 1, then
pa ` 2bq2 ě pb ` 2cq2 ` 6.
Proof. pa ` 2bq2 ´ pb ` 2cq2 “ pa ´ bq2 ` 2pb ´ cq2 ` 6pab ´ c2q ě 6. l
? ?
Lemma 1.2. 1 ` ¨ ¨ ¨ ` n ą 3 n . 2 3{2

Proof. Bernoulli’s inequality p1`tq3{2 ą 1` 32 t for 0 ą t ě ´1 (or, alternatively, a straightforward


check) gives ˆ ˙3{2 ˆ ˙
?
pk ´ 1q {
3 2
“k { 3 2

1
k
ąk { 3 2

3
2k
“ k3{2 ´ 32 k. p˚q
Summing up p˚q over k “ 1, 2, . . . , n yields
3 ´? ?¯
0 ą n3{2 ´ 1 `¨¨¨` n . l
2
Now put yi :“ 2xi `xi`1 for i “ 0, 1, . . . , n. We get y0 ě? 0 and yi2 ě yi2´1 `6 for i “ 1, 2, . . . , n
by Lemma 1.1. Thus, an easy induction on i gives yi ě 6i. Using this estimate and Lemma
1.2 we get
? ´? ? ? ¯ ? ˆ ˙3{2
3px0 ` . . . ` xn`1 q ě y1 ` . . . ` yn ě 1` 2 `...` ą 6 ¨ n3{2 “3
2 2n
6 n .
3 3

b
Solution 2. Say that an index i P t0, 1, . . . , n ` 1u is good, if xi ě 2
3
, otherwise call the
i
index i bad.
Lemma 2.1. There are no two consecutive bad indices.
Proof. Assume the contrary and consider two bad indices j , j ` 1 with minimal possible j . Since
0 is good, we get j ą 0, thus by minimality j ´ 1 is a good index and we have
2a
3
ě x2j´1 ` 1 ě 23 pj ´ 1q ` 1 “ 23 ¨ j ` p2j ` 1q
j pj ` 1q ą xj xj `1

that contradicts the AM–GM inequality for numbers j and j ` 1. l


Lemma 2.2. If an index j ď n ´ 1 is good, then
c ´ ¯
2 a a
xj `1 ` xj `2 ě j`1` j`2 .
3
Proof. We have
c c c
ě 2?x
b
xj `1 ` xj `2 ě2 x2j ` 1 ě 2 j`1ě j` ` j` ,
2 2 2 2 4
` `
j 1 xj 2
3 3 3 3 3
the last inequality follows from concavitybof the squarebroot function, or, alternatively, from
the AM–QM inequality for the numbers 23 j ` 23 and 23 j ` 43 . l
Shortlisted problems – solutions 23
b ? ?
Let Si “ x1 ` . . . ` xi and Ti “ 23 p 1 ` . . . ` iq.
Lemma 2.3. If an index i is good, then Si ě Ti .
Proof. Induction on i. The base case i “ 0 is clear. Assume that the claim holds for good
indices less than i and prove it for a good index i ą 0. b
If i ´ 1 is good, then by the inductive hypothesis we get Si “ Si´1 ` xi ě Ti´1 ` 23 i “ Ti.
If i ´ 1 is bad, then i ą 1, and i ´ 2 is good by Lemma 2.1. Then using Lemma 2.2 and the
inductive hypothesis we get
c ´
? ?¯
Si “ Si´2 ` xi´1 ` xi ě Ti´2 ` 2
3
i´1` i “ Ti. l
Since either n or n ` 1 is good by Lemma 2.1, Lemma 2.3 yields in both cases Sn`1 ě Tn ,
and it remains to apply Lemma 1.2 from Solution 1.
Comment 1. Another way to get p˚q is the integral bound
3? 3?
żk
3{2 3{2
k ´ pk ´ 1q “ x dx ă k.
k 1´ 2 2

a ?
Comment 2. If xi “ 2{3 ¨ p i ` 1q, the conditions of the problem hold. Indeed, the inequality to
check is ? ? ?
p i ` 1qp i ` 1 ` 1q ´ p i ´ 1 ` 1q2 ě 3{2,
that rewrites as
? ? ? a 1{4
i` i ` 1 ´ 2 i ´ 1 ě pi ` 1{2q ´ ipi ` 1q “ a ,
i ` 1{2 ` ipi ` 1q

which follows from ? ?


i´ i´1“ ? ?
1
ą 2i1 .
i` i´1
` 2n ˘3{2
For these numbers we have x0 ` . . . ` xn`1 “ 3 ` Opnq, thus the multiplicative constant p2{3q3{2
in the problem statement is sharp.
24 Saint-Petersburg — Russia, 16th–24th July 2021

A8. Determine all functions f : R Ñ R that satisfy


` ˘` ˘` ˘
f paq ´ f pbq f pbq ´ f pcq f pcq ´ f paq “ f pab2 ` bc2 ` ca2 q ´ f pa2b ` b2 c ` c2aq
for all real numbers a, b, c.
Answer: f pxq “ αx ` β or f pxq “ αx3 ` β where α P t´1, 0, 1u and β P R.
Solution. It is straightforward to check that above functions satisfy the equation. Now let f pxq
satisfy the equation, which we denote E pa, b, cq. Then clearly f pxq ` C also does; therefore, we
may suppose without loss of generality that f p0q “ 0.We start with proving
Lemma. Either f pxq ” 0 or f is injective.
Proof. Denote by Θ Ď R2 the set of points pa, bq for which f paq “ f pbq. Let Θ˚ “ tpx, y q P Θ :
x ‰ y u. The idea is that if pa, bq P Θ, then by E pa, b, xq we get

Ha,b pxq :“ pab2 ` bx2 ` xa2 , a2 b ` b2 x ` x2 aq P Θ

for all real x. Reproducing this argument starting with pa, bq P Θ˚, we get more and more
points in Θ. There are many ways to fill in the details, we give below only one of them.
Assume that pa, bq P Θ˚ . Note that
g´ pxq :“ pab2 ` bx2 ` xa2 q ´ pa2 b ` b2 x ` x2 aq “ pa ´ bqpb ´ xqpx ´ aq

and
g` pxq :“ pab2 ` bx2 ` xa2 q ` pa2 b ` b2 x ` x2 aq “ px2 ` abqpa ` bq ` xpa2 ` b2 q.

Hence, there exists x for which both g´pxq ‰ 0 and g`pxq ‰ 0. This gives a point pα, β q “
Ha,b pxq P Θ˚ for which α ‰ ´β . Now compare E pα, 1, 0q and E pβ, 1, 0q. The left-hand side
expressions coincide, on right-hand side we get f pαq ´ f pα2q “ f pβ q ´ f pβ 2q, respectively.
Hence, f pα2q “ f pβ 2q and we get a point pα1, β1q :“ pα2, β 2q P Θ˚ with both coordinates
α1 , β1 non-negative. Continuing squaring the coordinates, we get a point pγ, δ q P Θ˚ for which
δ ą 5γ ě 0. Our nearest goal is to get a point p0, r q P Θ˚ . If γ “ 0, this is already done. If
γ ą 0, denote by x a real root of the quadratic equation δγ 2 ` γx2 ` xδ 2 “ 0, which exists since
the discriminant δ4 ´ 4δγ 3 is positive. Also x ă 0 since this equation cannot have non-negative
root. For the point Hδ,γ pxq “: p0, rq P Θ the first coordinate is 0. The difference of coordinates
equals ´r “ pδ ´ γ qpγ ´ xqpx ´ δq ă 0, so r ‰ 0 as desired.
Now, let p0, rq P Θ˚. We get H0,r pxq “ prx2, r2xq P Θ. Thus f prx2q “ f pr2xq for all x P R.
Replacing x to ´x we get f prx2q “ f pr2xq “ f p´r2xq, so f is even: pa, ´aq P Θ for ? all a. Then
1` 5
Ha,´a pxq?“ pa ´ ax ` xa , ´a ` a x ` x aq P Θ for all real a, x. Putting x “ 2 a we obtain
3 2 2 3 2 2

p0, p1 ` 5qa3q P Θ which means that f pyq “ f p0q “ 0 for every real y. l
Hereafter we assume that f is injective and f p0q “ 0. By E pa, b, 0q we get
f paqf pbqpf paq ´ f pbqq “ f pa2 bq ´ f pab2 q. p♥q
Let κ :“ f p1q and note that κ “ f p1q ‰ f p0q “ 0 by injectivity. Putting b “ 1 in p♥q we get
κf paqpf paq ´ κq “ f pa2 q ´ f paq. p♣q
Subtracting the same equality for ´a we get
κpf paq ´ f p´aqqpf paq ` f p´aq ´ κq “ f p´aq ´ f paq.
Shortlisted problems – solutions 25

Now, if a ‰ 0, by injectivity we get f paq ´ f p´aq ‰ 0 and thus


f paq ` f p´aq “ κ ´ κ´1 “: λ. p♠q
It follows that
f paq ´ f pbq “ f p´bq ´ f p´aq
for all non-zero a, b. Replace non-zero numbers a, b in p♥q with ´a, ´b, respectively, and add
the two equalities. Due to p♠q we get
pf paq ´ f pbqqpf paqf pbq ´ f p´aqf p´bqq “ 0,
thus f paqf pbq “ f p´aqf p´bq “ pλ ´ f paqqpλ ´ f pbqq for all non-zero a ‰ b. If λ ‰ 0, this implies
f paq ` f pbq “ λ that contradicts injectivity when we vary b with fixed a. Therefore, λ “ 0 and
κ “ ˘1. Thus f is odd. Replacing f with ´f if necessary (this preserves the original equation)
we may suppose that f p1q “ 1.
Now, p♣q yields f pa2 q “ f 2paq. Summing relations p♥q for ? pairs pa, bq and pa, ´bq, we get
´2f paqf pbq “ ´2f pab q, i.e. f paqf pb q “ f pab q. Putting b “ x for each non-negative x we
2 2 2 2

get f paxq “ f paqf pxq for all real a and non-negative x. Since f is odd, this multiplicativity
relation is true for all a, x. Also, from f pa2 q “ f 2paq we see that f pxq ě 0 for x ě 0. Next,
f pxq ą 0 for x ą 0 by injectivity.
Assume that f pxq for x ą 0 does not have the form f pxq “ xτ for a constant τ . The known
property of multiplicative functions yields that the graph of f is dense on p0, 8q2. In particular,
we may find positive b ă 1{10 for which f pbq ą 1. Also, such b can be found if f pxq “ xτ for
some τ ă 0. Then for all x we have x2 ` xb2 ` b ě 0 and so E p1, b, xq implies that
f pb2 ` bx2 ` xq “ f px2 ` xb2 ` bq ` pf pbq ´ 1qpf pxq ´ f pbqqpf pxq ´ 1q ě 0 ´ ppf pbq ´ 1q3 {4

is bounded from below (the quadratic trinomial bound pt ´ f p1qqpt ´ f pbqq ě ´pf pbq ´ 1q2{4
for t “ f pxq is used). Hence, f is bounded from below on pb2 ´ 4b1 , `8q, and since f is odd it
is bounded from above on p0, 4b1 ´ b2 q. This is absurd if f pxq “ xτ for τ ă 0, and contradicts
to the above dense graph condition otherwise.
Therefore, f pxq “ xτ for x ą 0 and some constant τ ą 0. Dividing E pa, b, cq by pa ´ bqpb ´
cqpc ´ aq “ pab2 ` bc2 ` ca2 q ´ pa2 b ` b2 c ` c2 aq and taking a limit when a, b, c all go to 1
(the divided ratios tend to the corresponding derivatives, say, aa´´bb Ñ pxτ q1x“1 “ τ ), we get
τ τ

τ 3 “ τ ¨ 3τ ´1 , τ 2 “ 3τ ´1 , F pτ q :“ 3τ {2´1{2 ´ τ “ 0. Since function F is strictly convex, it has at


most two roots, and we get τ P t1, 3u.
26 Saint-Petersburg — Russia, 16th–24th July 2021

Combinatorics
C1. Let S be an infinite set of positive integers, such that there exist four pairwise distinct
a, b, c, d P S with gcdpa, bq ‰ gcdpc, dq. Prove that there exist three pairwise distinct x, y, z P S
such that gcdpx, y q “ gcdpy, zq ‰ gcdpz, xq.
Solution. There exists α P S so that tgcdpα, sq | s P S, s ‰ αu contains at least two ele-
ments. Since α has only finitely many divisors, there is a d | α such that the set B “ tβ P
S | gcdpα, β q “ du is infinite. Pick γ P S so that gcdpα, γ q ‰ d. Pick β1 , β2 P B so that
gcdpβ1 , γ q “ gcdpβ2 , γ q “: d1 . If d “ d1 , then gcdpα, β1 q “ gcdpγ, β1 q ‰ gcdpα, γ q. If d ‰ d1 ,
then either gcdpα, β1q “ gcdpα, β2q “ d and gcdpβ1, β2 q ‰ d or gcdpγ, β1q “ gcdpγ, β2q “ d1 and
gcdpβ1 , β2 q ‰ d1 .

Comment. The situation can be modelled as a complete graph on the infinite vertex set S , where
every edge ts, tu is colored by cps, tq :“ gcdps, tq. For every vertex the incident edges carry only finitely
many different colors, and by the problem statement at least two different colors show up on the edge
set. The goal is to show that there exists a bi-colored triangle (a triangle, whose edges carry exactly
two different colors).
For the proof, consider a vertex v whose incident edges carry at least two different colors. Let
X Ă S be an infinite subset so that cpv, xq ” c1 for all x P X . Let y P S be a vertex so that
cpv, y q ‰ c1 . Let x1 , x2 P X be two vertices with cpy, x1 q “ cpy, x2 q “ c2 . If c1 “ c2 , then the triangle
v, y, x1 is bi-colored. If c1 ‰ c2 , then one of v, x1 , x2 and y, x1 , x2 is bi-colored.
Shortlisted problems – solutions 27

C2. Let n ě 3 be an integer. An integer m ě n ` 1 is called n-colourful if, given infinitely


many marbles in each of n colours C1, C2, . . . , Cn , it is possible to place m of them around a
circle so that in any group of n ` 1 consecutive marbles there is at least one marble of colour
Ci for each i “ 1, . . . , n.
Prove that there are only finitely many positive integers which are not n-colourful. Find
the largest among them.
Answer: mmax “ n2 ´ n ´ 1.
Solution. First suppose that there are npn ´ 1q ´ 1 marbles. Then for one of the colours, say
blue, there are at most n ´ 2 marbles, which partition the non-blue marbles into at most n ´ 2
groups with at least pn ´ 1q2 ą npn ´ 2q marbles in total. Thus one of these groups contains at
least n ` 1 marbles and this group does not contain any blue marble.
Now suppose that the total number of marbles is at least npn ´ 1q. Then we may write this
total number as nk ` j with some k ě n ´ 1 and with 0 ď j ď n ´ 1. We place around a circle
k ´ j copies of the colour sequence r1, 2, 3, . . . , ns followed by j copies of the colour sequence
r1, 1, 2, 3, . . . , ns.
28 Saint-Petersburg — Russia, 16th–24th July 2021

C3. A thimblerigger has 2021 thimbles numbered from 1 through 2021. The thimbles are
arranged in a circle in arbitrary order. The thimblerigger performs a sequence of 2021 moves;
in the kth move, he swaps the positions of the two thimbles adjacent to thimble k.
Prove that there exists a value of k such that, in the kth move, the thimblerigger swaps
some thimbles a and b such that a ă k ă b.
Solution. Assume the contrary. Say that the kth thimble is the central thimble of the kth move,
and its position on that move is the central position of the move.
Step 1: Black and white colouring.
Before the moves start, let us paint all thimbles in white. Then, after each move, we repaint
its central thimble in black. This way, at the end of the process all thimbles have become black.
By our assumption, in every move k, the two swapped thimbles have the same colour (as
their numbers are either both larger or both smaller than k). At every moment, assign the
colours of the thimbles to their current positions; then the only position which changes its
colour in a move is its central position. In particular, each position is central for exactly one
move (when it is being repainted to black).
Step 2: Red and green colouring.
Now we introduce a colouring of the positions. If in the kth move, the numbers of the two
swapped thimbles are both less than k, then we paint the central position of the move in red;
otherwise we paint that position in green. This way, each position has been painted in red or
green exactly once. We claim that among any two adjacent positions, one becomes green and
the other one becomes red; this will provide the desired contradiction since 2021 is odd.
Consider two adjacent positions A and B , which are central in the ath and in the bth moves,
respectively, with a ă b. Then in the ath move the thimble at position B is white, and therefore
has a number greater than a. After the ath move, position A is green and the thimble at
position A is black. By the arguments from Step 1, position A contains only black thimbles
after the ath step. Therefore, on the bth move, position A contains a black thimble whose
number is therefore less than b, while thimble b is at position B . So position B becomes red,
and hence A and B have different colours.
Comment 1. Essentially, Step 1 provides the proof of the following two assertions (under the indirect
assumption):
(1) Each position P becomes central in exactly one move (denote that move’s number by k); and
(2) Before the kth move, position P always contains a thimble whose number is larger than the number
of the current move, while after the kth move the position always contains a thimble whose number is
smaller than the number of the current move.
Both (1) and (2) can be proved without introduction of colours, yet the colours help to visualise
the argument.
After these two assertions have been proved, Step 2 can be performed in various ways, e.g., as
follows.
At any moment in the process, the black positions are split into several groups consisting of one or
more contiguous black positions each; different groups are separated by white positions. Now one can
prove by induction on k that, after the kth move, all groups have odd sizes. Indeed, in every move, the
new black position either forms a separate group, or merges two groups (say, of lengths a and b) into
a single group of length a ` b ` 1.
However, after the 2020th move the black positions should form one group of length 2020. This is
a contradiction.
This argument has several variations; e.g., one can check in a similar way that, after the process
starts, at least one among the groups of white positions has an even size.
Shortlisted problems – solutions 29

Comment 2. The solution above works equally well for any odd number of thimbles greater than 1,
instead of 2021. On the other hand, a similar statement with an even number n “ 2k ě 4 of thimbles is
wrong. To show that, the thimblerigger can enumerate positions from 1 through n clockwise, and then
put thimbles 1, 2, . . . , k at the odd positions, and thimbles k ` 1, k ` 2, . . . , 2k at the even positions.
30 Saint-Petersburg — Russia, 16th–24th July 2021

C4. The kingdom of Anisotropy consists of n cities. For every two cities there exists exactly
one direct one-way road between them. We say that a path from X to Y is a sequence of roads
such that one can move from X to Y along this sequence without returning to an already
visited city. A collection of paths is called diverse if no road belongs to two or more paths in
the collection.
Let A and B be two distinct cities in Anisotropy. Let NAB denote the maximal number of
paths in a diverse collection of paths from A to B . Similarly, let NBA denote the maximal num-
ber of paths in a diverse collection of paths from B to A. Prove that the equality NAB “ NBA
holds if and only if the number of roads going out from A is the same as the number of roads
going out from B .
Solution 1. We write X Ñ Y (or Y Ð X ) if the road between X and Y goes from X
to Y . Notice that, if there is any route moving from X to Y (possibly passing through some
cities more than once), then there is a path from X to Y consisting of some roads in the route.
Indeed, any cycle in the route may be removed harmlessly; after some removals one obtains a
path.
Say that a path is short if it consists of one or two roads.
Partition all cities different from A and B into four groups, I , O, A, and B according to
the following rules: for each city C ,
CPI ðñ AÑC Ð B; CPO ðñ AÐC Ñ B;
CPA ðñ AÑC Ñ B; CPB ðñ AÐC Ð B.
Lemma. Let P be a diverse collection consisting of p paths from A to B . Then there exists
a diverse collection consisting of at least p paths from A to B and containing all short paths
from A to B .
Proof. In order to obtain the desired collection, modify P as follows.
If there is a direct road A Ñ B and the path consisting of this single road is not in P ,
merely add it to P .
Now consider any city C P A such that the path A Ñ C Ñ B is not in P . If P contains at
most one path containing a road A Ñ C or C Ñ B , remove that path (if it exists), and add the
path A Ñ C Ñ B to P instead. Otherwise, P contains two paths of the forms A Ñ C 99K B
and A 99K C Ñ B , where C 99K B and A 99K C are some paths. In this case, we recombine
the edges to form two new paths A Ñ C Ñ B and A 99K C 99K B (removing cycles from the
latter if needed). Now we replace the old two paths in P with the two new ones.
After any operation described above, the number of paths in the collection does not decrease,
and the collection remains diverse. Applying such operation to each C P A, we obtain the
desired collection. l
Back to the problem, assume, without loss of generality, that there is a road A Ñ B , and
let a and b denote the numbers of roads going out from A and B , respectively. Choose a diverse
collection P consisting of NAB paths from A to B . We will transform it into a diverse collection
Q consisting of at least NAB ` pb ´ aq paths from B to A. This construction yields

ě NAB ` pb ´ aq; similarly, we get NAB ě NBA ` pa ´ bq,


NBA

whence NBA ´ NAB “ b ´ a. This yields the desired equivalence.


Apply the lemma to get a diverse collection P 1 of at least NAB paths containing all |A| ` 1
short paths from A to B . Notice that the paths in P 1 contain no edge of a short path from B
to A. Each non-short path in P 1 has the form A Ñ C 99K D Ñ B , where C 99K D is
a path from some city C P I to some city D P O. For each such path, put into Q the
Shortlisted problems – solutions 31

path B Ñ C 99K D Ñ A; also put into Q all short paths from B to A. Clearly, the collection Q
is diverse.
Now, all roads going out from A end in the cities from I Y A Y tB u, while all roads going
out from B end in the cities from I Y B. Therefore,
a “ |I | ` |A| ` 1, b “ |I | ` |B|, and hence a ´ b “ |A| ´ |B| ` 1.

On the other hand, since there are |A| ` 1 short paths from A to B (including A Ñ B ) and |B|
short paths from B to A, we infer
|Q| “ |P 1| ´ p|A| ` 1q ` |B| ě NAB ` pb ´ aq,
as desired.
Solution 2. We recall some graph-theoretical notions. Let G be a finite graph, and let V be
the set of its vertices; fix two distinct vertices s, t P V . An ps, tq-cut is a partition of V into
two parts V “ S \ T such that s P S and t P T . The cut-edges in the cut pS, T q are the edges
going from S to T , and the size epS, T q of the cut is the number of cut-edges.
We will make use of the following theorem (which is a partial case of the Ford–Fulkerson
“min-cut max-flow” theorem).
Theorem (Menger). Let G be a directed graph, and let s and t be its distinct vertices. Then the
maximal number of edge-disjoint paths from s to t is equal to the minimal size of an ps, tq-cut.
Back to the problem. Consider a directed graph G whose vertices are the cities, and edges
correspond to the roads. Then NAB is the maximal number of edge-disjoint paths from A to B
in this graph; the number NBA is interpreted similarly.
As in the previous solution, denote by a and b the out-degrees of vertices A and B , respec-
tively. To solve the problem, we show that for any pA, B q-cut pSA , TA q in our graph there exists
a pB, Aq-cut pSB , TB q satisfying
epSB , TB q “ epSA , TA q ` pb ´ aq.

This yields
ď NAB ` pb ´ aq;
NBA similarly, we get NAB ď NBA ` pa ´ bq,
whence again NBA ´ NAB “ b ´ a.
The construction is simple: we put SB “ SA Y tB u z tAu and hence TB “ TA Y tAu z tB u.
To show that it works, let A and B denote the sets of cut-edges in pSA , TA q and pSB , TB q,
respectively. Let as and at “ a ´ as denote the numbers of edges going from A to SA and TA ,
respectively. Similarly, denote by bs and bt “ b ´ bs the numbers of edges going from B to SB
and TB , respectively.
Notice that any edge incident to none of A and B either belongs to both A and B, or belongs
to none of them. Denote the number of such edges belonging to A by c. The edges in A which
are not yet accounted for split into two categories: those going out from A to TA (including
A Ñ B if it exists), and those going from SA ztAu to B — in other words, going from SB to B .
The numbers of edges in the two categories are at and |SB | ´ 1 ´ bs , respectively. Therefore,
|A| “ c ` at ` p|SB | ´ bs ´ 1q. Similarly, we get |B| “ c ` bt ` p|SA| ´ as ´ 1q,
and hence
|B| ´ |A| “ pbt ` bsq ´ pat ` asq “ b ´ a,
since |SA| “ |SB |. This finishes the solution.
32 Saint-Petersburg — Russia, 16th–24th July 2021

C5. Let n and k be two integers with n ą k ě 1. There are 2n ` 1 students standing in
a circle. Each student S has 2k neighbours — namely, the k students closest to S on the right,
and the k students closest to S on the left.
Suppose that n ` 1 of the students are girls, and the other n are boys. Prove that there is
a girl with at least k girls among her neighbours.

Solution. We replace the girls by 1’s, and the boys by 0’s, getting the numbers a1 , a2, . . . , a2n`1
arranged in a circle. We extend this sequence periodically by letting a2n`1`k “ ak for all k P Z.
We get an infinite periodic sequence
. . . , a1 , a2 , . . . , a2n`1 , a1 , a2 , . . . , a2n`1 , . . . .

Consider the numbers bi “ ai ` ai´k´1 ´ 1 P t´1, 0, 1u for all i P Z. We know that


bm`1 ` bm`2 ` ¨ ¨ ¨ ` bm`2n`1 “1 pm P Zq; p1 q
in particular, this yields that there exists some i0 with bi “ 1. Now we want to find an index
0
i such that
bi “ 1 and bi`1 ` bi`2 ` ¨ ¨ ¨ ` bi`k ě 0. p2q
This will imply that ai “ 1 and
pai´k ` ai´k`1 ` ¨ ¨ ¨ ` ai´1 q ` pai`1 ` ai`2 ` ¨ ¨ ¨ ` ai`k q ě k,
as desired.
Suppose, to the contrary, that for every index i with bi “ 1 the sum bi`1 ` bi`2 ` ¨ ¨ ¨ ` bi`k
is negative. We start from some index i0 with bi “ 1 and construct a sequence i0 , i1, i2 , . . . ,
where ij (j ą 0) is the smallest possible index such that ij ą ij ´1 ` k and bi “ 1. We can
0

choose two numbers among i0, i1 , . . . , i2n`1 which are congruent modulo 2n ` 1 (without loss
j

of generality, we may assume that these numbers are i0 and iT ).


On the one hand, for every j with 0 ď j ď T ´ 1 we have
Sj :“ bij ` bi `1 ` bi `2 ` ¨ ¨ ¨ ` bi ` ´1 ď bi ` bi `1 ` bi `2 ` ¨ ¨ ¨ ` bi `k ď 0
j j j 1 j j j j

since bi `k`1, . . . , bi ` ´1 ď 0. On the other hand, since piT ´ i0q | p2n ` 1q, from p1q we deduce
j j 1

´
T ´ i0
ÿ1
iT
S0 ` ¨ ¨ ¨ ` ST ´1 “ “ i2n

i i0
bi
` 1 ą 0.
This contradiction finishes the solution.
Comment 1. After the problem is reduced to finding an index i satisfying p2q, one can finish the
solution by applying the (existence part of) following statement.
Lemma (Raney). If hx1 , x2 , . . . , xm i is any sequence of integers whose sum is `1, exactly one of
the cyclic shifts hx1 , x2 , . . . , xm i , hx2 , . . . , xm , x1 i , . . . , hxm , x1, . . . , xm´1 i has all of its partial sums
positive.
A (possibly wider known) version of this lemma, which also can be used in order to solve the
problem, is the following
Claim (Gas stations problem). Assume that there are several fuel stations located on a circular route
which together contain just enough gas to make one trip around. Then one can make it all the way
around, starting at the right station with an empty tank.
Shortlisted problems – solutions 33

Both Raney’s theorem and the Gas stations problem admit many different (parallel) proofs. Their
ideas can be disguised in direct solutions of the problem at hand (as it, in fact, happens in the above
solution); such solutions may avoid the introduction of the bi . Below, in Comment 2 we present a
variant of such solution, while in Comment 3 we present an alternative proof of Raney’s theorem.
Comment 2. Here is a version of the solution which avoids the use of the bi.
Suppose the contrary. Introduce the numbers ai as above. Starting from any index s0 with as “ 1,
we construct a sequence s0, s1 , s2, . . . by letting si to be the smallest index larger than si´1 ` k such that
0

as “ 1, for i “ 1, 2, . . . . Choose two indices among s1 , . . . , s2n`1 which are congruent modulo 2n ` 1;
we assume those two are s0 and sT , with sT ´ s0 “ tp2n ` 1q. Notice here that sT `1 ´ sT “ s1 ´ s0.
i

For every i “ 0, 1, 2, . . . , T , put


Li “ si`1 ´ si and Si “ as ` as `1 ` ¨ ¨ ¨ ` as ` ´1 .
i i i 1

Now, by the indirect assumption, for every i “ 1, 2, . . . , T , we have


asi ´k ` asi ´k`1 ` ¨ ¨ ¨ ` asi `k ď as ` pk ´ 1q “ k.
i

Recall that aj “ 0 for all j with si ` k ă j ă as ` . Therefore,i 1

sÿ
i k` ´´
si ÿ
k 1 sÿ`
i k

Si´1 ` Si “ aj “ aj ` aj ď psi ´ si´1 ´ kq ` k “ Li´1 .



j si´1 “
j si´1 “ ´
j si k

Summing up these equalities over i “ 1, 2, . . . , T we get


ÿ
T ÿ
T
2tpn ` 1q “ pSi´1 ` Siq ď Li´1 “ p2n ` 1qt,

i 1 “
i 1

which is a contradiction.
Comment 3. Here we present a proof of Raney’s lemma different from the one used above.
If we plot the partial sums sn “ x1 ` ¨ ¨ ¨ ` xn as a function of n, the graph of sn has an average
slope of 1{m, because sm`n “ sn ` 1.

The entire graph can be contained between two lines of slope 1{m. In general these bounding lines
touch the graph just once in each cycle of m points, since lines of slope 1{m hit points with integer
coordinates only once per m units. The unique (in one cycle) lower point of intersection is the only
place in the cycle from which all partial sums will be positive.
Comment 4. The following example shows that for different values of k the required girl may have
different positions: 0110 0110 1.
34 Saint-Petersburg — Russia, 16th–24th July 2021

C6. A hunter and an invisible rabbit play a game on an infinite square grid. First the
hunter fixes a colouring of the cells with finitely many colours. The rabbit then secretly chooses
a cell to start in. Every minute, the rabbit reports the colour of its current cell to the hunter,
and then secretly moves to an adjacent cell that it has not visited before (two cells are adjacent
if they share a side). The hunter wins if after some finite time either
• the rabbit cannot move; or

• the hunter can determine the cell in which the rabbit started.

Decide whether there exists a winning strategy for the hunter.


Answer: Yes, there exists a colouring that yields a winning strategy for the hunter.
Solution. A central idea is that several colourings C1, C2, . . . , Ck can be merged together into
a single product colouring C1 ˆ C2 ˆ ¨ ¨ ¨ ˆ Ck as follows: the colours in the product colouring
are ordered tuples pc1, . . . , cnq of colours, where ci is a colour used in Ci, so that each cell gets
a tuple consisting of its colours in the individual colourings Ci. This way, any information
which can be determined from one of the individual colourings can also be determined from
the product colouring.
Now let the hunter merge the following colourings:
• The first two colourings C1 and C2 allow the tracking of the horizontal and vertical
movements of the rabbit.
The colouring C1 colours the cells according to the residue of their x-coordinates modulo 3,
which allows to determine whether the rabbit moves left, moves right, or moves vertically.
Similarly, the colouring C2 uses the residues of the y -coordinates modulo 3, which allows
to determine whether the rabbit moves up, moves down, or moves horizontally.
• Under the condition that the rabbit’s x-coordinate is unbounded, colouring C3 allows to
determine the exact value of the x-coordinate:
In C3 , the columns are coloured white and black so that the gaps between neighboring
black columns are pairwise distinct. As the rabbit’s x-coordinate is unbounded, it will
eventually visit two black cells in distinct columns. With the help of colouring C1 the
hunter can catch that moment, and determine the difference of x-coordinates of those two
black cells, hence deducing the precise column.
Symmetrically, under the condition that the rabbit’s y -coordinate is unbounded, there is
a colouring C4 that allows the hunter to determine the exact value of the y -coordinate.
• Finally, under the condition that the sum x ` y of the rabbit’s coordinates is unbounded,
colouring C5 allows to determine the exact value of this sum: The diagonal lines x ` y “
const are coloured black and white, so that the gaps between neighboring black diagonals
are pairwise distinct.
Unless the rabbit gets stuck, at least two of the three values x, y and x`y must be unbounded as
the rabbit keeps moving. Hence the hunter can eventually determine two of these three values;
thus he does know all three. Finally the hunter works backwards with help of the colourings
C1 and C2 and computes the starting cell of the rabbit.

Comment. There are some variations of the solution above: e.g., the colourings C3, C4 and C5 can
be replaced with different ones. However, such alternatives are more technically involved, and we do
not present them here.
Shortlisted problems – solutions 35

C7. Consider a checkered 3m ˆ 3m square, where m is an integer greater than 1. A frog


sits on the lower left corner cell S and wants to get to the upper right corner cell F . The frog
can hop from any cell to either the next cell to the right or the next cell upwards.
Some cells can be sticky, and the frog gets trapped once it hops on such a cell. A set X of
cells is called blocking if the frog cannot reach F from S when all the cells of X are sticky. A
blocking set is minimal if it does not contain a smaller blocking set.
(a) Prove that there exists a minimal blocking set containing at least 3m2 ´ 3m cells.
(b) Prove that every minimal blocking set contains at most 3m2 cells.
Note. An example of a minimal blocking set for m “ 2 is shown below. Cells of the set X are marked
by letters x.
F
x x
x
x
x
S x

Solution for part (a). In the following example the square is divided into m stripes of size
3 ˆ 3m. It is easy to see that X is a minimal blocking set. The first and the last stripe each
contains 3m ´ 1 cells from the set X ; every other stripe contains 3m ´ 2 cells, see Figure 1.
The total number of cells in the set X is 3m2 ´ 2m ` 2.
x F
x x x x x
x x x x x
x x x x x

x x x x x
x x x x x
x x x x x
S x
Figure 1

Solution 1 for part (b). For a given blocking set X , say that a non-sticky cell is red if the
frog can reach it from S via some hops without entering set X . We call a non-sticky cell blue
if the frog can reach F from that cell via hops without entering set X . One can regard the
blue cells as those reachable from F by anti-hops, i.e. moves downwards and to the left. We
also colour all cells in X green. It follows from the definition of the blocking set that no cell
will be coloured twice. In Figure 2 we show a sample of a blocking set and the corresponding
colouring.
Now assume that X is a minimal blocking set. We denote by R (resp., B and G) be the
total number of red (resp., blue and green) cells.
We claim that G ď R ` 1 and G ď B ` 1. Indeed, there are at most 2R possible frog
hops from red cells. Every green or red cell (except for S ) is accessible by such hops. Hence
2R ě G ` pR ´ 1q, or equivalently G ď R ` 1. In order to prove the inequality G ď B ` 1, we
turn over the board and apply the similar arguments.
Therefore we get 9m2 ě B ` R ` G ě 3G ´ 2, so G ď 3m2.
36 Saint-Petersburg — Russia, 16th–24th July 2021

x F F
x x x
x x x
x x x
x x x
x x x
x x x
x x x
S x S
Figure 2 (a) Figure 2 (b)
Solution 2 for part (b). We shall use the same colouring as in the above solution. Again,
assume that X is a minimal blocking set.
Note that any 2 ˆ 2 square cannot contain more than 2 green cells. Indeed, on Figure 3(a)
the cell marked with “?” does not block any path, while on Figure 3(b) the cell marked with
“?” should be coloured red and blue simultaneously. So we can split all green cells into chains
consisting of three types of links shown on Figure 4 (diagonal link in the other direction is not
allowed, corresponding green cells must belong to different chains). For example, there are 3
chains in Figure 2(b).
?
?
(a) (b)
Figure 3 Figure 4 Figure 5
We will inscribe green chains in disjoint axis-aligned rectangles so that the number of green
cells in each rectangle will not exceed 1{3 of the area of the rectangle. This will give us the
bound G ď 3m2. Sometimes the rectangle will be the minimal bounding rectangle of the chain,
sometimes minimal bounding rectangles will be expanded in one or two directions in order to
have sufficiently large area.
Note that for any two consecutive cells in the chain the colouring of some neighbouring
cells is uniquely defined (see Figure 5). In particular, this observation gives a corresponding
rectangle for the chains of height (or width) 1 (see Figure 6(a)). A separate green cell can
be inscribed in 1 ˆ 3 or 3 ˆ 1 rectangle with one red and one blue cell, see Figure 6(b)–(c),
otherwise we get one of impossible configurations shown in Figure 3.

?
?
(a) (b) (c) (a) (b)
Figure 6 Figure 7
Any diagonal chain of length 2 is always inscribed in a 2 ˆ 3 or 3 ˆ 2 rectangle without
another green cells. Indeed, one of the squares marked with “?” in Figure 7(a) must be red. If
it is the bottom question mark, then the remaining cell in the corresponding 2 ˆ 3 rectangle
must have the same colour, see Figure 7(b).
A longer chain of height (or width) 2 always has a horizontal (resp., vertical) link and can be
inscribed into a 3 ˆ a rectangle. In this case we expand the minimal bounding rectangle across
the long side which touches the mentioned link. On Figure 8(a) the corresponding expansion
of the minimal bounding rectangle is coloured in light blue. The upper right corner cell must
be also blue. Indeed it cannot be red or green. If it is not coloured in blue, see Figure 8(b),
then all anti-hop paths from F to “?” are blocked with green cells. And these green cells are
surrounded by blue ones, what is impossible. In this case the green chain contains a cells, which
is exactly 1{3 of the area of the rectangle.
Shortlisted problems – solutions 37

Figure 8 (a) Figure 8 (b)


In the remaining case the minimal bounding rectangle of the chain is of size a ˆ b where
a, b ě 3. Denote by ℓ the length of the chain (i.e. the number of cells in the chain).
If the chain has at least two diagonal links (see Figure 9), then ℓ ď a ` b ´ 3 ď ab{3.
If the chain has only one diagonal link then ℓ “ a ` b ´ 2. In this case the chain has horizontal
and vertical end-links, and we expand the minimal bounding rectangle in two directions to get
an pa ` 1qˆpb ` 1q rectangle. On Figure 10 a corresponding expansion of the minimal bounding
rectangle is coloured in light red. Again the length of the chain does not exceed 1{3 of the
rectangle’s area: ℓ ď a ` b ´ 2 ď pa ` 1qpb ` 1q{3.
On the next step we will use the following statement: all cells in constructed rectangles are
coloured red, green or blue (the cells upwards and to the right of green cells are blue; the cells
downwards and to the left of green cells are red). The proof repeats the same arguments as
before (see Figure 8(b).)

(a) (b)
Figure 9 Figure 10 Figure 11
Note that all constructed rectangles are disjoint. Indeed, assume that two rectangles have a
common cell. Using the above statement, one can see that the only such cell can be a common
corner cell, as shown in Figure 11. Moreover, in this case both rectangles should be expanded,
otherwise they would share a green corner cell.
If they were expanded along the same axis (see Figure 11(a)), then again the common corner
cannot be coloured correctly. If they were expanded along different axes (see Figure 11(b)) then
the two chains have a common point and must be connected in one chain. (These arguments
work for 2 ˆ 3 and 1 ˆ 3 rectangles in a similar manner.)
Comment 1. We do not a priori know whether all points are either red, or blue, or green. One might
colour the remaining cells in black. The arguments from Solution 2 allow to prove that black cells do
not exist. (One can start with a black cell which is nearest to S . Its left and downward neighbours
must be coloured green or blue. In all cases one gets a configuration similar to Figure 8(b).)
Comment 2. The maximal possible size of a minimal blocking set in 3m ˆ 3m rectangle seems to
be 3m2 ´ 2m ` 2.
One can prove a more precise upper bound on the cardinality of the minimal blocking set: G ď
3m2 ´ m ` 2. Denote by DR the number of red branching cells (i.e. such cells which have 2 red
subsequent neighbours). And let DB be the number of similar blue cells. Then a double counting
argument allows to prove that G ď R ´ DR ` 1 and G ď B ´ DB ` 1. Thus, we can bound G in terms
of DB and DR as
9m2 ě R ` B ` G ě 3G ` DR ` DB ´ 2.
Now one can estimate the number of branching cells in order to obtain that G ď 3m2 ´ m ` 2.
38 Saint-Petersburg — Russia, 16th–24th July 2021

Comment 3. An example with 3m2 ´ 2m ` 2 green cells may look differently; see, e.g., Figure 12.

Figure 12
Shortlisted problems – solutions 39

C8. Determine the largest N for which there exists a table T of integers with N rows and
100 columns that has the following properties:
(i) Every row contains the numbers 1, 2, . . . , 100 in some order.
(ii) For any two distinct rows r and s, there is a column c such that |T pr, cq ´ T ps, cq| ě 2.
Here T pr, cq means the number at the intersection of the row r and the column c.
Answer: The largest such integer is N “ 100!{250 .
Solution 1.
Non-existence of a larger table. Let us consider some fixed row in the table, and let
us replace (for k “ 1, 2, . . . , 50) each of two numbers 2k ´ 1 and 2k respectively by the symbol
xk . The resulting pattern is an arrangement of 50 symbols x1 , x2 , . . . , x50, where every symbol
occurs exactly twice. Note that there are N “ 100!{250 distinct patterns P1, . . . , PN .
If two rows r ‰ s in the table have the same pattern Pi, then |T pr, cq ´ T ps, cq| ď 1 holds
for all columns c. As this violates property (ii) in the problem statement, different rows have
different patterns. Hence there are at most N “ 100!{250 rows.
Existence of a table with N rows. We construct the table by translating every pattern
Pi into a corresponding row with the numbers 1, 2, . . . , 100. We present a procedure that in-
ductively replaces the symbols by numbers. The translation goes through steps k “ 1, 2, . . . , 50
in increasing order and at step k replaces the two occurrences of symbol xk by 2k ´ 1 and 2k.
• The left occurrence of x1 is replaced by 1, and its right occurrence is replaced by 2.
• For k ě 2, we already have the number 2k ´ 2 somewhere in the row, and now we are
looking for the places for 2k ´ 1 and 2k. We make the three numbers 2k ´ 2, 2k ´ 1, 2k show
up (ordered from left to right) either in the order 2k ´ 2, 2k ´ 1, 2k, or as 2k, 2k ´ 2, 2k ´ 1,
or as 2k ´ 1, 2k, 2k ´ 2. This is possible, since the number 2k ´ 2 has been placed in
the preceding step, and shows up before / between / after the two occurrences of the
symbol xk .
We claim that the N rows that result from the N patterns yield a table with the desired
property (ii). Indeed, consider the r-th and the s-th row pr ‰ sq, which by construction result
from patterns Pr and Ps . Call a symbol xi aligned, if it occurs in the same two columns in
Pr and in Ps . Let k be the largest index, for which symbol xk is not aligned. Note that
k ě 2. Consider the column c1 with T pr, c1 q “ 2k and the column c2 with T ps, c2 q “ 2k . Then
T pr, c2 q ď 2k and T ps, c1 q ď 2k , as all symbols xi with i ě k ` 1 are aligned.
• If T pr, c2 q ď 2k ´ 2, then |T pr, c2q ´ T ps, c2 q| ě 2 as desired.
• If T ps, c1 q ď 2k ´ 2, then |T pr, c1 q ´ T ps, c1 q| ě 2 as desired.
• If T pr, c2 q “ 2k ´ 1 and T ps, c1 q “ 2k ´ 1, then the symbol xk is aligned; contradiction.
In the only remaining case we have c1 “ c2, so that T pr, c1q “ T ps, c1q “ 2k holds. Now let
us consider the columns d1 and d2 with T pr, d1q “ 2k ´ 1 and T ps, d2q “ 2k ´ 1. Then d ‰ d2
(as the symbol xk is not aligned), and T pr, d2q ď 2k ´ 2 and T ps, d1q ď 2k ´ 2 (as all symbols
xi with i ě k ` 1 are aligned).
• If T pr, d2 q ď 2k ´ 3, then |T pr, d2 q ´ T ps, d2q| ě 2 as desired.
• If T ps, c1 q ď 2k ´ 3, then |T pr, d1 q ´ T ps, d1 q| ě 2 as desired.
In the only remaining case we have T pr, d2q “ 2k ´ 2 and T ps, d1q “ 2k ´ 2. Now the row r
has the numbers 2k ´ 2, 2k ´ 1, 2k in the three columns d1 , d2, c1. As one of these triples violates
the ordering property of 2k ´ 2, 2k ´ 1, 2k, we have the final contradiction. l
40 Saint-Petersburg — Russia, 16th–24th July 2021

Comment 1. We can identify rows of the table T with permutations of M :“ t1, . . . , 100u; also for
every set S Ă M each row induces a subpermutation of S obtained by ignoring all entries not from S .
The example from Solution 1 consists of all permutations for which all subpermutations of the 50
sets t1, 2u, t2, 3, 4u, t4, 5, 6u, . . . , t98, 99, 100u are even.
Solution 2. We provide a bit different proof why the example from Solution 1 (see also
Comment 1) works.
Lemma. Let π1 and π2 be two permutations of the set t1, 2, . . . , nu such that |π1piq ´ π2 piq| ď 1
for every i. Then there exists a set of disjoint pairs pi, i ` 1q such that π2 is obtained from π1
by swapping elements in each pair from the set.
Proof. We may assume that π1 piq “ i for every i and proceed by induction on n. The case
n “ 1 is trivial. If π2 pnq “ n, we simply apply the induction hypothesis. If π2 pnq “ n ´ 1,
then π2 piq “ n for some i ă n. It is clear that i “ n ´ 1, and we can also use the induction
hypothesis. l
Now let π1 and π2 be two rows (which we identify with permutations of t1, 2, . . . , 100u)
of the table constructed in Solution 1. Assume that |π1piq ´ π2 piq| ď 1 for any i. From the
Lemma it follows that there exists a set S Ă t1, . . . , 99u such that any two numbers from
S differ by at least 2 and π2 is obtained from π1 by applying the permutations pj, j ` 1q,
j P S . Let r “ minpS q. If r “ 2k ´ 1 is odd, then π1 and π2 induce two subpermutations of
t2k ´ 2, 2k ´ 1, 2ku (or of t1, 2u for k “ 1) of opposite parities. Thus r “ 2k is even. Since
π1 and π2 induce subpermutations of the same (even) parity of t2k, 2k ` 1, 2k ` 2u, we must
have 2k ` 2 P S . Next, 2k ` 4 P S and so on, we get 98 P S , but then the parities of the
subpermutations of t98, 99, 100u in π1, π2 are opposite. A contradiction. l
Comment 2. In Solution 2 we only used that for each set from t1, 2u, t2, 3, 4u, t4, 5, 6u, . . . , t98, 99, 100u
any two rows of T induce a subpermutation of the same parity, not necessarily even.
Shortlisted problems – solutions 41

This page is intentionally left blank


42 Saint-Petersburg — Russia, 16th–24th July 2021

Geometry
G1. Let ABCD be a parallelogram such that AC “ BC . A point P is chosen on the
extension of the segment AB beyond B . The circumcircle of the triangle ACD meets the
segment P D again at Q, and the circumcircle of the triangle AP Q meets the segment P C
again at R. Prove that the lines CD, AQ, and BR are concurrent.
Common remarks. The introductory steps presented here are used in all solutions below.
Since AC “ BC “ AD, we have =ABC “ =BAC “ =ACD “ =ADC . Since the
quadrilaterals AP RQ and AQCD are cyclic, we obtain
=CRA “ 180˝ ´ =ARP “ 180˝ ´ =AQP “ =DQA “ =DCA “ =CBA,
so the points A, B , C , and R lie on some circle γ .
Solution 1. Introduce the point X “ AQ X CD; we need to prove that B , R and X are
collinear.
By means of the circle pAP RQq we have
=RQX “ 180˝ ´ =AQR “ =RP A “ =RCX
(the last equality holds in view of AB k CD), which means that the points C , Q, R, and X
also lie on some circle δ.
Using the circles δ and γ we finally obtain
=XRC “ =XQC “ 180˝ ´ =CQA “ =ADC “ =BAC “ 180˝ ´ =CRB,
that proves the desired collinearity.
D C
C
X

R
R
γ Q
Q

P
A B

Solution 2. Let α denote the circle pAP RQq. Since


=CAP “ =ACD “ =AQD “ 180˝ ´ =AQP,
the line AC is tangent to α.
Now, let AD meet α again at a point Y (which necessarily lies on the extension of DA
beyond A). Using the circle γ , along with the fact that AC is tangent to α, we have
=ARY “ =CAD “ =ACB “ =ARB,
so the points Y , B , and R are collinear.
Applying Pascal’s theorem to the hexagon AAY RP Q (where AA is regarded as the tangent
to α at A), we see that the points AA X RP “ C , AY X P Q “ D, and Y R X QA are collinear.
Hence the lines CD, AQ, and BR are concurrent.
Shortlisted problems – solutions 43

Comment 1. Solution 2 consists of two parts: (1) showing that BR and DA meet on α; and (2)
showing that this yields the desired concurrency. Solution 3 also splits into those parts, but the proofs
are different.
D C
C
X

R
R
γ Q
Q α

P
A B

Solution 3. As in Solution 1, we introduce the point X “ AQ X CD and aim at proving that


the points B , R, and X are collinear. As in Solution 2, we denote α “ pAP QRq; but now we
define Y to be the second meeting point of RB with α.
Using the circle α and noticing that CD is tangent to γ , we obtain
=RY A “ =RP A “ =RCX “ =RBC. (1)
So AY k BC , and hence Y lies on DA.
Now the chain of equalities (1) shows also that =RY D “ =RCX , which implies that the
points C , D, Y , and R lie on some circle β . Hence, the lines CD, AQ, and Y BR are the
pairwise radical axes of the circles pAQCDq, α, and β , so those lines are concurrent.
Comment 2. The original problem submission contained an additional assumption that BP “ AB .
The Problem Selection Committee removed this assumption as superfluous.
44 Saint-Petersburg — Russia, 16th–24th July 2021

G2. Let ABCD be a convex quadrilateral circumscribed around a circle with centre I .
Let ω be the circumcircle of the triangle ACI . The extensions of BA and BC beyond A and
C meet ω at X and Z , respectively. The extensions of AD and CD beyond D meet ω at Y
and T , respectively. Prove that the perimeters of the (possibly self-intersecting) quadrilaterals
ADT X and CDY Z are equal.

Solution. The point I is the intersection of the external bisector of the angle T CZ with the
circumcircle ω of the triangle T CZ , so I is the midpoint of the arc T CZ and IT “ IZ .
Similarly, I is the midpoint of the arc Y AX and IX “ IY . Let O be the centre of ω . Then X
and T are the reflections of Y and Z in IO, respectively. So XT “ Y Z .
ω
ω
X
Y

T
D Z
S
S R

A C
I
P
Q

B
Let the incircle of ABCD touch AB , BC , CD ,
and DA at points P , Q, R, and S , respec-
tively.
The right triangles IXP and IY S are congruent, since IP “ IS and IX “ IY . Similarly,
the right triangles IRT and IQZ are congruent. Therefore, XP “ Y S and RT “ QZ .
Denote the perimeters of ADT X and CDY Z by PADT X and PCDY Z respectively. Since
AS “ AP , CQ “ RC , and SD “ DR, we obtain

PADT X “ XT ` XA ` AS ` SD ` DT “ XT ` XP ` RT
“ Y Z ` Y S ` QZ “ Y Z ` Y D ` DR ` RC ` CZ “ PCDY Z ,
as required.
Comment 1. After proving that X and T are the reflections of Y and Z in IO, respectively, one can
finish the solution as follows. Since XT “ Y Z , the problem statement is equivalent to
XA ` AD ` DT “ Y D ` DC ` CZ. p1q
Since ABCD is circumscribed, AB ´ AD “ BC ´ CD. Adding this to (1), we come to an equivalent
equality XA ` AB ` DT “ Y D ` BC ` CZ , or
XB ` DT “ Y D ` BZ. p2q
Let λ “ XZ
AC “ AC . Since XACZ is cyclic, the triangles ZBX and ABC are similar, hence
TY

XB
BC
“ BZ
AB
“ XZ
AC
“ λ.
Shortlisted problems – solutions 45

It follows that XB “ λBC and BZ “ λAB . Likewise, the triangles T DY and ADC are similar, hence
DT
AD
“ DY
CD
“ TY
AC
“ λ.
Therefore, (2) rewrites as λBC ` λAD “ λCD ` λAB .
This is equivalent to BC ` AD “ CD ` AB which is true as ABCD is circumscribed.
Comment 2. Here is a more difficult modification of the original problem, found by the PSC.
Let ABCD be a convex quadrilateral circumscribed around a circle with centre I . Let ω be the
circumcircle of the triangle ACI . The extensions of BA and BC beyond A and C meet ω at X and
Z , respectively. The extensions of AD and CD beyond D meet ω at Y and T , respectively. Let
U “ BC X AD and V “ BA X CD . Let IU be the incentre of U Y Z and let JV be the V -excentre of
V XT . Then IU JV K BD .
46 Saint-Petersburg — Russia, 16th–24th July 2021

G3.
Version 1. Let n be a fixed positive integer, and let S be the set of points px, y q on the
Cartesian plane such that both coordinates x and y are nonnegative integers smaller than 2n
(thus |S| “ 4n2 ). Assume that F is a set consisting of n2 quadrilaterals such that all their
vertices lie in S, and each point in S is a vertex of exactly one of the quadrilaterals in F .
Determine the largest possible sum of areas of all n2 quadrilaterals in F .
Version 2. Let n be a fixed positive integer, and let S be the set of points px, y q on the
Cartesian plane such that both coordinates x and y are nonnegative integers smaller than 2n
(thus |S| “ 4n2). Assume that F is a set of polygons such that all vertices of polygons in F lie
in S, and each point in S is a vertex of exactly one of the polygons in F .
Determine the largest possible sum of areas of all polygons in F .
Answer for both Versions: The largest possible sum of areas is Σpnq :“ 13 n2 p2n ` 1qp2n ´ 1q.
Common remarks. Throughout all solutions, the area of a polygon P will ` be 1denoted ˘by rP s.
We say that a polygon is legal if all its vertices belong to S. Let O “ n ´ 2 , n ´ 2 be the
1

centre of S. We say that a legal square is central if its centre is situated at O. Finally, say that
a set F of polygons is acceptable if it satisfies the problem requirements, i.e. if all polygons
in F are legal, and each point in S is a vertex of exactly one polygon in F . For an acceptable
set F , we denote by ΣpF q the sum of areas of polygons in F .
Solution 1, for both Versions. Each point in S is a vertex of a unique central square. Thus
the set G of central squares is acceptable. We will show that
ΣpF q ď ΣpG q “ Σpnq, (1)
thus establishing the answer.
We will use the following key lemma.
Lemma 1. Let P “ A1A2 . . . Am be a polygon, and let O be an arbitrary point in the plane.
Then
1ÿ
m
rP s ď 2 OA2i ; (2)

i 1

moreover, if P is a square centred at O, then the inequality (2) turns into an equality.
Proof. Put An`1 “ A1 . For each i “ 1, 2, . . . , m, we have

rOAiAi`1s ď OAi ¨ 2OAi`1 ď OAi `4OAi`1 .


2 2

Therefore,
ÿ
m
1ÿ
m
1ÿ
m
rP s ď rOAiAi`1s ď 4 i“1
p OA2i ` OA2i`1 q “
2 i“1
OA2i ,

i 1

which proves (2). Finally, all the above inequalities turn into equalities when P is a square
centred at O. l
Back to the problem, consider an arbitrary acceptable set F . Applying Lemma 1 to each
element in F and to each element in G (achieving equality in the latter case), we obtain
1ÿ
ΣpF q ď OA2 “ ΣpG q,
2 APS

which establishes the left inequality in (1).


Shortlisted problems – solutions 47

It remains to compute ΣpG q. We have


˜ ˙2 ¸
2n´1 2n´1 ˆ ˙2 ˆ
1ÿ 1 ÿ ÿ
ΣpG q “ “ n´ ´i ` n´ ´j
1 1
OA2
2 APS 2 i“0 j “0 2 2
˜ ¸
ÿ ´
n 1 ´
nÿ1 ÿ
2n ÿ
n
“ 1
8
¨ 4 ¨ 2n p2n ´ 2i ´ 1q2 “ n p2j ` 1q2 “ n j2 ´ p2j q2
i“0 “
j 0 “
j 1 “
j 1
ˆ ˙
2np2n ` 1qp4n ` 1q
´ 4 ¨ npn ` 1qp6 2n ` 1q “ n p2n ` 13qp2n ´ 1q “ Σpnq.
2
“n 6

Comment. There are several variations of the above solution, also working for both versions of the
problem. E.g., one may implement only the inequality rOAi Ai`1 s ď 12 OAi ¨ OAi`1 to obtain

1ÿ
4n2
Σ pF q ď OKi ¨ OLi ,
2 i“1

where both pKi q and pLi q are permutations of all points in S. The right hand side can then be bounded
from above by means of the rearrangement inequality; the bound is also achieved on the collection G .
However, Version 2 seems to be more difficult than Version 1. First of all, the optimal model for
this version is much less easy to guess, until one finds an idea for proving the upper bound. Moreover,
Version 1 allows different solutions which do not seem to be generalized easily — such as Solution 2
below.

Solution 2, for Version 1. Let F be an accessible set of quadrilaterals. For every quadri-
lateral ABCD in F write

rABCDs “ AC 2¨ BD sin φ ď AC `4 BD ,
2 2
(3)

where φ is the angle between AC and BD. Applying this estimate to all members in F we
obtain
1ÿ
2n2
ΣpF q ď Ai Bi2 ,
4 i“1

where A1 , A2, . . . , A2n , B1 , B2, . . . , B2n is some permutation of S. For brevity, denote
2 2

ÿ
2
` ˘ 2n
f pAi q, pBi q :“ Ai Bi2 .

i 1

The rest of the solution is based on the following lemma.


` ˘
Lemma 2. The maximal value of f pAi q, pBi q over all permutations of S equals 43 n2p4n2 ´ 1q
and is achieved when Ai is symmetric to Bi with respect to O, for every i “ 1, 2, . . . , 2n2.
Proof. Let Ai “ ppi , qi q and Bi “ pri , siq, for i “ 1, 2, . . . , 2n2 . We have
ÿ ÿ
2 2
` ˘ 2n 2n
f pAi q, pBi q “ ppi ´ riq ` pqi ´ si q2;
2


i 1 “
i 1
48 Saint-Petersburg — Russia, 16th–24th July 2021

it suffices to bound the first sum, the second is bounded similarly. This can be done, e.g., by
means of the QM–AM inequality as follows:
ÿ
2n 2
ÿ
2n 2
` ˘ 2n´
ÿ1 ÿ
2n 2

pp i ´ r i q “
2
2p2i ` 2ri2 ´ ppi ` ri q “ 4n
2
j 2
´ ppi ` riq2

i 1 “
i 1 “
j 0 “
i 1
˜ ¸2 ˜
ÿ1
2n ´ ÿ
2n2 ÿ1
2n ´ ´ ¸2
ÿ1
2n
ď 4n j2 ´
1
2n2
ppi ` riq “ 4n j2 ´
1
2n2
2n ¨ j
j 0“ “
i 1 “
j 0 “
j 0

“ 4n ¨ 2np2n ´ 16qp4n ´ 1q ´ 2n2 p2n ´ 1q2 “ 2n p2n ´ 31qp2n ` 1q .


2

All the estimates are sharp if pi ` ri “ 2n ´ 1 for all i. Thus,


` ˘ 4n2 p4n2 ´ 1q
f pAi q, pBi q ď ,
3
and the estimate is sharp when pi ` ri “ qi ` si “ 2n ´ 1 for all i, i.e. when Ai and Bi are
symmetric with respect to O. l
Lemma 2 yields
1 4n2 p4n2 ´ 1q
“ n p2n ´ 13qp2n ` 1q .
2
ΣpF q ď ¨
4 3
Finally, all estimates are achieved simultaneously on the set G of central squares.
Comment 2. Lemma 2 also allows different proofs. E.g., one may optimize the sum ři piri step
by step: if pi ă pj and ri ă rj , then a swap ri Ø rj increases the sum. By applying a proper chain
of such replacements (possibly swapping elements in some pairs ppi , ri q), one eventually comes to a
permutation where pi ` ri “ 2n ´ 1 for all i.
Comment 3. Version 2 can also be considered for a square grid with odd number n of points on each
side. If we allow a polygon consisting of one point, then Solution 1 is applied verbatim, providing an
answer 121 n2pn2 ´ 1q. If such polygons are not allowed, then one needs to subtract 12 from the answer.
Shortlisted problems – solutions 49

G4. Let ABCD be a quadrilateral inscribed in a circle Ω. Let the tangent to Ω at D


intersect the rays BA and BC at points E and F , respectively. A point T is chosen inside the
triangle ABC so that T E k CD and T F k AD. Let K ‰ D be a point on the segment DF
such that T D “ T K . Prove that the lines AC , DT and BK intersect at one point.
Solution 1. Let the segments T E and T F cross AC at P and Q, respectively. Since P E k CD
and ED is tangent to the circumcircle of ABCD, we have
=EP A “ =DCA “ =EDA,
and so the points A, P , D, and E lie on some circle α. Similarly, the points C , Q, D, and F
lie on some circle γ .
We now want to prove that the line DT is tangent to both α and γ at D. Indeed, since
=F CD ` =EAD “ 180˝, the circles α and γ are tangent to each other at D. To prove that
T lies on their common tangent line at D (i.e., on their radical axis), it suffices to check that
T P ¨ T E “ T Q ¨ T F , or that the quadrilateral P EF Q is cyclic. This fact follows from
=QF E “ =ADE “ =AP E.
Since T D “ T K , we have =T KD “ =T DK . Next, as T D and DE are tangent to α and Ω,
respectively, we obtain
=T KD “ =T DK “ =EAD “ =BDE,
which implies T K k BD.
Next we prove that the five points T , P , Q, D, and K lie on some circle τ . Indeed, since
T D is tangent to the circle α we have
=EP D “ =T DF “ =T KD,
which means that the point P lies on the circle pT DK q. Similarly, we have Q P pT DK q.
Finally, we prove that P K k BC . Indeed, using the circles τ and γ we conclude that
=P KD “ =P QD “ =DF C,
which means that P K k BC .
Triangles T P K and DCB have pairwise parallel sides, which implies the fact that T D, P C
and KB are concurrent, as desired.
B
B D∗

TT

Q
Q C
C
P
P
YY γ
A
A
α
τ

E
E D
D K
K F
F
50 Saint-Petersburg — Russia, 16th–24th July 2021

Comment 1. There are several variations of the above solution.


E.g., after finding circles α and γ , one can notice that there exists a homothety h mapping the
triangle T P Q to the triangle DCA; the centre of that homothety is Y “ AC X T D. Since
=DP E “ =DAE “ =DCB “ =DQT,
the quadrilateral T P DQ is inscribed in some circle τ . We have hpτ q “ Ω, so the point D˚ “ hpDq lies
on Ω.
Finally, by
=DCD˚ “ =T P D “ =BAD,
the points B and D˚ are symmetric with respect to the diameter of Ω passing through D. This yields
DB “ DD ˚ and BD ˚ k EF , so hpK q “ B , and BK passes through Y .

Solution 2. Consider the spiral similarity φ centred at D which maps B to F . Recall that
for any two points X and Y , the triangles DXφpX q and DY φpY q are similar.
Define T 1 “ φpE q. Then
=CDF “ =F BD “ =φpB qBD “ =φpE qED “ =T 1 ED,
so CD k T 1E . Using the fact that DE is tangent to pABDq and then applying φ we infer
=ADE “ =ABD “ =T 1F D,
so AD k T 1F ; hence T 1 coincides with T . Therefore,
=BDE “ =F DT “ =DKT,
whence T K k BD.
Let BK X T D “ X , AC X T D “ Y , and AC X T F “ Q. Notice that T K k BD implies
TX
XD
“ BD
TK
“ BD
TD
.

So we wish to prove that YT YD is equal to the same ratio.


We first show that φpAq “ Q. Indeed,
=DAφpAq “ =DBF “ =DAC,
and so φpAq P AC . Together with φpAq P φpEB q “ T F this yields φpAq “ Q. It follows that
TQ
AE
“ TD
ED
.

B
B

TT

Q
Q C
C
X=
X = YY
A
A

E
E D
D K
K F
F
Shortlisted problems – solutions 51

Now, since T F k AD and △EAD „ △EDB , we have


TY
YD
“ AD
TQ
“ AE ¨ AD “ ED
T Q AE
¨ BD “ BD
T D ED TD
,

which completes the proof.


Comment 2. The point D is the Miquel point for any 4 of the 5 lines BA, BC , T E , T F and AC .
Essentially, this is proved in both solutions by different methods.
52 Saint-Petersburg — Russia, 16th–24th July 2021

G5. Let ABCD be a cyclic quadrilateral whose sides have pairwise different lengths. Let
O be the circumcentre of ABCD . The internal angle bisectors of =ABC and =ADC meet AC
at B1 and D1, respectively. Let OB be the centre of the circle which passes through B and is
tangent to AC at D1. Similarly, let OD be the centre of the circle which passes through D and
is tangent to AC at B1 .
Assume that BD1 k DB1. Prove that O lies on the line OB OD .
Common remarks. We introduce some objects and establish some preliminary facts common
for all solutions below.
Let Ω denote the circle pABCDq, and let γB and γD denote the two circles from the problem
statement (their centres are OB and OD , respectively). Clearly, all three centres O, OB , and OD
are distinct.
Assume, without loss of generality, that AB ą BC . Suppose B
that AD ą DC , and let H “ AC X BD. Then the rays BB1
and DD1 lie on one side of BD, as they contain the midpoints of B1111
B
the arcs ADC and ABC , respectively. However, if BD1 k DB1, A
D1 H
H
C
then B1 and D1 should be separated by H . This contradiction
shows that AD ă CD.
Let γB and γD meet Ω again at TB and TD , respectively. The
common chord BTB of Ω and γB is perpendicular to their line of D
centres OB O; likewise, DTD K OD O. Therefore, O P OB OD ðñ OB O k OD O ðñ BTB k
DTD , and the problem reduces to showing that
BTB k DTD . (1)
Comment 1. It seems that the discussion of the positions of points is necessary for both Solutions
below. However, this part automatically follows from the angle chasing in Comment 2.
Solution 1. Let the diagonals AC and BD cross at H . Consider the homothety h centred
at H and mapping B to D. Since BD1 k DB1, we have hpD1q “ B1.
Let the tangents to Ω at B and D meet AC at LB and LD , respectively. We have
=LB BB1 “ =LB BC ` =CBB1 “ =BALB ` =B1 BA “ =BB1 LB ,
which means that the triangle LB BB1 is isosceles, LB B “ LB B1 . The powers of LB with
respect to Ω and γD are LB B 2 and LB B12, respectively; so they are equal, whence LB lies on
the radical axis TD D of those two circles. Similarly, LD lies on the radical axis TB B of Ω
and γB .
By the sine rule in the triangle BHLB , we obtain
HLB
sin =HBLB
“ sin =BLB
BHL
“ B1 LB
sin =BHL
; (2)
B B
similarly,
HLD
sin =HDLD
“ sin =DLD
DHL
“ D1 LD
sin =DHL
. (3)
D D
Clearly, =BHLB “ =DHLD . In the circle Ω, tangent lines BLB and DLD form equal angles
with the chord BD, so sin =HBLB “ sin =HDLD (this equality does not depend on the
picture). Thus, dividing (2) by (3) we get
HLB ´ B1 LB
HLB
HLD
“ B1 LB
D1 LD
, and hence HLB
HLD
“ HLD ´ D1 LD
“ HB1
HD1
.

Since hpD1 q “ B1 , the obtained relation yields hpLD q “ LB , so h maps the line LD B to LB D,
and these lines are parallel, as desired.
Shortlisted problems – solutions 53

OB
O B
B
B
B

γB

TTB
B
B
B
LD A D1 C
H
H B1 LB
TD
O

γD

D
OD

Comment 2. In the solution above, the key relation hpLD q “ LB was obtained via a short compu-
tation in sines. Here we present an alternative, pure synthetical way of establishing that.
Let the external bisectors of =ABC and =ADC cross AC at B2 and D2 , respectively; assume that
Ŋ ą CB
AB Ŋ . In the right-angled triangle BB1 B2 , the point LB is a point on the hypothenuse such that
LB B1 “ LB B , so LB is the midpoint of B1 B2 .
Since DD1 is the internal angle bisector of =ADC , we have
=BDD1 “ =BDA ´2 =CDB “ =BCA ´2 =CAB “ =BB2D1 ,
so the points B , B2, D, and D1 lie on some circle ωB . Similarly, LD is the midpoint of D1 D2, and the
points D, D2 , B , and B1 lie on some circle ωD .
Now we have
=B2DB1 “ =B2DB ´ =B1DB “ =B2D1 B ´ =B1D2B “ =D2BD1 .
Therefore, the corresponding sides of the triangles DB1 B2 and BD1 D2 are parallel, and the triangles
are homothetical (in H ). So their corresponding medians DLB and BLD are also parallel.
B ωB

D2 LD D1 C
A H
H B1 LB B2

ωD
D

Yet alternatively, after obtaining the circles ωB and ωD , one may notice that H lies on their radical
axis BD, whence HB1 ¨ HD2 “ HD1 ¨ HB2 , or
HB1
HD1
“ HD
HB2
.
1

Since hpD1 q “ B1 , this yields hpD2 q “ B2 and hence hpLD q “ LB .


54 Saint-Petersburg — Russia, 16th–24th July 2021

Comment 3. Since h preserves the line AC and maps B ÞÑ D and D1 ÞÑ B1 , we have hpγB q “ γD .
Therefore, hpOB q “ OD ; in particular, H also lies on OB OD .
Solution 2. Let BD1 and TB D1 meet Ω again at XB and YB , respectively. Then
=BD1 C “ =BTB D1 “ =BTB YB “ =BXB YB ,
which shows that XB YB k AC . Similarly, let DB1 and TD B1 meet Ω again at XD and YD ,
respectively; then XD YD k AC .
Let MD and MB be the midpoints of the arcs ABC and ADC , respectively; then the
points D1 and B1 lie on DMD and BMB , respectively. Let K be the midpoint of AC (which
lies on MB MD ). Applying Pascal’s theorem to MD DXD XB BMB , we obtain that the points
D1 “ MD D X XB B , B1 “ DXD X BMB , and XD XB X MB MD are collinear, which means that
XB XD passes through K . Due to symmetry, the diagonals of an isosceles trapezoid XB YB XD YD
cross at K .
MD


B

γB YD XD

TB

D111 K
D K
A C
B1

TD
γD
XB YB
D MB
Let b and d denote the distances from the lines XB YB and XD YD , respectively, to AC . Then
we get
XB Y B
XD Y D
“ db “ D
BX
1 XB
,
1 D
where the second equation holds in view of D1 XB k B1 XD . Therefore, the triangles D1XB YB
and B1XD YD are similar. The triangles D1TB B and B1 TD D are similar to them and hence to
each other. Since BD1 k DB1, these triangles are also homothetical. This yields BTB k DTD ,
as desired.
Comment 4. The original problem proposal asked to prove that the relations BD1 k DB1 and
O P O1 O2 are equivalent. After obtaining BD1 k DB1 ñ O P O1 O2, the converse proof is either
repeated backwards mutatis mutandis, or can be obtained by the usual procedure of varying some
points in the construction.
The Problem Selection Committee chose the current version, because it is less technical, yet keeps
most of the ideas.
Shortlisted problems – solutions 55

This page is intentionally left blank


56 Saint-Petersburg — Russia, 16th–24th July 2021

G6. Determine all integers n ě 3 satisfying the following property: every convex n-gon
whose sides all have length 1 contains an equilateral triangle of side length 1.
(Every polygon is assumed to contain its boundary.)
Answer: All odd n ě 3.
Solution. First we show that for every even n ě 4 there exists a polygon violating the required
statement. Consider a regular k-gon A0 A1 , . . . Ak´1 with side length 1. Let B1, B2, . . . , Bn{2´1
be the points symmetric to A1 , A2, . . . , An{2´1 with respect to the line A0 An{2. Then P “
A0 A1 A2 . . . An{2´1 An{2 Bn{2´1 Bn{2´2 . . . B2 B1 is a convex n-gon whose sides all have length 1.
If k is big enough, P is contained in a strip of width 1{2, which clearly does not contain any
equilateral triangle of side length 1.
A1 A2 An/2−1
A0 An/2
B1 B2 Bn/2−1
Assume now that n “ 2k ` 1. As the case k “ 1 is trivially true, we assume k ě 2 henceforth.
Consider a convex p2k ` 1q-gon P whose sides all have length 1. Let d be its longest diagonal.
The endpoints of d split the perimeter of P into two polylines, one of which has length at least
k ` 1. Hence we can label the vertices of P so that P “ A0 A1 . . . A2k and d “ A0 Aℓ with
ℓ ě k ` 1. We will show that, in fact, the polygon A0 A1 . . . Aℓ contains an equilateral triangle
of side length 1.
Suppose that =Aℓ A0 A1 ě 60˝. Since d is the longest diagonal, we have A1Aℓ ď A0 Aℓ ,
so =A0 A1 Aℓ ě =Aℓ A0 A1 ě 60˝. It follows that there exists a point X inside the triangle
A0 A1 Aℓ such that the triangle A0 A1 X is equilateral, and this triangle is contained in P . Similar
arguments apply if =Aℓ´1Aℓ A0 ě 60˝.
A1 A2
Aℓ−1
X
A0 Aℓ
From now on, assume =Aℓ A0 A1 ă 60˝ and Aℓ´1Aℓ A0 ă 60˝.
Consider an isosceles trapezoid A0Y ZAℓ such that A0Aℓ k Y Z , A0Y “ ZAℓ “ 1, and
=Aℓ A0 Y “ =ZAℓ A0 “ 60˝. Suppose that A0 A1 . . . Aℓ is contained in A0Y ZAℓ. Note that the
perimeter of A0 A1 . . . Aℓ equals ℓ ` A0 Aℓ and the perimeter of A0Y ZAℓ equals 2A0Aℓ ` 1.
Y Z
A1 Am
A m
m
m Aℓ−1
A2222
A
A0 Aℓ
Recall a well-known fact stating that if a convex polygon P1 is contained in a convex
polygon P2, then the perimeter of P1 is at most the perimeter of P2 . Hence we obtain
ℓ ` A0 Aℓ ď 2A0Aℓ ` 1, i.e. ℓ ´ 1 ď A0 Aℓ .

On the other hand, the triangle inequality yields


A0 Aℓ ă Aℓ Aℓ`1 ` Aℓ`1Aℓ`2 ` . . . ` A2k A0 “ 2k ` 1 ´ ℓ ď ℓ ´ 1,
which gives a contradiction.
Therefore, there exists a vertex Am of A0A1 . . . Aℓ which lies outside A0 Y ZAℓ . Since
=Aℓ A0A1 ă 60˝ “ =Aℓ A0Y and Aℓ´1 Aℓ A0 ă 60˝ “ =ZAℓ A0, p1q
Shortlisted problems – solutions 57
?
the distance between Am and A0Aℓ is at least 3{2. ?
Let P be the projection of Am to A0 Aℓ . Then P Am ě 3{2, and by (1) we have A0 P ą 1{2
and P Aℓ ą?1{2. Choose points Q P A0 P , R P P Aℓ, and S P P Am such that P Q “ P R “ 1{2
and P S “ 3{2. Then QRS is an equilateral triangle of side length 1 contained in A0 A1 . . . Aℓ .
Am
Y S
S Z
A2
A1

A0 Aℓ
Q P R

Comment. In fact, for every odd n a stronger statement holds, which is formulated in terms defined
in the solution above: there exists an equilateral triangle Ai Ai`1 B contained in A0 A1 . . . Aℓ for some
0 ď i ă ℓ. We sketch an indirect proof below.
As above, we get =Aℓ A0 A1 ă 60˝ and Aℓ´1Aℓ A0 ă 60˝ . Choose an index m P r1, ℓ ´ 1s maximising
the distance between Am and A0 Aℓ . Arguments from the above solution yield 1 ă m ă ℓ ´ 1. Then
=A0 Am´1 Am ą 120˝ and =Am´1 Am Aℓ ą =A0 AmAℓ ě 60˝ . We construct an equilateral triangle
Am´1 Am B as in the figure below. If B lies in A0 Am´1 Am Aℓ , then we are done. Otherwise B and Am
lie on different sides of A0 Aℓ . As before, let P be the projection of Am to A0 Aℓ . We will show that
A0 A1 ` A1 A2 ` . . . ` Am´1 Am ă A0 P ` 1{2. p2q
Am Am+1
K Am−1

C P
A0 Aℓ
B
There exists a point C on the segment A0 P such that =Am´1CP “ 60˝ . Construct a parallelogram
A0 CAm´1 K . Then the polyline A0 A1 . . . Am´1 is contained in the triangle Am´1 KA0 , so
A0 A1 ` A1 A2 ` . . . ` Am´2 Am´1 ` Am´1 Am ď A0 K ` KAm´1 ` Am´1Am “ A0 C ` CAm´1 ` 1.
To prove (2), it suffices to show that CAm´1 ă CP ´ 1{2. Let the line through B parallel to CP
intersect the rays Am´1 C and Am P at D and T , respectively. It is easy to see that the desired
inequality will follow from DAm´1 ď DT ´ 1{2.
Two possible arrangements of points are shown in the figures below.
Observe that =DAm´1B ě 60˝ , so there is a point M on the segment DB such that the triangle
DM Am´1 is equilateral. Then =Am´1 M D “ 60˝ “ =Am´1 Am B , so Am´1 M BAm is a cyclic quadri-
lateral. Therefore, =Am M B “ 60˝ . Thus, T lies on the ray M B and we have to show that M T ě 1{2.
Indeed, M T “ Am M {2 and Am M ě AmB “ 1. This completes the proof of the inequality (2).
Am
A m
m
Am
A m
m
m

Am−1
A m−1
m−1
m−1

C
C P
P A
Am−1
m−1
m−1
m−1

C
C P

D
D M
M B
B TT
D
D M
M TT B
B
58 Saint-Petersburg — Russia, 16th–24th July 2021

Similarly, either there exists an equilateral triangle Am Am`1 B 1 contained in A0 A1 . . . Aℓ , or


Am Am`1 ` Am`1 Am`2 ` . . . ` Aℓ´1 Aℓ
ă Aℓ P ` 1{2. p3q
Adding (2) and (3) yields A0 A1 ` A1 A2 ` . . . ` Aℓ´1Aℓ ă A0Aℓ ` 1, which gives a contradiction.
Shortlisted problems – solutions 59

This page is intentionally left blank


60 Saint-Petersburg — Russia, 16th–24th July 2021

G7. A point D is chosen inside an acute-angled triangle ABC with AB ą AC so that


=BAD “ =DAC . A point E is constructed on the segment AC so that =ADE “ =DCB .
Similarly, a point F is constructed on the segment AB so that =ADF “ =DBC . A point
X is chosen on the line AC so that CX “ BX . Let O1 and O2 be the circumcentres of the
triangles ADC and DXE . Prove that the lines BC , EF , and O1O2 are concurrent.
Common remarks. Let Q be the isogonal conjugate of D with respect to the triangle ABC .
Since =BAD “ =DAC , the point Q lies on AD. Then =QBA “ =DBC “ =F DA, so the
points Q, D, F , and B are concyclic. Analogously, the points Q, D, E , and C are concyclic.
Thus AF ¨ AB “ AD ¨ AQ “ AE ¨ AC and so the points B , F , E , and C are also concyclic.
A

F
F
E

D
D
Q
Q
TT
B C
Let T be the intersection of BC and F E .
Claim. T D2 “ T B ¨ T C “ T F ¨ T E .
Proof. We will prove that the circles pDEF q and pBDC q are tangent to each other. Indeed,
using the above arguments, we get
=BDF “ =AF D ´ =ABD “ p180˝ ´ =F AD ´ =F DAq ´ p=ABC ´ =DBC q
“ 180˝ ´ =F AD ´ =ABC “ 180˝ ´ =DAE ´ =F EA “ =F ED ` =ADE “ =F ED ` =DCB,
which implies the desired tangency.
Since the points B , C , E , and F are concyclic, the powers of the point T with respect to the
circles pBDC q and pEDF q are equal. So their radical axis, which coincides with the common
tangent at D, passes through T , and hence T D2 “ T E ¨ T F “ T B ¨ T C . l
Solution 1. Let T A intersect the circle pABC q again at M . Due to the circles pBCEF q
and pAMCB q, and using the above Claim, we get T M ¨ T A “ T F ¨ T E “ T B ¨ T C “ T D2; in
particular, the points A, M , E , and F are concyclic.
Under the inversion with centre T and radius T D, the point M maps to A, and B maps to
C , which implies that the circle pMBD q maps to the circle pADC q. Their common point D
lies on the circle of the inversion, so the second intersection point K also lies on that circle,
which means T K “ T D. It follows that the point T and the centres of the circles pKDE q
and pADC q lie on the perpendicular bisector of KD.
Since the center of pADC q is O1, it suffices to show now that the points D, K , E , and X
are concyclic (the center of the corresponding circle will be O2).
The lines BM , DK , and AC are the pairwise radical axes of the circles pABCM q, pACDK q
and pBMDK q, so they are concurrent at some point P . Also, M lies on the circle pAEF q, thus
?pEX, XB q “ ?pCX, XB q “ ?pXC, BC q ` ?pBC, BX q “ 2?pAC, CB q
“ ?pAC, CB q ` ?pEF, F Aq “ ?pAM, BM q ` ?pEM, MAq “ ?pEM, BM q,
so the points M , E , X , and B are concyclic. Therefore, P E ¨ P X “ P M ¨ P B “ P K ¨ P D, so
the points E , K , D, and X are concyclic, as desired.
Shortlisted problems – solutions 61
X

K
K
A
A
M
M
F P
P
E
E

D
D

B C T

Comment 1. We present here a different solution which uses similar ideas.


Perform the inversion ι with centre T and radius T D. It swaps B with C and E with F ; the point
D maps to itself. Let X 1 “ ιpX q. Observe that the points E , F , X , and X 1 are concyclic, as well as
the points B , C , X , and X 1 . Then
?pCX 1 , X 1 F q “ ?pCX 1, X 1 X q ` ?pX 1 X, X 1 F q “ ?pCB, BX q ` ?pEX, EF q
“ ?pXC, CB q ` ?pEC, EF q “ ?pCA, CB q ` ?pBC, BF q “ ?pCA, AF q,
therefore the points C , X 1 , A, and F are concyclic.
Let X 1 F intersect AC at P , and let K be the second common point of DP and the circle pACDq.
Then
PK ¨ PD “ P A ¨ P C “ P X 1 ¨ P F “ P E ¨ P X;
hence, the points K , X , D, and E lie on some circle ω1, while the points K , X 1 , D, and F lie on some
circle ω2. (These circles are distinct since =EXF ` =EDF ă =EAF ` =DCB ` =DBC ă 180˝ ).
The inversion ι swaps ω1 with ω2 and fixes their common point D, so it fixes their second common
point K . Thus T D “ T K and the perpendicular bisector of DK passes through T , as well as through
the centres of the circles pCDKAq and pDEKX q.
X
X

K
K
′′
A
A X
X′′
P
P
F
F
E
E

D
D

B C TT
62 Saint-Petersburg — Russia, 16th–24th July 2021

Solution 2. We use only the first part of the Common remarks, namely, the facts that the
tuples pC, D, Q, E q and pB, C, E, F q are both concyclic. We also introduce the point T “
BC X EF . Let the circle pCDE q meet BC again at E1 . Since =E1 CQ “ =DCE , the arcs DE
and QE1 of the circle pCDQq are equal, so DQ k EE1 .
Since BF EC is cyclic, the line AD forms equal angles with BC and EF , hence so does EE1 .
Therefore, the triangle EE1T is isosceles, T E “ T E1, and T lies on the common perpendicular
bisector of EE1 and DQ.
Let U and V be the centres of circles pADE q and pCDQE q, respectively. Then UO1 is the
perpendicular bisector of AD. Moreover, the points U , V , and O2 belong to the perpendicular
bisector of DE . Since UO1 k V T , in order to show that O1O2 passes through T , it suffices to
show that
O2 U
O2 V
“ OT1VU . p1q
Denote angles A, B , and C of the triangle ABC by α, β , and γ , respectively. Projecting
onto AC we obtain
O2 U
O2 V
“ ppXE
XE ´ AE q{2
“ AX
` EC q{2 CX BX“ AX
“ sinpγ ´ β q
sin α
p2q
The projection of O1U onto AC is pAC ´ AE q{2 “ CE {2; the angle between O1U and AC
is 90˝ ´ α{2, so
O1 U
EC
“ 2 sin1pα{2q p3 q
Next, we claim that E , V , C , and T are concyclic. Indeed, the point V lies on the per-
pendicular bisector of CE , as well as on the internal angle bisector of =CT F . Therefore, V
coincides with the midpoint of the arc CE of the circle pT CE q.
Now we have =EV C “ 2=EE1 C “ 180˝ ´pγ ´ β q and =V ET “ =V E1T “ 90˝ ´ =E1 EC “
90˝ ´ α{2. Therefore,
sin =ET C sinpγ ´ β q
EC
TV
“ sin “
=V ET cospα{2q . p4q
X
X

O2222
O A
A

F
F
U
U E
E O111
O

D
D

Q
Q VV

TT
B
B E1 C
C
Shortlisted problems – solutions 63

Recalling p2q and multiplying p3q and p4q we establish p1q:


O2 U pγ ´ β q “ 1 ¨ sinpγ ´ β q “ O1U ¨ EC “ O1U .
“ sinsin
O2 V α 2 sinpα{2q cospα{2q EC T V TV

Solution 3. Notice that =AQE “ =QCB and =AQF “ =QBC ; so, if we replace the point D
with Q in the problem set up, the points E , F , and T remain the same. So, by the Claim, we
have T Q2 “ T B ¨ T C “ T D2.
Thus, there exists a circle Γ centred at T and passing through D and Q. We denote the
second meeting point of the circles Γ and pADC q by K . Let the line AC meet the circle pDEK q
again at Y ; we intend to prove that Y “ X . As in Solution 1, this will yield that the point T ,
as well as the centres O1 and O2, all lie on the perpendicular bisector of DK .
Let L “ AD X BC . We perform an inversion centred at C ; the images of the points
will be denoted by primes, e.g., A1 is the image of A. We obtain the following configuration,
constructed in a triangle A1 CL1.
The points D1 and Q1 are chosen on the circumcircle Ω of A1 L1 C such that ?pL1 C, D1C q “
?pQ1 C, A1C q, which means that A1L1 k D1Q1 . The lines D1 Q1 and A1 C meet at E 1.
A circle Γ1 centred on CL1 passes through D1 and Q1. Notice here that B 1 lies on the
segment CL1 , and that =A1 B 1C “ =BAC “ 2=LAC “ 2=A1 L1 C , so that B 1 L1 “ B 1A1 , and B 1
lies on the perpendicular bisector of A1 L1 (which coincides with that of D1Q1 ). All this means
that B 1 is the centre of Γ1.
Finally, K 1 is the second meeting point of A1 D1 and Γ1, and Y 1 is the second meeting
point of the circle pD1K 1E 1 q and the line A1 E 1, We have ?pY 1K 1 , K 1A1q “ ?pY 1 E 1, E 1D1q “
?pY 1 A1, A1L1 q, so A1 L1 is tangent to the circumcircle ω of the triangle Y 1A1 K 1.
Let O and O˚ be the centresÝÝofÑΩ and ω , respectively. Then O ˚ A1 K A1 L1 K B 1 O . The
projections of vectors
ÝÝÝ Ñ Ý
ÝÝ Ñ ÝÝÝÑ ÝÝÝÑ
O ˚ A1 and B 1 O onto K 1 D 1 are equal to K 1 A1 {2 “ K 1 D 1 {2 ´ A1 D 1 {2. So
ÝÝÝÑ ÝÝÑ ÝÝÑ ÝÝÝÑ
O ˚ A1 “ B 1 O, or equivalently A1 O “ O ˚ B 1 . Projecting this equality onto A1 C , we see that the
ÝÝÝÑ ÝÝÑ
projection of O˚B 1 equals A1 C {2. Since O˚ is projected to the midpoint of A1 Y 1, this yields
that B 1 is projected to the midpoint of CY 1, i.e., B 1Y 1 “ B 1 C and =B 1 Y 1C “ =B 1 CY 1. In
the original figure, this rewrites as =CBY “ =BCY , so Y lies on the perpendicular bisector
of BC , as desired.
E′′′′
E

D′′′′
D
A′′′′
A
K′′′′
K

Ω ∗
O∗∗∗
O ω


Q′′′
Q YY ′′′′

O Γ′′′′
Γ

L′′′′
L B′′′′
B C
C

Comment 2. The point K appears to be the same in Solutions 1 and 3 (and Comment 1 as well).
One can also show that K lies on the circle passing through A, X , and the midpoint of the arc BAC .
64 Saint-Petersburg — Russia, 16th–24th July 2021

Comment 3. There are different proofs of the facts from the Common remarks, namely, the cyclicity
of B , C , E , and F , and the Claim. We present one such alternative proof here.
We perform the composition φ of a homothety with centre A and the reflection in AD, which maps
E to B . Let U “ φpD q. Then ?pBC, CD q “ ?pAD, DE q “ ?pBU, U D q, so the points B , U , C ,
and D are concyclic. Therefore, ?pCU, U Dq “ ?pCB, BDq “ ?pAD, DF q, so φpF q “ C . Then the
coefficient of the homothety is AC {AF “ AB {AE , and thus points C , E , F , and B are concyclic.
Denote the centres of the circles pEDF q and pBU CDq by O3 and O4 , respectively. Then φpO3 q “
O4 , hence ?pO3 D, DAq “ ´?pO4 U, U Aq “ ?pO4 D, DAq, whence the circle pBDC q is tangent to the
circle pEDF q.
Now, the radical axes of circles pDEF q, pBDC q and pBCEF q intersect at T , and the claim follows.
A

F
O3333
O
E
E
D

O4
B C T

U
This suffices for Solution 1 to work. However, Solutions 2 and 3 need properties of point Q,
established in Common remarks before Solution 1.
Comment 4. In the original problem proposal, the point X was hidden. Instead, a circle γ was
constructed such that D and E lie on γ , and its center is collinear with O1 and T . The problem
requested to prove that, in a fixed triangle ABC , independently from the choice of D on the bisector
of =BAC , all circles γ pass through a fixed point.
Shortlisted problems – solutions 65

G8. Let ω be the circumcircle of a triangle ABC , and let ΩA be its excircle which is tangent
to the segment BC . Let X and Y be the intersection points of ω and ΩA . Let P and Q be the
projections of A onto the tangent lines to ΩA at X and Y , respectively. The tangent line at P
to the circumcircle of the triangle AP X intersects the tangent line at Q to the circumcircle of
the triangle AQY at a point R. Prove that AR K BC .

Solution 1. Let D be the point of tangency of BC and ΩA. Let D1 be the point such that
DD 1 is a diameter of ΩA . Let R1 be (the unique) point such that AR1 K BC and R1 D 1 k BC .
We shall prove that R1 coincides with R.
Let P X intersect AB and D1 R1 at S and T , respectively. Let U be the ideal common
point of the parallel lines BC and D1 R1. Note that the (degenerate) hexagon ASXT UC is
circumscribed around ΩA , hence by the Brianchon theorem AT , SU , and XC concur at a
point which we denote by V . Then V S k BC . It follows that ?pSV, V X q “ ?pBC, CX q “
?pBA, AX q, hence AXSV is cyclic. Therefore, ?pP X, XAq “ ?pSV, V Aq “ ?pR1 T, T Aq.
Since =AP T “ =AR1 T “ 90˝, the quadrilateral AP R1T is cyclic. Hence,
?pXA, AP q “ 90˝ ´ ?pP X, XAq “ 90˝ ´ ?pR1 T, T Aq “ ?pT A, AR1q “ ?pT P, P R1q.
It follows that P R1 is tangent to the circle pAP X q.
Analogous argument shows that QR1 is tangent to the circle pAQY q. Therefore, R “ R1
and AR K BC .

Comment 1. After showing ?pP X, XAq “ ?pR1 T, T Aq one can finish the solution as follows. There
exists a spiral similarity mapping the triangle AT R1 to the triangle AXP . So the triangles AT X
and AR1 P are similar and equioriented. Thus, ?pT X, XAq “ ?pR1 P, P Aq, which implies that P R1 is
tangent to the circle pAP X q.
Solution 2. Let J and r be the center and the radius of ΩA. Denote the diameter of ω by d
and its center by O. By Euler’s formula, OJ 2 “ pd{2q2 ` dr, so the power of J with respect to
ω equals dr.
66 Saint-Petersburg — Russia, 16th–24th July 2021

Let JX intersect ω again at L. Then JL “ d. Let LK be a diameter of ω and let M be


the midpoint of JK . Since JL “ LK , we have =LMK “ 90˝, so M lies on ω . Let R1 be the
point such that R1P is tangent to the circle pAP X q and AR1 K BC . Note that the line AR1 is
symmetric to the line AO with respect to AJ .
A
A
ω O
O
L K
K
L O
O
K
K X
X
M
M
P
P
X
X M
M T JJ

JJ N
N
Lemma. Let M be the midpoint of the side JK in a triangle AJK . Let X be a point on the
circle pAMK q such that =JXK “ 90˝. Then there exists a point T on the line KX such that
the triangles AKJ and AJT are similar and equioriented.
Proof. Note that MX “ MK . We construct a parallelogram AJNK . Let T be a point on KX
such that ?pNJ, JAq “ ?pKJ, JT q. Then
?pJN, NAq “ ?pKA, AM q “ ?pKX, XM q “ ?pMK, KX q “ ?pJK, KT q.
So there exists a spiral similarity with center J mapping the triangle AJN to the triangle
T JK . Therefore, the triangles NJK and AJT are similar and equioriented. It follows that the
triangles AKJ and AJT are similar and equioriented. l
A
ω

O
O
K
K

X P
P R∗∗∗∗ =
=AA′′′′
X R
M
M

T
JJ
R′

P∗
Shortlisted problems – solutions 67

Back to the problem, we construct a point T as in the lemma. We perform the composition
φ of inversion with centre A and radius AJ and reflection in AJ . It is known that every triangle
AEF is similar and equioriented to AφpF qφpE q.
So φpK q “ T and φpT q “ K . Let P ˚ “ φpP q and R˚ “ φpR1q. Observe that φpT K q is a
circle with diameter AP ˚. Let AA1 be a diameter of ω . Then P ˚K K AK K A1K , so A1 lies on
P ˚ K . The triangles AR1 P and AP ˚ R˚ are similar and equioriented, hence

?pAA1 , A1 P ˚q “ ?pAA1 , A1 K q “ ?pAX, XP q “ ?pAX, XP q “ ?pAP, P R1q “ ?pAR˚ , R˚P ˚q,


so A, A1, R˚, and P ˚ are concyclic. Since A1 and R˚ lie on AO, we obtain R˚ “ A1. So
R1 “ φpA1 q, and φpA1 qP is tangent to the circle pAP X q.
An identical argument shows that φpA1qQ is tangent to the circle pAQY q. Therefore, R “
φpA1 q and AR K BC .

Comment 2. One of the main ideas of Solution 2 is to get rid of the excircle, along with points B
and C . After doing so we obtain the following fact, which is, essentially, proved in Solution 2.
Let ω be the circumcircle of a triangle AK1 K2 . Let J be a point such that the midpoints of JK1
and JK2 lie on ω. Points X and Y are chosen on ω so that =JXK1 “ =JY K2 “ 90˝ . Let P and Q be
the projections of A onto XK1 and Y K2, respectively. The tangent line at P to the circumcircle of the
triangle AP X intersects the tangent line at Q to the circumcircle of the triangle AQY at a point R.
Then the reflection of the line AR in AJ passes through the centre O of ω.
68 Saint-Petersburg — Russia, 16th–24th July 2021

Number Theory
N1. Determine all integers n ě 1 for which there exists a pair of positive integers pa, bq
such that no cube of a prime divides a2 ` b ` 3 and
ab ` 3b ` 8
a2 ` b ` 3
“ n.

Answer: The only integer with that property is n “ 2.


Solution. As b ” ´a2 ´ 3 pmod a2 ` b ` 3q, the numerator of the given fraction satisfies
ab ` 3b ` 8 ” ap´a2 ´ 3q ` 3p´a2 ´ 3q ` 8 ” ´pa ` 1q3 pmod a2 ` b ` 3q.

As a2 ` b ` 3 is not divisible by p3 for any prime p, if a2 ` b ` 3 divides pa ` 1q3 then it does


also divide pa ` 1q2. Since
0 ă pa ` 1q2 ă 2pa2 ` b ` 3q,
we conclude pa ` 1q2 “ a2 ` b ` 3. This yields b “ 2pa ´ 1q and n “ 2. The choice pa, bq “ p2, 2q
with a2 ` b ` 3 “ 9 shows that n “ 2 indeed is a solution.
Shortlisted problems – solutions 69

N2. Let n ě 100 be an integer. The numbers n, n ` 1, . . . , 2n are written on n ` 1 cards,


one number per card. The cards are shuffled and divided into two piles. Prove that one of the
piles contains two cards such that the sum of their numbers is a perfect square.
Solution. To solve the problem it suffices to find three squares and three cards with numbers
on them such that pairwise sums a ` b, b ` c, a ` c are equal to the chosen squares. By
a, b, c
choosing the three consecutive squares p2k ´ 1q2, p2kq2, p2k ` 1q2 we arrive at the triple
` ˘
pa, b, cq “ 2k2 ´ 4k, 2k2 ` 1, 2k2 ` 4k .
We need a value for k such that
n ď 2k 2 ´ 4k, and 2k 2 ` 4k ď 2n.
A concrete k is suitable for all n with
“ ‰
n P k 2 ` 2k, 2k 2 ´ 4k ` 1 “: Ik .
For k ě 9 the intervals Ik and Ik`1 overlap because
pk ` 1q2 ` 2pk ` 1q ď 2k2 ´ 4k ` 1.
Hence I9 Y I10 Y . . . “ r99, 8q, which proves the statement for n ě 99.
Comment 1. There exist approaches which only work for sufficiently large n.
One possible approach is to consider three cards with numbers 70k2 , 99k2 , 126k2 on them. Then
their pairwise sums are perfect squares and so it suffices to find k such that 70k2 ě n and 126k2 ď 2n
which exists for sufficiently large n.
Another approach is to prove, arguing by contradiction, that a and a ´ 2 are in the same pile
provided that n is large enough and a is sufficiently close to n. For that purpose, note that every pair
of neighbouring numbers in the sequence? a, x2 ´ a, a `p2x ` 1q, x2 ` 2x ` 3 ´ a, a ´ 2 adds up to a perfect
square for any x; so by choosing x “ t 2au ` 1 and assuming that n is large enough we conclude that
a and a ´ 2 are in the same pile for any a P rn ` 2, 3n{2s. This gives a contradiction since it is easy to
find two numbers from rn ` 2, 3n{2s of the same parity which sum to a square.
It then remains to separately cover the cases of small n which appears to be quite technical.
Comment 2. An alternative formulation for this problem could ask for a proof of the statement
for all n ą 106 . An advantage of this formulation is that some solutions, e.g. those mentioned in
Comment 1 need not contain a technical part which deals with the cases of small n. However, the
original formulation seems to be better because the bound it gives for n is almost sharp, see the next
comment for details.
Comment 3. The statement of the problem is false for n “ 98. As a counterexample, the first pile
may contain the even numbers from 98 to 126, the odd numbers from 129 to 161, and the even numbers
from 162 to 196.
70 Saint-Petersburg — Russia, 16th–24th July 2021

N3. Find all positive integers n with the following property: the k positive divisors of n
have a permutation pd1, d2, . . . , dk q such that for every i “ 1, 2, . . . , k, the number d1 ` ¨ ¨ ¨ ` di
is a perfect square.
Answer: n “ 1 and n “ 3.
Solution. For i “ 1, 2, . . . , k let d1 ` . . . ` di “ s2i , and define s0 “ 0 as well. Obviously
0 “ s0 ă s1 ă s2 ă . . . ă sk , so

si ě i and di “ s2i ´ s2i´1 “ psi ` si´1 qpsi ´ si´1 q ě si ` si´1 ě 2i ´ 1. p1 q


The number 1 is one of the divisors d1, . . . , dk but, due to di ě 2i ´ 1, the only possibility
is d1 “ 1.
Now consider d2 and s2 ě 2. By definition, d2 “ s22 ´ 1 “ ps2 ´ 1qps2 ` 1q, so the numbers
s2 ´ 1 and s2 ` 1 are divisors of n. In particular, there is some index j such that dj “ s2 ` 1.
Notice that
s2 ` s1 “ s2 ` 1 “ dj ě sj ` sj´1; p2q
since the sequence s0 ă s1 ă . . . ă sk increases, the index j cannot be greater than 2. Hence,
the divisors s2 ´ 1 and s2 ` 1 are listed among d1 and d2. That means s2 ´ 1 “ d1 “ 1 and
s2 ` 1 “ d2 ; therefore s2 “ 2 and d2 “ 3.
We can repeat the above process in general.
Claim. di “ 2i ´ 1 and si “ i for i “ 1, 2, . . . , k.
Proof. Apply induction on i. The Claim has been proved for i “ 1, 2. Suppose that we have
already proved d “ 1, d2 “ 3, . . . , di “ 2i ´ 1, and consider the next divisor di`1:
di`1 “ s2i`1 ´ s2i “ s2i`1 ´ i2 “ psi`1 ´ iqpsi`1 ` iq.
The number si`1 ` i is a divisor of n, so there is some index j such that dj “ si`1 ` i.
Similarly to (2), by (1) we have
si`1 ` si
“ si`1 ` i “ dj ě sj ` sj´1; p3q
since the sequence s0 ă s1 ă . . . ă sk increases, (3) forces j ď i ` 1. On the other hand,
dj “ si`1 ` i ą 2i ą di ą di´1 ą . . . ą d1 , so j ď i is not possible. The only possibility is
j “ i ` 1.
Hence,
si`1 ` i “ di`1“ s2i`1 ´ s2i “ s2i`1 ´ i2;
s2i`1 ´ si`1 “ ipi ` 1q.
By solving this equation we get si`1 “ i ` 1 and di`1 “ 2i ` 1, that finishes the proof. l
Now we know that the positive divisors of the number n are 1, 3, 5, . . . , n ´ 2, n. The greatest
divisor is dk “ 2k ´ 1 “ n itself, so n must be odd. The second greatest divisor is dk´1 “ n ´ 2;
then n ´ 2 divides n “ pn ´ 2q ` 2, so n ´ 2 divides 2. Therefore, n must be 1 or 3.
The numbers n “ 1 and n “ 3 obviously satisfy the requirements: for n “ 1 we have k “ 1
and d1 “ 12 ; for n “ 3 we have k “ 2, d1 “ 12 and d1 ` d2 “ 1 ` 3 “ 22.
Shortlisted problems – solutions 71

This page is intentionally left blank


72 Saint-Petersburg — Russia, 16th–24th July 2021

N4. Alice is given a rational number r ą 1 and a line with two points B ‰ R, where
point R contains a red bead and point B contains a blue bead. Alice plays a solitaire game by
performing a sequence of moves. In every move, she chooses a (not necessarily positive) integer
k , and a bead to move. If that bead is placed at point X , and the other bead is placed at Y ,
ÝÝÑ
then Alice moves the chosen bead to point X 1 with Y X 1 “ rk Ý ÝÑ
Y X.
Alice’s goal is to move the red bead to the point B . Find all rational numbers r ą 1 such
that Alice can reach her goal in at most 2021 moves.

Answer: All r “ pb ` 1q{b with b “ 1, . . . , 1010.


Solution. Denote the red and blue beads by R and B, respectively. Introduce coordinates
on the line and identify the points with their coordinates so that R “ 0 and B “ 1. Then,
during the game, the coordinate of R is always smaller than the coordinate of B. Moreover,
the distance between the beads always has the form rℓ with ℓ P Z, since it only multiplies
by numbers of this form. Denote the value of the distance after the mth move by dm “ rα , m

m “ 0, 1, 2, . . . (after the 0th move we have just the initial position, so α0 “ 0).
If some bead is moved in two consecutive moves, then Alice could instead perform a single
move (and change the distance from di directly to di`2) which has the same effect as these two
moves. So, if Alice can achieve her goal, then she may as well achieve it in fewer (or the same)
number of moves by alternating the moves of B and R. In the sequel, we assume that Alice
alternates the moves, and that R is shifted altogether t times.
If R is shifted in the mth move, then its coordinate increases by dm ´ dm`1. Therefore, the
total increment of R’s coordinate, which should be 1, equals
´
tÿ1 ÿ
t
either pd0 ´ d1q ` pd2 ´ d3q ` ¨ ¨ ¨ ` pd2t´2 ´ d2t´1 q “ 1 ` r α2i ´ r α2i´1 ,

i 1 “
i 1
ÿ
t ÿ
t
or pd1 ´ d2q ` pd3 ´ d4q ` ¨ ¨ ¨ ` pd2t´1 ´ d2t q “ r α2i´1 ´ r α2i ,

i 1 “
i 1

depending on whether R or B is shifted in the first move. Moreover, in the former case we
should have t ď 1011, while in the latter one we need t ď 1010. So both cases reduce to an
equation
ÿ
n ´
nÿ1
r βi
“ r γi , βi , γi P Z, (1)

i 1 “
i 1

for some n ď 1011. Thus, if Alice can reach her goal, then this equation has a solution for
n “ 1011 (we can add equal terms to both sums in order to increase n).
Conversely, if (1) has a solution for n “ 1011, then Alice can compose a corresponding
sequence of distances d0, d1, d2, . . . , d2021 and then realise it by a sequence of moves. So the
problem reduces to the solvability of (1) for n “ 1011.
Assume that, for some rational r, there is a solution of (1). Write r in lowest terms as
r “ a{b. Substitute this into (1), multiply by the common denominator, and collect all terms
on the left hand side to get
´
ÿ1
2n
p´1qiaµ bN ´µ “ 0,
i i
µi P t0, 1, . . . , N u, (2)

i 1

for some N ě 0. We assume that there exist indices j´ and j` such that µj´ “ 0 and µj` “ N .
Shortlisted problems – solutions 73

Reducing (2) modulo a ´ b (so that a ” b), we get


ÿ1
2n ´ ÿ1
2n ´
0“ p´1q a b ´
i µi N µi
” p´1qibµ bN ´µ “ ´bN
i i
mod pa ´ bq.

i 1 “
i 1

Since gcdpa ´ b, bq “ 1, this is possible only if a ´ b “ 1.


Reducing (2) modulo a ` b (so that a ” ´b), we get
´
ÿ1
2n ´
ÿ1
2n
0“ p´1q a b ´
i µi N µi
” p´1qip´1qµ bµ bN ´µ “ SbN
i i i
mod pa ` bq

i 1 “
i 1

for some odd (thus nonzero) S with |S | ď 2n ´ 1. Since gcdpa ` b, bq “ 1, this is possible only
if a ` b | S . So a ` b ď 2n ´ 1, and hence b “ a ´ 1 ď n ´ 1 “ 1010.
Thus we have shown that any sought r has the form indicated in the answer. It remains to
show that for any b “ 1, 2, . . . , 1010 and a “ b ` 1, Alice can reach the goal. For this purpose,
in (1) we put n “ a, β1 “ β2 “ ¨ ¨ ¨ “ βa “ 0, and γ1 “ γ2 “ ¨ ¨ ¨ “ γb “ 1.
Comment 1. Instead of reducing modulo a ` b, one can reduce modulo a and modulo b. The first
reduction shows that the number of terms in (2) with µi “ 0 is divisible by a, while the second shows
that the number of terms with µi “ N is divisible by b.
Notice that, in fact, N ą 0, as otherwise (2) contains an alternating sum of an odd number of
equal terms, which is nonzero. Therefore, all terms listed above have different indices, and there are
at least a ` b of them.
Comment 2. Another way to investigate the solutions of equation (1) is to consider the Laurent
polynomial
ÿ
n nÿ1 ´
L px q “ xβ i ´ xγi .

i 1 “
i 1

We can pick a sufficiently large integer d so that P pxq “ xdLpxq is a polynomial in Zrxs. Then
P p1q “ 1, (3)
and
1 ď |P p´1q| ď 2021. (4)
If r “ p{q with integers p ą q ě 1 is a rational number with the properties listed in the problem
statement, then P pp{qq “ Lpp{qq “ 0. As P pxq has integer coefficients,
pp ´ qxq | P pxq. (5)
Plugging x “ 1 into (5) gives pp ´ qq | P p1q “ 1, which implies p “ q ` 1. Moreover, plugging x “ ´1
into (5) gives pp ` qq | P p´1q, which, along with (4), implies p ` q ď 2021 and q ď 1010. Hence
x “ pq ` 1q{q for some integer q with 1 ď q ď 1010.
74 Saint-Petersburg — Russia, 16th–24th July 2021

N5. Prove that there are only finitely many quadruples pa, b, c, nq of positive integers such
that
n! “ an´1 ` bn´1 ` cn´1 .

Solution. For fixed n there are clearly finitely many solutions; we will show that there is no
solution with n ą 100. So, assume n ą 100. By the AM–GM inequality,
n! “ 2npn ´ 1qpn ´ 2qpn ´ 3q ¨ p3 ¨ 4 ¨ ¨ ¨ pn ´ 4qq
ˆ ˙n´6 ˆ ˙n´6 ˆ ˙n´1
3 ` ¨ ¨ ¨ ` pn ´ 4 q n´1 n´1
ď 2 pn ´ 1 q4
n´6
“ 2pn ´ 1q 4
2
ă 2
,

thus a, b, c ă pn ´ 1q{2.
For every prime p and integer m ‰ 0, let νp pmq denote the p-adic valuation of m; that is,
the greatest non-negative integer k for which pk divides m. Legendre’s formula states that
8 Z ^
ÿ
νp pn!q “
n
,

s 1
ps

and a well-know corollary of this formula is that


8 n
ÿ
νp pn!q ă “ p ´n 1 . p♥q

s 1
ps

If n is odd then an´1, bn´1, cn´1 are squares, and by considering them modulo 4 we conclude
that a, b and c must be even. Hence, 2n´1 | n! but that is impossible for odd n because
ν2 pn!q “ ν2 ppn ´ 1q!q ă n ´ 1 by p♥q.
From now on we assume that n is even. If all three numbers a ` b, b ` c, c ` a are powers of 2
then a, b, c have the same parity. If they all are odd, then n! “ an´1 ` bn´1 ` cn´1 is also odd
which is absurd. If all a, b, c are divisible by 4, this contradicts ν2 pn!q ď n ´ 1. If, say, a is not
divisible by 4, then 2a “ pa ` bq`pa ` cq´pb ` cq is not divisible by 8, and since all a ` b, b ` c,
c ` a are powers of 2, we get that one of these sums equals 4, so two of the numbers of a, b, c are
equal to 2. Say, a “ b “ 2, then c “ 2r ´ 2 and, since c | n!, we must have c | an´1 ` bn´1 “ 2n
implying r “ 2, and so c “ 2, which is impossible because n! ” 0 ı 3 ¨ 2n´1 pmod 5q.
So now we assume that the sum of two numbers among a, b, c, say a ` b, is not a power of 2,
so it is divisible by some odd prime p. Then p ď a ` b ă n and so cn´1 “ n! ´ pan´1 ` bn´1q is
divisible by p. If p divides a and b, we get pn´1 | n!, contradicting p♥q. Next, using p♥q and
the Lifting the Exponent Lemma we get
` ˘
νp p1q`νp p2q`¨ ¨ ¨`νp pnq “ νp pn!q “ νp pn!´cn´1 q “ νp an´1 ` bn´1 “ νppa`bq`νp pn´1q. p♦q
In view of p♦q, no number of 1, 2, . . . , n can be divisible by p, except a ` b and n ´ 1 ą a ` b.
On the other hand, p|c implies that p ă n{2 and so there must be at least two such numbers.
Hence, there are two multiples of p among 1, 2, . . . , n, namely a ` b “ p and n ´ 1 “ 2p. But
this is another contradiction because n ´ 1 is odd. This final contradiction shows that there is
no solution of the equation for n ą 100.
Comment 1. The original version of the problem asked to find all solutions to the equation. The
solution to that version is not much different but is more technical.
Shortlisted problems – solutions 75

Comment 2. To find all solutions we can replace the bound a, b, c ă pn ´ 1q{2 for all n with a
weaker bound a, b, c ď n{2 only for even n, which is a trivial application of AM–GM to the tuple
p2, 3, . . . , nq. Then we may use the same argument for odd n (it works for n ě 5 and does not require
any bound on a, b, c), and for even n the same solution works for n ě 6 unless we have a ` b “ n ´ 1
and 2νp pn ´ 1q “ νppn!q. This is only possible for p “ 3 and n “ 10 in which case we can consider the
original equation modulo 7 to deduce that 7 | abc which contradicts the fact that 79 ą 10!. Looking at
n ď 4 we find four solutions, namely,

pa, b, c, nq “ p1, 1, 2, 3q, p1, 2, 1, 3q, p2, 1, 1, 3q, p2, 2, 2, 4q.

Comment 3. For sufficiently large n, the inequality a, b, c ă pn ´ 1q{2 also follows from Stirling’s
formula.
76 Saint-Petersburg — Russia, 16th–24th July 2021

N6. Determine all integers n ě 2 with the following property: every n pairwise distinct
integers whose sum is not divisible by n can be arranged in some order a1 , a2 , . . . , an so that
n divides 1 ¨ a1 ` 2 ¨ a2 ` ¨ ¨ ¨ ` n ¨ an .

Answer: All odd integers and all powers of 2.


Solution. If n “ 2k a, where a ě 3 is odd and k is a positive integer, we can consider a set
containing the number 2k ` 1 and n ´ 1 numbers congruent to 1 modulo n. The sum of these
numbers is congruent to 2k modulo n and therefore is not divisible by n; for any permutation
pa1 , a2, . . . , anq of these numbers
1 ¨ a1 ` 2 ¨ a2 ` ¨ ¨ ¨ ` n ¨ an ” 1 ` ¨ ¨ ¨ ` n ” 2k´1ap2k a ` 1q ı 0 pmod 2k q
and a fortiori 1 ¨ a1 ` 2 ¨ a2 ` ¨ ¨ ¨ ` n ¨ an is not divisible by n.
From now on, we suppose that n is either odd or a power of 2. Let S be the given set of
integers, and s be the sum of elements of S .
ř
Lemma 1. If there is a permutation pai q ofřS such that pn, sq divides ni“1 iai , then there is a
permutation pbiq of S such that n divides ni“1 ibi .
ř
Proof. Let r “ ni“1 iai . Consider the permutation pbi q defined by bi “ ai`x , where aj `n “ aj .
For this permutation, we have
ÿ
n ÿ
n ÿ
n
ibi “ iai`x ” pi ´ xqai ” r ´ sx pmod nq.

i 1 “
i 1 “
i 1

Since pn, sq divides r, the congruence r ´ sx ” 0 pmod nq admits a solution.


Lemma 2. Every set T of km integers, m ą 1, can be partitioned into m sets of k integers so
that in every set either the sum of elements is not divisible by k or all the elements leave the
same remainder upon division by k.
Proof. The base case, m “ 2. If T contains k elements leaving the same remainder upon division
by k, we form one subset A of these elements; the remaining elements form a subset B . If k
does not divide the sum of all elements of B , we are done. Otherwise it is enough to exchange
any element of A with any element of B not congruent to it modulo k, thus making sums of
both A and B not divisible by k. This cannot be done only when all the elements of T are
congruent modulo k; in this case any partition will do.
If no k elements of T have the same residue modulo k, there are three elements a, b, c P T
leaving pairwise distinct remainders upon division
ř by k . Let t be the sum of elements of T . It
suffices to find A Ă T such that |A| “ k and xPA x ı 0, t pmod kq: then neither the sum of
elements of A nor the sum of elements of B “ T z A is divisible by k. Consider U 1 Ă T zta, b, cu
with |U 1 | “ k ´ 1. The sums of elements of three sets U 1 Y tau, U 1 Y tbu, U 1 Y tcu leave three
different remainders upon division by k, and at least one of them is not congruent either to 0
or to t.
Now let m ą 2. If T contains k elements leaving the same remainder upon division by k,
we form one subset A of these elements and apply the inductive hypothesis to the remaining
k pm ´ 1q elements. Otherwise, we choose any U Ă T , |U | “ k ´ 1. Since all ř
the remaining
elements cannot be congruent modulo k, there is a P T z U such that a ı ´ xPU x pmod kq.
Now we can take A “ U Y tau and apply the inductive hypothesis to T z A.
Shortlisted problems – solutions 77

Now we are ready to prove the statement of the problem for all odd n and n “ 2k . The
proof is by induction.
If n is prime, the statement follows immediately from Lemma 1, since in this case pn, sq “ 1.
Turning to the general case, we can find prime p and an integer t such that pt | n and pt ∤ s.
By Lemma 2, we can partition S into p sets of np “ k elements so that in every set either the
sum of numbers is not divisible by k or all numbers have the same residue modulo k.
For sets
řk
in the first category, by the inductive hypothesis there is a permutation pai q such
that k | i“1 iai.
If n (and therefore k) is odd, then for each permutation pbiq of a set in the second category
we have
” b1 kpk 2` 1q ” 0 pmod kq.
kÿ
ibi

i 1

By combining ř such permutation for all sets of the partition, we get a permutation pci q of S
such that k | ni“1 ici . Since this sum is divisible by k, and k is divisible by pn, sq, we are done
by Lemma 1.
If n “ 2s , we have řp “ 2 and k “ 2s´1. Then for each of the subsets there is a permutation
pa1 , . . . , ak q such that ki“1 iai is divisible by 2s´2 “ k2 : if the subset belongs to the first category,
the expression is divisible even by k, and if it belongs to the second one,
ˆ ˙
ÿ k pk ` 1 q
k
iai ” a1 ”0 k
mod .
i“1
2 2

Now the numbers of each permutation should be multiplied by all the odd or all the even
numbers not exceeding n in increasing order so that the resulting sums are divisible by k:
ÿ
k ÿ
k ÿ
k
p2i ´ 1qai ” 2iai ”2 iai ” 0 pmod kq.

i 1 “
i 1 “
i 1
řn
Combining these two sums, we again get a permutation pciq of S such that k | “ ici , and
i 1
finish the case by applying Lemma 1.
Comment. We cannot dispense with the condition that n does not divide the sum of all elements.
Indeed, for each n ą 1 and the set consisting of 1, ´1, and n ´ 2 elements divisible by n the required
permutation does not exist.
78 Saint-Petersburg — Russia, 16th–24th July 2021

N7. Let a1, a2 , a3, . . . be an infinite sequence of positive integers such that an`2m divides
an ` an`m for all positive integers n and m. Prove that this sequence is eventually periodic, i.e.
there exist positive integers N and d such that an “ an`d for all n ą N .
Solution. We will make repeated use of the following simple observation:
Lemma 1. If a positive integer d divides an and an´m for some m and n ą 2m, it also divides
an´2m . If d divides an and an´2m , it also divides an´m.
Proof. Both parts are obvious since an divides an´2m ` an´m. l
Claim. The sequence pan q is bounded.
Proof. Suppose the contrary. Then there exist infinitely many indices n such that an is greater
than each of the previous terms a1 , a2, . . . , an´1. Let an “ k be such a term, n ą 10. For each
s ă n2 the number an “ k divides an´s ` an´2s ă 2k , therefore

an´s ` an´2s “ k.
In particular,
an“ an´1 ` an´2 “ an´2 ` an´4 “ an´4 ` an´8,
that is, an´1 “ an´4 and an´2 “ an´8. It follows from Lemma 1 that an´1 divides an´1´3s for
3s ă n ´ 1 and an´2 divides an´2´6s for 6s ă n ´ 2. Since at least one of the numbers an´1
and an´2 is at least an {2, so is some ai with i ď 6. However, an can be arbitrarily large, a
contradiction. l
Since pan q is bounded, there exist only finitely many i for which ai appears in the sequence
finitely many times. In other words, there exists N such that if ai “ t and i ą N , then aj “ t
for infinitely many j .
Clearly the sequence pan`N qną0 satisfies the divisibility condition, and it is enough to prove
that this sequence is eventually periodic. Thus truncating the sequence if necessary, we can
assume that each number appears infinitely many times in the sequence. Let k be the maximum
number appearing in the sequence.
Lemma 2. If a positive integer d divides an for some n, then the numbers i such that d divides
ai form an arithmetical progression with an odd difference.
Proof. Let i1 ă i2 ă i3 ă . . . be all the indices i such that d divides ai . If is ` is`1 is even, it
follows from Lemma 1 that d also divides a ` ` , impossible since is ă i `2i ` ă is`1. Thus
is is 1
s s 1

is and is`1 are always of different parity, and therefore is ` is`2 is even. Applying Lemma 1
2

again, we see that d divides a ` ` , hence i `2i ` “ is`1,


is is 2
2
s s 2
l
We are ready now to solve the problem.
The number of positive divisors of all terms of the progression is finite. Let ds be the
difference of the progression corresponding to s, that is, s divides an if and only if it divides
an`td for any positive integer t. Let D be the product of all ds . Then each s dividing a term
s
of the progression divides an if and only if it divides an`D . This means that the sets of divisors
of an and an`D coincide, and an`D “ an . Thus D is a period of the sequence.
Comment. In the above solution we did not try to find the exact structure of the periodic part of
pan q. A little addition to the argument above shows that the period of the sequence has one of the
following three forms:
(i) t (in this case the sequence is eventually constant);
(ii) t, 2t, 3t or 2t, t, 3t (so the period is 3);
(iii) t, t, . . . , 2t (the period can be any odd number).
Shortlisted problems – solutions 79

In these three cases t can be any positive integer. It is easy to see that all three cases satisfy the
original condition.
We again denote by k be the maximum number appearing in the sequence. All the indices i such
that ai “ k form an arithmetical progression. If the difference of this progression is 1, the sequence
pan q is constant, and we get the case (i). Assume that the difference T is at least 3.
Take an index n such that an “ k and let a “ an´2, b “ an´1. We have a, b ă k and therefore
k “ an “ an´1 ` an´2 “ a ` b. If a “ b “ k2 , then all the terms a1 , a2 , . . . , an are divisible by k{2,
that is, are equal to k or k{2. Since the indices i such that ai “ k form an arithmetical progression
with odd diference, we get the case (iii).
Suppose now that a ‰ b.
Claim. For n2 ă m ă n we have am “ a if m ” n ´ 2 pmod 3q and am “ b if m ” n ´ 1 pmod 3q.
Proof. The number k “ an divides an´2 ` an´1 “ a ` b and an´4 ` an´2 “ an´4 ` a and is therefore
equal to these sums (since a, b ă k and ai ď k for all i). Therefore an´1 “ an´4 “ b, that is, an´4 ă k,
an´4 ` an´8 “ k and an´8 “ an´2 “ a. One of the numbers a and b is greater than k{2.
If b “ an´1 “ an´4 ą k2 , it follows from Lemma 1 that an´1 divides an´1´3s when 3s ă n ´ 1, and
therefore an´1´3s “ b when 3s ă n´1. When 6s ă n´4, k also divides an´4´6s `an´2´3s “ b`an´2´3s,
thus, an´2´3s “ k ´ b “ a.
If a “ an´2 “ an´8 ą k2 , all the terms an´2´6s with 6s ă n ´ 2 are divisible by a, that is, the
indices i for which a divides ai form a progression with difference dividing 6. Since this difference is
odd and greater than 1, it must be 3, that is, an´2´3s “ a when 3s ă n ´ 2. Similarly to the previous
case, we have an´1´3s “ an ´ an´2´6s “ k ´ a “ b when 6s ă n ´ 2. l
Let an and an`T be two consecutive terms of the sequence equal to k. If n is large enough,
n`T
2 ă n ´ 2, and applying the claim to n ` T instead of n we see that the three consecutive terms
an´2 “ a, an´1 “ b, an “ k must be equal to an`T ´2 , an`T ´1 and an`T respectively. Thus, for some
i we have ai`3s “ a and ai`1`3s “ b for all s. Truncating the sequence again if necessary, we may
assume that a3s`1 “ a and a3s`2 “ b for all s. We know also that an “ k if and only if n is divisible
by T (incidentally, this proves that T is divisible by 3).
If a3s “ c for some integer s, each of the numbers a, b, c divides the sum of the other two. It is
easy to see that these numbers are proportional to one of the triplets (1, 1, 1), (1, 1, 2) and (1, 2, 3) in
some order. It follows that the greater of the two numbers a and b is the smaller multiplied by 2, 3 or
3{2. The last two cases are impossible because then c cannot be the maximum element in the triplet
pa, b, cq, while c “ k “ a ` b for infinitely many s. Thus the only possible case is 2, the numbers a
and b are k{3 and 2k{3 in some order, and the only possible values of c are k and k{3. Suppose that
a3s “ k{3 for some s ą 1. We can choose s so that a3s`3 “ k. Therefore T , which we already know to
be odd and divisible by 3, is greater than 3, that is, at least 9. Then a3s´3 ‰ k, and the only other
possibility is a3s´3 “ k{3. However, a3s`3 “ k must divide a3s ` a3s´3 “ 2k{3, which is impossible.
We have proved then that a3s “ k for all s ą 1, which is the case (ii).
80 Saint-Petersburg — Russia, 16th–24th July 2021

N8. For a polynomial P pxq with integer coefficients let P 1pxq “ P pxq and P k`1pxq “
P pP k pxqq for k ě 1. Find all positive integers n for which there exists a polynomial P pxq with
integer coefficients such that for every integer m ě 1, the numbers P mp1q, . . . , P mpnq leave
exactly rn{2m s distinct remainders when divided by n.

Answer: All powers of 2 and all primes.


Solution. Denote the set of residues modulo ℓ by Zℓ. Observe that P can be regarded as a
function Zℓ Ñ Zℓ for any positive integer ℓ. Denote the cardinality of the set P mpZℓ q by fm,ℓ .
Note that fm,n “ rn{2m s for all m ě 1 if and only if fm`1,n “ rfm,n {2s for all m ě 0.
Part 1. The required polynomial exists when n is a power of 2 or a prime.
If n is a power of 2, set P pxq “ 2x.
If n “ p is an odd prime, every function f : Zp Ñ Zp coincides with some polynomial with
integer coefficients. So we can pick the function that sends x P t0, 1, . . . , p ´ 1u to tx{2u.
Part 2. The required polynomial does not exist when n is not a prime power.
Let n “ ab where a, b ą 1 and gcdpa, bq “ 1. Note that, since gcdpa, bq “ 1,
fm,ab “ fm,afm,b
by the Chinese remainder theorem. Also, note that, if fm,ℓ “ fm`1,ℓ , then P permutes the
image of P m on Zℓ , and therefore fs,ℓ “ fm,ℓ for all s ą m. So, as fm,ab “ 1 for sufficiently large
m, we have for each m

fm,a ą fm`1,a or fm,a “ 1, fm,b ą fm`1,b or fm,b “ 1.


Choose the smallest m such that fm`1,a “ 1 or fm`1,b “ 1. Without loss of generality assume
that fm`1,a “ 1. Then fm`1,ab “ fm`1,b ă fm,b ď fm,ab {2 ď fm`1,ab , a contradiction.
Part 3. The required polynomial does not exist when n is an odd prime power that is not a
prime.
Let n “ pk , where p ě 3 is prime and k ě 2. For r P Zp let Sr denote the subset of Zp k

consisting of numbers congruent to r modulo p. We denote the cardinality of a set S by |S |.


Claim. For any residue r modulo p, either |P pSr q| “ pk´1 or |P pSr q| ď pk´2.
Proof. Recall that P pr ` hq “ P prq ` hP 1 prq ` h2Qpr, hq, where Q is an integer polynomial.
If p | P 1prq, then P pr ` psq ” P prq pmod p2 q, hence all elements of P pSr q are congruent
modulo p2. So in this case |P pSr q| ď pk´2.
Now we show that p ∤ P 1prq implies |P pSr q| “ pk´1 for all k.
Suppose the contrary: |P pSr q| ă pk´1 for some k ą 1. Let us choose the smallest k
for which this is so. To each residue in P pSr q we assign its residue modulo pk´1; denote
the resulting set by P pS, rq. We have |P pS, rq| “ pk´2 by virtue of minimality of k. Then
|P pSr q| ă pk´1 “ p ¨ |P pS, rq|, that is, there is u “ P pxq P P pSr q (x ” r pmod pq) and t ı 0
pmod pq such that u ` pk´1t R P pSr q.
Note that P px ` pk´1sq ” u ` pk´1sP 1pxq pmod pk q. Since P px ` pk´1sq ı u ` pk´1t
pmod pk q, the congruence pk´1sP 1pxq ” pk´1t pmod pk q has no solutions. So the congruence
sP 1 pxq ” t pmod pq has no solutions, which contradicts p ∤ P 1 pr q. l
Shortlisted problems – solutions 81

Since the image of P m consists of one element for sufficiently large m, we can take the
smallest m such that |P m´1pSr q| “ pk´1 for some r P Zp , but |P mpSq q| ď pk´2 for all q P Zp .
From now on, we fix m and r.
Since the image of P m´1pZp qzP m´1 pSr q under P contains P mpZp qzP mpSr q, we have
k k

a :“ |P mpZpk qzP m pSr q| ď |P m´1pZpk qzP m´1 pSr q|,

thus
a ` pk´1 ď fm´1,p ď 2fm,p ď 2pk´2 ` 2a,
k k

so
pp ´ 2qpk´2 ď a.
Since fi,p “ 1 for sufficiently large i, there is exactly one t P Zp such that P ptq ” t pmod pq.
Moreover, as i increases, the cardinality of the set ts P Zp | P ipsq ” t pmod pqu increases
(strictly), until it reaches the value p. So either
|ts P Zp | P m´1psq ” t pmod pqu| “ p or |ts P Zp | P m´1psq ” t pmod pqu| ě m.
Therefore, either fm´1,p “ 1 or there exists a subset X Ă Zp of cardinality at least m such
that P m´1pxq ” t pmod pq for all x P X .
In the first case |P m´1pZp q| ď pk´1 “ |P m´1pSr q|, so a “ 0, a contradiction.
k

In the second case let Y be the set of all elements of Zp congruentŤto some element of X
k

modulo p. Let Z “ Zp zY . Then P m´1pY q Ă St, P pStq Ĺ St, and Z “ iPZ zX Si, so
k
p

|P mpY q| ď |P pStq| ď pk´2 and |P mpZ q| ď |ZpzX | ¨ pk´2 ď pp ´ mqpk´2.


Hence,
pp ´ 2qpk´2 ď a ă |P mpZp q| ď |P mpY q| ` |P mpZ q| ď pp ´ m ` 1qpk´2
k

and m ă 3. Then |P 2pSq q| ď pk´2 for all q P Zp , so


pk {4 ď |P 2pZp q| ď pk´1 ,
k

which is impossible for p ě 5. It remains to consider the case p “ 3.


As before, let t be the only residue modulo 3 such that P ptq ” t pmod 3q.
If 3 ∤ P 1ptq, then P pStq “ St by the proof of the Claim above, which is impossible.
So 3 | P 1ptq. By substituting h “ 3is into the formula P pt ` hq “ P ptq ` hP 1ptq ` h2 Qpt, hq,
we obtain P pt ` 3isq ” P ptq pmod 3i`1q. Using induction on i we see that all elements of P ipStq
are congruent modulo 3i`1. Thus, |P k´1pStq| “ 1.
Note that f1,3 ď 2 and f2,3 ď 1, so P 2pZ3 q Ă St . Therefore, |P k`1pZ3 q| ď |P k´1pStq| “ 1.
k k

It follows that 3k ď 2k`1, which is impossible for k ě 2.


Comment. Here is an alternative version of the problem.
A function f : Z Ñ Z is chosen so that a ´ b | f paq ´ f pbq for all a, b P Z with a ‰ b. Let S0 “ Z,
and for each positive integer m, let Sm denote the image of f on the set Sm´1 . It is given that, for
each nonnegative integer m, there are exactly rn{2m s distinct residues modulo n in the set Sm. Find
all possible values of n.
Answer: All powers of primes.
Solution. Observe that f can be regarded as a function Zℓ Ñ Zℓ for any positive integer ℓ. We use
notations f m and fm,ℓ as in the above solution.
82 Saint-Petersburg — Russia, 16th–24th July 2021

Part 1. There exists a function f : Zpk Ñ Zpk satisfying the desired properties.
For x P Zpk , let revpxq denote the reversal of the base-p digits of x (we write every x P Zpk with
exactly k digits, adding zeroes at the beginning if necessary). Choose
ˆZ ^˙
revpxq
f pxq “ rev
2

where, for dividing by 2, revpxq is interpreted as an integer in the range r0, pk q. It is easy to see that
fm`1,k “ rfm,k {2s.
We claim that if a, b P Zp so that pm|a ´ b, then pm|f paq ´ f pbq. Let x “ revpaq, y “ revpbq. The
k

first m digits of x and y are the same, i.e tx{pm´k u “ ty{pm´k u. For every positive integers c, d and z
we have ttz{cu{du “ tz{pcdqu “ ttz{du{cu, so
Y ] Y ] Y ] Y ]
tx{2u{p ´
m k
“ t x {p ´
m k
u{2 “ ty{p ´
m k
u{2 “ ty{2u{p ´ .
m k

Thus, the first m digits of tx{2u and ty{2u are the same. So the last m digits of f paq and f pbq are the
same, i.e. pm|f paq ´ f pbq.
Part 2. Lifting the function f : Zpk Ñ Zpk to a function on all of Z.
We show that, for any function f : Zpk Ñ Zpk for which gcdppk , a ´ bq | f paq ´ f pbq, there is
a corresponding function g : Z Ñ Z for which a ´ b | gpaq ´ gpbq for all distinct integers a, b and
gpxq ” f pxq pmod pk q for all x P Z, whence the proof will be completed. We will construct the values
of such a function inductively; assume that we have constructed it for some interval ra, bq and wish to
define gpbq. (We will define gpa ´ 1q similarly.)
For. every prime q ď |a ´ b|, we choose the maximal αq for which there exists cq P ra, bq, such that
b ´ cq .. q αq , and choose one such cq .
We apply Chinese remainder theorem to find gpbq satisfying the following conditions:
gpbq ” gpcq q
pmod qα q for q ‰ p, and q

gpbq ” gpcp q pmod q α q if αp ě k,


p
g pbq ” f pbq pmod pk q if αp ă k.
It is not hard to verify that b ´ c | gpbq ´ gpcq for every c P ra, bq and gpbq ” f pbq pmod pk q.
Part 3. The required function does not exist if n has at least two different prime divisors.
The proof is identical to the polynomial version.
63rd International Mathematical Olympiad
Oslo, Norway, 6th–16th July 2022

SHORTLISTED
PROBLEMS
WITH SOLUTIONS
Note of Confidentiality

The Shortlist has to be kept strictly confidential


until the conclusion of the following
International Mathematical Olympiad.
IMO General Regulations §6.6

Contributing Countries

The Organising Committee and the Problem Selection Committee of IMO 2022 thank the
following 50 countries for contributing 193 problem proposals (43 A, 59 C, 52 G, 39 N):

Armenia, Australia, Austria, Belarus, Belgium, Canada, China, Colombia,


Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Estonia, France,
Georgia, Germany, Ghana, Greece, Hong Kong, India, Indonesia, Iran,
Ireland, Israel, Japan, Kazakhstan, Luxembourg, Mongolia, Netherlands,
Nigeria, North Macedonia, Panama, Philippines, Poland, Romania, Serbia,
Singapore, Slovakia, Slovenia, South Africa, Spain, Taiwan, Thailand,
Trinidad and Tobago, Tunisia, Ukraine, United Kingdom, U.S.A., Vietnam

Problem Selection Committee

Dávid Alexander Betts Márton Borbényi James Cranch Elisa Lorenzo


Kunszenti-Kovács García

Karl Erik Holter Maria-Romina Johannes Kleppe Géza Kós Dmitry Krachun
Ivan

Charles Leytem Sofia Lindqvist Arnaud Maret Waldemar Pompe Paul Vaderlind
Shortlisted problems 3

Problems
Algebra
A1. Let pan qně1 be a sequence of positive real numbers with the property that
pan`1 q2 ` an an`2 ď an ` an`2
for all positive integers n. Show that a2022 ď 1.
(Nigeria)
A2. Let k ě 2 be an integer. Find the smallest integer n ě k ` 1 with the property that
there exists a set of n distinct real numbers such that each of its elements can be written as a
sum of k other distinct elements of the set.
(Slovakia)
A3. Let Rą0 be the set of positive real numbers. Find all functions f : Rą0 Ñ Rą0 such
that, for every x P Rą0 , there exists a unique y P Rą0 satisfying
xf pyq ` yf pxq ď 2.
(Netherlands)
A4. Let n ě 3 be an integer, and let x1 , x2 , ..., xn be real numbers in the interval r0, 1s.
Let s “ x1 ` x2 ` . . . ` xn , and assume that s ě 3. Prove that there exist integers i and j with
1 ď i ă j ď n such that
2j´i xi xj ą 2s´3 .
(Trinidad and Tobago)
A5. Find all positive integers n ě 2 for which there exist n real numbers a1 ă ¨ ¨ ¨ ă an
and a real number r ą 0 such that the 12 npn ´ 1q differences aj ´ ai for 1 ď i ă j ď n are equal,
1
in some order, to the numbers r1 , r2 , . . . , r 2 npn´1q .
(Czech Republic)
A6. Let R be the set of real numbers. We denote by F the set of all functions f : R Ñ R
such that
f px ` f pyqq “ f pxq ` f pyq
for every x, y P R. Find all rational numbers q such that for every function f P F, there exists
some z P R satisfying f pzq “ qz.
(Indonesia)
A7. For a positive integer n we denote by spnq the sum of the digits of n. Let P pxq “
xn ` an´1 xn´1 ` ¨ ¨ ¨ ` a1 x ` a0 be a polynomial, where n ě 2 and ai is a positive integer for all
0 ď i ď n ´ 1. Could it be the case that, for all positive integers k, spkq and spP pkqq have the
same parity?
(Belarus)
A8. For a positive integer n, an n-sequence is a sequence pa0 , . . . , an q of non-negative
integers satisfying the following condition: if i and j are non-negative integers with i ` j ď n,
then ai ` aj ď n and aai `aj “ ai`j .
Let f pnq be the number of n-sequences. Prove that there exist positive real numbers c1 , c2
and λ such that
c1 λn ă f pnq ă c2 λn
for all positive integers n.
(Canada)
4 Oslo, Norway, 6th–16th July 2022

Combinatorics
C1. A ˘1-sequence is a sequence of 2022 numbers a1 , . . . , a2022 , each equal to either `1 or
´1. Determine the largest C so that, for any ˘1-sequence, there exists an integer k and indices
1 ď t1 ă . . . ă tk ď 2022 so that ti`1 ´ ti ď 2 for all i, and
k
ÿ
ati ě C.
i“1

(Czech Republic)
C2. The Bank of Oslo issues coins made out of two types of metal: aluminium (denoted
A) and copper (denoted C). Morgane has n aluminium coins, and n copper coins, and arranges
her 2n coins in a row in some arbitrary initial order. Given a fixed positive integer k ď 2n, she
repeatedly performs the following operation: identify the largest subsequence containing the
k-th coin from the left which consists of consecutive coins made of the same metal, and move
all coins in that subsequence to the left end of the row. For example, if n “ 4 and k “ 4, the
process starting from the configuration AACCCACA would be

AACCCACA Ñ CCCAAACA Ñ AAACCCCA Ñ CCCCAAAA Ñ ¨ ¨ ¨ .

Find all pairs pn, kq with 1 ď k ď 2n such that for every initial configuration, at some point
of the process there will be at most one aluminium coin adjacent to a copper coin.
(France)
C3. In each square of a garden shaped like a 2022 ˆ 2022 board, there is initially a tree
of height 0. A gardener and a lumberjack alternate turns playing the following game, with the
gardener taking the first turn:

• The gardener chooses a square in the garden. Each tree on that square and all the
surrounding squares (of which there are at most eight) then becomes one unit taller.

• The lumberjack then chooses four different squares on the board. Each tree of positive
height on those squares then becomes one unit shorter.

We say that a tree is majestic if its height is at least 106 . Determine the largest number K
such that the gardener can ensure there are eventually K majestic trees on the board, no matter
how the lumberjack plays.
(Colombia)
C4.
Let n ą 3 be a positive integer. Suppose that n children are arranged in a circle, and n
coins are distributed between them (some children may have no coins). At every step, a child
with at least 2 coins may give 1 coin to each of their immediate neighbours on the right and
left. Determine all initial distributions of coins from which it is possible that, after a finite
number of steps, each child has exactly one coin.
(Israel)
Shortlisted problems 5

C5. Let m, n ě 2 be integers, let X be a set with n elements, and let X1 , X2 , . . . , Xm


be pairwise distinct non-empty, not necessary disjoint subsets of X. A function f : X Ñ
t1, 2, . . . , n ` 1u is called nice if there exists an index k such that
ÿ ÿ
f pxq ą f pxq for all i ‰ k.
xPXk xPXi

Prove that the number of nice functions is at least nn .


(Germany)
C6. Let n be a positive integer. We start with n piles of pebbles, each initially containing
a single pebble. One can perform moves of the following form: choose two piles, take an equal
number of pebbles from each pile and form a new pile out of these pebbles. For each positive
integer n, find the smallest number of non-empty piles that one can obtain by performing a
finite sequence of moves of this form.
(Croatia)
C7. Lucy starts by writing s integer-valued 2022-tuples on a blackboard. After doing that,
she can take any two (not necessarily distinct) tuples v “ pv1 , . . . , v2022 q and w “ pw1 , . . . , w2022 q
that she has already written, and apply one of the following operations to obtain a new tuple:

v ` w “ pv1 ` w1 , . . . , v2022 ` w2022 q


v _ w “ pmaxpv1 , w1 q, . . . , maxpv2022 , w2022 qq

and then write this tuple on the blackboard.


It turns out that, in this way, Lucy can write any integer-valued 2022-tuple on the blackboard
after finitely many steps. What is the smallest possible number s of tuples that she initially
wrote?
(Czech Republic)
C8.
Alice fills the fields of an n ˆ n board with numbers from 1 to n2 , each number being used
exactly once. She then counts the total number of good paths on the board. A good path is a
sequence of fields of arbitrary length (including 1) such that:

(i) The first field in the sequence is one that is only adjacent to fields with larger numbers,

(ii) Each subsequent field in the sequence is adjacent to the previous field,

(iii) The numbers written on the fields in the sequence are in increasing order.

Two fields are considered adjacent if they share a common side. Find the smallest possible
number of good paths Alice can obtain, as a function of n.
(Serbia)
C9. Let Zě0 be the set of non-negative integers, and let f : Zě0 ˆ Zě0 Ñ Zě0 be a
bijection such that whenever f px1 , y1 q ą f px2 , y2 q, we have f px1 ` 1, y1 q ą f px2 ` 1, y2 q and
f px1 , y1 ` 1q ą f px2 , y2 ` 1q.
Let N be the number of pairs of integers px, yq, with 0 ď x, y ă 100, such that f px, yq is
odd. Find the smallest and largest possible value of N .
(U.S.A.)
6 Oslo, Norway, 6th–16th July 2022

Geometry
G1. Let ABCDE be a convex pentagon such that BC “ DE. Assume there is a point
T inside ABCDE with T B “ T D, T C “ T E and =T BA “ =AET . Let lines CD and CT
intersect line AB at points P and Q, respectively, and let lines CD and DT intersect line AE
at points R and S, respectively. Assume that points P, B, A, Q and R, E, A, S respectively, are
collinear and occur on their lines in this order. Prove that the points P , S, Q, R are concyclic.
(Slovakia)
G2. In the acute-angled triangle ABC, the point F is the foot of the altitude from A, and
P is a point on the segment AF . The lines through P parallel to AC and AB meet BC at D
and E, respectively. Points X ‰ A and Y ‰ A lie on the circles ABD and ACE, respectively,
such that DA “ DX and EA “ EY .
Prove that B, C, X and Y are concyclic.
(Netherlands)
G3. Let ABCD be a cyclic quadrilateral. Assume that the points Q, A, B, P are collinear
in this order, in such a way that the line AC is tangent to the circle ADQ, and the line BD is
tangent to the circle BCP . Let M and N be the midpoints of BC and AD, respectively. Prove
that the following three lines are concurrent: line CD, the tangent of circle AN Q at point A,
and the tangent to circle BM P at point B.
(Slovakia)
G4. Let ABC be an acute-angled triangle with AC ą AB, let O be its circumcentre, and
let D be a point on the segment BC. The line through D perpendicular to BC intersects the
lines AO, AC and AB at W , X and Y , respectively. The circumcircles of triangles AXY and
ABC intersect again at Z ‰ A.
Prove that if OW “ OD, then DZ is tangent to the circle AXY .
(United Kingdom)
G5. Let ABC be a triangle, and let `1 and `2 be two parallel lines. For i “ 1, 2, let `i
meet the lines BC, CA, and AB at Xi , Yi , and Zi , respectively. Suppose that the line through
Xi perpendicular to BC, the line through Yi perpendicular to CA, and finally the line through
Zi perpendicular to AB, determine a non-degenerate triangle ∆i .
Show that the circumcircles of ∆1 and ∆2 are tangent to each other.
(Vietnam)
G6. In an acute-angled triangle ABC, point H is the foot of the altitude from A. Let
P be a moving point such that the bisectors k and ` of angles P BC and P CB, respectively,
intersect each other on the line segment AH. Let k and AC meet at E, let ` and AB meet
at F , and let EF and AH meet at Q. Prove that, as P varies, the line P Q passes through a
fixed point.
(Iran)
G7. Let ABC and A1 B 1 C 1 be two triangles having the same circumcircle ω, and the same
orthocentre H. Let Ω be the circumcircle of the triangle determined by the lines AA1 , BB 1
and CC 1 . Prove that H, the centre of ω, and the centre of Ω are collinear.
(Denmark)
G8. Let AA1 BCC 1 B 1 be a convex cyclic hexagon such that AC is tangent to the incircle
of the triangle A1 B 1 C 1 , and A1 C 1 is tangent to the incircle of the triangle ABC. Let the lines
AB and A1 B 1 meet at X and let the lines BC and B 1 C 1 meet at Y .
Prove that if XBY B 1 is a convex quadrilateral, then it has an incircle.
(Australia)
Shortlisted problems 7

Number Theory
N1. A number is called Norwegian if it has three distinct positive divisors whose sum is
equal to 2022. Determine the smallest Norwegian number.
(Note: The total number of positive divisors of a Norwegian number is allowed to be larger
than 3.)
(Cyprus)
N2. Find all positive integers n ą 2 such that
ˇ
ˇ ź
n! ˇˇ pp ` qq.
păqďn,
p,q primes

(Nigeria)
N3. Let a ą 1 be a positive integer, and let d ą 1 be a positive integer coprime to a. Let
x1 “ 1 and, for k ě 1, define
#
xk ` d if a doesn’t divide xk ,
xk`1 “
xk {a if a divides xk .
Find the greatest positive integer n for which there exists an index k such that xk is divisible
by an .
(Croatia)
N4. Find all triples of positive integers pa, b, pq with p prime and
ap “ b! ` p.
(Belgium)
N5. For each 1 ď i ď 9 and T P N, define di pT q to be the total number of times the digit
i appears when all the multiples of 1829 between 1 and T inclusive are written out in base 10.
Show that there are infinitely many T P N such that there are precisely two distinct values
among d1 pT q, d2 pT q, . . . , d9 pT q.
(United Kingdom)
N6. Let Q be a set of prime numbers, not necessarily finite. For a positive integer n
consider its prime factorisation; define ppnq to be the sum of all the exponents and qpnq to be
the sum of the exponents corresponding only to primes in Q. A positive integer n is called
special if ppnq ` ppn ` 1q and qpnq ` qpn ` 1q are both even integers. Prove that there is a
constant c ą 0 independent of the set Q such that for any positive integer N ą 100, the number
of special integers in r1, N s is at least cN .
(For example, if Q “ t3, 7u, then pp42q “ 3, qp42q “ 2, pp63q “ 3, qp63q “ 3, pp2022q “ 3,
qp2022q “ 1.)
(Costa Rica)
N7. Let k be a positive integer and let S be a finite set of odd prime numbers. Prove that
there is at most one way (modulo rotation and reflection) to place the elements of S around a
circle such that the product of any two neighbors is of the form x2 ` x ` k for some positive
integer x.
(U.S.A.)
N8. Prove that 5n ´ 3n is not divisible by 2n ` 65 for any positive integer n.
(Belgium)
8 Oslo, Norway, 6th–16th July 2022
Shortlisted problems – solutions 9

Solutions
Algebra
A1. Let pan qně1 be a sequence of positive real numbers with the property that

pan`1 q2 ` an an`2 ď an ` an`2

for all positive integers n. Show that a2022 ď 1.


(Nigeria)

Solution. We begin by observing that pan`1 q2 ´ 1 ď an ` an`2 ´ an an`2 ´ 1, which is equivalent


to
pan`1 q2 ´ 1 ď p1 ´ an qpan`2 ´ 1q.
Suppose now that there exists a positive integer n such that an`1 ą 1 and an`2 ą 1.
Since pan`1 q2 ´ 1 ď p1 ´ an qpan`2 ´ 1q, we deduce that 0 ă 1 ´ an ă 1 ă 1 ` an`2 , thus
pan`1 q2 ´ 1 ă pan`2 ` 1qpan`2 ´ 1q “ pan`2 q2 ´ 1.
On the other hand, pan`2 q2 ´ 1 ď p1 ´ an`3 qpan`1 ´ 1q ă p1 ` an`1 qpan`1 ´ 1q “ pan`1 q2 ´ 1,
a contradiction. We have shown that we cannot have two consecutive terms, except maybe a1
and a2 , strictly greater than 1.
Finally, suppose a2022 ą 1. This implies that a2021 ď 1 and a2023 ď 1. Therefore 0 ă
pa2022 q2 ´ 1 ď p1 ´ a2021 qpa2023 ´ 1q ď 0, a contradiction. We conclude that a2022 ď 1.
10 Oslo, Norway, 6th–16th July 2022

A2. Let k ě 2 be an integer. Find the smallest integer n ě k ` 1 with the property that
there exists a set of n distinct real numbers such that each of its elements can be written as a
sum of k other distinct elements of the set.
(Slovakia)

Answer: n “ k ` 4.

Solution. First we show that n ě k ` 4. Suppose that there exists such a set with n numbers
and denote them by a1 ă a2 ă ¨ ¨ ¨ ă an .
Note that in order to express a1 as a sum of k distinct elements of the set, we must have
a1 ě a2 ` ¨ ¨ ¨ ` ak`1 and, similarly for an , we must have an´k ` ¨ ¨ ¨ ` an´1 ě an . We also know
that n ě k ` 1.
If n “ k ` 1 then we have a1 ě a2 ` ¨ ¨ ¨ ` ak`1 ą a1 ` ¨ ¨ ¨ ` ak ě ak`1 , which gives a
contradiction.
If n “ k ` 2 then we have a1 ě a2 ` ¨ ¨ ¨ ` ak`1 ě ak`2 , that again gives a contradiction.
If n “ k ` 3 then we have a1 ě a2 ` ¨ ¨ ¨ ` ak`1 and a3 ` ¨ ¨ ¨ ` ak`2 ě ak`3 . Adding the two
inequalities we get a1 ` ak`2 ě a2 ` ak`3 , again a contradiction.
It remains to give an example of a set with k ` 4 elements satisfying the condition of the
problem. We start with the case when k “ 2l and l ě 1. In that case, denote by Ai “ t´i, iu
and take the set A1 Y ¨ ¨ ¨ Y Al`2 , which has exactly k ` 4 “ 2l ` 4 elements. We are left to show
that this set satisfies the required condition.
Note that if a number i can be expressed in the desired way, then so can ´i by negating
the expression. Therefore, we consider only 1 ď i ď l ` 2.
If i ă l ` 2, we sum the numbers from some l ´ 1 sets Aj with j ‰ 1, i ` 1, and the numbers
i ` 1 and ´1.
For i “ l ` 2, we sum the numbers from some l ´ 1 sets Aj with j ‰ 1, l ` 1, and the numbers
l ` 1 and 1.
It remains to a give a construction for odd k “ 2l ` 1 with l ě 1 (since k ě 2). To that end,
we modify the construction for k “ 2l by adding 0 to the previous set.
This is a valid set as 0 can be added to each constructed expression, and 0 can be ex-
pressed as follows: take the numbers 1, 2, ´3 and all the numbers from the remaining l ´ 1 sets
A4 , A5 , ¨ ¨ ¨ , Al`2 .
Shortlisted problems – solutions 11

A3. Let Rą0 be the set of positive real numbers. Find all functions f : Rą0 Ñ Rą0 such
that, for every x P Rą0 , there exists a unique y P Rą0 satisfying
xf pyq ` yf pxq ď 2.
(Netherlands)

Answer: The function f pxq “ 1{x is the only solution.

Solution 1. First we prove that the function f pxq “ 1{x satisfies the condition of the problem
statement. The AM-GM inequality gives
x y
` ě2
y x
for every x, y ą 0, with equality if and only if x “ y. This means that, for every x ą 0, there
exists a unique y ą 0 such that
x y
` ď 2,
y x
namely y “ x.
Let now f : Rą0 Ñ Rą0 be a function that satisfies the condition of the problem statement.
We say that a pair of positive real numbers px, yq is good if xf pyq ` yf pxq ď 2. Observe that
if px, yq is good, then so is py, xq.
Lemma 1.0. If px, yq is good, then x “ y.
Proof. Assume that there exist positive real numbers x ‰ y such that px, yq is good. The
uniqueness assumption says that y is the unique positive real number such that px, yq is good.
In particular, px, xq is not a good pair. This means that
xf pxq ` xf pxq ą 2
and thus xf pxq ą 1. Similarly, py, xq is a good pair , so py, yq is not a good pair, which implies
yf pyq ą 1. We apply the AM-GM inequality to obtain
a a
xf pyq ` yf pxq ě 2 xf pyq ¨ yf pxq “ 2 xf pxq ¨ yf pyq ą 2.
This is a contradiction, since px, yq is a good pair.
By assumption, for any x ą 0, there always exists a good pair containing x, however Lemma
1 implies that the only good pair that can contain x is px, xq, so
1
xf pxq ď 1 ðñ f pxq ď ,
x
for every x ą 0.
In particular, with x “ 1{f ptq for t ą 0, we obtain
ˆ ˙
1 1
¨f ď 1.
f ptq f ptq
Hence ˆ ˙
1
t¨f ď tf ptq ď 1.
f ptq
We claim that pt, 1{f ptqq is a good pair for every t ą 0. Indeed,
ˆ ˙ ˆ ˙
1 1 1
t¨f ` f ptq “ t ¨ f ` 1 ď 2.
f ptq f ptq f ptq
Lemma 1 implies that t “ 1{f ptq ðñ f ptq “ 1{t for every t ą 0.
12 Oslo, Norway, 6th–16th July 2022

Solution 1.1. We give an alternative way to prove that f pxq “ 1{x assuming f pxq ď 1{x for
every x ą 0.
Indeed, if f pxq ă 1{x then for every a ą 0 with f pxq ă 1{a ă 1{x (and there are at least
two of them), we have
x
af pxq ` xf paq ă 1 ` ă 2.
a
Hence px, aq is a good pair for every such a, a contradiction. We conclude that f pxq “ 1{x.

Solution 1.2. We can also conclude from Lemma 1 and f pxq ď 1{x as follows.
Lemma 2. The function f is decreasing.
Proof. Let y ą x ą 0. Lemma 1 says that px, yq is not a good pair, but py, yq is. Hence

xf pyq ` yf pxq ą 2 ě 2yf pyq ą yf pyq ` xf pyq,

where we used y ą x (and f pyq ą 0) in the last inequality. This implies that f pxq ą f pyq,
showing that f is decreasing.
We now prove that f pxq “ 1{x for all x. Fix a value of x and note that for y ą x we must
have xf pxq ` yf pxq ą xf pyq ` yf pxq ą 2 (using that f is decreasing for the first step), hence
2
f pxq ą x`y . The last inequality is true for every y ą x ą 0. If we fix x and look for the
supremum of the expression x`y 2
over all y ą x, we get

2 1
f pxq ě “ .
x`x x
Since we already know that f pxq ď 1{x, we conclude that f pxq “ 1{x.

Solution 2.0. As in the first solution, we note that f pxq “ 1{x is a solution, and we set out
to prove that it is the only one. We write gpxq for the unique positive real number such that
px, gpxqq is a good pair. In this solution, we prove Lemma 2 without assuming Lemma 1.
Lemma 2. The function f is decreasing.
Proof. Consider x ă y. It holds that yf pgpyqq ` gpyqf pyq ď 2. Moreover, because y is the only
positive real number such that pgpyq, yq is a good pair and x ‰ y, we have xf pgpyqq`gpyqf pxq ą
2. Combining these two inequalities yields

xf pgpyqq ` gpyqf pxq ą 2 ě yf pgpyqq ` gpyqf pyq,

or f pgpyqqpx ´ yq ą gpyqpf pyq ´ f pxqq. Because gpyq and f pgpyqq are both positive while x ´ y
is negative, it follows that f pyq ă f pxq, showing that f is decreasing.
We now prove Lemma 1 using Lemma 2. Suppose that x ‰ y but xf pyq ` yf pxq ď 2.
As in the first solution, we get xf pxq ` xf pxq ą 2 and yf pyq ` yf pyq ą 2, which implies
xf pxq ` yf pyq ą 2. Now
xf pxq ` yf pyq ą 2 ě xf pyq ` yf pxq
implies px ´ yqpf pxq ´ f pyqq ą 0, which contradicts the fact that f is decreasing. So y “ x is
the unique y such that px, yq is a good pair, and in particular we have f pxq ď 1{x.
We can now conclude the proof as in any of the Solutions 1.x.

Solution 3.0. As in the other solutions we verify that the function f pxq “ 1{x is a solution.
We first want to prove the following lemma:
Lemma 3. For all x P Rą0 we actually have xf pgpxqq ` gpxqf pxq “ 2 (that is: the inequality
is actually an equality).
Shortlisted problems – solutions 13

Proof. We proceed by contradiction: Assume there exists some number x ą 0 such that for
y “ gpxq we have xf pyq ` yf pxq ă 2. Then for any 0 ă  ă 2´xf2f
pyq´yf pxq
pxq
we have, by uniqueness
of y, that xf py ` q ` py ` qf pxq ą 2. Therefore
2 ´ py ` qf pxq 2 ´ yf pxq ´ f pxq
f py ` q ą “
x x
2´xf pyq´yf pxq
2 ´ yf pxq ´ 2
ą
x
2 ´ xf pyq ´ yf pxq
“ ` f pyq ą f pyq. (1)
2x
Furthermore, for every such  we have gpy ` qf py ` q ` py ` qf pgpy ` qq ď 2 and
gpy ` qf pyq ` yf pgpy ` qq ą 2 (since y ‰ y `  “ gpgpy ` qq). This gives us the two
inequalities
2 ´ gpy ` qf py ` q 2 ´ gpy ` qf pyq
f pgpy ` qq ď and f pgpy ` qq ą .
y` y
Combining these two inequalities and rearranging the terms leads to the inequality
2 ă gpy ` qrpy ` qf pyq ´ yf py ` qs.
Moreover combining with the inequality (1) we obtain
„ ˆ ˙ „ 
2 ´ xf pyq ´ yf pxq 2 ´ xf pyq ´ yf pxq
2 ă gpy`q py ` qf pyq ´ y ` f pyq “ gpy`q f pyq ´ y .
2x 2x
We now reach the desired contradiction, since for  sufficiently small we have that the left
hand side is positive while the right hand side is negative.
With this lemma it then follows that for all x, y P Rą0 we have
xf pyq ` yf pxq ě 2,
since for y “ gpxq we have equality and by uniqueness for y ‰ gpxq the inequality is strict.
In particular for every x P Rą0 and for y “ x we have 2xf pxq ě 2, or equivalently f pxq ě 1{x
for all x P Rą0 . With this inequality we obtain for all x P Rą0
x gpxq
2 ě xf pgpxqq ` gpxqf pxq ě ` ě 2,
gpxq x
where the first inequality comes from the problem statement. Consequently each of these
inequalities must actually be an equality, and in particular we obtain f pxq “ 1{x for all x P Rą0 .

Solution 4. Again, let us prove that f pxq “ 1{x is the only solution. Let again gpxq be the
unique positive real number such that px, gpxqq is a good pair.
Lemma 4. The function f is strictly convex.
Proof. Consider the function qs pxq “ f pxq ` sx for some real number s. If f is not strictly
convex, then there exist u ă v and t P p0, 1q such that
f ptu ` p1 ´ tqvq ě tf puq ` p1 ´ tqf pvq.
Hence
qs ptu ` p1 ´ tqvq ě tf puq ` p1 ´ tqf pvq ` sptu ` p1 ´ tqvq
“ tqs puq ` p1 ´ tqqs pvq.
14 Oslo, Norway, 6th–16th July 2022

Let w “ tu`p1´tqv and consider the case s “ f pgpwqq{gpwq. For that particular choice of s,
the function qs pxq has a unique minimum at x “ w. However, since qs pwq ě tqs puq`p1´tqqs pvq,
it must hold qs puq ď qs pwq or qs pvq ď qs pwq, a contradiction.
Lemma 5. The function f is continuous.
Proof. Since f is strictly convex and defined on an open interval, it is also continuous.
As in Solution 1, we can prove that f pxq ď 1{x. If f pxq ă 1{x, then we consider the function
hpyq “ xf pyq ` yf pxq which is continuous. Since hpxq ă 2, there exist at least two distinct
z ‰ x such that hpzq ă 2 giving that px, zq is good pair for both values of z, a contradiction.
We conclude that f pxq “ 1{x as desired.

Comment. Lemma 5 implies Lemma 3, using an argument similar as in the end of Solution 4.
Shortlisted problems – solutions 15

A4. Let n ě 3 be an integer, and let x1 , x2 , ..., xn be real numbers in the interval r0, 1s.
Let s “ x1 ` x2 ` . . . ` xn , and assume that s ě 3. Prove that there exist integers i and j with
1 ď i ă j ď n such that
2j´i xi xj ą 2s´3 .
(Trinidad and Tobago)
Solution.
Let 1 ď a ă b ď n be such that 2b´a xa xb is maximal. This choice of a and b implies that
xa`t ď 2t xa for all 1 ´ a `ď t ď b ´ a ´ 1, and` similarly xb´t ď 2t xb for all b ´ n ď t ď b ´ a ` 1.
Now, suppose that xa P 2u`1 , 21u and xb P 2v`1 , 21v , and write xa “ 2´α , xb “ 2´β . Then
1
‰ 1

a`u´1 ˆ ˙
ÿ
u 1 1 1
xi ď 2 xa ` ` . . . ` a`u´1 ă 2u xa ď 1,
i“1
2 4 2
and similarly,
n ˆ ˙
ÿ
v 1 1 1
xi ď 2 xb ` ` . . . ` n´b`v ă 2v xb ď 1,
i“b´v`1
2 4 2
In other words, the sum of the xi ’s for i outside of the interval ra ` u, b ´ vs is strictly less than
2. Since the total sum is at least 3, and each term is at most 1, it follows that this interval
must have at least two integers. i.e., a ` u ă b ´ v. Thus, by bounding the sum of the xi for
i P r1, a ` us Y rb ´ v, ns like above, and trivially bounding each xi P pa ` u, b ´ vq by 1, we
obtain
s ă 2u`1 xa ` 2v`1 xb ` ppb ´ vq ´ pa ` uq ´ 1q “ b ´ a ` p2u`1´α ` 2v`1´β ´ pu ` v ` 1qq.
Now recall α P pu, u ` 1s and β P pv, v ` 1s, so applying Bernoulli’s inequality yields
2u`1´α ` 2v`1´β ´ u ´ v ´ 1 ď p1 ` pu ` 1 ´ αqqq ` p1 ` pv ` 1 ´ βqq ´ u ´ v ´ 1 “ 3 ´ α ´ β.
It follows that s ´ 3 ă b ´ a ´ α ´ β, and so
2s´3 ă 2b´a´α´β “ 2b´a xa xb .

Comment 1. It is not hard to see that the inequality is tight. Suppose that n “ 2k ` 1, and we set
xk`1 “ 1, xk “ xk`2 “ 12 ` 21k , and xk`1´t “ xk`1`t “ 21t . Then s “ 3 (so the right hand side is 1),
and
1 2
ˆ ˙
j´i 2 1
max 2 xi xj “ 2 ` ,
iăj 2 2k
which can be made arbitrarily close to 1. Note that s can be made larger by putting in more 1-s in
the middle (and this accommodates even n as well).

Comment 2. An alternative formulation of the problem is to show that there exists a positive
constant c (or find the best such c) such that
max 2j´i xi xj ą c2s .
iăj

The above shows that c “ 1{8 is the best possible. A somewhat simpler ending to the proof can be
given for c “ 1{32.
End of solution for c “ 1{32.
As in the original solution, we arrive at
s ă 2u`1 xa ` 2v`1 xb ` ppb ´ vq ´ pa ` uq ´ 1q “ b ´ a ` p2u`1´α ` 2v`1´β ´ pu ` v ` 1qq.
Now 2b´a xa xb ě 2b´a 2´u´1 2´v´1 , so it is enough to show s ´ 5 ă b ´ a ´ u ´ v ´ 2, or s ă b ´ a ´
u ´ v ` 3. The fact that u ` 1 ´ α ă 1 and v ` 1 ´ β ă 1 implies 2u`1´α ` 2v`1´β ă 4, and so
s ă b ´ a ` p2 ` 2 ´ u ´ v ´ 1q “ b ´ a ´ u ´ v ´ 3.
16 Oslo, Norway, 6th–16th July 2022

A5. Find all positive integers n ě 2 for which there exist n real numbers a1 ă ¨ ¨ ¨ ă an
and a real number r ą 0 such that the 12 npn ´ 1q differences aj ´ ai for 1 ď i ă j ď n are equal,
1
in some order, to the numbers r1 , r2 , . . . , r 2 npn´1q .
(Czech Republic)

Answer: n P t2, 3, 4u.

Solution. We first show a solution for each n P t2, 3, 4u. We will later show the impossibility
of finding such a solution for n ě 5.
For n “ 2, take for example pa1 , a2 q “ p1, 3q and r “ 2.
For n “ 3, take the root r ą 1 of x2 ´ x ´ 1 “ 0 (the golden ratio) and set pa1 , a2 , a3 q “
p0, r, r ` r2 q. Then

pa2 ´ a1 , a3 ´ a2 , a3 ´ a1 q “ pr, r2 , r ` r2 “ r3 q.

For n “ 4, take the root r P p1, 2q of x3 ´ x ´ 1 “ 0 (such a root exists because 13 ´ 1 ´ 1 ă 0


and 23 ´ 2 ´ 1 ą 0) and set pa1 , a2 , a3 , a4 q “ p0, r, r ` r2 , r ` r2 ` r3 q. Then

pa2 ´ a1 , a3 ´ a2 , a4 ´ a3 , a3 ´ a1 , a4 ´ a2 , a4 ´ a1 q “ pr, r2 , r3 , r4 , r5 , r6 q.

For n ě 5, we will proceed by contradiction. Suppose there exist numbers a1 ă ¨ ¨ ¨ ă an


and r ą 1 satisfying the conditions of the problem. We start with a lemma:
Lemma. We have rn´1 ą 2.
Proof. There are only n ´ 1 differences aj ´ ai with j “ i ` 1, so there exists an exponent e ď n
and a difference aj ´ ai with j ě i ` 2 such that aj ´ ai “ re . This implies

rn ě re “ aj ´ ai “ paj ´ aj´1 q ` paj´1 ´ ai q ą r ` r “ 2r,

thus rn´1 ą 2 as desired.


To illustrate the general approach, we first briefly sketch the idea behind the argument in
the special case n “ 5. In this case, we clearly have a5 ´ a1 “ r10 . Note that there are 3 ways
to rewrite a5 ´ a1 as a sum of two differences, namely

pa5 ´ a4 q ` pa4 ´ a1 q, pa5 ´ a3 q ` pa3 ´ a1 q, pa5 ´ a2 q ` pa2 ´ a1 q.

Using the lemma above and convexity of the function f pnq “ rn , we argue that those three
ways must be r10 “ r9 ` r1 “ r8 ` r4 “ r7 ` r6 . That is, the “large” exponents keep dropping
by 1, while the “small” exponents keep increasing by n ´ 2, n ´ 3, ..., 2. Comparing any two
such equations, we then get a contradiction unless n ď 4.
Now we go back to the full proof for any n ě 5. Denote b “ 21 npn ´ 1q. Clearly, we have
an ´ a1 “ rb . Consider the n ´ 2 equations of the form:

an ´ a1 “ pan ´ ai q ` pai ´ a1 q for i P t2, . . . , n ´ 1u.

In each equation, one of the two terms on the right-hand side must be at least 21 pan ´ a1 q.
But from the lemma we have rb´pn´1q “ rb {rn´1 ă 12 pan ´ a1 q, so there are at most n ´ 2
sufficiently large elements in trk | 1 ď k ă bu, namely rb´1 , . . . , rb´pn´2q (note that rb is already
used for an ´ a1 ). Thus, the “large” terms must be, in some order, precisely equal to elements
in
L “ trb´1 , . . . , rb´pn´2q u.
Next we claim that the “small” terms in the n ´ 2 equations must be equal to the elements
in
1
S “ trb´pn´2q´ 2 ipi`1q | 1 ď i ď n ´ 2u,
Shortlisted problems – solutions 17

in the corresponding order (the largest “large” term with the smallest “small” term, etc.). Indeed,
suppose that
rb “ an ´ a1 “ rb´i ` rαi for i P t1, . . . , n ´ 2u,
where 1 ď α1 ă ¨ ¨ ¨ ă αn´2 ď b ´ pn ´ 1q. Since r ą 1 and f prq “ rn is convex, we have

rb´1 ´ rb´2 ą rb´2 ´ rb´3 ą . . . ą rb´pn´3q ´ rb´pn´2q ,

implying
rα2 ´ rα1 ą rα3 ´ rα2 ą . . . ą rαn´2 ´ rαn´3 .
Convexity of f prq “ rn further implies

α2 ´ α1 ą α3 ´ α2 ą . . . ą αn´2 ´ αn´3 .

Note that αn´2 ´ αn´3 ě 2: Otherwise we would have αn´2 ´ αn´3 “ 1 and thus

rαn´3 ¨ pr ´ 1q “ rαn´2 ´ rαn´3 “ rb´pn´3q ´ rb´pn´2q “ rb´pn´2q ¨ pr ´ 1q,

implying that αn´3 “ b ´ pn ´ 2q, a contradiction. Therefore, we have

αn´2 ´ α1 “ pαn´2 ´ αn´3 q ` ¨ ¨ ¨ ` pα2 ´ α1 q


ě 2 ` 3 ` ¨ ¨ ¨ ` pn ´ 2q
1 1
“ pn ´ 2qpn ´ 1q ´ 1 “ npn ´ 3q.
2 2
On the other hand, from αn´2 ď b ´ pn ´ 1q and α1 ě 1 we get
1 1
αn´2 ´ α1 ď b ´ n “ npn ´ 1q ´ n “ npn ´ 3q,
2 2
implying that equalities must occur everywhere and the claim about the small terms follows.
Now, assuming n ´ 2 ě 2, we have the two different equations:

rb “ rb´pn´2q ` rb´pn´2q´1 and rb “ rb´pn´3q ` rb´pn´2q´3 ,

which can be rewritten as

rn´1 “ r ` 1 and rn`1 “ r4 ` 1. (1)

Simple algebra now gives

r4 ` 1 “ rn`1 “ rn´1 ¨ r2 “ r3 ` r2 ùñ pr ´ 1qpr3 ´ r ´ 1q “ 0.

Since r ‰ 1, using Equation (1) we conclude r3 “ r ` 1 “ rn´1 , thus n “ 4, which gives a


contradiction.
18 Oslo, Norway, 6th–16th July 2022

A6. Let R be the set of real numbers. We denote by F the set of all functions f : R Ñ R
such that
f px ` f pyqq “ f pxq ` f pyq
for every x, y P R. Find all rational numbers q such that for every function f P F, there exists
some z P R satisfying f pzq “ qz.
(Indonesia)

Answer: The desired set of rational numbers is n`1 : n P Z, n ‰ 0 .


(
n

Solution. Let Z be the set of all rational numbers q such that for every function f P F, there
exists some z P R satisfying f pzq “ qz. Let further
" *
n`1
S“ : n P Z, n ‰ 0 .
n

We prove that Z “ S by showing the two inclusions: S Ď Z and Z Ď S.


We first prove that S Ď Z. Let f P F and let P px, yq be the relation f px ` f pyqq “ f pxq `
f pyq. First note that P p0, 0q gives f pf p0qq “ 2f p0q. Then, P p0, f p0qq gives f p2f p0qq “ 3f p0q.
We claim that
f pkf p0qq “ pk ` 1qf p0q
for every integer k ě 1. The claim can be proved by induction. The cases k “ 1 and k “ 2
have already been established. Assume that f pkf p0qq “ pk ` 1qf p0q and consider P p0, kf p0qq
which gives ` ˘
f pk ` 1qf p0q “ f p0q ` f pkf p0qq “ pk ` 2qf p0q.
This proves the claim. We conclude that k`1
k
P Z for every integer k ě 1. Note that P p´f p0q, 0q
gives f p´f p0qq “ 0. We now claim that

f p´kf p0qq “ p´k ` 1qf p0q

for every integer k ě 1. The proof by induction is similar to the one above. We conclude that
´k`1
´k
P Z for every integer k ě 1. This shows that S Ď Z.
We now prove that Z Ď S. Let p be a rational number outside the set S. We want to prove
that p does not belong to Z. To that end, we construct a function f P F such that f pzq ‰ pz
for every z P R. The strategy is to first construct a function

g : r0, 1q Ñ Z

and then define f as f pxq “ gptxuq ` txu. This function f belongs to F. Indeed,

f px ` f pyqq “ gptx ` f pyquq ` tx ` f pyqu


“ gptx ` gptyuq ` tyuuq ` tx ` gptyuq ` tyuu
“ gptxuq ` txu ` gptyuq ` tyu
“ f pxq ` f pyq,

where we used that g only takes integer values.


Lemma 1. For every α P r0, 1q, there exists m P Z such that

m ` n ‰ ppα ` nq

for every n P Z.
Shortlisted problems – solutions 19

Proof. Note that if p “ 1 the claim is trivial. If p ‰ 1, then the claim is equivalent to the
existence of an integer m such that
m ´ pα
p´1
is never an integer. Assume the contrary. That would mean that both

m ´ pα pm ` 1q ´ pα
and
p´1 p´1
are integers, and so is their difference. The latter is equal to
1
.
p´1

Since we assumed p R S, 1{pp ´ 1q is never an integer. This is a contradiction.


Define g : r0, 1q Ñ Z by gpαq “ m for any integer m that satisfies the conclusion of Lemma
1. Note that f pzq ‰ pz if and and only if

gptzuq ` tzu ‰ pptzu ` tzuq

The latter is guaranteed by the construction of the function g. We conclude that p R Z as


desired. This shows that Z Ă S.
20 Oslo, Norway, 6th–16th July 2022

A7. For a positive integer n we denote by spnq the sum of the digits of n. Let P pxq “
xn ` an´1 xn´1 ` ¨ ¨ ¨ ` a1 x ` a0 be a polynomial, where n ě 2 and ai is a positive integer for all
0 ď i ď n ´ 1. Could it be the case that, for all positive integers k, spkq and spP pkqq have the
same parity?
(Belarus)

Answer: No. For any such polynomial there exists a positive integer k such that spkq and
spP pkqq have different parities.

Solution. With the notation above, we begin by choosing a positive integer t such that
# +
n´1
100 a n´1 a n´1 a n´1 a n´1
10t ą max 1 1 , 10n´1 , p10an´1 qn´1 , . . . , p10a0 qn´1 .
p10 n´1 ´9 q n´1 n´1 9 9 9

As a direct consequence of 10t being bigger than the first quantity listed in the above set,
we get that the interval
«ˆ 1
˙ n´1 ˆ 1
˙ n´1 ¸
9 1
I“ 10t , 10t`1
an´1 an´1

contains at least 100 consecutive positive integers.


Let X be a positive integer in I such that X is congruent to 1 mod 100. Since X P I we
have
9 ¨ 10t ď an´1 X n´1 ă 10t`1 ,
thus the first digit (from the left) of an´1 X n´1 must be 9.
Next, we observe that an´1 p10ai qn´1 ă 9 ¨ 10t ď an´1 X n´1 , thus 10ai ă X for all i, which
immediately implies that a0 ă a1 X ă ¨ ¨ ¨ ă an X n , and the number of digits of this strictly
increasing sequence forms a strictly increasing sequence too. In other words, if i ă j, the
number of digits of ai X i is less than the number of digits of aj X j .
Let α be the number of digits of an´1 X n´1 , thus 10α´1 ď an´1 X n´1 ă 10α . We are now
going to look at P p10α Xq and P p10α´1 Xq and prove that the sum of their digits has different
parities. This will finish the proof since sp10α Xq “ sp10α´1 Xq “ spXq.
We have P p10α Xq “ 10αn X n `an´1 10αpn´1q X n´1 `¨ ¨ ¨`a0 , and since 10αpi`1q ą 10αi an´1 X n´1 ą
10αi ai X i , the terms ai 10αi X i do not interact when added; in particular, there is no carryover
caused by addition. Thus we have spP p10α Xqq “ spX n q ` span´1 X n´1 q ` ¨ ¨ ¨ ` spa0 q.
We now look at P p10α´1 Xq “ 10pα´1qn X n ` an´1 10pα´1qpn´1q X n´1 ` ¨ ¨ ¨ ` a0 . Firstly, if
i ă n´1, then an´1 X n´1 has more digits than ai X i and an´1 X n´1 ě 10ai X i . It now follows that
10pα´1qpi`1q`1 ą 10pα´1qi an´1 X n´1 ě 10pα´1qi`1 ai X i , thus all terms 10pα´1qi ai X i for 0 ď i ď n´1
come in ‘blocks’, exactly as in the previous case.
Finally, 10pα´1qn`1 ą 10pα´1qpn´1q an´1 X n´1 ě 10pα´1qn , thus 10pα´1qpn´1q an´1 X n´1 has ex-
actly pα ´ 1qn ` 1 digits, and its first digit is 9, as established above. On the other hand,
10pα´1qn X n has exactly pα ´ 1qn zeros, followed by 01 (as X is 1 mod 100). Therefore, when
we add the terms, the 9 and 1 turn into 0, the 0 turns into 1, and nothing else is affected.
Putting everything together, we obtain

spP p10α´1 Xqq “ spX n q ` span´1 X n´1 q ` ¨ ¨ ¨ ` spa0 q ´ 9 “ spP p10α Xqq ´ 9,

thus spP p10α Xqq and spP p10α´1 Xqq have different parities, as claimed.
Shortlisted problems – solutions 21

A8. For a positive integer n, an n-sequence is a sequence pa0 , . . . , an q of non-negative


integers satisfying the following condition: if i and j are non-negative integers with i ` j ď n,
then ai ` aj ď n and aai `aj “ ai`j .
Let f pnq be the number of n-sequences. Prove that there exist positive real numbers c1 , c2
and λ such that
c1 λn ă f pnq ă c2 λn
for all positive integers n.
(Canada)

Answer: Such constants exist with λ “ 31{6 ; we will discuss appropriate values of c1 and c2 in
the solution below.

Solution. In order to solve this, we will give a complete classification of n-sequences.


Let k “ tn{2u. We will say that an n-sequence is large if ai ą k for some i, and small if no
such i exists. For now we will assume that pai q is not the identity sequence (in other words,
that ai ‰ i for some i).
Lemma 1. If ar “ as and r, s ă n, then ar`1 “ as`1 .
Proof. We have ar`1 “ aar `a1 “ aas `a1 “ as`1 .
Lemma 2. If i ď k, then ai ď k.
Proof. We have i ` i ď n, so ai ` ai ď n whence ai ď k.
Lemma 3. There exist r, s such that ar “ as and r ‰ s.
Proof. If a0 ‰ 0 then a2a0 “ a0 . Otherwise, aai “ ai for all i, so take i such that ai ‰ i (which
we can do by our earlier assumption).
Lemma 4. Let r be the smallest index such that as “ ar for some s ą r, and let d be the
minimum positive integer such that ar`d “ ar . Then

1. The subsequence par , ar`1 , . . . , an q is periodic with minimal period d. That is, for u ă v,
we have au “ av if and only if u, v ě r and d | v ´ u.

2. ai “ i for i ă r and ai ě r for i ě r.

In this case we say pai q has period d and offset r.


Proof. We prove each in turn:

1. The “if” implication is clear from Lemma 1. For the reverse direction, suppose au “ av .
Then there are integers r ď u0 , v0 ă r ` d such that d | u ´ u0 , v ´ v0 , so au0 “ au “ av “
av0 . If u0 ă v0 then ar`d`u0 ´v0 “ ar`d “ ar , contradicting the minimality of d. There is
a similar contradiction when u0 ą v0 . Thus u0 “ v0 , so d | u ´ v.

2. If r “ 0 there is nothing to prove. Otherwise a0 “ a2a0 so 2a0 “ 0. Then we have aai “ ai


for all i, so ai “ i for i ă r.

Lemma 5. Either

1. d | ai ´ i for all i, or

2. r “ 0 and d | ai ´ i ´ d{2 for all i.


22 Oslo, Norway, 6th–16th July 2022

Proof. Note that Lemma 4 tells us that if au “ av then d | u ´ v. Since aai `a0 “ ai for all i, we
have d | ai ´ i ` a0 . For i “ 0, this means that d | 2a0 . If d | a0 then that means that d | ai ´ i
for all i. Otherwise, if d - a0 , then d | a0 ´ d{2 and thus d | ai ´ i ´ d{2 for all i. In addition,
part 2 of Lemma 4 says that we must have r “ 0 in this case.
Lemma 6. If d is even and d | a0 ´ d{2, then pai q is small. (Note that we must have r “ 0 in
this case.)
Proof. Note that if d ď k ` 1, then by Lemma 2, pa0 , . . . , ad´1 q is a period for the sequence
consisting of elements at most k, so pai q must be small. Now suppose d ą k ` 1. We show that
ai ď k for all i by induction. Note that Lemma 2 already establishes this for i ď k. We must
have d | ad{2 and ad{2 ď k ă d so ad{2 “ 0. Thus, for i ą k, if aj ď k for j ă i, then ai´d{2 ď k,
so ai “ api´d{2q`d{2 “ aai´d{2 ď k.
Lemma 7. If pai q is small, then r ` d ď k ` 1.
Proof. Since pai q is small, there exists u, v ď k ` 1 such that u ă v and au “ av . Thus u ď r
and d | v ´ u, so r ` d ď v ď k ` 1.
Lemma 8. If pai q is large, then r ` d ą k ` 1 and ai “ i for all 0 ď i ă r ` d.
Proof. Since pai q is large and has period d and offset r, the period par , . . . , ar`d´1 q must have
an element that is larger than k, so by Lemma 2 we must have r ` d ´ 1 ą k.
We already have ai “ i for i ă r. Now we show that ai “ i for r ď i ď k. By Lemma 6 we
have d | ai ´ i but r ď i ď k. Since k ´ r ` 1 ą d, this means that ai “ i for i ď k.
Finally, one can show inductively that ai “ i for k ă i ă r ` d. Indeed, if aj “ j for all
j ă i, then ai ě i (otherwise ai “ aj for some j ă i, but then r ď j and i ă r ` d means that
d - j ´ i.) However, ai ` pn ´ iq “ ai ` an´i ď n, so ai “ i.
Thus large sequences are determined by r and d. It is not hard to check that all sequences
of the form ai “ i for i ă r ` d and with period d and offset r are n-sequences. There are
pn ´ k ´ 1qpn ` k ` 2q{2 possible choices of pr, dq where 0 ď r ă n, d ě 1, and k ` 1 ă r ` d ď n.
For small sequences, for a given period d and offset r, we need to choose the period
par , . . . , ar`d´1 q satisfying r ď aj ď k and d | aj ´ j for r ď j ă r ` d. There are gpk ` 1 ´ r, dq
such choices, where we define gpx, dq to be pp ` 1qq pd´q with p “ tx{du and q “ x ´ dp.
Furthermore, if d is even then there are gpk ` 1, dq choices for the period pa0 , . . . , ad´1 q
satisfying d | aj ´ j ´ d{2 for j ă d. Again it is not hard to check that, once these choices are
made, then the resulting sequence is an n-sequence.
Thus the total number of n-sequences is
tpk`1q{2u k k`1´r
pn ´ k ´ 1qpn ` k ` 2q ÿ ÿ ÿ
f pnq “ 1 ` ` gpk ` 1, 2d1 q ` gpk ` 1 ´ r, dq. (1)
2 d1 “1 r“0 d“1

Now, to show that f pnq ą c1 λn for some c1 , we note that


ˆ Z ^˙
k`1
f pnq ą g k ` 1, ě 3tpk`1q{3u ą 3n{6 ´ 1.
3

To show that f pnq ă c2 λn for some c2 , it actually suffices to show that there is a positive real
number c3 such that for all positive integers x,
x
ÿ
gpx, dq ď c3 3x{3 .
d“1

In fact, the following lemma suffices, as it bounds the left hand side of the above inequality by
a pair of geometric series with initial term 3x{3 :
Shortlisted problems – solutions 23

Lemma. For positive d, x, we have:


# ` 64 ˘x{3´d
3x{3 , if d ď x{3;
gpx, dq ď ` 81˘
x{3 8 d´x{3
3 9
, if d ě x{3.

Proof. There are a few key observations needed, all of which are immediate from the definition:

• px, dq is the maximum product of a sequence of d integers that sums to x.

• For any positive integer k, we have gpkx, kdq “ gpx, dqk .

• If 2d ď x ď 3d, then gpx, dq “ 23d´x 3x´2d . Likewise, if 3d ď x ď 4d then gpx, dq “


34d´x 4x´3d .

With these observations, if d ď x{3, then

34px´3dq gp3x, 3dq ď gp3x ` 12px ´ 3dq, 3d ` 4px ´ 3dqq “ gp15x ´ 36d, 4x ´ 9dq

To calculate gp15x ´ 36d, 4x ´ 9dq, note that

3p4x ´ 9dq “ 12x ´ 27d ď15x ´ 36d,


4p4x ´ 9dq “ 16x ´ 36d ě15x ´ 36d,

so
gp15x ´ 36d, 4x ´ 9dq “ 34p4x´9dq´p15x´36dq 4p15x´36dq´3p4x´9dq “ 3x 43px´3dq .
Thus ˆ ˙x´3d
3 34px´3dq gp3x, 3dq 3x 43px´3dq 64
gpx, dq “ gp3x, 3dq “ ď “ 3x ,
34px´3dq 34px´3dq 81
which completes the proof of the first claim. Likewise, if d ě x{3,

32p3d´xq gp3x, 3dq3 ď gp3x ` 6p3d ´ xq, 3d ` 2p3d ´ xqq “ gp18d ´ 3x, 9d ´ 2xq.

Again we have

2p9d ´ 2xq ď 18 ´ 3x ď 18 ´ 3x ` 3p3d ´ xq “ 3p9d ´ 2xq,

so
gp18d ´ 3x, 9d ´ 2xq “ 23p9d´2xq´p18d´3xq 3p18d´3xq´2p9d´2xq “ 23p3d´xq 3x .
Thus x ˆ ˙3d´x
3 23p3d´xq gp3x, 3dq 23p3d´xq3 8
gpx, dq “ gp3x, 3dq “ ď “ 3x ,
32p3d´xq 32p3d´xq 9
from which the second claim follows.

Common remarks. The best possible value of c1 is constrained by n “ 1: in this case,


f p1q “ 2, which means that c1 ą 2 ¨ 3´1{6 « 1.66537.
With a careful analysis one can show that the best possible value of c2 is 236567
4930
31{3 «
69.20662.
24 Oslo, Norway, 6th–16th July 2022

Combinatorics
C1. A ˘1-sequence is a sequence of 2022 numbers a1 , . . . , a2022 , each equal to either `1 or
´1. Determine the largest C so that, for any ˘1-sequence, there exists an integer k and indices
1 ď t1 ă . . . ă tk ď 2022 so that ti`1 ´ ti ď 2 for all i, and
k
ÿ
ati ě C.
i“1

(Czech Republic)

Answer: The answer is C “ 506.

Solution. First, we prove that this can always be achieved. Without loss of generality, suppose
at least 2022
2
“ 1011 terms of the ˘1-sequence are `1. Define a subsequence as follows: starting
at t “ 0, if at “ `1 we always include at in the subsequence. Otherwise, we skip at if we can
(i.e. if we included at´1 in the subsequence), otherwise we include it out of necessity, and go
to the next t. Clearly, this subsequence will include all `1s. Also, for each ´1 included in the
sequence, a ´1 must have been skipped, so at most t 1011 2
u “ 505 can be included. Hence the
sum is at least 1011 ´ 505 “ 506, as desired.
Next, we prove that, for the ˘1-sequence

pt´1u, t`1, `1u, t´1, ´1u, t`1, `1u, . . . , t`1, `1u, t´1, ´1u, t`1uq,

each admissible subsequence ati has ´506 ď i ati ď 506. We say that the terms inside each
ř
curly bracket is a block. In total, there are 1012 blocks - 506 of them hold `1-s, and 506 of
them hold ´1s. (The two blocks at each end hold 1 number each, each other block holds 2.)
Suppose an admissible subsequence includes terms from k blocks holding `1-s. Then, in
each ´1-pair in between the `1-pairs, the subsequence must also include at least one ´1. There
can be at most two `1s included from each `1-block, and at least one ´1 must be included
from each ´1-block, so the sum is at most 2k ´ pk ´ 1q “ k ` 1.
For k ă 506, this is at most 506. If k “ 506, one of the `1-blocks must be the one at the
end, meaning it can only include one `1, so that the maximum in this case is only k, not k ` 1,
so in this case the sum is also at most 506.
Hence we have shown ř that for any admissible subsequence, i ati ď 506. Analogously we
ř
can show that ´506 ď i ati , meaning that C ď 506 as desired.

Comment. A possible reformulation of the problem is the following.

2022 buckets of water are arranged in a row, each coloured either red or blue. Sally the
salmon plays a game in the following way: first, she chooses any bucket she likes to start
in. Then, any number of times she may jump either to the next bucket in the row, or
across it to land in the bucket after that. (She may not jump across more than one bucket.)
At any point, she may finish the game. At that time, her score is the absolute value of
the difference between the number of red and blue buckets she visited during the game.
Determine the largest C so that no matter how the buckets are coloured, Sally can achieve
a score of at least C.
Shortlisted problems – solutions 25

C2. The Bank of Oslo issues coins made out of two types of metal: aluminium (denoted
A) and copper (denoted C). Morgane has n aluminium coins, and n copper coins, and arranges
her 2n coins in a row in some arbitrary initial order. Given a fixed positive integer k ď 2n, she
repeatedly performs the following operation: identify the largest subsequence containing the
k-th coin from the left which consists of consecutive coins made of the same metal, and move
all coins in that subsequence to the left end of the row. For example, if n “ 4 and k “ 4, the
process starting from the configuration AACCCACA would be

AACCCACA Ñ CCCAAACA Ñ AAACCCCA Ñ CCCCAAAA Ñ ¨ ¨ ¨ .

Find all pairs pn, kq with 1 ď k ď 2n such that for every initial configuration, at some point
of the process there will be at most one aluminium coin adjacent to a copper coin.
(France)

Answer: All pairs pn, kq such that n ď k ď 3n`1


2
.

Solution. Define a block to be a maximal subsequence of consecutive coins made out of the
same metal, and let M b denote a block of b coins of metal M . The property that there is at
most one aluminium coin adjacent to a copper coin is clearly equivalent to the configuration
having two blocks, one consisting of all A-s and one consisting of all C-s.
First, notice that if k ă n, the sequence An´1 C n´1 AC remains fixed under the operation,
and will therefore always have 4 blocks. Next, if k ą 3n`1
2
, let a “ k ´ n ´ 1, b “ 2n ´ k ` 1.
Then k ą 2a ` b, k ą 2b ` a, so the configuration A C A C will always have four blocks:
a b b a

Aa C b Ab C a Ñ C a Aa C b Ab Ñ Ab C a Aa C b Ñ C b Ab C a Aa Ñ Aa C b Ab C a Ñ . . .
Therefore a pair pn, kq can have the desired property only if n ď k ď 3n`1
2
. We claim that all
such pairs in fact do have the desired property. Clearly, the number of blocks in a configuration
cannot increase, so whenever the operation is applied, it either decreases or remains constant.
We show that unless there are only two blocks, after a finite amount of steps the number of
blocks will decrease.
Consider an arbitrary configuration with c ě 3 blocks. We note that as k ě n, the leftmost
block cannot be moved, because in this case all n coins of one type are in the leftmost block,
meaning there are only two blocks. If a block which is not the leftmost or rightmost block is
moved, its neighbor blocks will be merged, causing the number of blocks to decrease.
Hence the only case in which the number of blocks does not decrease in the next step is if
the rightmost block is moved. If c is odd, the leftmost and the rightmost blocks are made of
the same metal, so this would merge two blocks. Hence c ě 4 must be even. Suppose there is a
configuration of c blocks with the i-th block having size ai so that the operation always moves
the rightmost block:

Aa1 . . . Aac´1 C ac Ñ C ac Aa1 . . . Aac´1 Ñ Aac´1 C ac Aa1 . . . C ac´2 Ñ . . .

Because the rightmost block is always moved, for all Because


ř
k ě 2n ` 1 ´ a i i. ai “ 2n,
summing this over all i we get ck ě 2cn ` c ´ ai “ 2cn ` c ´ 2n, so k ě 2n ` 1 ´ c ě 3n
2n
ř
2
` 1.
But this contradicts k ď 2 . Hence at some point the operation will not move the rightmost
3n`1

block, meaning that the number of blocks will decrease, as desired.


26 Oslo, Norway, 6th–16th July 2022

C3. In each square of a garden shaped like a 2022 ˆ 2022 board, there is initially a tree
of height 0. A gardener and a lumberjack alternate turns playing the following game, with the
gardener taking the first turn:

• The gardener chooses a square in the garden. Each tree on that square and all the
surrounding squares (of which there are at most eight) then becomes one unit taller.

• The lumberjack then chooses four different squares on the board. Each tree of positive
height on those squares then becomes one unit shorter.

We say that a tree is majestic if its height is at least 106 . Determine the largest number K
such that the gardener can ensure there are eventually K majestic trees on the board, no matter
how the lumberjack plays.
(Colombia)
20222
Answer: K “ 5 ¨ 9
“ 2271380. In general, for a 3N ˆ 3N board, K “ 5N 2 .

Solution. We solve the problem for a general 3N ˆ 3N board. First, we prove that the
lumberjack has a strategy to ensure there are never more than 5N 2 majestic trees. Giving the
squares of the board coordinates in the natural manner, colour each square where at least one
of its coordinates are divisible by 3, shown below for a 9 ˆ 9 board:

Then, as each 3 ˆ 3 square on the board contains exactly 5 coloured squares, each move of
the gardener will cause at most 4 trees on non-coloured squares to grow. The lumberjack may
therefore cut those trees, ensuring no tree on a non-coloured square has positive height after
his turn. Hence there cannot ever be more majestic trees than coloured squares, which is 5N 2 .
Next, we prove the gardener may ensure there are 5N 2 majestic trees. In fact, we prove
this statement in a modified game which is more difficult for the gardener: on the lumberjack’s
turn in the modified game, he may decrement the height of all trees on the board except those
the gardener did not just grow, in addition to four of the trees the gardener just grew. Clearly,
a sequence of moves for the gardener which ensures that there are K majestic trees in the
modified game also ensures this in the original game.
Shortlisted problems – solutions 27

Let M “ 95 ; we say that a map is one of the M possible ways to mark 5 squares on a

3 ˆ 3 board. In the modified game, after the gardener chooses a 3 ˆ 3 subboard on the board,
the lumberjack chooses a map in this subboard, and the total result of the two moves is that
each tree marked on the map increases its height by 1, each tree in the subboard which is not
in the map remains unchanged, and each tree outside the subboard decreases its height by 1.
Also note that if the gardener chooses a 3 ˆ 3 subboard M l times, the lumberjack will have to
choose some map at least l times, so there will be at least 5 trees which each have height ě l.
The strategy for the gardener will be to divide the board into N 2 disjoint 3 ˆ 3 subboards,
number them 0, . . . , N 2 ´ 1 in some order. Then, for b “ N 2 ´ 1, . . . , 0 in order, he plays
106 M pM ` 1qb times on subboard number b. Hence, on subboard number b, the moves on that
subboard will first ensure 5 of its trees grows by at least 106 pM ` 1qb , and then each move
after that will decrease their heights by 1. (As the trees on subboard b had height 0 before
the gardener started playing there, no move made on subboards ě b decreased their heights.)
As the gardener makes 106 M pM ` 1qb´1 ` . . . “ 106 ppM ` 1qb ´ 1q moves after he finishes
playing on subboard b, this means that on subboard b, there will be 5 trees of height at least
106 pM ` 1qb ´ 106 ppM ` 1qb ´ 1q “ 106 , hence each of the subboard has 5 majestic trees, which
was what we wanted.
28 Oslo, Norway, 6th–16th July 2022

C4.
Let n ą 3 be a positive integer. Suppose that n children are arranged in a circle, and n
coins are distributed between them (some children may have no coins). At every step, a child
with at least 2 coins may give 1 coin to each of their immediate neighbours on the right and
left. Determine all initial distributions of coins from which it is possible that, after a finite
number of steps, each child has exactly one coin.
(Israel)
n
Answer: All distributions where npn`1q
pmod nq, where ci denotes the number of coins
ř
ici “ 2
i“1
the i-th child starts with.

Solution 1.
Number the children 1, . . . , n, and denote the number of coins the i-th child has by ci . A
step of this process consists of reducing some ci by 2, and increasing ci´1 , ci`1 by 1. (Indices
n
are considered pmod nq.) Because pi ´ 1q ´ 2i ` pi ` 1q “ 0, the quantity ici pmod nq will
ř
i“1
be invariant under this process. Hence a necessary condition for the children to end up with
an uniform distribution of coins is that
n
ÿ npn ` 1q
ici “ pmod nq.
i“1
2

We will show that this condition is also sufficient. Consider an arbitrary initial distribution
of coins. First, whenever child i has more than one coin and i ‰ n, have child i pass coins to its
neighbors. (Child i does nothing.) Then, after some amount of such steps, it must eventually
become impossible to do any more steps becauseř no child except perhaps child i has more than
1 coin. (To see this, consider e.g. the quantity i“1 n´1 2
i ci , which (as pi ´ 1q2 ` pi ` 1q2 ą 2i2 )
increases at each step.)
Hence we can reach a state of the form pz1 , . . . , zn´1 , M q, where zi “ 0 or 1. Call such states
semi-uniform states of irregularity M .
k ones
hkkikkj k ones
hkkikkj
Lemma. If there is a string of children having coins a, 1, ... , 1, b, 1, ... , 1, c, with b ě 2, after some
k ones
hkkikkj k ones
hkkikkj
sequence of steps we may reach the state a ` 1, 1, ... , 1, b ´ 2, 1, ... , 1, c ` 1. We call performing
this sequence of steps long-passing coins.
Proof. This is simply repeated application of the operation. We prove the lemma by induction
on k. For k “ 0, this is just the operation of the problem. If k “ 1, have the child with b
coins pass coins, then both of their neighbors pass coins, then the child with b coins pass coins
again. For k ě 2, first, have the child with b coins pass coins, then have both their neigbors
send coins, giving the state
k´2 ones
hkkikkj k´2 ones
hkkikkj
a, 1, ... , 1, 2, 0, b, 0, 2, 1, ... , 1, c.
Now set aside the children with a, b and c coins, and have each child with 2 coins give them to
their neighbors until there are no such children remaining. This results in the state
k´2 ones
hkkikkj k´2 ones
hkkikkj
a ` 1, 0, 1, ... , 1, b, 1, ... , 1, 0, c ` 1.

By the induction hypothesis, we can have the child with b coins may pass a coin to each of the
children with 0 coins, proving the lemma. l
Shortlisted problems – solutions 29

Claim. We can reach a semi-uniform state of irregularity M ď 2.


Proof. If M ą 3, because there are only n coins in total, there must be at least two children
with 0 coins. Consider the arc of the circle spanned by the two such children closest to the
child with M coins. It has the form

a ones
hkkikkj b ones
hkkikkj
0, 1, ... , 1, M, 1, ... , 1, 0

If a “ b, applying the previous lemma we can have the child with M coins long-pass a coin
to each of the children with 0 coins, which yields a semi-uniform state with lower M . Otherwise,
WLOG a ą b, so we can have the child with M coins long-pass a coin to each of the children
at distance b from it, reaching a state of the form (α :“ a ´ b ´ 1, β :“ b)

α ones
hkkikkj β ones
hkkikkj c ones
hkkikkj
0, 1, ... , 1, 2, 1, ... , 1, M ´ 2, 1, ... , 1

The children in the rightmost string of ones need make no further moves, so consider only
the leftmost string. If α ă β, have the child with 2 coins long-pass coins to the child with
0 coins to its left and some child with 1 coin to its right, reaching a new state of the form
α ones
hkkikkj β ones
hkkikkj
0, 1, ... , 1, 2, 1, ... , 1, M ´ 2 with a smaller β. As β cannot decrease indefinitely, eventually
α ě β. If α “ β, have the child with 2 coins long-pass to the child with M coins and the child
with 0 coins, reaching a semi-uniform state of irregularity M ´ 1 as desired. Otherwise, α ă β,
so have the child with 2 coins long-pass to the child with M coins and a child with 1 coin,
reaching a state of the form

x ones
hkkikkj y ones
hkkikkj z ones
hkkikkj
0, 1, ... , 1, 2, 1, ... , 1, 0, 1, ... , 1, M ´ 1

Now, consider only the substring between the two children with 0 coins, which has the form
x ones
hkkikkj y ones
hkkikkj
0, 1, ... , 1, 2, 1, ... , 1, 0. Repeatedly have the child in this substring with 2 coins long-pass to the
closest child with 0 coins and some other child. If the other child has 1 coin, we have a new
x ones
hkkikkj y ones
hkkikkj
strictly shorter substring of the form 0, 1, ... , 1, 2, 1, ... , 1, 0. Hence eventually it must happen
that the other child also has 0 coins, at which point we reach a semi-uniform state of irregularity
M ´ 1, proving the claim. l
We have now shown that we can reach a semi-regular state of irregularity M ď 2, If M “ 1,
each child must have one coin, as desired. Otherwise, we must have M “ 2, so there is one
child with 0 coins, one child with 2 coins, and the remaining children all have 1 coin. Recall
that the state we started with satisfied the invariant

n
ÿ npn ` 1q
ici “ pmod nq
i“1
2

Because each step preserves this invariant, this must also be true of the current state.
Number the children so that the child with M ˆ coins is child
˙ number n, and suppose the child
n n
with 0 coins is child k. Then npn`1q 1 ¨ ci ´ k “ npn`1q ´ k pmod nq, so k “ 0
ř ř
2
“ ici “ 2
i“1 i“1
pmod nq. But this is impossible, as no child except the child with M coins has an index divisible
by n. Hence we cannot end up in a semi-regular state of irregularity 2, so we are done.
30 Oslo, Norway, 6th–16th July 2022

Solution 2. Encode the sequence ci as a polynomial ppxq “ i ai xi . The cyclic nature of the
ř
problem makes it natural to work modulo xn ´ 1. Child i performing a step is equivalent to
adding xi px ´ 1q2 to the polynomial, and we want to reach the polynomial qpxq “ 1 ` x ` . . . `
xn´1 . Since we only add multiples of px ´ 1q2 , this is only possible if ppxq “ qpxq modulo the
ideal generated by xn ´ 1 and px ´ 1q2 , i.e.
ˆ n ˙
n 2 x ´1
px ´ 1, px ´ 1q q “ px ´ 1q , x ´ 1 “ px ´ 1q ¨ pn, px ´ 1qq
x´1
This is equivalent to pp1q “ qp1q (which simply translates to the condition that there are n
coins) and p1 p1q “ q 1 p1q pmod nq, which translates to the invariant described in solution 1.
Shortlisted problems – solutions 31

C5. Let m, n ě 2 be integers, let X be a set with n elements, and let X1 , X2 , . . . , Xm


be pairwise distinct non-empty, not necessary disjoint subsets of X. A function f : X Ñ
t1, 2, . . . , n ` 1u is called nice if there exists an index k such that
ÿ ÿ
f pxq ą f pxq for all i ‰ k.
xPXk xPXi

Prove that the number of nice functions is at least nn .


(Germany)

Solution. For a subset Y Ď X, we write f pY q for yPY f pyq. Note that a function f : X Ñ
ř
t1, . . . , n ` 1u is nice, if and only if f pXi q is maximized by a unique index i P t1, . . . , mu.
We will first investigate the set F of functions f : X Ñ t1, . . . , nu; note that |F| “ nn .
For every function f P F, define a corresponding function f ` : X Ñ t1, 2, . . . , n ` 1u in the
following way: Pick some set Xl that maximizes the value f pXl q.

• For all x P Xl , define f ` pxq “ f pxq ` 1.

• For all x P XzXl , define f ` pxq “ f pxq.

Claim. The resulting function f ` is nice.


Proof. Note that f ` pXi q “ f pXi q ` |Xi X Xl | holds for all Xi . We show that f ` pXi q is
maximized at the unique index i “ l. Hence consider some arbitrary index j ‰ l. Then
Xl Ă Xj is impossible, as this would imply f pXj q ą f pXl q and thereby contradict the choice
of set Xl ; this in particular yields |Xl | ą |Xj X Xl |.

f ` pXl q “ f pXl q ` |Xl | ě f pXj q ` |Xl | ą f pXj q ` |Xj X Xl | “ f ` pXj q

The first inequality follows since Xl was chosen to maximize the value f pXl q. The second
(strict) inequality follows from |Xl | ą |Xj X Xl | as observed above. This completes the proof
of the claim. l
Next observe that function f can be uniquely reconstructed from f : the claim yields that
`

f has a unique maximizer Xl , and by decreasing the value of f ` on Xl by 1, we get we can fully
`

determine the values of f . As each of the nn functions f P F yields a (unique) corresponding


nice function f ` : X Ñ t1, 2, . . . , n ` 1u, the proof is complete.
32 Oslo, Norway, 6th–16th July 2022

C6. Let n be a positive integer. We start with n piles of pebbles, each initially containing
a single pebble. One can perform moves of the following form: choose two piles, take an equal
number of pebbles from each pile and form a new pile out of these pebbles. For each positive
integer n, find the smallest number of non-empty piles that one can obtain by performing a
finite sequence of moves of this form.
(Croatia)

Answer: 1 if n is a power of two, and 2 otherwise.

Solution 1. The solution we describe is simple, but not the most effective one.
We can combine two piles of 2k´1 pebbles to make one pile of 2k pebbles. In particular,
given 2k piles of one pebble, we may combine them as follows:

2k piles of 1 pebble Ñ 2k´1 piles of 2 pebbles


2k´1 piles of 2 pebbles Ñ 2k´2 piles of 4 pebbles
2k´2 piles of 4 pebbles Ñ 2k´3 piles of 8 pebbles
..
.
2 piles of 2k´1 pebbles Ñ 1 pile of 2k pebbles

This proves the desired result in the case when n is a power of 2.


If n is not a power of 2, choose N such that 2N ă n ă 2N `1 . Let m “ n ´ 2N . Then
0 ă m ă 2N . Make a pile of 2N pebbles and call it the large pile. (Alternatively, one can
be more efficient and make a pile of 2M pebbles where m ď 2M .) Since n is not a power of
two, there is at least one other pile with pebbles. All other piles have a single pebble (initial
condition).
Choose one single pebble pile and remove the pebble and one pebble from the large pile and
form a pile of 2 pebbles. If m ă 2N ´ 1, remove another pebble from the large pile and one
pebble from the 2-pile and form a new pile of 2 pebbles. Repeat until the large pile contains
exactly m pebbles.
At this point we have one pile of m pebbles, one pile of 2 pebbles, and the rest are single
pebble piles. There must be n ´ m ´ 2 “ 2N ´ 2 single piles. Combine two and two into piles
of two pebbles. Then there are 2N ´1 piles of two pebbles, which we can make into one pile of
2N pebbles. We are left with exactly two piles of pebbles.
Lastly we will prove that it is not possible to form a single pile with all pebbles when n is
not a power of two. A move consists of choosing two piles of say a and b pebbles, then removing
c ď minpa, bq pebbles from both piles, and forming a new pile with 2c pebbles. If we include
piles of zero pebbles, then this move changes the number of pebbles in three piles as follows
(and leaves all other piles unchanged):

a Ñ a´c
b Ñ b´c
0 Ñ 2c

Assume that after the move the number of pebbles in each pile is divisible by an odd integer
m. In particular, m | 2c, m | a ´ c and m | b ´ c. Since m is odd, it follows that m | c, and then
that m | a and m | b. Hence also before the move the number of pebbles in each pile is divisible
by the integer m.
If n is not a power of 2, then n is divisible by an odd integer m ą 1. In order to make
a single pile of n pebbles, we would have to start with a distribution in which the number of
pebbles in each pile is divisible by the integer m. This is impossible when we start with all
piles containing a single pebble.
Shortlisted problems – solutions 33

Remarks on starting configurations From any starting configuration that is not a single
pile, if there are at least two piles with at least two pebbles, we can remove one pebble from
two such piles, and form a new pile with 2 pebbles. We can repeat this until we have one pile
of 2 pebbles and the rest are single pebble piles, and then proceed as in the solution. Hence, if
n is a power of two, we can make a single pile from any starting configuration.
If n is of the form n “ 2k m where m ą 1 is odd, then we can make a single pile from any
starting configuration in which the number of pebbles in each pile is divisible by the integer
m, otherwise two piles is the best we can do. Half of this is proven already. For the other half,
assume we start with a configuration in which the number of pebbles in each pile is divisible by
the integer m. Replace each pile of tm pebbles with a pile of t boulders. We now have a total
of 2k boulders, hence we can make them into one pile of 2k boulders. Replacing the boulders
with pebbles again, we are done.

Solution 2. We show an alternative strategy if n is not a power of 2. Write n in binary form:


n “ 2i1 ` 2i2 ` ¨ ¨ ¨ ` 2ik , where i1 ą i2 ą ¨ ¨ ¨ ą ik . Now we make piles of sizes 2i1 , 2i2 , . . . , 2ik .
We call the pile with 2i1 the large pile, all the others are the small piles.
The strategy is the following: take the two smallest small pile. If they have the same size
of 2a , we make a pile of size 2a`1 . If they have different sizes, we double the smaller pile using
the large pile (we allow the large pile to have a negative number of pebbles: later we prove
that it is not possible). We call all the new piles small. When we have only one small pile, we
terminate the process: we have at most 2 piles.
After each move we have one less number of piles, and all the piles have cardinality power
of 2. The number of pebbles is decreasing, and at the end of the process, it has a size of
n ´ 2i2 `1 ě n ´ 2i1 ą 0, thus we can manage to have two piles.

Solution 3. Throughout the solution, we will consider the moves in reverse order. Namely,
imagine we have some piles of pebbles, and we are allowed to perform moves as follows: take a
pile with an even number of pebbles, split it into two equal halves and add the pebbles from
each half to a different pile, possibly forming new piles (we may assume for convenience that
there are infinitely many empty piles at any given moment). Given a configuration of piles C,
we will use |C| to denote the number of non-empty piles in C. Given two configurations C1 , C2 ,
we will say that C2 is reachable from C1 if C2 can be obtained by performing a finite sequence
of moves starting from C1 . Call a configuration of piles C

• simple if each (non-empty) pile in C consists of a single pebble;

• good if at least one (non-empty) pile in C has an even number of pebbles and the numbers
of pebbles on the piles in C have no non-trivial odd common divisor (C has the odd divisor
property);

• solvable if there exists a simple configuration which is reachable from C.

The problem asks to find the smallest number of non-empty piles in a solvable configuration
consisting of n pebbles. We begin the process of answering this question by making the following
observation:
Lemma 1. Let C be a configuration of piles. Let C 1 be a configuration obtained by applying a
single move to C. Then

(i) if C 1 has the odd divisor property, then so does C;

(ii) the converse to (i) holds if |C 1 | ě |C|.


34 Oslo, Norway, 6th–16th July 2022

Proof. Suppose that the move consists of splitting a pile of size 2a and adding a pebbles to each
of two piles of sizes b and c. Here, a is a positive integer and b, c are non-negative integers.
Thus, C 1 can be obtained from C by replacing the piles of sizes 2a, b, c by two piles of sizes
a ` b and a ` c. Note that the extra assumption |C 1 | ě |C| of part (ii) holds if and only if at
least one of b, c is zero.
(i) Suppose C doesn’t have the odd divisor property, i.e. there exists an odd integer d ą 1
such that the size of each pile in C is divisible by d. In particular, 2a, b, c are multiples of d,
so since d is odd, it follows that a, b, c are all divisible by d. Thus, a ` b and a ` c are also
divisible by d, so d divides the size of each pile in C 1 . In conclusion, C 1 doesn’t have the odd
divisor property.
(ii) If C 1 doesn’t have the odd divisor property and at least one of b, c is zero, then there
exists an odd integer d ą 1 such that the size of each pile in C 1 is divisible by d. In particular,
d divides a ` b and a ` c, so since at least one of these numbers is equal to a, it follows that d
divides a. But then d must divide all three of a, b and c, and hence it certainly divides 2a, b
and c. Thus, C doesn’t have the odd divisor property, as desired. l
Lemma 2. If C2 is reachable from C1 and C2 has the odd divisor property, then so does C1 . In
particular, any solvable configuration has the odd divisor property.
Proof. The first statement follows by inductively applying part (i) of Lemma 1. The second
statement follows from the first because every simple configuration has the odd divisor property.
l
The main claim is the following:
Lemma 3. Let C be a good configuration. Then there exists a configuration C 1 with the
following properties:

• C 1 is reachable from C and |C 1 | ą |C|;

• C 1 is either simple or good.

Proof. Call a configuration terminal if it is a counterexample to the claim. The following claim
is at the heart of the proof:
Claim. Let a1 , . . . , ak be the numbers of pebbles on the non-empty piles of a terminal config-
uration C. Then there exists a unique i P rks such that ai is even. Moreover, for all t ě 1 we
have aj ” a2i p mod 2t q for all j ‰ i.
Proof of Claim. Since the configuration is good, there must exist i P rks such that ai is even.
Moreover, by assumption, if we split the pile with ai pebbles into two equal halves, the resulting
configuration will not be good. By part (ii) of Lemma 2,the only way this can happen is that
ai
2
and aj for all j ‰ i are odd. To prove the second assertion, we proceed by induction on t,
with the case t “ 1 already being established. If t ě 2, then split the pile with ai pebbles into
two equal halves and move one half to the pile with aj pebbles. Since a2i and aj are both odd,
aj ` a2i is even, so by part (ii) of Lemma 2, the resulting configuration C 1 is good. Thus, C 1 is
terminal, so by the induction hypothesis, we have a2i ” 12 paj ` a2i qp mod 2t´1 q, whence aj ” a2i p
mod 2t q, as desired. l
Suppose for contradiction that there exists a configuration as in the Claim. It follows that
there exists i P rks and an odd integer x such that ai “ 2x and aj “ x for all j ‰ i. Thus, x is
an odd common divisor of a1 , . . . , ak , so by the odd divisor property, we must have x “ 1. But
then we can obtain a simple configuration by splitting the only pile with two pebbles into two
piles each consisting of a single pebble, which is a contradiction. l
With the aid of Lemmas 2 and 3, it is not hard to characterise all solvable configurations:
Lemma 4. A configuration of piles C is solvable if and only if it is simple or good.
Shortlisted problems – solutions 35

Proof. (ùñ) Suppose C is not simple. Then since we have to be able to perform at least one
move, there must be at least one non-empty pile in C with an even number of pebbles. Moreover,
by Lemma 2, C has the odd divisor property, so it must be good.
(ðù) This follows by repeatedly applying Lemma 3 until we reach a simple configuration.
Note that the process must stop eventually since the number of non-empty piles is bounded
from above. l
Finally, the answer to the problem is implied by the following corollary of Lemma 4:
Lemma 5. Let n be a positive integer. Then

(i) a configuration consisting of a single pile of n pebbles is solvable if and only if n is a


power of two;

(ii) if n ě 2, then the configuration consisting of piles of sizes 2 and n ´ 2 is good.

Proof. (i) By Lemma 4, this configuration is solvable if and only if either n “ 1 or n is even
and has no non-trivial odd divisor, so the conclusion follows.
(ii) Since 2 is even and has no non-trivial odd divisor, this configuration is certainly good,
so the conclusion follows by Lemma 4. l

Common remarks. Instead of choosing pebbles from two piles, one could allow choosing an
equal number of pebbles from each of k piles, where k ě 2 is a fixed (prime) integer. However,
this seems to yield a much harder problem – if k “ 3, numerical evidence suggests the same
answer as in the case k “ 2 (with powers of two replaced by powers of three), but the case
k “ 5 is already unclear.
36 Oslo, Norway, 6th–16th July 2022

C7. Lucy starts by writing s integer-valued 2022-tuples on a blackboard. After doing that,
she can take any two (not necessarily distinct) tuples v “ pv1 , . . . , v2022 q and w “ pw1 , . . . , w2022 q
that she has already written, and apply one of the following operations to obtain a new tuple:

v ` w “ pv1 ` w1 , . . . , v2022 ` w2022 q


v _ w “ pmaxpv1 , w1 q, . . . , maxpv2022 , w2022 qq

and then write this tuple on the blackboard.


It turns out that, in this way, Lucy can write any integer-valued 2022-tuple on the blackboard
after finitely many steps. What is the smallest possible number s of tuples that she initially
wrote?
(Czech Republic)

Answer: The smallest possible number is s “ 3.

Solution. We solve the problem for n-tuples for any n ě 3: we will show that the answer is
s “ 3, regardless of the value of n.
First, let us briefly introduce some notation. For an n-tuple v, we will write vi for its i-th
coordinate (where 1 ď i ď n). For a positive integer n and a tuple v we will denote by n ¨ v
the tuple obtained by applying addition on v with itself n times. Furthermore, we denote by
epiq the tuple which has i-th coordinate equal to one and all the other coordinates equal to
zero. We say that a tuple is positive if all its coordinates are positive, and negative if all its
coordinates are negative.
We will show that three tuples suffice, and then that two tuples do not suffice.

Three tuples suffice. Write c for the constant-valued tuple c “ p´1, . . . , ´1q.
We note that it is enough for Lucy to be able to make the tuples ep1q, . . . , epnq, c; from
those any other tuple v can be made as follows. First we choose some positive integer k such
that k ` vi ą 0 for all i. Then, by adding a positive number of copies of c, ep1q, . . . , epnq, she
can make
kc ` pk ` v1 q ¨ ep1q ` ¨ ¨ ¨ ` pk ` vn q ¨ epnq,

which we claim is equal to v. Indeed, this can be checked by comparing coordinates: the i-th
coordinate of the right-hand side is ´k ` pk ` vi q “ vi as needed.
Lucy can take her three starting tuples to be a, b and c, such that ai “ ´i2 , bi “ i and
c “ ´1 (as above).
For any 1 ď j ď n, write dpjq for the tuple 2 ¨ a ` 4j ¨ b ` p2j 2 ´ 1q ¨ c, which Lucy can make
by adding together a, b and c repeatedly. This has ith term

dpjqi “ 2ai ` 4jbi ` p2j 2 ´ 1qci


“ ´2i2 ` 4ij ´ p2j 2 ´ 1q
“ 1 ´ 2pi ´ jq2 .

This is 1 if j “ i, and at most ´1 otherwise. Hence Lucy can produce the tuple 1 “ p1, . . . , 1q
as dp1q _ ¨ ¨ ¨ _ dpnq.
She can then produce the constant tuple 0 “ p0, . . . , 0q as 1 ` c, and for any 1 ď j ď n
she can then produce the tuple epjq as dpjq _ 0. Since she can now produce ep1q, . . . , epnq and
already had c, she can (as we argued earlier) produce any integer-valued tuple.
Shortlisted problems – solutions 37

Two tuples do not suffice. We start with an observation: Let a be a non-negative real
number and suppose that two tuples v and w satisfy vj ě avk and wj ě awk for some
1 ď j, k ď n. Then we claim that the same inequality holds for v ` w and v _ w: Indeed, the
property for the sum is verified by an easy computation:

pv ` wqj “ vj ` wj ě avk ` awk “ apv ` wqk .

For the second operation, we denote by m the tuple v _ w. Then mj ě vj ě avk and
mj ě wj ě awk . Since mk “ vk or mk “ wk , the observation follows.
As a consequence of this observation we have that if all starting tuples satisfy such an
inequality, then all generated tuples will also satisfy it, and so we would not be able to obtain
every integer-valued tuple.
Let us now prove that Lucy needs at least three starting tuples. For contradiction, let us
suppose that Lucy started with only two tuples v and w. We are going to distinguish two
cases. In the first case, suppose we can find a coordinate i such that vi , wi ě 0. Both opera-
tions preserve the sign, thus we can not generate any tuple that has negative i-th coordinate.
Similarly for vi , wi ď 0.
Suppose the opposite, i.e., for every i we have either vi ą 0 ą wi , or vi ă 0 ă wi . Since
we assumed that our tuples have at least three coordinates, by pigeonhole principle there exist
two coordinates j ‰ k such that vj has the same sign as vk and wj has the same sign as wk
(because there are only two possible combinations of signs).
Without loss of generality assume that vj , vk ą 0 and wj , wk ă 0. Let us denote the
positive real number vj {vk by a. If wj {wk ď a, then both inequalities vj ě avk and wj ě awk
are satisfied. On the other hand, if wj {wk ď a, then both vk ě p1{aqvj and wk ě p1{aqwj are
satisfied. In either case, we have found the desired inequality satisfied by both starting tuples,
a contradiction with the observation above.

Common remarks.

1. For n P t1, 2u, two starting n-tuples are necessary and sufficient.

2. The operations `, _ used in this problem are studied in the area of tropical geometry.
However, as far as we know, familiarity with tropical geometry does not help when solving
the problem.
38 Oslo, Norway, 6th–16th July 2022

C8.
Alice fills the fields of an n ˆ n board with numbers from 1 to n2 , each number being used
exactly once. She then counts the total number of good paths on the board. A good path is a
sequence of fields of arbitrary length (including 1) such that:

(i) The first field in the sequence is one that is only adjacent to fields with larger numbers,

(ii) Each subsequent field in the sequence is adjacent to the previous field,

(iii) The numbers written on the fields in the sequence are in increasing order.

Two fields are considered adjacent if they share a common side. Find the smallest possible
number of good paths Alice can obtain, as a function of n.
(Serbia)

Answer: 2n2 ´ 2n ` 1.

Solution.
We will call any field that is only adjacent to fields with larger numbers a well. Other fields
will be called non-wells. Let us make a second n ˆ n board B where in each field we will write
the number of good sequences which end on the corresponding field in the original board A.
We will thus look for the minimal possible value of the sum of all entries in B.
We note that any well has just one good path ending in it, consisting of just the well, and
that any other field has the number of good paths ending in it equal to the sum of this quantity
for all the adjacent fields with smaller values, since a good path can only come into the field
from a field of lower value. Therefore, if we fill in the fields in B in increasing order with respect
to their values in A, it follows that each field not adjacent to any already filled field will receive
a 1, while each field adjacent to already filled fields will receive the sum of the numbers already
written on these adjacent fields.
We note that there is at least one well in A, that corresponding with the field with the entry
1 in A. Hence, the sum of values of fields in B corresponding to wells in A is at least 1. We
will now try to minimize the sum of the non-well entries, i.e. of the entries in B corresponding
to the non-wells in A. We note that we can ascribe to each pair of adjacent fields the value of
the lower assigned number and that the sum of non-well entries will then equal to the sum of
the ascribed numbers. Since the lower number is still at least 1, the sum of non-well entries
will at least equal the number of pairs of adjacent fields, which is 2npn ´ 1q. Hence, the total
minimum sum of entries in B is at least 2npn ´ 1q ` 1 “ 2n2 ´ 2n ` 1. The necessary conditions
for the minimum to be achieved is for there to be only one well and for no two entries in B
larger than 1 to be adjacent to each other.
We will now prove that the lower limit of 2n2 ´2n`1 entries can be achieved. This amounts
to finding a way of marking a certain set of squares, those that have a value of 1 in B, such
that no two unmarked squares are adjacent and that the marked squares form a connected tree
with respect to adjacency.
For n “ 1 and n “ 2 the markings are respectively the lone field and the L-trimino. Now,
for n ą 2, let s “ 2 for n ” 0, 2 mod 3 and s “ 1 for n ” 1 mod 3. We will take indices k and
l to be arbitrary non-negative integers. For n ě 3 we will construct a path of marked squares
in the first two columns consisting of all squares of the form p1, iq where i is not of the form
6k ` s and p2, jq where j is of the form 6k ` s ´ 1, 6k ` s or 6 ` s ` 1. Obviously, this path is
connected. Now, let us consider the fields p2, 6k ` sq and p1, 6k ` s ` 3q. For each considered
field pi, jq we will mark all squares of the form pl, jq for l ą i and pi ` 2k, j ˘ 1q. One can easily
see that no set of marked fields will produce a cycle, that the only fields of the unmarked form
p1, 6k ` sq, p2 ` 2l ` 1, 6k ` s ˘ 1q and p2 ` 2l, 6k ` s ` 3 ˘ 1q and that no two are adjacent, since
Shortlisted problems – solutions 39

the consecutive considered fields are in columns of opposite parity. Examples of markings are
given for n “ 3, 4, 5, 6, 7, and the corresponding constructions for A and B are given for n “ 5.

n=7
n=6 n=5:
n=5 A: B:
n=4 12 13 14 15 16 1 1 1 1 1
n=3 11 24 17 25 18 1 4 1 4 1
10 9 22 8 23 1 1 4 1 3
21 3 4 5 6 3 1 1 1 1
1 2 19 7 20 1 1 3 1 2

Common remarks.

• The construction can be achieved in different ways. For example, it can also be done
recursively; we can complete any construction for n to a construction for n ` 1.

• It is a natural idea to change the direction of the path: that way it can start anywhere,
but only can end in a well, which exactly means that we cannot extend the path. This is
just a reformulation of the problem, but can give some intuitions.
40 Oslo, Norway, 6th–16th July 2022

C9. Let Zě0 be the set of non-negative integers, and let f : Zě0 ˆ Zě0 Ñ Zě0 be a
bijection such that whenever f px1 , y1 q ą f px2 , y2 q, we have f px1 ` 1, y1 q ą f px2 ` 1, y2 q and
f px1 , y1 ` 1q ą f px2 , y2 ` 1q.
Let N be the number of pairs of integers px, yq, with 0 ď x, y ă 100, such that f px, yq is
odd. Find the smallest and largest possible value of N .
(U.S.A.)

Answer: The optimal bounds are 2500 ď N ď 7500.

Solution. We defer the constructions to the end of the solution. Instead, we begin by char-
acterizing all such functions f , prove a formula and key property for such functions, and then
solve the problem, providing constructions.

Characterization Suppose f satisfies the given relation. The condition can be written more
strongly as

f px1 , y1 q ą f px2 , y2 q ðñ f px1 ` 1, y1 q ą f px2 ` 1, y2 q


ðñ f px1 , y1 ` 1q ą f px2 , y2 ` 1q.

In particular, this means for any pk, lq P Z2 , f px ` k, y ` lq ´ f px, yq has the same sign for all
x and y.
Call a non-zero vector pk, lq P Zě0 ˆ Zě0 a needle if f px ` k, yq ´ f px, y ` lq ą 0 for all x
and y. It is not hard to see that needles and non-needles are both closed under addition, and
thus under scalar division (whenever the quotient lives in Z2 ).
In addition, call a positive rational number kl a grade if the vector pk, lq is a needle. (Since
needles are closed under scalar multiples and quotients, this is well-defined.)
Claim. Grades are closed upwards.
Proof. Consider positive rationals k1 {l1 ă k2 {l2 with k1 {l1 a grade. Then:

• pk1 , l1 q is a needle

• so pk1 l2 , l1 l2 q is a needle,

• so pk2 l1 , l1 l2 q is a needle (as k2 l1 ´ k1 l2 ą 0 and p1, 0q is a needle).

Thus pk2 , l2 q is a needle, as wanted. l


Claim. A grade exists.
Proof. If no positive integer n is a grade, then f p1, 0q ą f p0, nq for all n which is impossible.
l
Similarly, there is an n such that f p0, 1q ă f pn, 0q, thus 1{n is not a grade for some large n.
That means that small positive rational values are not grades, then there is a switch, and after
that all values are grades. Call the place of that switch α. Here α is the infimum of the grades.
Claim (Key property). If x1 ` y1 α ą x2 ` y2 α then f px1 , y1 q ą f px2 , y2 q.
Proof. If both x1 ě x2 and y1 ě y2 this is clear.
Suppose x1 ě x2 and y1 ă y2 . Then xy21 ´y ´x2
1
ą α is a grade. This gives f px1 , y1 q ą f px2 , y2 q.
Suppose x1 ă x2 and y1 ě y2 . Then u1 ´u2 ă α is not a grade. This gives f px2 , y2 q ă f px1 , y1 q.
x2 ´x1

From those observations we get the following claim.


Claim. The function f orders pairs px, yq based on the value of x ` yα. If α is rational,
tiebreaking is done by larger x- or y-coordinate (depending on whether α is a grade).
Shortlisted problems – solutions 41

We can imagine this the following way: take a line with slope ´ α1 under the first quadrant
of the plane. And we start to move this line upward (but it stays parallel to the original line).
First it hits p0, 0q, so f p0, 0q “ 0. And each time the line hits a point p, f ppq is the num-
ber of points hit before. If α P Q, it is possible that the line hits multiple points. Then those
points are ordered the same way as their x or y coordinates, depending on whether α is a grade.

We understood the behaviour of f , now we need to focus on the region of A “ tpx, yq P


Zě0 ˆ Zě0 |x ă 100, y ă 100u. First, we can assume that α is irrational. If we change it a little
bit in the right direction, the behaviour and values of the f function does not change in A.
Claim.
f px, yq ` f px ` 1, y ` 1q “ f px ` 1, yq ` f px, y ` 1q ` 1.
Proof.

f px ` 1, y ` 1q ´ f px, y ` 1q “
#tpa, bq P Zě0 ˆ Zě0 | x ` py ` 1qα ď a ` bα ă px ` 1q ` py ` 1qαu “
#tpa, bq P Zě0 ˆ Zą0 | x ` py ` 1qα ď a ` bα ă px ` 1q ` py ` 1qαu`
#tpa, 0q P Zě0 ˆ Zě0 | px ` 1q ` yα ď a ă px ` 1q ` py ` 1qαu “
#tpa, bq P Zě0 ˆ Zě0 | x ` yα ď a ` bα ă px ` 1q ` yαu ` 1 “ f px ` 1, yq ´ f px, yq. l

From this claim we immediately get that 2500 ď N ď 7500; now we show that those bounds
are indeed sharp.
Remember that if α is irrational then

f pa, bq “ # tpx, yq P Zě0 ˆ Zě0 | x ` yα ă a ` bαu .

Construction for 7500 Select α « 199.999.


Claim.

1. f pn, 0q “ n for 0 ď n ď 100.

2. f p0, kq ” k mod 2 for 0 ď k ď 100.

Proof.

1. f pn, 0q “ #tpx, yq| x ` yα ă nu “ #tpx, yq| x ` 199y ă nu “ n.

2.
k´1
ÿ
f p0, kq “ #tpx, yq| x ` yα ă kαu “ #tpx, lq| x ` lα ă kαu
l“0
k´1
ÿ k´1
ÿ
“ #tx| x ă pk ´ lqαu “ 200pk ´ lq ´ 1 “ 200A ´ k
l“0 l“0

for some integer A.

From this claim, using the equality f px, yq ` f px ` 1, y ` 1q “ f px ` 1, yq ` f px, y ` 1q ` 1, we


can prove that mod 2 the region A looks like the following: in the rows p´, 2yq the remainders
modulo 2 alternate, while the rows p´, 2y ` 1q contain only odd numbers.
42 Oslo, Norway, 6th–16th July 2022

..
0 1 0 1 0 1
1 1 1 1 1 1
0 1 0 1 0 1 ...
1 1 1 1 1 1
0 1 0 1 0 1

The numbers mod 2 in the construction for 7500.

Construction for 2500 Select α « 200.001.


Claim.

1. f pn, 0q “ n for 0 ď n ď 100.

2. f p0, kq ” 0 mod 2 for 0 ď k ď 100.

Proof.

1. As above.

2. Similarly to the above:


k´1
ÿ
f p0, kq “ #tpx, yq| x ` yα ă kαu “ #tpx, lq| x ` lα ă kαu
l“0
k´1
ÿ k´1
ÿ
“ #tx| x ă pk ´ lqαu “ 200pk ´ lq “ 200A
l“0 l“0

for some integer A.

Similarly to the above, we can prove that mod 2 the region A looks like the following: in
the rows p´, 2yq the remainder modulo 2 alternate, while the rows p´, 2y ` 1q contain only even
numbers.
..
0 1 0 1 0 1
0 0 0 0 0 0
0 1 0 1 0 1 ...
0 0 0 0 0 0
0 1 0 1 0 1

The numbers mod 2 in the construction for 7500.

Common remarks.

• In the proposer’s solution, an exact formula is proved in the case where α is irrational.
Let µ “ α1 and ν “ α. Then

f pa, bq “ ab ` pr1µs ` ¨ ¨ ¨ ` rµsq ` pr1νs ` ¨ ¨ ¨ ` rνsq .

They even suggested that this could be the source of a fun olympiad problem: it is not
easy to see that f is a bijection.
Shortlisted problems – solutions 43

• (On the choice of statement, by the proposer). As seen in the solution, such functions
have various properties, and it was not clear what statement to choose.
I decided to go with the present statement since I believe it requires a good understanding
of the setup and the functions involved. The key property is used in order to establish
the bounds, and the formula is used to develop constructions and easily verify they work.
While choosing a different statement (e.g. just prove the key property) may make the
problem less bulky, I believe that doing so runs the risk of introducing unintended solutions
which don’t “see the full picture.” In fact, the present statement probably runs admits
such solutions as well, likely through proving the key property via simply examining valid
locations for n ` 1 given the locations of 0, . . . , n, and using induction.
Unfortunately, I’m not sure how else to improve the statement.
One person I’ve shown this problem to suggests removing one half of the problem, by only
asking for the smallest or only the largest possible value of N . Their rationale is that the
two parts are mostly the same. I sympathize with them, but am reluctant to break the
symmetry.

• (PSC) The real difficulty of this problem is that one should understand the whole picture,
and in particular how the function f works, and how that quadrant can behave. In this
solution we characterised all such functions f , before even talking about parity, while the
problem only asks the number of odd numbers.
44 Oslo, Norway, 6th–16th July 2022

Geometry
G1. Let ABCDE be a convex pentagon such that BC “ DE. Assume there is a point
T inside ABCDE with T B “ T D, T C “ T E and =T BA “ =AET . Let lines CD and CT
intersect line AB at points P and Q, respectively, and let lines CD and DT intersect line AE
at points R and S, respectively. Assume that points P, B, A, Q and R, E, A, S respectively, are
collinear and occur on their lines in this order. Prove that the points P , S, Q, R are concyclic.
(Slovakia)

Solution 1. By the conditions we have BC “ DE, CT “ ET and T B “ T D, so the triangles


T BC and T DE are congruent, in particular =BT C “ =DT E.
In triangles T BQ and T ES we have =T BQ “ =SET and =QT B “ 180˝ ´=BT C “ 180˝ ´
=DT E “ =ET S, so these triangles are similar to each other. It follows that =T SE “ =BQT
and
TD TB TE TC
“ “ “ .
TQ TQ TS TS
By rearranging this relation we get T D ¨ T S “ T C ¨ T Q, so C, D, Q and S are concyclic.
(Alternatively, we can get =CQD “ =CSD from the similar triangles T CS and T DQ.) Hence,
=DCQ “ =DSQ.
Finally, from the angles of triangle CQP we get

=RP Q “ =RCQ ´ =P QC “ =DSQ ´ =DSR “ =RSQ,

which proves that P , Q, R and S are concyclic.


Q

S
A

V T W
E

P C D R

Solution 2. As in the previous solution, we note that triangles T BC and T DE are congruent.
Denote the intersection point of DT and BA by V , and the intersection point of CT and EA
by W . From triangles BCQ and DES we then have

=V SW “ =DSE “ 180˝ ´ =SED ´ =EDS “ 180˝ ´ =AET ´ =T ED ´ =EDT


“ 180˝ ´ =T BA ´ =T CB ´ =CBT “ 180˝ ´ =QCB ´ =CBQ “ =BQC “ =V QW ,

meaning that V SQW is cyclic, and in particular =W V Q “ =W SQ. Since

=V T B “ 180˝ ´ =BT C ´ =CT D “ 180˝ ´ =CT D ´ =DT E “ =ET W ,

and =T BV “ =W ET by assumption, we have that the triangles V T B and W T E are similar,


hence
VT BT DT
“ “ .
WT ET CT
Shortlisted problems – solutions 45

Thus CD k V W , and angle chasing yields

=RP Q “ =W V Q “ =W SQ “ =RSQ,

concluding the proof.


46 Oslo, Norway, 6th–16th July 2022

G2. In the acute-angled triangle ABC, the point F is the foot of the altitude from A, and
P is a point on the segment AF . The lines through P parallel to AC and AB meet BC at D
and E, respectively. Points X ‰ A and Y ‰ A lie on the circles ABD and ACE, respectively,
such that DA “ DX and EA “ EY .
Prove that B, C, X and Y are concyclic.
(Netherlands)

Solution 1. Let A1 be the intersection of lines BX and CY . By power of a point, it suffices


to prove that A1 B ¨ A1 X “ A1 C ¨ A1 Y , or, equivalently, that A1 lies on the radical axis of the
circles ABDX and ACEY .
From DA “ DX it follows that in circle ABDX, point D bisects of one of the arcs AX.
Therefore, depending on the order of points, the line BC is either the internal or external
bisector of =ABX. In both cases, line BX is the reflection of BA in line BDC. Analogously,
line CY is the reflection of CA in line BC; we can see that A1 is the reflection of A in line BC,
so A, F and A1 are collinear.
FD FP FE
By P D k AC and P E k AB we have “ “ , hence F D ¨ F B “ F E ¨ F C. So,
FC FA FB
point F has equal powers with respect to circles ABDX and ACEY .
Point A, being a common point of the two circles, is another point with equal powers, so
the radical axis of circles ABDX and ACEY is the altitude AF that passes through A1 .

B E F D C

A′

Solution 2. We present another way to prove that line AP A1 is the radical axis of the circles
ABD and ACE. It suffices to show that the second intersection point of ABD and ACE lies
on AP .
Define N to be the second intersection of circle P DE and AP . From =DN A “ =DN P “
=DEP “ =DBA it follows that N lies on circle ABD; analogously, we can show that N lies
on circle ACE.
Shortlisted problems – solutions 47

G3. Let ABCD be a cyclic quadrilateral. Assume that the points Q, A, B, P are collinear
in this order, in such a way that the line AC is tangent to the circle ADQ, and the line BD is
tangent to the circle BCP . Let M and N be the midpoints of BC and AD, respectively. Prove
that the following three lines are concurrent: line CD, the tangent of circle AN Q at point A,
and the tangent to circle BM P at point B.
(Slovakia)

Solution 1. We first prove that triangles ADQ and CDB are similar. Since ABCD is
cyclic, we have =DAQ “ =DCB. By the tangency of AC to the circle AQD we also have
=CBD “ =CAD “ =AQD. The claimed similarity is proven.
Let R be the midpoint of CD. Points N and R correspond in the proven similarity, and so
=QN A “ =BRC.

R
K
D
M

Q A B P

Let K be the second common point of line CD with circle ABR (i.e., if CD intersects circle
ABR, then K ‰ R is the other intersection; otherwise, if CD is tangent to CD, then K “ R).
In both cases, we have =BAK “ =BRC “ =QN A; that indicates that AK is tangent to circle
AN Q. It can be showed analogously that BK is tangent to circle BM P .

Comment. Note that M and N can be any points on lines BC and AD such that BM : M C “
DN : N A, as we then simply choose R to be such that DR : RC is that same ratio, and the rest of
the proof remains unchanged.
48 Oslo, Norway, 6th–16th July 2022

Solution 2. We present a second solution, without using the condition that ABCD is cyclic.
Again, M and N can be any points on lines BC and AD such that BM : M C “ DN : N A.
Let AB and CD meet at T (if AB k CD then T is their common ideal point). Let CD meet
the tangent to the circle AN Q at A, and the tangent to the circle BM P at B at points K1
and K2 , respectively.

I I J J

K2
K1
D
M

T Q A B P

Let I and J be the ideal points of AD and BC, respectively. Notice that the pencils
pAD, AC, AT, AK1 q and pQA, QD, QI, QN q of lines are congruent, because =K1 AD “ =AQN ,
=CAD “ =AQD and =IAT “ =IQT . Hence,
DN
pD, C; T, K1 q “ pAD, AC; AT, AK1 q “ pQA, QD; QI, QN q “ pA, D; I, N q “ .
NA
It can be obtained analogously that
BM
pD, C; T, K2 q “ pBD, BC; BT, BK2 q “ pP C, P B; P J, P M q “ pC, B; I, N q “ .
MC
From BM : M C “ DN : DA we get pD, C; T, K1 q “ pD, C; T, K2 q and hence K1 “ K2 .
Shortlisted problems – solutions 49

G4. Let ABC be an acute-angled triangle with AC ą AB, let O be its circumcentre, and
let D be a point on the segment BC. The line through D perpendicular to BC intersects the
lines AO, AC and AB at W , X and Y , respectively. The circumcircles of triangles AXY and
ABC intersect again at Z ‰ A.
Prove that if OW “ OD, then DZ is tangent to the circle AXY .
(United Kingdom)

Solution 1. Let AO intersect BC at E. As EDW is a right-angled triangle and O is on W E,


the condition OW “ OD means O is the circumcentre of this triangle. So OD “ OE which
establishes that D, E are reflections in the perpendicular bisector of BC.
Now observe:
180˝ ´ =DXZ “ =ZXY “ =ZAY “ =ZCD,

which shows CDXZ is cyclic.

A Z′ = Z
X

B D E C

We next show that AZ k BC. To do this, introduce point Z 1 on circle ABC such that
AZ 1 k BC. By the previous result, it suffices to prove that CDXZ 1 is cyclic. Notice that
triangles BAE and CZ 1 D are reflections in the perpendicular bisector of BC. Using this and
that A, O, E are collinear:

=DZ 1 C “ =BAE “ =BAO “ 90˝ ´ 21 =AOB “ 90˝ ´ =C “ =DXC,

so DXZ 1 C is cyclic, giving Z ” Z 1 as desired.


Using AZ k BC and CDXZ cyclic we get:

=AZD “ =CDZ “ =CXZ “ =AY Z,

which by the converse of alternate segment theorem shows DZ is tangent to circle AXY .
50 Oslo, Norway, 6th–16th July 2022

Solution 2. Notice that point Z is the Miquel-point of lines AC, BC, BA and DY ; then
B, D, Z, Y and C, D, X, Y are concyclic. Moreover, Z is the centre of the spiral similarity that
maps BC to Y X.
By BC K Y X, the angle of that similarity is 90˝ ; hence the circles ABCZ and AXY Z are
perpendicular, therefore the radius OZ in circle ABCZ is tangent to circle AXY Z.

A Z
X

B D C

By OW “ OD, the triangle OW D is isosceles, and

=ZOA “ 2=ZBA “ 2=ZBY “ 2=ZDY “ =ODW ` =DW O,

so D lies on line ZO that is tangent to circle AXY .


Shortlisted problems – solutions 51

G5. Let ABC be a triangle, and let `1 and `2 be two parallel lines. For i “ 1, 2, let `i
meet the lines BC, CA, and AB at Xi , Yi , and Zi , respectively. Suppose that the line through
Xi perpendicular to BC, the line through Yi perpendicular to CA, and finally the line through
Zi perpendicular to AB, determine a non-degenerate triangle ∆i .
Show that the circumcircles of ∆1 and ∆2 are tangent to each other.
(Vietnam)

Solution 1. Throughout the solutions, ?pp, qq will denote the directed angle between lines p
and q, taken modulo 180˝ .
Let the vertices of ∆i be Di , Ei , Fi , such that lines Ei Fi , Fi Di and Di Ei are the perpendic-
ulars through X, Y and Z, respectively, and denote the circumcircle of ∆i by ωi .
In triangles D1 Y1 Z1 and D2 Y2 Z2 we have Y1 Z1 k Y2 Z2 because they are parts of `1 and `2 .
Moreover, D1 Y1 k D2 Y2 are perpendicular to AC and D1 Z1 k D2 Z2 are perpendicular to AB, so
the two triangles are homothetic and their homothetic centre is Y1 Y2 X Z1 Z2 “ A. Hence, line
D1 D2 passes through A. Analogously, line E1 E2 passes through B and F1 F2 passes through C.

A
E1 ℓ1

Y1 ℓ2
ω1
Y2
Z1
E2
D1
ω2 Z2

D2

X1 X2 B C

∆2 H
∆1

F2
F1

The corresponding sides of ∆1 and ∆2 are parallel, because they are perpendicular to the
respective sides of triangle ABC. Hence, ∆1 and ∆2 are either homothetic, or they can be
translated to each other. Using that B, X2 , Z2 and E2 are concyclic, C, X2 , Y2 and F2 are
concyclic, Z2 E2 K AB and Y2 , F2 K AC we can calculate

?pE1 E2 , F1 F2 q “ ?pE1 E2 , X1 X2 q ` ?pX1 X2 , F1 F2 q “ ?pBE2 , BX2 q ` ?pCX2 , CF2 q


“ ?pZ2 E2 , Z2 X2 q ` ?pY2 X2 , Y2 F2 q “ ?pZ2 E2 , `2 q ` ?p`2 , Y2 F2 q
“ ?pZ2 E2 , Y2 F2 q “ ?pAB, ACq ı 0, (1)

and conclude that lines E1 E2 and F1 F2 are not parallel. Hence, ∆1 and ∆2 are homothetic;
the lines D1 D2 , E1 E2 , and F1 F2 are concurrent at the homothetic centre of the two triangles.
Denote this homothetic centre by H.
For i “ 1, 2, using (1), and that A, Yi , Zi and Di are concyclic,

?pHEi , HFi q “ ?pE1 E2 , F1 F2 q “ ?pAB, ACq


“ ?pAZi , AYi q “ ?pDi Zi , Di Yi q “ ?pDi Ei , Di Fi q,
52 Oslo, Norway, 6th–16th July 2022

so H lies on circle ωi .
The same homothety that maps ∆1 to ∆2 , sends ω1 to ω2 as well. Point H, that is the
centre of the homothety, is a common point of the two circles, That finishes proving that ω1
and ω2 are tangent to each other.

Solution 2. As in the first solution, let the vertices of ∆i be Di , Ei , Fi , such that Ei Fi , Fi Di


and Di Ei are the perpendiculars through Xi , Yi and Zi , respectively. In the same way we
conclude that pA, D1 , D2 q, pB, E1 , E2 q and pC, F1 , F2 q are collinear.
The corresponding sides of triangles ABC and Di Ei Fi are perpendicular to each other.
Hence, there is a spiral similarity with rotation ˘90˝ that maps ABC to Di Ei Fi ; let Mi be the
centre of that similarity. Hence, ?pMi A, Mi Di q “ ?pMi B, Mi Ei q “ ?pMi C, Mi Fi q “ 90˝ . The
circle with diameter ADi passes through Mi , Yi , Zi , so Mi , A, Yi , Zi , Di are concyclic; analogously
pMi , B, Xi , Zi , Ei q and pMi , C, Xi , Yi , Fi q are concyclic.
By applying Desargues’ theorem to triangles ABC and Di Ei Fi we conclude that the lines
ADi , BEi and BFi are concurrent; let their intersection be H. Since pA, D1 .D2 q, pB, E1 .E2 q
and pC, F1 .F2 q are collinear, we obtain the same point H for i “ 1 and i “ 2.

Mi

Ei

Xi C
B
Zi H
ℓi
Yi
Di
∆i
Fi
ωi

By ?pCB, CHq “ ?pCXi , CFi q “ ?pYi Xi , Yi Fi q “ ?pYi Zi , Yi Di q “ ?pAZi , ADi q “


?pAB, AHq, point H lies on circle ABC.
Analogously, from ?pFi Di , Fi Hq “ ?pFi Yi , Fi Cq “ ?pXi Yi , Xi Cq “ ?pXi Zi , Xi Bq “
?pEi Zi , Ei Bq “ ?pEi Di , Ei Hq, we can see that point H lies on circle Di Ei Fi as well. Therefore,
circles ABC and Di Ei Fi intersect at point H.
The spiral similarity moves the circle ABC to circle Di Ei Fi , so the two circles are per-
pendicular. Hence, both circles D1 E1 F1 and D2 E2 F2 are tangent to the radius of circle ABC
at H.

Comment 1. As the last picture suggests, the circles ABC and Di Ei Fi pass through Mi . In fact,
point Mi , being the second intersection of circles Di Ei Fi and Di Yi Zi , the Miquel point of the lines
AYi , AZi , CXi and Xi Yi , so it is concyclic with A, B, C. Similarly, Mi the Miquel point of lines Di Ei ,
Ei Fi , Fi Yi and Xi Yi , so it is concyclic with Di , Ei , Di .

Comment 2. Instead of two lines `1 and `2 , it is possible to reformulate the problem with a single,
varying line `:
Shortlisted problems – solutions 53

Let ABC be a triangle, and let ` be a varying line whose direction is fixed. Let ` intersect lines BC,
CA, and AB at X, Y , and Z, respectively. Suppose that the line through X, perpendicular to BC,
the line through Y , perpendicular to CA, and the line through Z, perpendicular to AB, determine a
non-degenerate triangle ∆.
Show that as ` varies, the circumcircles of the obtained triangles ∆ pass through a fixed point, and
these circles are tangent to each other.
A reasonable approach is finding the position of line ` when the triangle DEF degenerates to a
single point. That happens when the line XY Z is the Simson line respect to point D “ E “ F on the
circumcircle ABC. Based on this observation a possible variant of the solution is as follows.
Let H be the second intersection of circles ABC and line AD. Like in the solutions above, we can
find that the line AD is fixed, so H is independent of the position of line `.

H F
C
Z ℓ
Y X

From ?pHF, HDq “ ?pHC, HAq “ ?pBC, BAq “ ?pBX, BZq “ ?pEX, EZq “ ?pEF, EDq we
can see that circle ∆ passes through H. Hence, all circles DEF passes through a fixed point.
The corresponding sides of triangles ABC and DEF are perpendicular, so their circumcircle are
perpendicular; that proves that circle DEF is tangent to the radius of circle ABC at H.
54 Oslo, Norway, 6th–16th July 2022

G6. In an acute-angled triangle ABC, point H is the foot of the altitude from A. Let
P be a moving point such that the bisectors k and ` of angles P BC and P CB, respectively,
intersect each other on the line segment AH. Let k and AC meet at E, let ` and AB meet
at F , and let EF and AH meet at Q. Prove that, as P varies, the line P Q passes through a
fixed point.
(Iran)

Solution 1. Let the reflections of the line BC with respect to the lines AB and AC intersect
at point K. We will prove that P , Q and K are collinear, so K is the common point of the
varying line P Q.
Let lines BE and CF intersect at I. For every point O and d ą 0, denote by pO, dq the
circle centred at O with radius d, and define ωI “ pI, IHq and ωA “ pA, AHq. Let ωK and ωP
be the incircle of triangle KBC and the P -excircle of triangle P BC, respectively.
Since IH K BC and AH K BC, the circles ωA and ωI are tangent to each other at H.
So, H is the external homothetic centre of ωA and ωI . From the complete quadrangle BCEF
we have pA, I; Q, Hq “ ´1, therefore Q is the internal homothetic centre of ωA and ωI . Since
BA and CA are the external bisectors of angles =KBC and =KCB, circle ωA is the K-excircle
in triangle BKC. Hence, K is the external homothetic centre of ωA and ωK . Also it is clear
that P is the external homothetic centre of ωI and ωP . Let point T be the tangency point
of ωP and BC, and let T 1 be the tangency point of ωK and BC. Since ωI is the incircle and
ωP is the P -excircle of P BC, T C “ BH and since ωK is the incircle and ωA is the K-excircle
of KBC, T 1 C “ BH. Therefore T C “ T 1 C and T ” T 1 . It yields that ωK and ωP are tangent
to each other at T .

P
E

ωA Q
F
ωI
k I

B C
H S T

ωP ωK

Let point S be the internal homothetic centre of ωA and ωP , and let S 1 be the internal
homothetic centre of ωI and ωK . It’s obvious that S and S 1 lie on BC. We claim that S ” S 1 .
To prove our claim, let rA , rI , rP , and rK be the radii of ωA , ωI , ωP and ωk , respectively.
It is well known that if the sides of a triangle are a, b, c, its semiperimeter is s “ pa`b`cq{2,
and the radii of the incircle and the a-excircle are r and ra , respectively, then r¨ra “ ps´bqps´cq.
Applying this fact to triangle P BC we get rI ¨ rP “ BH ¨ CH. The same fact in triangle KCB
Shortlisted problems – solutions 55

yields rK ¨ rA “ CT ¨ BT . Since BH “ CT and BT “ CH, from these two we get

HS rA rI HS 1
“ “ “ 1 ,
ST rP rK ST
so S “ S 1 indeed.
Finally, by applying the generalised Monge’s theorem to the circles ωA , ωI , and ωK (with
two pairs of internal and one pair of external common tangents), we can see that points Q,
S, and K are collinear. Similarly one can show that Q, S and P are collinear, and the result
follows.

Solution 2. Again, let BE and CF meet at I, that is the incentre in triangle BCP ; then
P I is the third angle bisector. From the tangent segments of the incircle we have BP ´ CP “
BH ´ CH; hence, the possible points P lie on a branch of a hyperbola H with foci B, C, and
H is a vertex of H. Since P I bisects the angle between the radii BP and CP of the hyperbola,
line P I is tangent to H.

P
G E

F
I

C
B H
K

Let K be the second intersection of P Q and H, we will show that AK is tangent to H at


K; this property determines K.
Let G “ KI X AP and M “ P I X AK. From the complete quadrangle BCEF we can see
that pH, Q; I, Aq is harmonic, so in the complete quadrangle AP IK, point H lies on line GM .
Consider triangle AIM . Its side AI is tangent to H at H, the side IM is tangent to H at
P , and K is a common point of the third side AM and the hyperbola such that the lines AP ,
IK and M H are concurrent at the generalised Gergonne-point G. It follows that the third
side, AM is also tangent to H at K.
(Alternatively, in the last step we can apply the converse of Brianchon’s theorem to the
degenerate hexagon AHIP M K. By the theorem there is a conic section H1 such that lines
AI, IM and M A are tangent to H1 at H, P and K, respectively. But the three points H, K
and P , together with the tangents at H and P uniquely determine H1 , so indeed H1 “ H.)
56 Oslo, Norway, 6th–16th July 2022

G7. Let ABC and A1 B 1 C 1 be two triangles having the same circumcircle ω, and the same
orthocentre H. Let Ω be the circumcircle of the triangle determined by the lines AA1 , BB 1
and CC 1 . Prove that H, the centre of ω, and the centre of Ω are collinear.
(Denmark)

Solution. In what follows, ?pp, qq will denote the directed angle between lines p and q, taken
modulo 180˝ . Denote by O the centre of ω. In any triangle, the homothety with ratio ´ 12
centred at the centroid of the triangle takes the vertices to the midpoints of the opposite sides
and it takes the orthocentre to the circumcentre. Therefore the triangles ABC and A1 B 1 C 1
share the same centroid G and the midpoints of their sides lie on a circle ρ with centre on OH.
We will prove that ω, Ω, and ρ are coaxial, so in particular it follows that their centres are
collinear on OH.
Let D “ BB 1 XCC 1 , E “ CC 1 XAA1 , F “ AA1 XBB 1 , S “ BC 1 XB 1 C, and T “ BC XB 1 C 1 .
Since D, S, and T are the intersections of opposite sides and of the diagonals in the quadrilateral
BB 1 CC 1 inscribed in ω, by Brocard’s theorem triangle DST is self-polar with respect to ω, i.e.
each vertex is the pole of the opposite side. We apply this in two ways.

S F A

A′
ρ
B′ E

G O
H
N M′
C Ω
M

B T
D∗
ω
C′
D

First, from D being the pole of ST it follows that the inverse D˚ of D with respect to ω
is the projection of D onto ST . In particular, D˚ lies on the circle with diameter SD. If N
denotes the midpoint of SD and R the radius of ω, then the power of O with respect to this
circle is ON 2 ´ N D2 “ OD ¨ OD˚ “ R2 . By rearranging, we see that N D2 is the power of N
with respect to ω.
Second, from T being the pole of SD it follows that OT is perpendicular to SD. Let M
and M 1 denote the midpoints of BC and B 1 C 1 . Then since OM K BC and OM 1 K B 1 C 1 it
follows that OM M 1 T is cyclic and

?pSD, BCq “ ?pOT, OM q “ ?pB 1 C 1 , M M 1 q.

From BB 1 CC 1 being cyclic we also have ?pBC, BB 1 q “ ?pCC 1 , B 1 C 1 q, hence we obtain

?pSD, BB 1 q “ ?pSD, BCq ` ?pBC, BB 1 q


“ ?pB 1 C 1 , M M 1 q ` ?pCC 1 , B 1 C 1 q “ ?pCC 1 , M M 1 q.

Now from the homothety mentioned in the beginning, we know that M M 1 is parallel to AA1 ,
hence the above implies that ?pSD, BB 1 q “ ?pCC 1 , AA1 q, which shows that Ω is tangent to
SD at D. In particular, N D2 is also the power of N with respect to Ω.
Shortlisted problems – solutions 57

Additionally, from BB 1 CC 1 being cyclic it follows that triangles DBC and DC 1 B 1 are in-
versely similar, so ?pBB 1 , DM 1 q “ ?pDM, CC 1 q. This yields
?pSD, DM 1 q “ ?pSD, BB 1 q ` ?pBB 1 , DM 1 q
“ ?pCC 1 , M M 1 q ` ?pDM, CC 1 q “ ?pDM, M M 1 q,
which shows that the circle DM M 1 is also tangent to SD. Since N , M , and M 1 are collinear on
the Newton–Gauss line of the complete quadrilateral determined by the lines BB 1 , CC 1 , BC 1 ,
and B 1 C, it follows that N D2 “ N M ¨ N M 1 . Hence N has the same power with respect to ω,
Ω, and ρ.
By the same arguments there exist points on the tangents to Ω at E and F which have the
same power with respect to ω, Ω, and ρ. The tangents to a given circle at three distinct points
cannot be concurrent, hence we obtain at least two distinct points with the same power with
respect to ω, Ω, and ρ. Hence the three circles are coaxial, as desired.
Comment 1. Instead of invoking the Newton–Gauss line, one can also use a nice symmetry argument:
If from the beginning we swapped the labels of B 1 and C 1 , then in the proof above the labels of D and
S would be swapped while the labels of M and M 1 do not change. The consequence is that the circle
SM M 1 is also tangent to SD. Since N is the midpoint of SD it then has the same power with respect
to circles DM M 1 and SM M 1 , so it lies on their radical axis M M 1 .

Comment 2. There exists another triple of points on the common radical axis of ω, Ω, and ρ which
can be used to solve the problem. We outline one such solution.
P

F
K′ A

B′
ρ A′
E

L′ K

M′ C
M
L
B
ω
C′
D

Let L and L1 denote the feet of the altitudes from A and A1 in triangle ABC and A1 B 1 C 1 , respec-
tively. Since ρ is the nine-point circle of the two triangles it contains both L and L1 . Furthermore,
HA¨HL and HA1 ¨HL1 both equal twice the power of H with respect to ρ, so A, A1 , L, L1 are concyclic
as well.
Now let ` “ AA1 and denote P “ LL1 X `, K “ BC X `, and K 1 “ B 1 C 1 X `. As M M 1 k ` (shown
in the previous solution) and LL1 M M 1 is cyclic
?pBC, `q “ ?pBC, M M 1 q “ ?pLL1 , B 1 C 1 q
so K, K 1 , L, and L1 are also concyclic. From the cyclic quadrilaterals AA1 LL1 and KK 1 LL1 we get
P A ¨ P A1 “ P L ¨ P L1 “ P K ¨ P K 1 . This implies that P is the centre of the (unique) involution σ on `
that swaps A, A1 and K, K 1 . On the other hand, by Desargues’ involution theorem applied to the line
`, the quadrilateral BB 1 CC 1 , and its circumcircle ω, the involution σ also swaps E and F . Hence
P A ¨ P A1 “ P L ¨ P L1 “ P E ¨ P F.
However, this means that P has the same power with respect to ω, Ω, and ρ, and by the same arguments
there exist points on BB 1 and CC 1 with this property.
58 Oslo, Norway, 6th–16th July 2022

G8. Let AA1 BCC 1 B 1 be a convex cyclic hexagon such that AC is tangent to the incircle
of the triangle A1 B 1 C 1 , and A1 C 1 is tangent to the incircle of the triangle ABC. Let the lines
AB and A1 B 1 meet at X and let the lines BC and B 1 C 1 meet at Y .
Prove that if XBY B 1 is a convex quadrilateral, then it has an incircle.
(Australia)

Solution. Denote by ω and ω 1 the incircles of 4ABC and 4A1 B 1 C 1 and let I and I 1 be the
centres of these circles. Let N and N 1 be the second intersections of BI and B 1 I 1 with Ω, the
circumcircle of A1 BCC 1 B 1 A, and let O be the centre of Ω. Note that ON K AC, ON 1 K A1 C 1
and ON “ ON 1 so N N 1 is parallel to the angle bisector II 1 of AC and A1 C 1 . Thus II 1 k N N 1
which is antiparallel to BB 1 with respect to BI and B 1 I 1 . Therefore B, I, I 1 , B 1 are concyclic.

Γ1
Γ2

B′
N
M
C′
A I ′

ω

P
O

A′ I C
ω

N′
B Z

Further define P as the intersection of AC and A1 C 1 and M as the antipode of N 1 in Ω.


Consider the circle Γ1 with centre N and radius N A “ N C and the circle Γ2 with centre
M and radius M A1 “ M C 1 . Their radical axis passes through P and is perpendicular to
M N K N N 1 k IP , so I lies on their radical axis. Therefore, since I lies on Γ1 , it must also
lie on Γ2 . Thus, if we define Z as the second intersection of M I with Ω, we have that I is
the incentre of triangle ZA1 C 1 . (Note that the point Z can also be constructed directly via
Poncelet’s porism.)
Consider the incircle ωc with centre Ic of triangle C 1 B 1 Z. Note that =ZIC 1 “ 90˝ `
1
2
=ZA1 C 1 “ 90˝ ` 12 =ZB 1 C 1 “ =ZIc C 1 , so Z, I, Ic , C 1 are concyclic. Similarly B 1 , I 1 , Ic , C 1
are concyclic.
The external centre of dilation from ω to ωc is the intersection of IIc and C 1 Z (D in the
picture), that is the radical centre of circles Ω, C 1 Ic IZ and II 1 Ic . Similarly, the external centre
of dilation from ω 1 to ωc is the intersection of I 1 Ic and B 1 C 1 (D1 in the picture), that is the
radical centre of circles Ω, B 1 I 1 Ic C 1 and II 1 Ic . Therefore the Monge line of ω, ω 1 and ωc is line
DD1 , and the radical axis of Ω and circle II 1 Ic coincide. Hence the external centre T of dilation
from ω to ω 1 is also on the radical axis of Ω and circle II 1 Ic .
Shortlisted problems – solutions 59

D′
B′

ω′
ωc
A I′ C′
Ic

ω
A′
I
B
Z C

Now since B, I, I 1 , B 1 are concyclic, the intersection T 1 of BB 1 and II 1 is on the radical


axis of Ω and circle II 1 Ic . Thus T 1 “ T and T lies on line BB 1 . Finally, construct a circle Ω0
tangent to A1 B 1 , B 1 C 1 , AB on the same side of these lines as ω 1 . The centre of dilation from
ω 1 to Ω0 is B 1 , so by Monge’s theorem the external centre of dilation from Ω0 to ω must be on
the line T BB 1 . However, it is on line AB, so it must be B and BC must be tangent to Ω0 as
desired.
B′

A I′ ω′ C′
Ic
X
Ω0
A′ ω
I
B C Y

T
60 Oslo, Norway, 6th–16th July 2022

Number Theory
N1. A number is called Norwegian if it has three distinct positive divisors whose sum is
equal to 2022. Determine the smallest Norwegian number.
(Note: The total number of positive divisors of a Norwegian number is allowed to be larger
than 3.)
(Cyprus)

Answer: 1344

Solution. Observe that 1344 is a Norwegian number as 6, 672 and 1344 are three distinct
divisors of 1344 and 6 ` 672 ` 1344 “ 2022. It remains to show that this is the smallest such
number.
Assume for contradiction that N ă 1344 is Norwegian and let N {a, N {b and N {c be the
three distinct divisors of N , with a ă b ă c. Then
ˆ ˙ ˆ ˙
1 1 1 1 1 1
2022 “ N ` ` ă 1344 ` `
a b c a b c
and so ˆ ˙
1 1 1 2022 337 3 1
` ` ą “ “ ` .
a b c 1344 224 2 224
If a ą 1 then
1 1 1 1 1 1 13 3
` ` ď ` ` “ ă ,
a b c 2 3 4 12 2
so it must be the case that a “ 1. Similarly, it must hold that b ă 4 since otherwise
1 1 1 1 3
1` ` ď1` ` ă .
b c 4 5 2
This leaves two cases to check, b “ 2 and b “ 3.
Case b “ 3. Then
1 3 1 1 1
ą ` ´1´ ą ,
c 2 224 3 6
so c “ 4 or c “ 5. If c “ 4 then
ˆ ˙
1 1 19
2022 “ N 1 ` ` “ N,
3 4 12
but this is impossible as 19 - 2022. If c “ 5 then
ˆ ˙
1 1 23
2022 “ N 1 ` ` “ N,
3 5 15
which again is impossible, as 23 - 2022.
Case b “ 2. Note that c ă 224 since
1 3 1 1 1
ą ` ´1´ “ .
c 2 224 2 224
It holds that ˆ ˙
1 1 3c ` 2
2022 “ N 1 ` ` “ N ñ p3c ` 2qN “ 4044c.
2 c 2c
Since pc, 3c´2q “ pc, 2q P t1, 2u, then 3c`2 | 8088 “ 23 ¨3¨337 which implies that 3c`2 | 23 ¨337.
But since 3c ` 2 ě 3 ¨ 3 ` 2 ą 8 “ 23 and 3c ` 2 ‰ 337, then it must hold that 3c ` 2 ě 2 ¨ 337,
contradicting c ă 224.
Shortlisted problems – solutions 61

N2. Find all positive integers n ą 2 such that


ˇ
ˇ ź
n! ˇˇ pp ` qq.
păqďn,
p,q primes

(Nigeria)

Answer: This only holds for n “ 7.

Solution. Assume that n satisfies n!| păqďn pp ` qq and let 2 “ p1 ă p2 ă ¨ ¨ ¨ ă pm ď n be


ś
the primes in t1, 2, . . . , nu. Each such prime divides n!. In particular, pm | pi ` pj for some
pi ă pj ď n. But
pi ` pj pm ` pm
0ă ă “ 2,
pm pm
so pm “ pi ` pj which implies m ě 3, pi “ 2 and pm “ 2 ` pj “ 2 ` pm´1 .
Similarly, pm´1 |pk ` pl for some pk ă pl ď n. But
p l ` pk pm ` pm´1 2pm´1 ` 2
0ă ď “ ă 3,
pm´1 pm´1 pm´1
so either pm´1 “ pl ` pk or 2pm´1 “ pl ` pk . As above, the former case gives pm´1 “ 2 ` pm´2 .
If 2pm´1 “ pl ` pk , then pm´1 ă pk , so k “ m and

2pm´1 “ pl ` pm´1 ` 2 ñ pm´1 “ pl ` 2 “ pm´2 ` 2.

Either way, pm´2 ą 2 and 3 divides one of pm´2 , pm´1 “ pm´2 ` 2 and pm “ pm´2 ` 4. This
implies pm´2 “ 3 and thus pm “ 7, giving 7 ď nś ă 11.
Finally, a quick computation shows that 7! | păqď7 pp`qq but 8! - păqď7 pp`qq, so neither
ś
does 9! and 10!.
62 Oslo, Norway, 6th–16th July 2022

N3. Let a ą 1 be a positive integer, and let d ą 1 be a positive integer coprime to a. Let
x1 “ 1 and, for k ě 1, define
#
xk ` d if a doesn’t divide xk ,
xk`1 “
xk {a if a divides xk .

Find the greatest positive integer n for which there exists an index k such that xk is divisible
by an .
(Croatia)

Answer: n is the exponent with d ă an ă ad.

Solution 1. By trivial induction, xk is coprime to d.


By induction and the fact that there can be at most a ´ 1 consecutive increasing terms in
the sequence, it also holds that xk ă da if xk “ xk´1 ` d and that xk ă d if xk “ xk´1a
or k “ 1.
This gives the upper bound on the exponent.
This implies that the sequence is (eventually) periodic, and that both increasing and decreas-
ing steps happen infinitely many times. Let a´k be the multiplicative inverse of ak modulo d.
The sequence contains elements congruent to 1, a´1 , a´2 , . . . modulo d.
Let xk0 the first element such that xk0 ” a´n pmod dq. We have either k0 “ 1 or xk0 “
xk0 ´1 {a; in both cases xk0 ă d ă an ă da and therefore
(
xk0 P an ´ d, an ´ 2d, . . . , an ´ pa ´ 1qd .

In this set no element is divisible by a, so therefore the sequence will visit the value an in the
next a ´ 1 steps.

Solution 2. Like in the first solution, xk is relatively prime to d and xk ă ad for all k.
Let
#
x ` d if a - x,
and f : S Ñ S, f pxq “
(
S “ tx P Zą0 : 0 ă x ă ad, gcdpx, dq “ 1
x{a if a | x.

So, we have x1 “ 1 and xk`1 “ f pxk q.


Notice that the recurrence formula is invertible. Suppose that f pxq “ y for some x, y P S.
If y ą d then y ´ d P S but a ¨ y R S; otherwise, if y ă d then a ¨ y P S but y ´ d R S. So, the
function f is a permutation on S, and its inverse is
#
y ´ d if y ą d,
f ´1 pyq “ for all y P S.
a ¨ y if y ă d

It follows that the sequence is periodic, and therefore attains the initial value 1 infinitely
many times. Let k1 ą 1 be an index such that xk1 “ 1. Then

xk1 “ 1, xk1 ´1 “ f ´1 p1q “ a, xk1 ´2 “ f ´1 paq “ a2 , . . . , xk1 ´n “ an .


Shortlisted problems – solutions 63

Solution 3. Like in the first solution, xk is relatively prime to d and xk ă ad for all k.
We wish to prove that there are n consecutive decreasing indices. Let m0 “ 0 and mk be the
k-th smallest decreasing index (an index k is decreasing if xk “ xk´1 {a) and define a sequence
pyk qk “ pxmk qk , i.e. the subsequence consisting only of elements with decreasing indices. For
each k ě 1 we can write
yk ` zk d
yk`1 “
a
for some zk P t0, 1, . . . , a ´ 1u, where zk “ 0 if and only if yk and yk`1 are consecutive elements
in the original sequence. Then

1 ` pz0 ` z1 a ` ¨ ¨ ¨ ` zk´1 ak´1 qd


yk “ ,
ak
because yk is bounded the sequence is (eventually) periodic. Consider some yu “ yu`v where
v ě 1. We can write
1 ` pz0 ` z1 a ` ¨ ¨ ¨ ` zu´1 au´1 qd
yu “
au
and
1 ` pz0 ` z1 a ` ¨ ¨ ¨ ` zu`v´1 au`v´1 qd
yu`v “
au`v
and so
1 ` pz0 ` z1 a ` ¨ ¨ ¨ ` zu`v´1 au`v´1 qd 1 ` pz0 ` z1 a ` ¨ ¨ ¨ ` zu´1 au´1 qd
“ .
au`v au
Rearranging gives
av ´ 1
“ z0 ` z1 a ` ¨ ¨ ¨ ` zv´1 av´1 ` pzv ´ z0 qav ` ¨ ¨ ¨ ` pzu`v´1 ´ zu´1 qau`v´1 .
d
Since d ą an {a “ an´1 the LHS is strictly less than av´n . This implies that on the RHS, the
coefficients of av´n , av´n`1 , . . . must all be zero, i.e. zv´n “ zv´n`1 “ ¨ ¨ ¨ “ zv´1 “ 0. This
implies that there are n consecutive decreasing indices in the original sequence.
64 Oslo, Norway, 6th–16th July 2022

N4. Find all triples of positive integers pa, b, pq with p prime and

ap “ b! ` p.

(Belgium)

Answer: p2, 2, 2q and p3, 4, 3q.

Solution 1. Clearly, a ą 1. We consider three cases.


Case 1: We have a ă p. Then we either have a ď b which implies a | ap ´ b! “ p leading to
a contradiction, or a ą b which is also impossible since in this case we have b! ď a! ă ap ´ p,
where the last inequality is true for any p ą a ą 1.
Case 2: We have a ą p. In this case b! “ ap ´ p ą pp ´ p ě p! so b ą p which means that
ap “ b! ` p is divisible by p. Hence, a is divisible by p and b! “ ap ´ p is not divisible by p2 .
This means that b ă 2p. If a ă p2 then a{p ă p divides both ap and b! and hence it also divides
p “ ap ´ b! which is impossible. On the other hand, the case a ě p2 is also impossible since
p
then ap ě pp2 q ą p2p ´ 1q! ` p ě b! ` p.

Comment. The inequality p2p ą p2p ´ 1q! ` p can be shown e.g. by using
˜ˆ ˙ ¸p´1
2p 2
p2p ´ 1q! “ r1 ¨ p2p ´ 1qs ¨ r2 ¨ p2p ´ 2qs ¨ ¨ ¨ ¨ ¨ rpp ´ 1qpp ` 1qs ¨ p ă ¨ p “ p2p´1 ,
2

where the inequality comes from applying AM-GM to each of the terms in square brackets.
Case 3: We have a “ p. In this case b! “ pp ´ p. One can check that the values p “ 2, 3 lead
to the claimed solutions and p “ 5 does not lead to a solution. So we now assume that p ě 7.
We have b! “ pp ´ p ą p! and so b ě p ` 1 which implies that
ˆ ˙
` p´1 LT E p´1
v2 pp ` 1q!q ď v2 pb!q “ v2 pp ´ 1q “ 2v2 pp ´ 1q ` v2 pp ` 1q ´ 1 “ v2 ¨ pp ´ 1q ¨ pp ` 1q ,
2
where in the middle we used lifting-the-exponent lemma. On the RHS we have three factors of
pp ` 1q!. But, due to p ` 1 ě 8, there are at least 4 even numbers among 1, 2, . . . , p ` 1, so this
case is not possible.

Solution 2. The cases a ‰ p are covered as in solution 1, as are p “ 2, 3. For p ě 5 we have


b! “ pppp´1 ´ 1q. By Zsigmondy’s Theorem there exists some prime q that divides pp´1 ´ 1
but does not divide pk ´ 1 for k ă p ´ 1. It follows that ordq ppq “ p ´ 1, and hence q ” 1
mod pp ´ 1q. Note that p ‰ q. But then we must have q ě 2p ´ 1, giving

b! ě p2p ´ 1q! “ r1 ¨ p2p ´ 1qs ¨ r2 ¨ p2p ´ 2qs ¨ ¨ ¨ ¨ ¨ rpp ´ 1q ¨ pp ` 1qs ¨ p ą p2p ´ 1qp´1 p ą pp ą pp ´ p,

a contradiction.

Solution 3. The cases a ‰ p are covered as in solution 1, as are p “ 2, 3. Also b ą p, as


pp ą p! ` p for p ą 2. The cases p “ 5, 7, 11 are also checked manually, so assume p ě 13.
Let q|p ` 1 be an odd prime. By LTE
ˆ ˙
p
´
2 p´1
¯
2 p´1
vq pp ´ pq “ vq pp q 2 ´ 1 “ vq pp ´ 1q ` vq “ vq pp ` 1q.
2
But b ě p ` 1, so then vq pb!q ą vq pp ` 1q, since q ă p ` 1, a contradiction. This means that
p ` 1 has no odd prime divisor, i.e. p ` 1 “ 2k for some k.
Shortlisted problems – solutions 65

Now let q|p ´ 1 be an odd prime. By LTE

vq ppp ´ pq “ 2vq pp ´ 1q.

Let d “ vq pp ´ 1q. Then p ě 1 ` q d , so

vq pb!q ě vq pp!q ě vq pq d !q ą q d´1 ě 2d

provided d ě 2 and q ą 3, or d ě 3.
If q “ 3, d “ 2 and p ě 13 then vq pb!q ě vq pp!q ě vq p13!q “ 5 ą 2d. Either way, d ď 1.
If p ą 2q ` 1 (so p ą 3q, as q|p ´ 1) then

vq pb!q ě vq pp3qq!q “ 3,

so we must have q ě p2 , in other words, p´1 “ 2q. This implies that p “ 2k ´1 and q “ 2k´1 ´1
are both prime, but it is not possible to have two consecutive Mersenne primes.

Solution 4. Let a “ p, b ą p and p ě 5 (the remaining cases are dealt with as in solution 3).
Modulo pp ` 1q2 it holds that
ˆ ˙
p p p ` ˘
p ´p “ pp`1´1q ´p ” pp`1qp´1qp´1 `p´1qp ´p “ ppp`1q´1´p “ p2 ´1 ı 0 mod pp ` 1q2 .
1

Since p ě 5, the numbers 2 and p`1


2
are distinct and less than or equal to p. Therefore, p ` 1|p!,
and so pp ` 1q2 |pp ` 1q!.
But b ě p ` 1, so b! ” 0 ı pp ´ p mod pp ` 1q2 , a contradiction.
66 Oslo, Norway, 6th–16th July 2022

N5. For each 1 ď i ď 9 and T P N, define di pT q to be the total number of times the digit
i appears when all the multiples of 1829 between 1 and T inclusive are written out in base 10.
Show that there are infinitely many T P N such that there are precisely two distinct values
among d1 pT q, d2 pT q, . . . , d9 pT q.
(United Kingdom)

Solution. Let n :“ 1829. First, we choose some k such that n | 10k ´ 1. For instance, any
multiple of ϕpnq would work since n is coprime to 10. We will show that either T “ 10k ´ 1
or T “ 10k ´ 2 has the desired property, which completes the proof since k can be taken to be
arbitrary large.
For this it suffices to show that #tdi 10k ´ 1 : 1 ď i ď 9u ď 2. Indeed, if
` ˘

` ˘
#tdi 10k ´ 1 : 1 ď i ď 9u “ 1

then, since 10k ´ 1 which consists of all nines is a multiple of n, we have

di 10k ´ 2 “ di 10k ´ 1 for i P t1, . . . , 8u, and d9 10k ´ 2 ă d9 10k ´ 1 .


` ˘ ` ˘ ` ˘ ` ˘

This means that #tdi 10k ´ 2 : 1 ď i ď 9u “ 2.


` ˘

To prove that #tdi 10k ´ 1 u ď 2 we need an observation. Let ak´1 ak´2 . . . a0 P 1, . . . , 10k ´ 1
` ˘ (

be the decimal expansion of an arbitrary number, possibly with leading zeroes. Then ak´1 ak´2 . . . a0
is divisible by n if and only if ak´2 . . . a0 ak´1 is divisible by n. Indeed, this follows from the fact
that ` ˘
10 ¨ ak´1 ak´2 . . . a0 ´ ak´2 . . . a0 ak´1 “ 10k ´ 1 ¨ ak´1
is divisible by n.
This observation shows that the set of multiples of n between 1 and 10k ´ 1 is invariant
under simultaneous cyclic permutation of digits ` when ˘numbers are written with leading zeroes.
Hence, for each i P t1, . . . , 9u the number di 10 ´ 1 is k times larger than the number of k
k

digit numbers which start from the digit i and are divisible
` kby n.˘ Since the latter number is
either t10 {nu or 1 ` t10 {nu, we conclude that #tdi 10 ´ 1 u ď 2.
k´1 k´1

` ˘
Comment. More careful analysis shows that #tdi 10k ´ 1 : 1 ď i ď 9u “ 1 if and only if n ” 1
pmod 10q, which is not the case for n “ 1829.
Shortlisted problems – solutions 67

N6. Let Q be a set of prime numbers, not necessarily finite. For a positive integer n
consider its prime factorisation; define ppnq to be the sum of all the exponents and qpnq to be
the sum of the exponents corresponding only to primes in Q. A positive integer n is called
special if ppnq ` ppn ` 1q and qpnq ` qpn ` 1q are both even integers. Prove that there is a
constant c ą 0 independent of the set Q such that for any positive integer N ą 100, the number
of special integers in r1, N s is at least cN .
(For example, if Q “ t3, 7u, then pp42q “ 3, qp42q “ 2, pp63q “ 3, qp63q “ 3, pp2022q “ 3,
qp2022q “ 1.)
(Costa Rica)

Solution. Let us call two positive integers m, n friends if ppmq ` ppnq and qpmq ` qpnq are
both even integers. We start by noting that the pairs pppkq, qpkqq modulo 2 can take at most 4
different values; thus, among any five different positive integers there are two which are friends.
In addition, both functions p and q satisfy f pabq “ f paq ` f pbq for any a, b. Therefore, if
m and n are divisible by d, then both p and q satisfy the equality f pmq ` f pnq “ f pm{dq `
f pn{dq ` 2f pdq. This implies that m, n are friends if and only if m{d, n{d are friends.
Let us call a set of integers tn1 , n2 , . . . , n5 u an interesting set if for any indexes i, j, the
difference dij “ |ni ´ nj | divides both ni and nj . We claim that if elements of an interesting
set are all positive, then we can obtain a special integer. Indeed, if we were able to construct
such a set, then there would be a pair of integers tni , nj u which are friends, according to the
first observation. Additionally, the second observation yields that the quotients ni {dij , nj {dij
form a pair of friends, which happen to be consecutive integers, thus giving a special integer as
desired.
In order to construct a family of interesting sets, we can start by observing that the set
t0, 6, 8, 9, 12u is an interesting set. Using that 72 “ 23 ¨ 32 is the least common multiple of all
pairwise differences in this set, we obtain a family of interesting sets by considering

t72k, 72k ` 6, 72k ` 8, 72k ` 9, 72k ` 12u,

for any k ě 1. If we consider the quotients (of these numbers by the appropriate differences),
then we obtain that the set

Sk “ t6k, 8k, 9k, 12k, 12k ` 1, 18k ` 2, 24k ` 2, 24k ` 3, 36k ` 3, 72k ` 8u,

has at least one special integer. In particular, the interval r1, 100ks contains the sets S1 , S2 , ..., Sk ,
each of which has a special number. Any special number can be contained in at most ten sets
Sk , from where we conclude that the number of special integers in r1, 100ks is at least k{10.
Finally, let N “ 100k ` r, with k ě 1 and 0 ď r ă 100, so that we have N ă 100pk ` 1q ď
200k. Then the number of special integers in r1, N s is at least k{10 ą N {2000, as we wanted
to prove.

Comment 1. The statement is also true for N ě 15 as at least one of the numbers 7, 14, 15 is special.

Comment 2. Another approach would be to note that if pp2nq, pp2n ` 1q, pp2n ` 2q all have the
same parity then one of the numbers n, 2n, 2n ` 1 is special. Indeed, if qpnq ` qpn ` 1q is even then n
is special since ppnq ` ppn ` 1q ” pp2nq ` pp2n ` 2q ” 0 pmod 2q. Otherwise, if qpnq ` qpn ` 1q is odd,
so is qp2nq ` qp2n ` 2q which implies that exactly one of the numbers 2n, 2n ` 1 is special.
Unfortunately, it seems hard to show that the set of such n has positive density: see a recent
paper https://arxiv.org/abs/1509.01545 for the proof that all eight patterns of the parities of
ppnq, ppn ` 1q, ppn ` 2q appear for a positive proportion of positive integers.
This page is intentionally left blank
Shortlisted problems – solutions 69

N7. Let k be a positive integer and let S be a finite set of odd prime numbers. Prove that
there is at most one way (modulo rotation and reflection) to place the elements of S around a
circle such that the product of any two neighbors is of the form x2 ` x ` k for some positive
integer x.
(U.S.A.)

Solution. Let us allow the value x “ 0 as well; we prove the same statement under this more
general constraint. Obviously that implies the statement with the original conditions.

Call a pair tp, qu of primes with p ‰ q special if pq “ x2 ` x ` k for some nonnegative


integer x. The following claim is the key mechanism of the problem:
Claim.

(a) For every prime r, there are at most two primes less than r forming a special pair with r.

(b) If such p and q exist, then tp, qu is itself special.

We present two proofs of the claim.


Proof 1. We are interested in integers 1 ď x ă r satsfying

x2 ` x ` k ” 0 pmod rq. p1q

Since there are at most two residues modulo r that can satisfy that quadratic congruence, there
are at most two possible values of x. That proves (a).
Now suppose there are primes p, q with p ă q ă r and nonnegative integers x, y such that

x2 ` x ` k “ pr
y 2 ` y ` k “ qr.

From p ă q ă r we can see that 0 ď x ă y ď r ´ 1. The numbers x, y are the two solutions of
p1q; by Vieta’s formulas, we should have x ` y ” ´1 pmod rq, so x ` y “ r ´ 1.
Letting K “ 4k ´ 1, X “ 2x ` 1, and Y “ 2y ` 1, we obtain

4pr “ X 2 ` K,
4qr “ Y 2 ` K

with X ` Y “ 2r. Multiplying the two above equations,

16pqr2 “ pX 2 ` KqpY 2 ` Kq
“ pXY ´ Kq2 ` KpX ` Y q2
“ pXY ´ Kq2 ` 4Kr2 ,
ˆ ˙2
XY ´ K
4pq “ ` K.
2r

In particular, the number Z “ XY ´K


2r
should be an integer, and so 4pq “ Z 2 ` K. By parity,
Z is odd, and thus
Z ´1
pq “ z 2 ` z ` k where z “ ,
2
so tp, qu is special. l
70 Oslo, Norway, 6th–16th July 2022

Proof 2. As before, we suppose that


x2 ` x ` k “ pr
y 2 ` y ` k “ qr.
Subtracting, we have
px ` y ` 1qpx ´ yq “ rpp ´ qq.
As before, we have x ` y “ r ´ 1, so x ´ y “ p ´ q, and
x “ 21 pr ` p ´ q ´ 1q
y “ 21 pr ` q ´ p ´ 1q.
Then,
k “ pr ´ x2 ´ x “ 14 p4pr ´ pr ` p ´ q ´ 1q2 ´ 2pr ` p ´ q ´ 1qq
“ 14 p4pr ´ pr ` p ´ qq2 ` 1q
“ 41 p2pq ` 2pr ` 2qr ´ p2 ´ q 2 ´ r2 ` 1q,
which is symmetric in p, q, r, so
pq “ z 2 ` z ` k where z “ 21 pp ` q ´ r ´ 1q,
and tp, qu is special. l
Now we settle the problem by induction on |S|, with |S| ď 3 clear.
Suppose we have proven it for |S| “ n and consider |S| “ n ` 1. Let r be the largest prime
in S; the claim tells us that in any valid cycle of primes:
• the neighbors of r are uniquely determined, and
• removing r from the cycle results in a smaller valid cycle.
It follows that there is at most one valid cycle, completing the inductive step.
Comment. The statement is not as inapplicable as it might seem. For example, for k “ 41, the
following 385 primes form a valid cycle of primes:
53, 4357, 104173, 65921, 36383, 99527, 193789, 2089123, 1010357, 2465263, 319169, 15559, 3449, 2647, 1951, 152297,
542189, 119773, 91151, 66431, 222137, 1336799, 469069, 45613, 1047941, 656291, 355867, 146669, 874879, 2213327,
305119, 3336209, 1623467, 520963, 794201, 1124833, 28697, 15683, 42557, 6571, 39607, 1238833, 835421, 2653681,
5494387, 9357539, 511223, 1515317, 8868173, 114079681, 59334071, 22324807, 3051889, 5120939, 7722467, 266239,
693809, 3931783, 1322317, 100469, 13913, 74419, 23977, 1361, 62983, 935021, 512657, 1394849, 216259, 45827,
31393, 100787, 1193989, 600979, 209543, 357661, 545141, 19681, 10691, 28867, 165089, 2118023, 6271891, 12626693,
21182429, 1100467, 413089, 772867, 1244423, 1827757, 55889, 1558873, 5110711, 1024427, 601759, 290869, 91757,
951109, 452033, 136471, 190031, 4423, 9239, 15809, 24133, 115811, 275911, 34211, 877, 6653, 88001, 46261, 317741,
121523, 232439, 379009, 17827, 2699, 15937, 497729, 335539, 205223, 106781, 1394413, 4140947, 8346383, 43984757,
14010721, 21133961, 729451, 4997297, 1908223, 278051, 529747, 40213, 768107, 456821, 1325351, 225961, 1501921,
562763, 75527, 5519, 9337, 14153, 499, 1399, 2753, 14401, 94583, 245107, 35171, 397093, 195907, 2505623, 34680911,
18542791, 7415917, 144797293, 455529251, 86675291, 252704911, 43385123, 109207907, 204884269, 330414209,
14926789, 1300289, 486769, 2723989, 907757, 1458871, 65063, 4561, 124427, 81343, 252887, 2980139, 1496779,
3779057, 519193, 47381, 135283, 268267, 446333, 669481, 22541, 54167, 99439, 158357, 6823, 32497, 1390709,
998029, 670343, 5180017, 13936673, 2123491, 4391941, 407651, 209953, 77249, 867653, 427117, 141079, 9539, 227,
1439, 18679, 9749, 25453, 3697, 42139, 122327, 712303, 244261, 20873, 52051, 589997, 4310569, 1711069, 291563,
3731527, 11045429, 129098443, 64620427, 162661963, 22233269, 37295047, 1936969, 5033449, 725537, 1353973,
6964457, 2176871, 97231, 7001, 11351, 55673, 16747, 169003, 1218571, 479957, 2779783, 949609, 4975787, 1577959,
2365007, 3310753, 79349, 23189, 107209, 688907, 252583, 30677, 523, 941, 25981, 205103, 85087, 1011233, 509659,
178259, 950479, 6262847, 2333693, 305497, 3199319, 9148267, 1527563, 466801, 17033, 9967, 323003, 4724099,
14278309, 2576557, 1075021, 6462593, 2266021, 63922471, 209814503, 42117791, 131659867, 270892249, 24845153,
12104557, 3896003, 219491, 135913, 406397, 72269, 191689, 2197697, 1091273, 2727311, 368227, 1911661, 601883,
892657, 28559, 4783, 60497, 31259, 80909, 457697, 153733, 11587, 1481, 26161, 15193, 7187, 2143, 21517, 10079,
207643, 1604381, 657661, 126227, 372313, 2176331, 748337, 64969, 844867, 2507291, 29317943, 14677801, 36952793,
69332267, 111816223, 5052241, 8479717, 441263, 3020431, 1152751, 13179611, 38280013, 6536771, 16319657,
91442699, 30501409, 49082027, 72061511, 2199433, 167597, 317963, 23869, 2927, 3833, 17327, 110879, 285517,
40543, 4861, 21683, 50527, 565319, 277829, 687917, 3846023, 25542677, 174261149, 66370753, 9565711, 1280791,
91393, 6011, 7283, 31859, 8677, 10193, 43987, 11831, 13591, 127843, 358229, 58067, 15473, 65839, 17477, 74099,
19603, 82847, 21851, 61.
Shortlisted problems – solutions 71

N8. Prove that 5n ´ 3n is not divisible by 2n ` 65 for any positive integer n.


(Belgium)

Solution 1. Let n be a positive integer, and let m “ 2n ` 65. For the sake of contradiction,
suppose that m | 5n ´ 3n , so 5n ” 3n pmod mq.
Notice that if n is even, then 3 | m, but 3 - 5n ´ 3n , contradiction. So, from now on we
assume that n is odd, n “ 2k ` 1. Obviously n “ 1 is not possible, so n ě 3. Notice that m is
coprime to 2, 3 and 5.

Let m1 be the smallest positive multiple of m that can be written in the form of
either |5a2 ´ 3b2 | or |a2 ´ 15b2 | with some integers a and b.
` ˘2 ` ˘2
Note that 5n ´ 3n “ 5 5k ´ 3 3k is a multiple of m, so the set of such multiples is
non-empty, and therefore m1 is well-defined.
I. First we show that m1 ď 5m. Consider the numbers
?
5k`1 x ` 3k`1 y, 0 ď x, y ď m.
X? \ ?
There are m ` 1 ą m choices for x and y, so there are more than m possible pairs px, yq.
Hence, two of these sums are congruent modulo m: 5k`1 x1 `3k`1 y1 ” 5k`1 x2 `3k`1 y2 pmod mq.
Now choose a “ x1 ´ x2 and b “ y1 ´ y2 ; at least one of a, b is nonzero, and
?
5k`1 a ` 3k`1 b ” 0 pmod mq, |a|, |b| ď m.
From
0 ” p5k`1 aq2 ´ p3k`1 bq2 “ 5n`1 a2 ´ 3n`1 b2 ” 5 ¨ 3n a2 ´ 3n`1 b2 “ 3n p5a2 ´ 3b2 q pmod mq
we can see that |5a2 ´ 3b2 | is a multiple of m. Since at least one of a and b is nonzero, 5a2 ‰ 3b2 .
Hence, by the choice of a, b, we have 0 ă |5a2 ´ 3b2 | ď maxp5a2 , 3b2 q ď 5m. That shows that
m1 ď 5m.
II. Next, we show that m1 cannot be divisible by 2, 3 and 5. Since m1 equals either |5a2 ´ 3b2 |
or |a2 ´ 15b2 | with some integers a, b, we have six cases to check. In all six cases, we will get a
contradiction by presenting another multiple of m, smaller than m1 .
` ˘2 ˇ
• If 5 | m1 and m1 “ |5a2 ´ 3b2 |, then 5 | b and ˇa2 ´ 15 5b ˇ “ m51 ă m1 .
ˇ

ˇ ` ˘2
• If 5 | m1 and m1 “ |a2 ´ 15b2 |, then 5 | a and ˇ5 a5 ´ 3b2 ˇ “ m51 ă m1 .
ˇ

` ˘2 ˇ
• If 3 | m1 and m1 “ |5a2 ´ 3b2 |, then 3 | a and ˇb2 ´ 15 a3 ˇ “ m31 ă m1 .
ˇ

` ˘2 ˇ
• If 3 | m1 and m1 “ |a2 ´ 15b2 |, then 3 | a and ˇ5b2 ´ 3 a3 ˇ “ m31 ă m1 .
ˇ

˘2 ` a´b ˘2 ˇ m
• If 2 | m1 and m1 “ |5a2 ´ 3b2 |, then ˇ 5a´3b ˇ “ 1 ă m1 .
ˇ`
2
´ 15 2 2
2 2
• If 2 | m1 and m1 “ |a2 ´ 15b2 |, then ˇ5 a´3b ˇ “ m1 ă m1 .
ˇ ` ˘ ` ˘ ˇ
2
´ 3 a´5b
2 2
? ? ? ? ?
(The last ?two expressions
? ? can ? be obtained from
? p 5a ` 3bqp 5 ´ 3q “ p5a ´ 3bq ` 15pb ´ aq
and pa ` 15bqp 5 ´ 3q “ 5pa ´ 3bq ` 3p5b ´ aq.)
In all six cases, we found that either m21 , m31 or m51 is of the form |5x2 ´ 3y 2 | or |x2 ´ 15y 2 |.
Since m is coprime to 2, 3 and 5, the presented number is a multiple of m, but this contradicts
the minimality of m1 .
III. The last remaining case is m1 “ m, so either m “ |5a2 ´ 3b2 | or m “ |a2 ´ 15b2 |. We will
get a contradiction by considering the two sides modulo 3, 4 and 5.
• 2n ` 65 “ 5a2 ´ 3b2 is not possible, because 2n ` 65 ” 1 pmod 3q, but 5a2 ´ 3b2 ı 1
pmod 3q.

• 2n ` 65 “ 3b2 ´ 5a2 is not possible, because 2n ` 65 ” 1 pmod 4q, but 3b2 ´ 5a2 ı 1
pmod 4q.

• 2n ` 65 “ a2 ´ 15b2 is not possible, because 2n ` 65 ” ˘2 pmod 5q, but a2 ´ 15b2 ı ˘2


pmod 5q.

• 2n ` 65 “ 15b2 ´ a2 is not possible, because 2n ` 65 ” 1 pmod 4q, but 15b2 ´ a2 ı 1


pmod 4q.

We found a contradiction in all cases, that completes the solution.

Comment 1. Part I is a standard application of Thue’s lemma:

Lemma (Thue). Suppose that m ą 1 and c are integers, and X, Y are positive integers
such that X ď m ă XY . Then there exist some integers x, y with |x| ă X and 0 ă y ă Y ,
such that x ” cy pmod mq.

It is a well-known corollary that if c, d are coprime to m, the congruence cx2 ” dy 2 pmod mq has
a solution such that x, y are coprime to m, and X, Y are positive integers such that XY ą m, then
cx2 ” dy 2 pmod mq has a solution such that at least one of x, y is nonzero,
X?|x|\ ă X and |y| ă Y .
In the solution we applied this corollary with c “ 5, d “ 3, X “ Y “ m ` 1.

Comment 2. In fact, we proved that a positive integer m with m ” 13 or 37 pmod 60q cannot divide
any nonzero integer of the form 5a2 ´ 3b2 or a2 ´ 15b2 with coprime integers a, b. In other words, if
m ” 13 or 37 pmod 60q, then 15 is not a quadratic residue modulo m. Using the tools of quadratic
reciprocity, the solution can be significantly shortened.
Suppose that a and b are coprime. For every prime divisor p ą 5 of 5a2 ´ 3b2 or a2 ´ 15b2 , we have
ˆ ˙ ˆ ˙ˆ ˙ ˆ ˙ˆ ˙
15 3 5 p´1 p p
1“ “ “ p´1q 2 , p1q
p p p 3 5
` ˘
where ap stands for the Legendre symbol. Considering the remainders of p when divided by 4, 3
and 5, p1q leads to
p ” ˘1, ˘7, ˘11 or ˘17 mod 60.
These remainders form a subgroup of the reduced remainders modulo 60. Since 13 and 37 are not
elements in this subgroup, the number m “ 2n ` 65 cannot be a product of such primes.
Instead of handling the prime divisors of m separately, we can use Jacobi symbols for further
simplification, as shown in the next solution.

Solution 2. Suppose again that 5n ” 3n pmod m “ 2n ` 65q. Like in the first solution, we
conclude that n must be odd, and n ě 3, so 8 | 2n .
Using Jacobi symbols,
ˆ n ˙ ˆ ˙ ˆ ˙ ˆ ˙ ˆ ˙ ˆ n ˙
2 ` 65 5 5n 3n 3 2 ` 65
´1 “ “ “ “ “ “ “ 1,
5 2n ` 65 2n ` 65 2n ` 65 2n ` 65 3

contradiction.

You might also like