Shortlisted Problems with Solutions $57^{\text {th }}$ 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.
Problems
Algebra
A1. Let $a, b$ and $c$ be positive real numbers such that $\min {a b, b c, c a} \geqslant 1$. Prove that
A2. Find the smallest real constant $C$ such that for any positive real numbers $a_{1}, a_{2}, a_{3}, a_{4}$ and $a_{5}$ (not necessarily distinct), one can always choose distinct subscripts $i, j, k$ and $l$ such that
A3. Find all integers $n \geqslant 3$ with the following property: for all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ satisfying $\left|a_{k}\right|+\left|b_{k}\right|=1$ for $1 \leqslant k \leqslant n$, there exist $x_{1}, x_{2}, \ldots, x_{n}$, each of which is either -1 or 1 , such that
A4. Denote by $\mathbb{R}^{+}$the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that
for all positive real numbers $x$ and $y$.
A5.
(a) Prove that for every positive integer $n$, there exists a fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $0<b \leqslant \sqrt{n}+1$ and $\sqrt{n} \leqslant \frac{a}{b} \leqslant \sqrt{n+1}$. (b) Prove that there are infinitely many positive integers $n$ such that there is no fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $0<b \leqslant \sqrt{n}$ and $\sqrt{n} \leqslant \frac{a}{b} \leqslant \sqrt{n+1}$.
A6. The equation
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 $\mathbb{R}$ the set of all real numbers. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $f(0) \neq 0$ and
for all real numbers $x$ and $y$.
A8. Determine the largest real number $a$ such that for all $n \geqslant 1$ and for all real numbers $x_{0}, x_{1}, \ldots, x_{n}$ satisfying $0=x_{0}<x_{1}<x_{2}<\cdots<x_{n}$, we have
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. $\mathbf{C 4}$. Find all positive integers $n$ for which we can fill in the entries of an $n \times 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 \geqslant 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.
C6. There are $n \geqslant 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 \geqslant 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 $2 n \times 2 n$ board so that there exists a unique partition of the board into $1 \times 2$ and $2 \times 1$ dominoes, none of which contains two marked cells.
Geometry
G1. In a convex pentagon $A B C D E$, let $F$ be a point on $A C$ such that $\angle F B C=90^{\circ}$. Suppose triangles $A B F, A C D$ and $A D E$ are similar isosceles triangles with
Let $M$ be the midpoint of $C F$. Point $X$ is chosen such that $A M X E$ is a parallelogram. Show that $B D, E M$ and $F X$ are concurrent.
G2. Let $A B C$ be a triangle with circumcircle $\Gamma$ and incentre $I$. Let $M$ be the midpoint of side $B C$. Denote by $D$ the foot of perpendicular from $I$ to side $B C$. The line through $I$ perpendicular to $A I$ meets sides $A B$ and $A C$ at $F$ and $E$ respectively. Suppose the circumcircle of triangle $A E F$ intersects $\Gamma$ at a point $X$ other than $A$. Prove that lines $X D$ and $A M$ meet on $\Gamma$.
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 $P_{1} P_{2} P_{3}$, there exists a unique point $A$ in $S$ and a permutation $\sigma$ of the indices ${1,2,3}$ for which triangles $A B C$ and $P_{\sigma(1)} P_{\sigma(2)} P_{\sigma(3)}$ are similar.
Prove that there exist two distinct nice subsets $S$ and $S^{\prime}$ of the set ${(x, y): x \geqslant 0, y \geqslant 0}$ such that if $A \in S$ and $A^{\prime} \in S^{\prime}$ are the unique choices of points in (ii), then the product $B A \cdot B A^{\prime}$ is a constant independent of the triangle $P_{1} P_{2} P_{3}$.
G4. Let $A B C$ be a triangle with $A B=A C \neq B C$ and let $I$ be its incentre. The line $B I$ meets $A C$ at $D$, and the line through $D$ perpendicular to $A C$ meets $A I$ at $E$. Prove that the reflection of $I$ in $A C$ lies on the circumcircle of triangle $B D E$.
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 $A B C$. A circle $\omega$ with centre $S$ passes through $A$ and $D$, and it intersects sides $A B$ and $A C$ at $X$ and $Y$ respectively. Let $P$ be the foot of altitude from $A$ to $B C$, and let $M$ be the midpoint of $B C$. Prove that the circumcentre of triangle $X S Y$ is equidistant from $P$ and $M$.
G6. Let $A B C D$ be a convex quadrilateral with $\angle A B C=\angle A D C<90^{\circ}$. The internal angle bisectors of $\angle A B C$ and $\angle A D C$ meet $A C$ at $E$ and $F$ respectively, and meet each other at point $P$. Let $M$ be the midpoint of $A C$ and let $\omega$ be the circumcircle of triangle $B P D$. Segments $B M$ and $D M$ intersect $\omega$ again at $X$ and $Y$ respectively. Denote by $Q$ the intersection point of lines $X E$ and $Y F$. Prove that $P Q \perp A C$.
G7. Let $I$ be the incentre of a non-equilateral triangle $A B C, I_{A}$ be the $A$-excentre, $I_{A}^{\prime}$ be the reflection of $I_{A}$ in $B C$, and $l_{A}$ be the reflection of line $A I_{A}^{\prime}$ in $A I$. Define points $I_{B}, I_{B}^{\prime}$ and line $l_{B}$ analogously. Let $P$ be the intersection point of $l_{A}$ and $l_{B}$. (a) Prove that $P$ lies on line $O I$ where $O$ is the circumcentre of triangle $A B C$. (b) Let one of the tangents from $P$ to the incircle of triangle $A B C$ meet the circumcircle at points $X$ and $Y$. Show that $\angle X I Y=120^{\circ}$.
G8. Let $A_{1}, B_{1}$ and $C_{1}$ be points on sides $B C, C A$ and $A B$ of an acute triangle $A B C$ respectively, such that $A A_{1}, B B_{1}$ and $C C_{1}$ are the internal angle bisectors of triangle $A B C$. Let $I$ be the incentre of triangle $A B C$, and $H$ be the orthocentre of triangle $A_{1} B_{1} C_{1}$. Show that
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 \geqslant 2016$, the integer $P(n)$ is positive and
N2. Let $\tau(n)$ be the number of positive divisors of $n$. Let $\tau_{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 $\frac{\tau(10 n)}{\tau_{1}(10 n)}$.
N3. Define $P(n)=n^{2}+n+1$. For any positive integers $a$ and $b$, the set
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 \neq 1$ such that $n^{k}+m n^{l}+1$ divides $n^{k+l}-1$. Prove that
- $m=1$ and $l=2 k$; or
- $l \mid k$ and $m=\frac{n^{k-l}-1}{n^{l}-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
for some integers $x$ and $y$ with $x>\sqrt{a}$. Denote by $B$ the set of all positive integers $k$ such that (1) is satisfied for some integers $x$ and $y$ with $0 \leqslant x<\sqrt{a}$. Prove that $A=B$.
N6. Denote by $\mathbb{N}$ the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for all positive integers $m$ and $n$, the integer $f(m)+f(n)-m n$ is nonzero and divides $m f(m)+n f(n)$.
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 $2 S$ 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 $x_{1}, x_{2}, \ldots, x_{n}$ such that $\frac{1}{2}<\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}<2$ and $\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}$ is the $d$-th power of a rational number for every pair of indices $i$ and $j$ with $1 \leqslant i, j \leqslant n$.
Solutions
Algebra
A1. Let $a, b$ and $c$ be positive real numbers such that $\min {a b, b c, c a} \geqslant 1$. Prove that
Solution 1. We first show the following.
- Claim. For any positive real numbers $x, y$ with $x y \geqslant 1$, we have
Proof. Note that $x y \geqslant 1$ implies $\left(\frac{x+y}{2}\right)^{2}-1 \geqslant x y-1 \geqslant 0$. We find that $\left(x^{2}+1\right)\left(y^{2}+1\right)=(x y-1)^{2}+(x+y)^{2} \leqslant\left(\left(\frac{x+y}{2}\right)^{2}-1\right)^{2}+(x+y)^{2}=\left(\left(\frac{x+y}{2}\right)^{2}+1\right)^{2}$.
Without loss of generality, assume $a \geqslant b \geqslant c$. This implies $a \geqslant 1$. Let $d=\frac{a+b+c}{3}$. Note that
Then we can apply (2) to the pair $(a, d)$ and the pair $(b, c)$. We get
Next, from
we can apply (2) again to the pair $\left(\frac{a+d}{2}, \frac{b+c}{2}\right)$. Together with (3), we have
Therefore, $\left(a^{2}+1\right)\left(b^{2}+1\right)\left(c^{2}+1\right) \leqslant\left(d^{2}+1\right)^{3}$, and (1) follows by taking cube root of both sides.
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 $x y \geqslant 1$ is preserved under each mixing step. This is true since whenever $a b, b c, c a \geqslant 1$, we have
Solution 2. Let $f(x)=\ln \left(1+x^{2}\right)$. Then the inequality (1) to be shown is equivalent to
while (2) becomes
for $x y \geqslant 1$. Without loss of generality, assume $a \geqslant b \geqslant c$. From the Claim in Solution 1, we have
Note that $a \geqslant 1$ and $\frac{b+c}{2} \geqslant \sqrt{b c} \geqslant 1$. Since
we know that $f$ is concave on $[1, \infty)$. Then we can apply Jensen's Theorem to get
This completes the proof.
A2. Find the smallest real constant $C$ such that for any positive real numbers $a_{1}, a_{2}, a_{3}, a_{4}$ and $a_{5}$ (not necessarily distinct), one can always choose distinct subscripts $i, j, k$ and $l$ such that
Answer. The smallest $C$ is $\frac{1}{2}$. Solution. We first show that $C \leqslant \frac{1}{2}$. For any positive real numbers $a_{1} \leqslant a_{2} \leqslant a_{3} \leqslant a_{4} \leqslant a_{5}$, consider the five fractions
Each of them lies in the interval $(0,1]$. Therefore, by the Pigeonhole Principle, at least three of them must lie in $\left(0, \frac{1}{2}\right]$ or lie in $\left(\frac{1}{2}, 1\right]$ simultaneously. In particular, there must be two consecutive terms in (2) which belong to an interval of length $\frac{1}{2}$ (here, we regard $\frac{a_{1}}{a_{2}}$ and $\frac{a_{4}}{a_{5}}$ as consecutive). In other words, the difference of these two fractions is less than $\frac{1}{2}$. As the indices involved in these two fractions are distinct, we can choose them to be $i, j, k, l$ and conclude that $C \leqslant \frac{1}{2}$.
Next, we show that $C=\frac{1}{2}$ 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 $\frac{1}{n}, \frac{2}{n}, \frac{1}{2}, \frac{2}{2}, \frac{2}{1}, \frac{n}{2}, \frac{n}{1}$. Since the indices $i, j, k, l$ are distinct, $\frac{1}{n}$ and $\frac{2}{n}$ cannot be chosen simultaneously. Therefore the minimum value of the left-hand side of (1) is $\frac{1}{2}-\frac{2}{n}$. When $n$ tends to infinity, this value approaches $\frac{1}{2}$, and so $C$ cannot be less than $\frac{1}{2}$.
These conclude that $C=\frac{1}{2}$ is the smallest possible choice. Comment. The conclusion still holds if $a_{1}, a_{2}, \ldots, a_{5}$ are pairwise distinct, since in the construction, we may replace the 2's by real numbers sufficiently close to 2 .
There are two possible simplifications for this problem: (i) the answer $C=\frac{1}{2}$ is given to the contestants; or (ii) simply ask the contestants to prove the inequality (1) for $C=\frac{1}{2}$.
A3. Find all integers $n \geqslant 3$ with the following property: for all real numbers $a_{1}, a_{2}, \ldots, a_{n}$ and $b_{1}, b_{2}, \ldots, b_{n}$ satisfying $\left|a_{k}\right|+\left|b_{k}\right|=1$ for $1 \leqslant k \leqslant n$, there exist $x_{1}, x_{2}, \ldots, x_{n}$, each of which is either -1 or 1 , such that
Answer. $n$ can be any odd integer greater than or equal to 3 . Solution 1. For any even integer $n \geqslant 4$, we consider the case
The condition $\left|a_{k}\right|+\left|b_{k}\right|=1$ is satisfied for each $1 \leqslant k \leqslant n$. No matter how we choose each $x_{k}$, both sums $\sum_{k=1}^{n} x_{k} a_{k}$ and $\sum_{k=1}^{n} x_{k} b_{k}$ are odd integers. This implies $\left|\sum_{k=1}^{n} x_{k} a_{k}\right| \geqslant 1$ and $\left|\sum_{k=1}^{n} x_{k} b_{k}\right| \geqslant 1$, which shows (1) cannot hold.
For any odd integer $n \geqslant 3$, we may assume without loss of generality $b_{k} \geqslant 0$ for $1 \leqslant k \leqslant n$ (this can be done by flipping the pair $\left(a_{k}, b_{k}\right)$ to $\left(-a_{k},-b_{k}\right)$ and $x_{k}$ to $-x_{k}$ if necessary) and $a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{m} \geqslant 0>a_{m+1} \geqslant \cdots \geqslant a_{n}$. We claim that the choice $x_{k}=(-1)^{k+1}$ for $1 \leqslant k \leqslant n$ will work. Define
Note that
by the assumption $a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{m}$ (when $m$ is odd, there is a single term $a_{m}$ at the end, which is also positive). Next, we have
Similarly,
and
From the condition, we have $a_{k}+b_{k}=1$ for $1 \leqslant k \leqslant m$ and $-a_{k}+b_{k}=1$ for $m+1 \leqslant k \leqslant n$. It follows that $\sum_{k=1}^{n} x_{k} a_{k}=s-t$ and $\sum_{k=1}^{n} x_{k} b_{k}=1-s-t$. Hence it remains to prove
under the constraint $0 \leqslant s, t \leqslant 1$. By symmetry, we may assume $s \geqslant t$. If $1-s-t \geqslant 0$, then we have
If $1-s-t \leqslant 0$, then we have
Hence, the inequality is true in both cases. These show $n$ can be any odd integer greater than or equal to 3 .
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 $a_{1} \geqslant a_{2} \geqslant a_{3} \geqslant 0$ and $b_{1}=a_{1}-1$ (if $b_{1}=1-a_{1}$, we may replace each $b_{k}$ by $-b_{k}$ ).
- Case 1. $b_{2}=a_{2}-1$ and $b_{3}=a_{3}-1$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(1,-1,1)$.
Let $c=a_{1}-a_{2}+a_{3}$ so that $0 \leqslant c \leqslant 1$. Then $\left|b_{1}-b_{2}+b_{3}\right|=\left|a_{1}-a_{2}+a_{3}-1\right|=1-c$ and hence $|c|+\left|b_{1}-b_{2}+b_{3}\right|=1$.
- Case 2. $b_{2}=1-a_{2}$ and $b_{3}=1-a_{3}$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(1,-1,1)$.
Let $c=a_{1}-a_{2}+a_{3}$ so that $0 \leqslant c \leqslant 1$. Since $a_{3} \leqslant a_{2}$ and $a_{1} \leqslant 1$, we have
This gives $\left|b_{1}-b_{2}+b_{3}\right| \leqslant 1-c$ and hence $|c|+\left|b_{1}-b_{2}+b_{3}\right| \leqslant 1$.
- Case 3. $b_{2}=a_{2}-1$ and $b_{3}=1-a_{3}$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(-1,1,1)$.
Let $c=-a_{1}+a_{2}+a_{3}$. If $c \geqslant 0$, then $a_{3} \leqslant 1$ and $a_{2} \leqslant a_{1}$ imply
If $c<0$, then $a_{1} \leqslant a_{2}+1$ and $a_{3} \geqslant 0$ imply
In both cases, we get $\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1-|c|$ and hence $|c|+\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1$.
- Case 4. $b_{2}=1-a_{2}$ and $b_{3}=a_{3}-1$, in which case we take $\left(x_{1}, x_{2}, x_{3}\right)=(-1,1,1)$.
Let $c=-a_{1}+a_{2}+a_{3}$. If $c \geqslant 0$, then $a_{2} \leqslant 1$ and $a_{3} \leqslant a_{1}$ imply
If $c<0$, then $a_{1} \leqslant a_{3}+1$ and $a_{2} \geqslant 0$ imply
In both cases, we get $\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1-|c|$ and hence $|c|+\left|-b_{1}+b_{2}+b_{3}\right| \leqslant 1$. We have found $x_{1}, x_{2}, x_{3}$ satisfying (1) in each case for $n=3$. Now, let $n \geqslant 5$ be odd and suppose the result holds for any smaller odd cases. Again we may assume $a_{k} \geqslant 0$ for each $1 \leqslant k \leqslant n$. By the Pigeonhole Principle, there are at least three indices $k$ for which $b_{k}=a_{k}-1$ or $b_{k}=1-a_{k}$. Without loss of generality, suppose $b_{k}=a_{k}-1$ for $k=1,2,3$. Again by the Pigeonhole Principle, as $a_{1}, a_{2}, a_{3}$ lies between 0 and 1 , the difference of two of them is at most $\frac{1}{2}$. By changing indices if necessary, we may assume $0 \leqslant d=a_{1}-a_{2} \leqslant \frac{1}{2}$.
By the inductive hypothesis, we can choose $x_{3}, x_{4}, \ldots, x_{n}$ such that $a^{\prime}=\sum_{k=3}^{n} x_{k} a_{k}$ and $b^{\prime}=\sum_{k=3}^{n} x_{k} b_{k}$ satisfy $\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$. We may further assume $a^{\prime} \geqslant 0$.
- Case 1. $b^{\prime} \geqslant 0$, in which case we take $\left(x_{1}, x_{2}\right)=(-1,1)$.
We have $\left|-a_{1}+a_{2}+a^{\prime}\right|+\left|-\left(a_{1}-1\right)+\left(a_{2}-1\right)+b^{\prime}\right|=\left|-d+a^{\prime}\right|+\left|-d+b^{\prime}\right| \leqslant$ $\max \left{a^{\prime}+b^{\prime}-2 d, a^{\prime}-b^{\prime}, b^{\prime}-a^{\prime}, 2 d-a^{\prime}-b^{\prime}\right} \leqslant 1$ since $0 \leqslant a^{\prime}, b^{\prime}, a^{\prime}+b^{\prime} \leqslant 1$ and $0 \leqslant d \leqslant \frac{1}{2}$.
- Case 2. $0>b^{\prime} \geqslant-a^{\prime}$, in which case we take $\left(x_{1}, x_{2}\right)=(-1,1)$.
We have $\left|-a_{1}+a_{2}+a^{\prime}\right|+\left|-\left(a_{1}-1\right)+\left(a_{2}-1\right)+b^{\prime}\right|=\left|-d+a^{\prime}\right|+\left|-d+b^{\prime}\right|$. If $-d+a^{\prime} \geqslant 0$, this equals $a^{\prime}-b^{\prime}=\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$. If $-d+a^{\prime}<0$, this equals $2 d-a^{\prime}-b^{\prime} \leqslant 2 d \leqslant 1$.
- Case 3. $b^{\prime}<-a^{\prime}$, in which case we take $\left(x_{1}, x_{2}\right)=(1,-1)$.
We have $\left|a_{1}-a_{2}+a^{\prime}\right|+\left|\left(a_{1}-1\right)-\left(a_{2}-1\right)+b^{\prime}\right|=\left|d+a^{\prime}\right|+\left|d+b^{\prime}\right|$. If $d+b^{\prime} \geqslant 0$, this equals $2 d+a^{\prime}+b^{\prime}<2 d \leqslant 1$. If $d+b^{\prime}<0$, this equals $a^{\prime}-b^{\prime}=\left|a^{\prime}\right|+\left|b^{\prime}\right| \leqslant 1$.
Therefore, we have found $x_{1}, x_{2}, \ldots, x_{n}$ satisfying (1) in each case. By induction, the property holds for all odd integers $n \geqslant 3$.
A4. Denote by $\mathbb{R}^{+}$the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$such that
for all positive real numbers $x$ and $y$.
Answer. $f(x)=\frac{1}{x}$ for any $x \in \mathbb{R}^{+}$.
hence $f(1)=1$. Swapping $x$ and $y$ in (1) and comparing with (1) again, we find
Taking $y=1$ in (2), we have $x f\left(x^{2}\right)+f(f(x))=f(f(x))+f(x)$, that is,
Take $y=1$ in (1) and apply (3) to $x f\left(x^{2}\right)$. We get $f(x)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$, which implies
For any $x \in \mathbb{R}^{+}$, we find that
It remains to show the following key step.
- Claim. The function $f$ is injective.
Proof. Using (3) and (4), we rewrite (1) as
Take $x=y$ in (6) and apply (3). This gives $f(x) f(f(x))+f(x f(x))=2 \frac{f(f(x))}{x}$, which means
Using (3), equation (2) can be rewritten as
Suppose $f(x)=f(y)$ for some $x, y \in \mathbb{R}^{+}$. Then (8) implies
Using (7), this gives
Noting $f(x)=f(y)$, we find $x=y$. This establishes the injectivity.
By the Claim and (5), we get the only possible solution $f(x)=\frac{1}{x}$. It suffices to check that this is a solution. Indeed, the left-hand side of (1) becomes
while the right-hand side becomes
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))=2 f(1) f(f(1))$ and hence $f(1)=1$. Putting $x=1$ in (1), we have $f(f(y))+f(y)=f(y)\left(1+f\left(f\left(y^{2}\right)\right)\right)$ so that
Putting $y=1$ in (1), we get $x f\left(x^{2}\right)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$. Using (9), this gives
Replace $y$ by $\frac{1}{x}$ in (1). Then we have
The relation (10) shows $f\left(\frac{f(x)}{x}\right)=f\left(f\left(x^{2}\right)\right)$. Also, using (9) with $y=\frac{1}{x}$ and using (10) again, the last equation reduces to
Replace $x$ by $\frac{1}{x}$ and $y$ by $\frac{1}{y}$ in (1) and apply (11). We get
Clearing denominators, we can use (1) to simplify the numerators and obtain
Using (9) and (10), this is the same as
Substitute $y=f(x)$ in (12) and apply (10) (with $x$ replaced by $f(x)$ ). We have
Taking $y=x$ in (12), squaring both sides, and using (10) and (13), we find that
Finally, we combine (9), (10) and (14) to get
which implies $f(y)=\frac{1}{y}$. This is a solution by the checking in Solution 1.
A5.
(a) Prove that for every positive integer $n$, there exists a fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $0<b \leqslant \sqrt{n}+1$ and $\sqrt{n} \leqslant \frac{a}{b} \leqslant \sqrt{n+1}$. (b) Prove that there are infinitely many positive integers $n$ such that there is no fraction $\frac{a}{b}$ where $a$ and $b$ are integers satisfying $0<b \leqslant \sqrt{n}$ and $\sqrt{n} \leqslant \frac{a}{b} \leqslant \sqrt{n+1}$.
Solution.
(a) Let $r$ be the unique positive integer for which $r^{2} \leqslant n<(r+1)^{2}$. Write $n=r^{2}+s$. Then we have $0 \leqslant s \leqslant 2 r$. We discuss in two cases according to the parity of $s$.
- Case 1. $s$ is even.
Consider the number $\left(r+\frac{s}{2 r}\right)^{2}=r^{2}+s+\left(\frac{s}{2 r}\right)^{2}$. We find that
It follows that
Since $s$ is even, we can choose the fraction $r+\frac{s}{2 r}=\frac{r^{2}+(s / 2)}{r}$ since $r \leqslant \sqrt{n}$.
- Case 2. $s$ is odd.
Consider the number $\left(r+1-\frac{2 r+1-s}{2(r+1)}\right)^{2}=(r+1)^{2}-(2 r+1-s)+\left(\frac{2 r+1-s}{2(r+1)}\right)^{2}$. We find that
It follows that
Since $s$ is odd, we can choose the fraction $(r+1)-\frac{2 r+1-s}{2(r+1)}=\frac{(r+1)^{2}-r+((s-1) / 2)}{r+1}$ since $r+1 \leqslant \sqrt{n}+1$. (b) We show that for every positive integer $r$, there is no fraction $\frac{a}{b}$ with $b \leqslant \sqrt{r^{2}+1}$ such that $\sqrt{r^{2}+1} \leqslant \frac{a}{b} \leqslant \sqrt{r^{2}+2}$. Suppose on the contrary that such a fraction exists. Since $b \leqslant \sqrt{r^{2}+1}<r+1$ and $b$ is an integer, we have $b \leqslant r$. Hence,
This shows the square number $a^{2}$ is strictly bounded between the two consecutive squares $(b r)^{2}$ and $(b r+1)^{2}$, which is impossible. Hence, we have found infinitely many $n=r^{2}+1$ for which there is no fraction of the desired form.
A6. The equation
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 \equiv 2,3(\bmod 4)$, and all factors $(x-m)$ on the right-hand side with $m \equiv 0,1(\bmod 4)$. Therefore, it suffices to show that no real number $x$ satisfies
- Case 1. $x=1,2, \ldots, 2016$.
In this case, one side of (1) is zero while the other side is not. This shows $x$ cannot satisfy (1).
- Case 2. $4 k+1<x<4 k+2$ or $4 k+3<x<4 k+4$ for some $k=0,1, \ldots, 503$.
For $j=0,1, \ldots, 503$ with $j \neq k$, the product $(x-4 j-1)(x-4 j-4)$ is positive. For $j=k$, the product $(x-4 k-1)(x-4 k-4)$ is negative. This shows the left-hand side of (1) is negative. On the other hand, each product $(x-4 j-2)(x-4 j-3)$ on the right-hand side of (1) is positive. This yields a contradiction.
- Case 3. $x<1$ or $x>2016$ or $4 k<x<4 k+1$ for some $k=1,2, \ldots, 503$.
The equation (1) can be rewritten as
Note that $(x-4 j-2)(x-4 j-3)>2$ for $0 \leqslant j \leqslant 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. $4 k+2<x<4 k+3$ for some $k=0,1, \ldots, 503$.
This time we rewrite (1) as
Clearly, $\frac{x-1}{x-2}$ and $\frac{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.
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 \equiv 2(\bmod 4)$, one may leave $l(x)=(x-1)(x-2) \cdots\left(x-\frac{n}{2}\right)$ on the left-hand side and $r(x)=\left(x-\frac{n}{2}-1\right)\left(x-\frac{n}{2}-2\right) \cdots(x-n)$ on the right-hand side. One checks that for $x<\frac{n+1}{2}$, we have $|l(x)|<|r(x)|$, while for $x>\frac{n+1}{2}$, we have $|l(x)|>|r(x)|$.
If $n \equiv 3(\bmod 4)$, one may leave $l(x)=(x-1)(x-2) \cdots\left(x-\frac{n+1}{2}\right)$ on the left-hand side and $r(x)=\left(x-\frac{n+3}{2}\right)\left(x-\frac{x+5}{2}\right) \cdots(x-n)$ on the right-hand side. For $x<1$ or $\frac{n+1}{2}<x<\frac{n+3}{2}$, we have $l(x)>0>r(x)$. For $1<x<\frac{n+1}{2}$, we have $|l(x)|<|r(x)|$. For $x>\frac{n+3}{2}$, we have $|l(x)|>|r(x)|$.
If $n \equiv 1(\bmod 4)$, as the proposer mentioned, the situation is a bit more out of control. Since the construction for $n-1 \equiv 0(\bmod 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) \cdots(x-8)$, while there seems to be no such partition for $n=13$.
A7. Denote by $\mathbb{R}$ the set of all real numbers. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $f(0) \neq 0$ and
for all real numbers $x$ and $y$.
Answer.
- $f(x)=-1$ for any $x \in \mathbb{R}$; or
- $f(x)=x-1$ for any $x \in \mathbb{R}$.
Solution 1. Taking $x=y=0$ in (1), we get $f(0)^{2}=2 f(0)^{2}+\max {2 f(0), f(0)}$. If $f(0)>0$, then $f(0)^{2}+2 f(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}=-2 f(x)+f\left(x^{2}\right)$, which is the same as $(f(x)+1)^{2}=f\left(x^{2}\right)+1$. Let $g(x)=f(x)+1$. Then for any $x \in \mathbb{R}$, we have
From (1), we find that $f(x+y)^{2} \geqslant 2 f(x) f(y)+f\left(x^{2}\right)+f\left(y^{2}\right)$. In terms of $g$, this becomes $(g(x+y)-1)^{2} \geqslant 2(g(x)-1)(g(y)-1)+g\left(x^{2}\right)+g\left(y^{2}\right)-2$. Using (2), this means
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}=-2 f(-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 inductively that $g\left(2^{2^{n}}\right)=g(2)^{2^{n}}=0$ for any $n \in \mathbb{N}$. Substitute $y=2^{2^{n}}-x$ in (3). We obtain
For any fixed $x \geqslant 0$, we consider $n$ to be sufficiently large so that $2^{2^{n}}-x>0$. From (2), this implies $g\left(2^{2^{n}}-x\right) \geqslant 0$ so that $g(x) \leqslant 1+\sqrt{2}$. Using (2) again, we get
for any $n \in \mathbb{N}$. Therefore, $|g(x)| \leqslant 1$ for any $x \geqslant 0$. If there exists $a \in \mathbb{R}$ for which $g(a) \neq 0$, then for sufficiently large $n$ we must have $g\left(\left(a^{2}\right)^{\frac{1}{2^{n}}}\right)=g\left(a^{2}\right)^{\frac{1}{2^{n}}}>\frac{1}{2}$. By taking $x=-y=-\left(a^{2}\right)^{\frac{1}{2^{n}}}$ in (1), we obtain
since $|g(-x)|=|g(x)| \in\left(\frac{1}{2}, 1\right]$ by (2) and the choice of $x$, and since $g(z) \leqslant 1$ for $z \geqslant 0$. This yields a contradiction and hence $g(x)=0$ must hold for any $x$. This means $f(x)=-1$ for any $x \in \mathbb{R}$, which clearly satisfies (1).
- 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=2 n$ and $y=2$ in (3), we have
By induction on $n$, it is easy to prove that $g(2 n) \geqslant n+1$ for all $n \in \mathbb{N}$. For any real number $a>1$, we choose a large $n \in \mathbb{N}$ and take $k$ to be the positive integer such that $2 k \leqslant a^{2^{n}}<2 k+2$. From (2) and (3), we have
since $g\left(a^{2^{n}}-2 k\right) \geqslant 0$. For large $n$, this clearly implies $g(a)^{2^{n}}>1$. Thus,
This yields
Note that
by binomial expansion. This can be rewritten as
Together with (4), we conclude $g(a) \geqslant a$ by taking $n$ sufficiently large. Consider $x=n a$ and $y=a>1$ in (3). This gives $(g((n+1) a)-1)^{2} \geqslant(g(n a)+g(a)-1)^{2}-1$. By induction on $n$, it is easy to show $g(n a) \geqslant(n-1)(g(a)-1)+a$ for any $n \in \mathbb{N}$. We choose a large $n \in \mathbb{N}$ and take $k$ to be the positive integer such that $k a \leqslant 2^{2^{n}}<(k+1) a$. Using (2) and (3), we have $2^{2^{n+1}}>\left(2^{2^{n}}-1\right)^{2}+1=\left(g\left(2^{2^{n}}\right)-1\right)^{2}+1 \geqslant\left(g\left(2^{2^{n}}-k a\right)+g(k a)-1\right)^{2} \geqslant((k-1)(g(a)-1)+a-1)^{2}$, from which it follows that
holds for sufficiently large $n$. Hence, we must have $\frac{g(a)-1}{a} \leqslant 1$, which implies $g(a) \leqslant a+1$ for any $a>1$. Then for large $n \in \mathbb{N}$, from (3) and (2) we have
This implies
When $n$ tends to infinity, this forces $g(a) \leqslant a$. Together with $g(a) \geqslant 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 \in \mathbb{R}$, we choose $y$ sufficiently large in (1) so that $y, x+y>1$. This gives $(x+y-1)^{2}=2 f(x)(y-1)+\max \left{f\left(x^{2}\right)+y^{2}-1, x^{2}+y^{2}-1\right}$, which can be rewritten as
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
Solution 2. Taking $x=y=0$ in (1), we get $f(0)^{2}=2 f(0)^{2}+\max {2 f(0), f(0)}$. If $f(0)>0$, then $f(0)^{2}+2 f(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
Replace $x$ by $-x$ in (5) and compare with (5) again. We get $f(x)^{2}+2 f(x)=f(-x)^{2}+2 f(-x)$, which implies
Taking $x=y$ and $x=-y$ respectively in (1) and comparing the two equations obtained, we have
Combining (6) and (7) to eliminate $f(-x)$, we find that $f(2 x)$ can be $\pm 1$ (when $f(x)=f(-x)$ ) or $\pm(2 f(x)+1)$ (when $f(x)+f(-x)=-2$ ).
We prove the following.
- Claim. $f(x)+f(-x)=-2$ for any $x \in \mathbb{R}$.
Proof. Suppose there exists $a \in \mathbb{R}$ such that $f(a)+f(-a) \neq-2$. Then $f(a)=f(-a) \neq-1$ and we may assume $a>0$. We first show that $f(a) \neq 1$. Suppose $f(a)=1$. Consider $y=a$ in (7). We get $f(2 a)^{2}=1$. Taking $x=y=a$ in (1), we have $1=2+\max \left{2 f\left(a^{2}\right), f\left(2 a^{2}\right)\right}$. From (5), $f\left(a^{2}\right)=3$ so that $1 \geqslant 2+6$. This is impossible, and thus $f(a) \neq 1$.
As $f(a) \neq \pm 1$, we have $f(a)= \pm\left(2 f\left(\frac{a}{2}\right)+1\right)$. Similarly, $f(-a)= \pm\left(2 f\left(-\frac{a}{2}\right)+1\right)$. These two expressions are equal since $f(a)=f(-a)$. If $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$, then the above argument works when we replace $a$ by $\frac{a}{2}$. In particular, we have $f(a)^{2}=f\left(2 \cdot \frac{a}{2}\right)^{2}=1$, which is a contradiction. Therefore, (6) forces $f\left(\frac{a}{2}\right)+f\left(-\frac{a}{2}\right)=-2$. Then we get
For any choices of the two signs, we either get a contradiction or $f\left(\frac{a}{2}\right)=-1$, in which case $f\left(\frac{a}{2}\right)=f\left(-\frac{a}{2}\right)$ and hence $f(a)= \pm 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
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\left(x^{2}\right)+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\left(x^{2}\right)$. The latter relation shows $g(y)$ is nonnegative for $y \geqslant 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)=c x$ for some constant $c$.
From $(c x)^{2}=g(x)^{2}=g\left(x^{2}\right)=c x^{2}$, 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$,
and
for any $x \in \mathbb{R}$. We shall show that one of the statements in (9) holds for all $x \in \mathbb{R}$. Suppose $f(a)=f(-a)$ but $f(a)+f(-a) \neq-2$, while $f(b) \neq f(-b)$ but $f(b)+f(-b)=-2$. Clearly, $a, b \neq 0$ and $f(a), f(b) \neq-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)= \pm f(x-a)$. This implies $f(x+2 a)= \pm f(x)$ for all $x \in \mathbb{R}$. Putting $x=b$ and $x=-2 a-b$ respectively, we find $f(2 a+b)= \pm f(b)$ and $f(-2 a-b)= \pm f(-b)= \pm(-2-f(b))$. Since $f(b) \neq-1$, the term $\pm(-2-f(b))$ is distinct from $\pm f(b)$ in any case. So $f(2 a+b) \neq f(-2 a-b)$. From (9), we must have $f(2 a+b)+f(-2 a-b)=-2$. Note that we also have $f(b)+f(-b)=-2$ where $|f(b)|,|f(-b)|$ are equal to $|f(2 a+b)|,|f(-2 a-b)|$ respectively. The only possible case is $f(2 a+b)=f(b)$ and $f(-2 a-b)=f(-b)$.
Applying the argument to $-a$ instead of $a$ and using induction, we have $f(2 k a+b)=f(b)$ and $f(2 k a-b)=f(-b)$ for any integer $k$. Note that $f(b)+f(-b)=-2$ and $f(b) \neq-1$ imply one of $f(b), f(-b)$ is less than -1 . Without loss of generality, assume $f(b)<-1$. We consider $x=\sqrt{2 k a+b}$ in (8) for sufficiently large $k$ so that
yields a contradiction. Therefore, one of the statements in (9) must hold for all $x \in \mathbb{R}$.
- Case 1. $f(x)=f(-x)$ for any $x \in \mathbb{R}$.
For any $a \in \mathbb{R}$, setting $x=y=\frac{a}{2}$ and $x=-y=\frac{a}{2}$ in (1) respectively and comparing these, we obtain $f(a)^{2}=f(0)^{2}=1$, which means $f(a)= \pm 1$ for all $a \in \mathbb{R}$. If $f(a)=1$ for some $a$, we may assume $a>0$ since $f(a)=f(-a)$. Taking $x=y=\sqrt{a}$ in (1), we get
Note that the left-hand side is $\pm 1$ while the right-hand side is an even integer. This is a contradiction. Therefore, $f(x)=-1$ for all $x \in \mathbb{R}$, which is clearly a solution.
- Case 2. $f(x)+f(-x)=-2$ for any $x \in \mathbb{R}$.
This case can be handled in the same way as in Solution 2, which yields another solution $f(x)=x-1$.
A8. Determine the largest real number $a$ such that for all $n \geqslant 1$ and for all real numbers $x_{0}, x_{1}, \ldots, x_{n}$ satisfying $0=x_{0}<x_{1}<x_{2}<\cdots<x_{n}$, we have
Answer. The largest $a$ is $\frac{4}{9}$. Solution 1. We first show that $a=\frac{4}{9}$ is admissible. For each $2 \leqslant k \leqslant n$, by the CauchySchwarz Inequality, we have
which can be rewritten as
Summing (2) over $k=2,3, \ldots, n$ and adding $\frac{9}{x_{1}}$ to both sides, we have
This shows (1) holds for $a=\frac{4}{9}$. Next, we show that $a=\frac{4}{9}$ is the optimal choice. Consider the sequence defined by $x_{0}=0$ and $x_{k}=x_{k-1}+k(k+1)$ for $k \geqslant 1$, that is, $x_{k}=\frac{1}{3} k(k+1)(k+2)$. Then the left-hand side of (1) equals
while the right-hand side equals
When $n$ tends to infinity, the left-hand side tends to 1 while the right-hand side tends to $\frac{9}{4} a$. Therefore $a$ has to be at most $\frac{4}{9}$.
Hence the largest value of $a$ is $\frac{4}{9}$. Solution 2. We shall give an alternative method to establish (1) with $a=\frac{4}{9}$. We define $y_{k}=x_{k}-x_{k-1}>0$ for $1 \leqslant k \leqslant n$. By the Cauchy-Schwarz Inequality, for $1 \leqslant k \leqslant n$, we have
This can be rewritten as
Summing (3) over $k=1,2, \ldots, n$, we get
where for $1 \leqslant m \leqslant n$,
From (4), the inequality (1) holds for $a=\frac{4}{9}$. This is also the upper bound as can be verified in the same way as Solution 1.
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=2 k$ and 1 if $n \neq 2 k$. Solution 1. Let $X$ be the binary string chosen by the leader and let $X^{\prime}$ 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^{\prime}$ and $k$ is changed to $n-k$. In view of this, we may assume $k \geqslant \frac{n}{2}$. Also, for the particular case $k=\frac{n}{2}$, this argument shows that the strings $X$ and $X^{\prime}$ 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<2 k$. 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<2 k$. From this observation, the contestant must know that $Y$ is not the desired string.
As we have assumed $k \geqslant \frac{n}{2}$, when $n<2 k$, every string $Y \neq X$ differs from $X$ in fewer than $2 k$ digits. When $n=2 k$, every string except $X$ and $X^{\prime}$ differs from $X$ in fewer than $2 k$ digits. Hence, the answer is as claimed.
Solution 2. Firstly, assume $n \neq 2 k$. Without loss of generality suppose the first digit of the leader's string is 1 . Then among the $\binom{n}{k}$ strings written by the deputy leader, $\binom{n-1}{k}$ will begin with 1 and $\binom{n-1}{k-1}$ will begin with 0 . Since $n \neq 2 k$, we have $k+(k-1) \neq n-1$ and so $\binom{n-1}{k} \neq\binom{ n-1}{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 \neq 2 k$.
Secondly, for the case $n=2$ and $k=1$, the answer is clearly 2 . For the remaining cases where $n=2 k>2$, the deputy leader would write down the same strings if the leader's string $X$ is replaced by $X^{\prime}$ 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 $\binom{2 k-2}{k-1}$ times each, while the prefices 00 and 11 will occur $\binom{2 k-2}{k}$ times each. The two numbers are interchanged if the first two digits of the leader's string are different. Since $\binom{2 k-2}{k-1} \neq\binom{ 2 k-2}{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 other digits in the same way and reduce the leader's string to only 2 possibilities. The proof is complete.
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 \times 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 \geqslant n$, where equality holds only when $n=1$.
For $j=1,2, \ldots, l$, let $d_{j}$ be the largest number in the $j$-th column. Without loss of generality, assume $d_{1}>d_{2}>\cdots>d_{l}$. Since these are divisors of $n$, we have
As $d_{l}$ is the maximum entry of the $l$-th column, we must have
The relations (1) and (2) combine to give $\frac{n}{l} \geqslant \frac{n}{k}$, that is, $k \geqslant l$. Together with $k \leqslant 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=p_{1}^{r_{1}} p_{2}^{r_{2}} \cdots p_{t}^{r_{t}}$. Suppose the table has $k$ rows and $l$ columns with $1<k \leqslant l$. Note that $k l$ 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 $\sigma(n)$. Consider the column containing $n$. Since the column sum is $\frac{\sigma(n)}{l}$, we must have $\frac{\sigma(n)}{l}>n$. Therefore, we have
This can be rewritten as
where
Direct computation yields
Also, we find that
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 .
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 $a_{k}$ be the number of isosceles triangles whose vertices contain exactly $k$ colours. Suppose on the contrary that $a_{3}=0$. Let $b, c, d$ be the number of vertices of the three different colours respectively. We now count the number of pairs $(\triangle, E)$ where $\triangle$ is an isosceles triangle and $E$ is a side of $\triangle$ whose endpoints are of different colours.
On the one hand, since we have assumed $a_{3}=0$, each triangle in the pair must contain exactly two colours, and hence each triangle contributes twice. Thus the number of pairs is $2 a_{2}$ 。
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 $A B$ is not the base and one when $A B$ 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(b c+c d+d b)$. However, note that $2 a_{2}$ is even while $3(b c+c d+d b)$ is odd, as each of $b, c, d$ is. This yields a contradiction and hence $a_{3} \geqslant 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 $A_{0}, A_{1}, \ldots, A_{24}$. Suppose colour 1 is used for $A_{0}$, colour 2 is used for $A_{5}, A_{10}, A_{15}, A_{20}$, while colour 3 is used for the remaining vertices. Then any isosceles triangle having colours 1 and 2 must contain $A_{0}$ and one of $A_{5}, A_{10}, A_{15}, A_{20}$. Clearly, the third vertex must have index which is a multiple of 5 so it is not of colour 3 .
C4. Find all positive integers $n$ for which we can fill in the entries of an $n \times 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 \times 9$ table.
It is a direct checking that the table (1) satisfies the requirements. For $n=9 k$ where $k$ is a positive integer, we form an $n \times n$ table using $k \times 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 \times 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=3 k$ where $k$ is a positive integer. We divide the whole table into $k \times k$ copies of $3 \times 3$ blocks. We call the entry at the centre of such a $3 \times 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
occurrences of $M$. Therefore, we have $N=4 k^{2}$.
On the other hand, there are $3 k^{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 $3 k^{2} \bmod 3$.
From the double counting, we get $4 k^{2} \equiv 3 k^{2}(\bmod 3)$, which forces $k$ to be a multiple of 3. Therefore, $n$ has to be a multiple of 9 and the proof is complete.
C5. Let $n \geqslant 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 $A B$ and $C D$ are perpendicular, and let $E$ be the vertex lying on the perpendicular bisector of $A B$. Let $E^{\prime}$ be the opposite point of $E$ on the circumcircle of the regular polygon. Since $E C=E^{\prime} D$ and $C, D, E$ are vertices of the regular polygon, $E^{\prime}$ 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.

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) \geqslant 2(k-2)$, so that $k \leqslant l-2$.

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 $P_{1}, P_{2}, \ldots, P_{l}$ in this order. We claim that each selected diagonal outside $S$ must connect vertices of the same group $P_{i}$. Consider any diagonal $d$ joining vertices from distinct groups $P_{i}$ and $P_{j}$. Let $d_{1}$ and $d_{2}$ be two diagonals in $S$ each having one of the outermost points of $P_{i}$ as endpoint. Then $d$ must meet either $d_{1}, d_{2}$ or a diagonal in $S$ which is perpendicular to both $d_{1}$ and $d_{2}$. In any case $d$ should belong to $S$ by definition, which is a contradiction.
Within the same group $P_{i}$, 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 $\left|P_{i}\right|-2$ selected diagonals within $P_{i}$, including the one joining the two outermost points of $P_{i}$ when $\left|P_{i}\right|>2$. Therefore, the maximum number of diagonals selected is
This upper bound can be attained as follows. We take any vertex $A$ and let $A^{\prime}$ be the vertex for which $A A^{\prime}$ is a diameter of the circumcircle. If we select all diagonals emanated from $A$ together with the diagonal $d^{\prime}$ joining the two neighbouring vertices of $A^{\prime}$, then the only pair of diagonals that meet each other is $A A^{\prime}$ and $d^{\prime}$, which are perpendicular to each other. In total we can take $n-2$ diagonals.

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 $\Gamma$.
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 $\Gamma$. 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 $d_{1}, d_{2}$. They divide the circumference of $\Gamma$ into four arcs, each of which lies on the same side of a diameter of $\Gamma$. If there are two selected diagonals intersecting each other and neither is parallel to $d_{1}$ or $d_{2}$, then their endpoints must belong to the same arc determined by $d_{1}, d_{2}$, and hence they cannot be perpendicular. This violates the condition, and hence all selected diagonals must have the same direction as one of $d_{1}, d_{2}$.

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 $\frac{1}{2}(2(n-4)+4)=n-2$ diagonals. Then the proof follows by induction.
C6. There are $n \geqslant 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 $\mathcal{A}$ and $B$ in set $\mathcal{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 $\mathcal{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 $\mathcal{A} \cup \mathcal{B}$ one by one. Suppose we have two sets $\mathcal{A}$ and $\mathcal{B}$ which form a network where $3 \leqslant|\mathcal{A} \cup \mathcal{B}|<n$. This relation no longer holds only when a ferry route between islands $A \in \mathcal{A}$ and $B \in \mathcal{B}$ is closed. In that case, we define $\mathcal{A}^{\prime}={A, B}$, and $\mathcal{B}^{\prime}=(\mathcal{A} \cup \mathcal{B})-{A, B}$. Note that $\mathcal{B}^{\prime}$ is nonempty. Consider any island $C \in \mathcal{A}-{A}$. From the relation of $\mathcal{A}$ and $\mathcal{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 $\mathcal{B}-{B}$. Therefore, $\mathcal{A}^{\prime}$ and $\mathcal{B}^{\prime}$ form a network, and $\mathcal{A}^{\prime} \cup \mathcal{B}^{\prime}=\mathcal{A} \cup \mathcal{B}$. Hence these islands can always be partitioned into sets $\mathcal{A}$ and $\mathcal{B}$ which form a network.
As $|\mathcal{A} \cup \mathcal{B}|<n$, there are some islands which are not included in $\mathcal{A} \cup \mathcal{B}$. From the condition, after some years there must be a ferry route between an island $A$ in $\mathcal{A} \cup \mathcal{B}$ and an island $D$ outside $\mathcal{A} \cup \mathcal{B}$ which closes. Without loss of generality assume $A \in \mathcal{A}$. Then each island in $\mathcal{B}$ must then be connected to $D$, no matter it was or not before. Hence, we can put $D$ in set $\mathcal{A}$ so that the new sets $\mathcal{A}$ and $\mathcal{B}$ still form a network and the size of $\mathcal{A} \cup \mathcal{B}$ is increased by 1 . The same process can be done to increase the size of $\mathcal{A} \cup \mathcal{B}$. Eventually, all islands are included in this way so we may now assume $|\mathcal{A} \cup \mathcal{B}|=n$.
Suppose a ferry route between $A \in \mathcal{A}$ and $B \in \mathcal{B}$ is closed after some years. We put $A$ and $B$ in set $\mathcal{A}^{\prime}$ and all remaining islands in set $\mathcal{B}^{\prime}$. Then $\mathcal{A}^{\prime}$ and $\mathcal{B}^{\prime}$ form a network. This relation no longer holds only when a route between $A$, without loss of generality, and $C \in \mathcal{B}^{\prime}$ is closed. Since this must eventually occur, at that time island $B$ will be connected to all other islands and the result follows.
C7. Let $n \geqslant 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 $l_{i}$ so that each of them cuts the disk at two distinct points $A_{i}, B_{i}$.
(a) For odd $n$, we travel along the circumference of the disk and mark each of the points $A_{i}$ or $B_{i}$ 'in' and 'out' alternately. Since every pair of lines intersect in the disk, there are exactly $n-1$ points between $A_{i}$ and $B_{i}$ for any fixed $1 \leqslant i \leqslant n$. As $n$ is odd, this means one of $A_{i}$ and $B_{i}$ 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 $l_{i}$ and $l_{j}$ do not meet for any pairs $i, j$, hence proving part (a).

Without loss of generality, we may assume the snails start at $A_{i}$ and $A_{j}$ respectively. Let $l_{i}$ intersect $l_{j}$ at $P$. Note that there is an odd number of points between arc $A_{i} A_{j}$. Each of these points belongs to a line $l_{k}$. Such a line $l_{k}$ must intersect exactly one of the segments $A_{i} P$ and $A_{j} P$, making an odd number of intersections. For the other lines, they may intersect both segments $A_{i} P$ and $A_{j} P$, or meet none of them. Therefore, the total number of intersection points on segments $A_{i} P$ and $A_{j} 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 $A_{i} P$ and $A_{j} 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 $A_{i}$ or $B_{i}$ 'in' and 'out' according to the directions travelled by the snails. In this case there must be two neighbouring points $A_{i}$ and $A_{j}$ both of which are marked 'in'. Let $P$ be the intersection of the segments $A_{i} B_{i}$ and $A_{j} B_{j}$. Then any other segment meeting one of the segments $A_{i} P$ and $A_{j} P$ must also meet the other one, and so the number of intersections on $A_{i} P$ and $A_{j} P$ are the same. This shows the snails starting from $A_{i}$ and $A_{j}$ will meet at $P$.
Comment. The conclusions do not hold for pseudosegments, as can be seen from the following examples.

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 $2 n \times 2 n$ board so that there exists a unique partition of the board into $1 \times 2$ and $2 \times 1$ dominoes, none of which contains two marked cells.
Answer. $2 n$. Solution. We first construct an example of marking $2 n$ cells satisfying the requirement. Label the rows and columns $1,2, \ldots, 2 n$ and label the cell in the $i$-th row and the $j$-th column $(i, j)$.
For $i=1,2, \ldots, 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), \ldots,(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<2 n$ 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 $c_{0}, c_{1}, \ldots, c_{m}$ where $c_{0}=c$ and $m$ is the least positive integer such that $c_{m}$ lies on $d$. Clearly, $c_{m}$ 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 $2 n$ cells in $d$ belong to $n$ cycles $C_{1}, C_{2}, \ldots, C_{n}$, each has length at least 4.
By the Pigeonhole Principle, there exists a cycle $C_{i}$ containing at most one of the $k$ marked cells. We modify $P$ as follows. We remove all dominoes containing the vertices of $C_{i}$, which correspond to the red edges of $C_{i}$. Then we put the dominoes corresponding to the blue edges of $C_{i}$. Since $C_{i}$ has at least 4 vertices, the resultant partition $P^{\prime}$ is different from $P$. Clearly, no domino in $P^{\prime}$ contains two marked cells as $C_{i}$ contains at most one marked cell. This shows the partition is not unique and hence $k$ cannot be less than $2 n$.
Geometry
G1. In a convex pentagon $A B C D E$, let $F$ be a point on $A C$ such that $\angle F B C=90^{\circ}$. Suppose triangles $A B F, A C D$ and $A D E$ are similar isosceles triangles with
Let $M$ be the midpoint of $C F$. Point $X$ is chosen such that $A M X E$ is a parallelogram. Show that $B D, E M$ and $F X$ are concurrent.
Solution 1. Denote the common angle in (1) by $\theta$. As $\triangle A B F \sim \triangle A C D$, we have $\frac{A B}{A C}=\frac{A F}{A D}$ so that $\triangle A B C \sim \triangle A F D$. From $E A=E D$, we get
Hence, $F$ lies on the circle with centre $E$ and radius $E A$. In particular, $E F=E A=E D$. As $\angle E F A=\angle E A F=2 \theta=\angle B F C$, points $B, F, E$ are collinear.
As $\angle E D A=\angle M A D$, we have $E D / / A M$ and hence $E, D, X$ are collinear. As $M$ is the midpoint of $C F$ and $\angle C B F=90^{\circ}$, we get $M F=M B$. In the isosceles triangles $E F A$ and $M F B$, we have $\angle E F A=\angle M F B$ and $A F=B F$. Therefore, they are congruent to each other. Then we have $B M=A E=X M$ and $B E=B F+F E=A F+F M=A M=E X$. This shows $\triangle E M B \cong \triangle E M X$. As $F$ and $D$ lie on $E B$ and $E X$ respectively and $E F=E D$, we know that lines $B D$ and $X F$ are symmetric with respect to $E M$. It follows that the three lines are concurrent.

Solution 2. From $\angle C A D=\angle E D A$, we have $A C / / E D$. Together with $A C / / E X$, we know that $E, D, X$ are collinear. Denote the common angle in (1) by $\theta$. From $\triangle A B F \sim \triangle A C D$, we get $\frac{A B}{A C}=\frac{A F}{A D}$ so that $\triangle A B C \sim \triangle A F D$. This yields $\angle A F D=\angle A B C=90^{\circ}+\theta$ and hence $\angle F D C=90^{\circ}$, implying that $B C D F$ is cyclic. Let $\Gamma_{1}$ be its circumcircle.
Next, from $\triangle A B F \sim \triangle A D E$, we have $\frac{A B}{A D}=\frac{A F}{A E}$ so that $\triangle A B D \sim \triangle A F E$. Therefore,
This implies $B, F, E$ are collinear. Note that $F$ is the incentre of triangle $D A B$. Point $E$ lies on the internal angle bisector of $\angle D B A$ and lies on the perpendicular bisector of $A D$. It follows that $E$ lies on the circumcircle $\Gamma_{2}$ of triangle $A B D$, and $E A=E F=E D$.
Also, since $C F$ is a diameter of $\Gamma_{1}$ and $M$ is the midpoint of $C F, M$ is the centre of $\Gamma_{1}$ and hence $\angle A M D=2 \theta=\angle A B D$. This shows $M$ lies on $\Gamma_{2}$. Next, $\angle M D X=\angle M A E=\angle D X M$ since $A M X E$ is a parallelogram. Hence $M D=M X$ and $X$ lies on $\Gamma_{1}$.

We now have two ways to complete the solution.
- Method 1. From $E F=E A=X M$ and $E X / / F M, E F M X$ is an isosceles trapezoid and is cyclic. Denote its circumcircle by $\Gamma_{3}$. Since $B D, E M, F X$ are the three radical axes of $\Gamma_{1}, \Gamma_{2}, \Gamma_{3}$, they must be concurrent.
- Method 2. As $\angle D M F=2 \theta=\angle B F M$, we have $D M / / E B$. Also,
implies $D F / / X B$. These show the corresponding sides of triangles $D M F$ and $B E X$ are parallel. By Desargues' Theorem, the two triangles are perspective and hence $D B, M E, F X$ meet at a point.
Comment. In Solution 2, both the Radical Axis Theorem and Desargues' Theorem could imply $D B, M E, F X$ are parallel. However, this is impossible as can be seen from the configuration. For example, it is obvious that $D B$ and $M E$ meet each other.
Solution 3. Let the common angle in (1) be $\theta$. From $\triangle A B F \sim \triangle A C D$, we have $\frac{A B}{A C}=\frac{A F}{A D}$ so that $\triangle A B C \sim \triangle A F D$. Then $\angle A D F=\angle A C B=90^{\circ}-2 \theta=90^{\circ}-\angle B A D$ and hence $D F \perp A B$. As $F A=F B$, this implies $\triangle D A B$ is isosceles with $D A=D B$. Then $F$ is the incentre of $\triangle D A B$.
Next, from $\angle A E D=180^{\circ}-2 \theta=180^{\circ}-\angle D B A$, points $A, B, D, E$ are concyclic. Since we also have $E A=E D$, this shows $E, F, B$ are collinear and $E A=E F=E D$.

Note that $C$ lies on the internal angle bisector of $\angle B A D$ and lies on the external angle bisector of $\angle D B A$. It follows that it is the $A$-excentre of triangle $D A B$. As $M$ is the midpoint of $C F, M$ lies on the circumcircle of triangle $D A B$ and it is the centre of the circle passing through $D, F, B, C$. By symmetry, $D E F M$ is a rhombus. Then the midpoints of $A X, E M$ and $D F$ coincide, and it follows that $D A F X$ is a parallelogram.
Let $P$ be the intersection of $B D$ and $E M$, and $Q$ be the intersection of $A D$ and $B E$. From $\angle B A C=\angle D C A$, we know that $D C, A B, E M$ are parallel. Thus we have $\frac{D P}{P B}=\frac{C M}{M A}$. This is further equal to $\frac{A E}{B E}$ since $C M=D M=D E=A E$ and $M A=B E$. From $\triangle A E Q \sim \triangle B E A$, we find that
by the Angle Bisector Theorem. This implies $Q D / / F P$ and hence $F, P, X$ are collinear, as desired.
G2. Let $A B C$ be a triangle with circumcircle $\Gamma$ and incentre $I$. Let $M$ be the midpoint of side $B C$. Denote by $D$ the foot of perpendicular from $I$ to side $B C$. The line through $I$ perpendicular to $A I$ meets sides $A B$ and $A C$ at $F$ and $E$ respectively. Suppose the circumcircle of triangle $A E F$ intersects $\Gamma$ at a point $X$ other than $A$. Prove that lines $X D$ and $A M$ meet on $\Gamma$.
Solution 1. Let $A M$ meet $\Gamma$ again at $Y$ and $X Y$ meet $B C$ at $D^{\prime}$. It suffices to show $D^{\prime}=D$. We shall apply the following fact.
- Claim. For any cyclic quadrilateral $P Q R S$ whose diagonals meet at $T$, we have
Proof. We use $\left[W_{1} W_{2} W_{3}\right]$ to denote the area of $W_{1} W_{2} W_{3}$. Then
Applying the Claim to $A B Y C$ and $X B Y C$ respectively, we have $1=\frac{B M}{M C}=\frac{A B \cdot B Y}{A C \cdot C Y}$ and $\frac{B D^{\prime}}{D^{\prime} C}=\frac{X B \cdot B Y}{X C \cdot C Y}$. These combine to give
Next, we use directed angles to find that $\measuredangle X B F=\measuredangle X B A=\measuredangle X C A=\measuredangle X C E$ and $\measuredangle X F B=\measuredangle X F A=\measuredangle X E A=\measuredangle X E C$. This shows triangles $X B F$ and $X C E$ are directly similar. In particular, we have
In the following, we give two ways to continue the proof.
- Method 1. Here is a geometrical method. As $\angle F I B=\angle A I B-90^{\circ}=\frac{1}{2} \angle A C B=\angle I C B$ and $\angle F B I=\angle I B C$, the triangles $F B I$ and $I B C$ are similar. Analogously, triangles $E I C$ and $I B C$ are also similar. Hence, we get
Next, construct a line parallel to $B C$ and tangent to the incircle. Suppose it meets sides $A B$ and $A C$ at $B_{1}$ and $C_{1}$ respectively. Let the incircle touch $A B$ and $A C$ at $B_{2}$ and $C_{2}$ respectively. By homothety, the line $B_{1} I$ is parallel to the external angle bisector of $\angle A B C$, and hence $\angle B_{1} I B=90^{\circ}$. Since $\angle B B_{2} I=90^{\circ}$, we get $B B_{2} \cdot B B_{1}=B I^{2}$, and similarly $C C_{2} \cdot C C_{1}=C I^{2}$. Hence,
Combining (1), (2), (3) and (4), we conclude
so that $D^{\prime}=D$. The result then follows.
- Method 2. We continue the proof of Solution 1 using trigonometry. Let $\beta=\frac{1}{2} \angle A B C$ and $\gamma=\frac{1}{2} \angle A C B$. Observe that $\angle F I B=\angle A I B-90^{\circ}=\gamma$. Hence, $\frac{B F}{F I}=\frac{\sin \angle F I B}{\sin \angle I B F}=\frac{\sin \gamma}{\sin \beta}$. Similarly, $\frac{C E}{E I}=\frac{\sin \beta}{\sin \gamma}$. As $F I=E I$, we get
Together with (1) and (2), we find that
This shows $D^{\prime}=D$ and the result follows.
Solution 2. Let $\omega_{A}$ be the $A$-mixtilinear incircle of triangle $A B C$. From the properties of mixtilinear incircles, $\omega_{A}$ touches sides $A B$ and $A C$ at $F$ and $E$ respectively. Suppose $\omega_{A}$ is tangent to $\Gamma$ at $T$. Let $A M$ meet $\Gamma$ again at $Y$, and let $D_{1}, T_{1}$ be the reflections of $D$ and $T$ with respect to the perpendicular bisector of $B C$ respectively. It is well-known that $\angle B A T=\angle D_{1} A C$ so that $A, D_{1}, T_{1}$ are collinear.

We then show that $X, M, T_{1}$ are collinear. Let $R$ be the radical centre of $\omega_{A}, \Gamma$ and the circumcircle of triangle $A E F$. Then $R$ lies on $A X, E F$ and the tangent at $T$ to $\Gamma$. Let $A T$ meet $\omega_{A}$ again at $S$ and meet $E F$ at $P$. Obviously, $S F T E$ is a harmonic quadrilateral. Projecting from $T$, the pencil $(R, P ; F, E)$ is harmonic. We further project the pencil onto $\Gamma$ from $A$, so that $X B T C$ is a harmonic quadrilateral. As $T T_{1} / / B C$, the projection from $T_{1}$ onto $B C$ maps $T$ to a point at infinity, and hence maps $X$ to the midpoint of $B C$, which is $M$. This shows $X, M, T_{1}$ are collinear.
We have two ways to finish the proof.
- Method 1. Note that both $A Y$ and $X T_{1}$ are chords of $\Gamma$ passing through the midpoint $M$ of the chord $B C$. By the Butterfly Theorem, $X Y$ and $A T_{1}$ cut $B C$ at a pair of symmetric points with respect to $M$, and hence $X, D, Y$ are collinear. The proof is thus complete.
- Method 2. Here, we finish the proof without using the Butterfly Theorem. As $D T T_{1} D_{1}$ is an isosceles trapezoid, we have
so that $D, T, Y, M$ are concyclic. As $X, M, T_{1}$ are collinear, we have
This shows $X, D, Y$ are collinear.
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 $P_{1} P_{2} P_{3}$, there exists a unique point $A$ in $S$ and a permutation $\sigma$ of the indices ${1,2,3}$ for which triangles $A B C$ and $P_{\sigma(1)} P_{\sigma(2)} P_{\sigma(3)}$ are similar.
Prove that there exist two distinct nice subsets $S$ and $S^{\prime}$ of the set ${(x, y): x \geqslant 0, y \geqslant 0}$ such that if $A \in S$ and $A^{\prime} \in S^{\prime}$ are the unique choices of points in (ii), then the product $B A \cdot B A^{\prime}$ is a constant independent of the triangle $P_{1} P_{2} P_{3}$.
Solution. If in the similarity of $\triangle A B C$ and $\triangle P_{\sigma(1)} P_{\sigma(2)} P_{\sigma(3)}, B C$ corresponds to the longest side of $\triangle P_{1} P_{2} P_{3}$, then we have $B C \geqslant A B \geqslant A C$. The condition $B C \geqslant A B$ is equivalent to $(x+1)^{2}+y^{2} \leqslant 4$, while $A B \geqslant A C$ is trivially satisfied for any point in the first quadrant. Then we first define
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 \in S$ to meet condition (i). For any point $A$ in $S$, the relation $B C \geqslant A B \geqslant A C$ always holds. Therefore, the point $A$ in (ii) is uniquely determined, while its existence is guaranteed by the above construction.

Next, if in the similarity of $\triangle A^{\prime} B C$ and $\triangle P_{\sigma(1)} P_{\sigma(2)} P_{\sigma(3)}, B C$ corresponds to the second longest side of $\triangle P_{1} P_{2} P_{3}$, then we have $A^{\prime} B \geqslant B C \geqslant A^{\prime} C$. The two inequalities are equivalent to $(x+1)^{2}+y^{2} \geqslant 4$ and $(x-1)^{2}+y^{2} \leqslant 4$ respectively. Then we define
The boundedness condition is satisfied while (ii) can be argued as in the previous case. For (i), note that $S^{\prime}$ contains points inside the disk $(x-1)^{2}+y^{2} \leqslant 4$ and outside the disk $(x+1)^{2}+y^{2} \geqslant 4$. This shows we can take $T^{\prime}=(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 $B A \cdot B A^{\prime}$ is a constant. Suppose we are given a triangle $P_{1} P_{2} P_{3}$ with $P_{1} P_{2} \geqslant P_{2} P_{3} \geqslant P_{3} P_{1}$. By the similarity, we have
Thus $B A \cdot B A^{\prime}=B C^{2}=4$, which is certainly independent of the triangle $P_{1} P_{2} P_{3}$. Comment. The original version of this problem includes the condition that the interiors of $S$ and $S^{\prime}$ are disjoint. We remove this condition since it is hard to define the interior of a point set rigorously.
G4. Let $A B C$ be a triangle with $A B=A C \neq B C$ and let $I$ be its incentre. The line $B I$ meets $A C$ at $D$, and the line through $D$ perpendicular to $A C$ meets $A I$ at $E$. Prove that the reflection of $I$ in $A C$ lies on the circumcircle of triangle $B D E$.
Solution 1.
Let $\Gamma$ be the circle with centre $E$ passing through $B$ and $C$. Since $E D \perp A C$, the point $F$ symmetric to $C$ with respect to $D$ lies on $\Gamma$. From $\angle D C I=\angle I C B=\angle C B I$, the line $D C$ is a tangent to the circumcircle of triangle $I B C$. Let $J$ be the symmetric point of $I$ with respect to $D$. Using directed lengths, from
the point $J$ also lies on $\Gamma$. Let $I^{\prime}$ be the reflection of $I$ in $A C$. Since $I J$ and $C F$ bisect each other, $C J F I$ is a parallelogram. From $\angle F I^{\prime} C=\angle C I F=\angle F J C$, we find that $I^{\prime}$ lies on $\Gamma$. This gives $E I^{\prime}=E B$.
Note that $A C$ is the internal angle bisector of $\angle B D I^{\prime}$. This shows $D E$ is the external angle bisector of $\angle B D I^{\prime}$ as $D E \perp A C$. Together with $E I^{\prime}=E B$, it is well-known that $E$ lies on the circumcircle of triangle $B D I^{\prime}$.
Solution 2. Let $I^{\prime}$ be the reflection of $I$ in $A C$ and let $S$ be the intersection of $I^{\prime} C$ and $A I$. Using directed angles, we let $\theta=\measuredangle A C I=\measuredangle I C B=\measuredangle C B I$. We have
and
This shows $I^{\prime}, D, E, S$ are concyclic.
Next, we find $\measuredangle I^{\prime} S B=2 \measuredangle I^{\prime} S E=6 \theta$ and $\measuredangle I^{\prime} D B=2 \measuredangle C D I=6 \theta$. Therefore, $I^{\prime}, D, B, S$ are concyclic so that $I^{\prime}, D, E, B, S$ lie on the same circle. The result then follows.

Comment. The point $S$ constructed in Solution 2 may lie on the same side as $A$ of $B C$. Also, since $S$ lies on the circumcircle of the non-degenerate triangle $B D E$, we implicitly know that $S$ is not an ideal point. Indeed, one can verify that $I^{\prime} C$ and $A I$ are parallel if and only if triangle $A B C$ is equilateral.
Solution 3. Let $I^{\prime}$ be the reflection of $I$ in $A C$, and let $D^{\prime}$ be the second intersection of $A I$ and the circumcircle of triangle $A B D$. Since $A D^{\prime}$ bisects $\angle B A D$, point $D^{\prime}$ is the midpoint of the arc $B D$ and $D D^{\prime}=B D^{\prime}=C D^{\prime}$. Obviously, $A, E, D^{\prime}$ lie on $A I$ in this order.

We find that $\angle E D^{\prime} D=\angle A D^{\prime} D=\angle A B D=\angle I B C=\angle I C B$. Next, since $D^{\prime}$ is the circumcentre of triangle $B C D$, we have $\angle E D D^{\prime}=90^{\circ}-\angle D^{\prime} D C=\angle C B D=\angle I B C$. The two relations show that triangles $E D^{\prime} D$ and $I C B$ are similar. Therefore, we have
Also, we get
These show triangles $B C I^{\prime}$ and $B D^{\prime} E$ are similar, and hence triangles $B C D^{\prime}$ and $B I^{\prime} E$ are similar. As $B C D^{\prime}$ is isosceles, we obtain $B E=I^{\prime} E$.
As $D E$ is the external angle bisector of $\angle B D I^{\prime}$ and $E I^{\prime}=E B$, we know that $E$ lies on the circumcircle of triangle $B D I^{\prime}$.
Solution 4. Let $A I$ and $B I$ meet the circumcircle of triangle $A B C$ again at $A^{\prime}$ and $B^{\prime}$ respectively, and let $E^{\prime}$ be the reflection of $E$ in $A C$. From
points $B^{\prime}, A, D, E^{\prime}$ are concyclic. Then
and hence $B^{\prime}, E^{\prime}, A^{\prime}$ are collinear. It is well-known that $A^{\prime} B^{\prime}$ is the perpendicular bisector of $C I$, so that $C E^{\prime}=I E^{\prime}$. Let $I^{\prime}$ be the reflection of $I$ in $A C$. This implies $B E=C E=I^{\prime} E$. As $D E$ is the external angle bisector of $\angle B D I^{\prime}$ and $E I^{\prime}=E B$, we know that $E$ lies on the circumcircle of triangle $B D I^{\prime}$.

Solution 5. Let $F$ be the intersection of $C I$ and $A B$. Clearly, $F$ and $D$ are symmetric with respect to $A I$. Let $O$ be the circumcentre of triangle $B I F$, and let $I^{\prime}$ be the reflection of $I$ in $A C$.

From $\angle B F O=90^{\circ}-\angle F I B=\frac{1}{2} \angle B A C=\angle B A I$, we get $E I / / F O$. Also, from the relation $\angle O I B=90^{\circ}-\angle B F I=90^{\circ}-\angle C D I=\angle I^{\prime} I D$, we know that $O, I, I^{\prime}$ are collinear.
Note that $E D / / O I$ since both are perpendicular to $A C$. Then $\angle F E I=\angle D E I=\angle O I E$. Together with $E I / / F O$, the quadrilateral $E F O I$ is an isosceles trapezoid. Therefore, we find that $\angle D I E=\angle F I E=\angle O E I$ so $O E / / I D$. Then $D E O I$ is a parallelogram. Hence, we have $D I^{\prime}=D I=E O$, which shows $D E O I^{\prime}$ is an isosceles trapezoid. In addition, $E D=O I=O B$ and $O E / / B D$ imply $E O B D$ is another isosceles trapezoid. In particular, both $D E O I^{\prime}$ and $E O B D$ are cyclic. This shows $B, D, E, I^{\prime}$ are concyclic.
Solution 6. Let $I^{\prime}$ be the reflection of $I$ in $A C$. Denote by $T$ and $M$ the projections from $I$ to sides $A B$ and $B C$ respectively. Since $B I$ is the perpendicular bisector of $T M$, we have
Since $\angle A D E=\angle A T I=90^{\circ}$ and $\angle D A E=\angle T A I$, we have $\triangle A D E \sim \triangle A T I$. This shows $\frac{A D}{A E}=\frac{A T}{A I}=\frac{A T}{A I^{\prime}}$. Together with $\angle D A T=2 \angle D A E=\angle E A I^{\prime}$, this yields $\triangle D A T \sim \triangle E A I^{\prime}$. In particular, we have
Obviously, the right-angled triangles $A M B$ and $A T I$ are similar. Then we get
Next, from $\triangle A M B \sim \triangle A T I \sim \triangle A D E$, we have $\frac{A M}{A B}=\frac{A D}{A E}$ so that $\triangle A D M \sim \triangle A E B$. It follows that
Combining (1), (2), (3) and (4), we get $E B=E I^{\prime}$. As $D E$ is the external angle bisector of $\angle B D I^{\prime}$, we know that $E$ lies on the circumcircle of triangle $B D I^{\prime}$.

Comment. A stronger version of this problem is to ask the contestants to prove the reflection of $I$ in $A C$ lies on the circumcircle of triangle $B D E$ if and only if $A B=A C$. 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.

Let $I^{\prime}$ be the reflection of $I$ in $A C$ and suppose $B, E, D, I^{\prime}$ lie on a circle $\Gamma$. Let $A I$ meet $\Gamma$ again at $S$. As $D E$ is the external angle bisector of $\angle B D I^{\prime}$, we have $E B=E I^{\prime}$. Using directed angles, we get
This means $I^{\prime}, C, S$ are collinear. From this we get $\measuredangle B S E=\measuredangle E S I^{\prime}=\measuredangle E S C$ and hence $A S$ bisects both $\angle B A C$ and $\angle B S C$. Clearly, $S$ and $A$ are distinct points. It follows that $\triangle B A S \cong \triangle C A S$ and thus $A B=A C$.
As in some of the above solutions, an obvious way to prove the stronger version is to establish the following equivalence: $B E=E I^{\prime}$ if and only if $A B=A C$. In addition to the ideas used in those solutions, one can use trigonometry to express the lengths of $B E$ and $E I^{\prime}$ in terms of the side lengths of triangle $A B C$ and to establish the equivalence.
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 $A B C$. A circle $\omega$ with centre $S$ passes through $A$ and $D$, and it intersects sides $A B$ and $A C$ at $X$ and $Y$ respectively. Let $P$ be the foot of altitude from $A$ to $B C$, and let $M$ be the midpoint of $B C$. Prove that the circumcentre of triangle $X S Y$ is equidistant from $P$ and $M$.
Solution 1. Denote the orthocentre and circumcentre of triangle $A B C$ by $H$ and $O$ respectively. Let $Q$ be the midpoint of $A H$ and $N$ be the nine-point centre of triangle $A B C$. It is known that $Q$ lies on the nine-point circle of triangle $A B C, N$ is the midpoint of $Q M$ and that $Q M$ is parallel to $A O$.
Let the perpendicular from $S$ to $X Y$ meet line $Q M$ at $S^{\prime}$. Let $E$ be the foot of altitude from $B$ to side $A C$. Since $Q$ and $S$ lie on the perpendicular bisector of $A D$, using directed angles, we have
This shows $D, S^{\prime}, S, Q$ are concyclic.

Let the perpendicular from $N$ to $B C$ intersect line $S S^{\prime}$ at $O_{1}$. (Note that the two lines coincide when $S$ is the midpoint of $A O$, in which case the result is true since the circumcentre of triangle $X S Y$ must lie on this line.) It suffices to show that $O_{1}$ is the circumcentre of triangle $X S Y$ since $N$ lies on the perpendicular bisector of $P M$. From
since $S Q / / O D$ and $Q A / / O_{1} N$, we know that $D, O_{1}, S^{\prime}, N$ are concyclic. Therefore, we get
so that $S D$ is a tangent to the circle through $D, O_{1}, S^{\prime}, N$. Then we have
Next, we show that $S$ and $S^{\prime}$ are symmetric with respect to $X Y$. By the Sine Law, we have
It follows that
which is twice the distance from $S$ to $X Y$. Note that $S$ and $C$ lie on the same side of the perpendicular bisector of $P M$ if and only if $\angle S A C<\angle O A C$ if and only if $\angle Y X A>\angle C B A$. This shows $S$ and $O_{1}$ lie on different sides of $X Y$. As $S^{\prime}$ lies on ray $S O_{1}$, it follows that $S$ and $S^{\prime}$ cannot lie on the same side of $X Y$. Therefore, $S$ and $S^{\prime}$ are symmetric with respect to $X Y$.
Let $d$ be the diameter of the circumcircle of triangle $X S Y$. As $S S^{\prime}$ is twice the distance from $S$ to $X Y$ and $S X=S Y$, we have $S S^{\prime}=2 \frac{S X^{2}}{d}$. It follows from (1) that $d=2 S O_{1}$. As $S O_{1}$ is the perpendicular bisector of $X Y$, point $O_{1}^{d}$ is the circumcentre of triangle $X S Y$.
Solution 2. Denote the orthocentre and circumcentre of triangle $A B C$ by $H$ and $O$ respectively. Let $O_{1}$ be the circumcentre of triangle $X S Y$. Consider two other possible positions of $S$. We name them $S^{\prime}$ and $S^{\prime \prime}$ and define the analogous points $X^{\prime}, Y^{\prime}, O_{1}^{\prime}, X^{\prime \prime}, Y^{\prime \prime} O_{1}^{\prime \prime}$ accordingly. Note that $S, S^{\prime}, S^{\prime \prime}$ lie on the perpendicular bisector of $A D$.
As $X X^{\prime}$ and $Y Y^{\prime}$ meet at $A$ and the circumcircles of triangles $A X Y$ and $A X^{\prime} Y^{\prime}$ meet at $D$, there is a spiral similarity with centre $D$ mapping $X Y$ to $X^{\prime} Y^{\prime}$. We find that
and similarly $\measuredangle S Y X=\measuredangle S^{\prime} Y^{\prime} X^{\prime}$. This shows triangles $S X Y$ and $S^{\prime} X^{\prime} Y^{\prime}$ are directly similar. Then the spiral similarity with centre $D$ takes points $S, X, Y, O_{1}$ to $S^{\prime}, X^{\prime}, Y^{\prime}, O_{1}^{\prime}$. Similarly, there is a spiral similarity with centre $D$ mapping $S, X, Y, O_{1}$ to $S^{\prime \prime}, X^{\prime \prime}, Y^{\prime \prime}, O_{1}^{\prime \prime}$. From these, we see that there is a spiral similarity taking the corresponding points $S, S^{\prime}, S^{\prime \prime}$ to points $O_{1}, O_{1}^{\prime}, O_{1}^{\prime \prime}$. In particular, $O_{1}, O_{1}^{\prime}, O_{1}^{\prime \prime}$ are collinear.

It now suffices to show that $O_{1}$ lies on the perpendicular bisector of $P M$ for two special cases.
Firstly, we take $S$ to be the midpoint of $A H$. Then $X$ and $Y$ are the feet of altitudes from $C$ and $B$ respectively. It is well-known that the circumcircle of triangle $X S Y$ is the nine-point circle of triangle $A B C$. Then $O_{1}$ is the nine-point centre and $O_{1} P=O_{1} M$. Indeed, $P$ and $M$ also lies on the nine-point circle.
Secondly, we take $S^{\prime}$ to be the midpoint of $A O$. Then $X^{\prime}$ and $Y^{\prime}$ are the midpoints of $A B$ and $A C$ respectively. Then $X^{\prime} Y^{\prime} / / B C$. Clearly, $S^{\prime}$ lies on the perpendicular bisector of $P M$. This shows the perpendicular bisectors of $X^{\prime} Y^{\prime}$ and $P M$ coincide. Hence, we must have $O_{1}^{\prime} P=O_{1}^{\prime} M$.

G6. Let $A B C D$ be a convex quadrilateral with $\angle A B C=\angle A D C<90^{\circ}$. The internal angle bisectors of $\angle A B C$ and $\angle A D C$ meet $A C$ at $E$ and $F$ respectively, and meet each other at point $P$. Let $M$ be the midpoint of $A C$ and let $\omega$ be the circumcircle of triangle $B P D$. Segments $B M$ and $D M$ intersect $\omega$ again at $X$ and $Y$ respectively. Denote by $Q$ the intersection point of lines $X E$ and $Y F$. Prove that $P Q \perp A C$.
Solution 1.
Let $\omega_{1}$ be the circumcircle of triangle $A B C$. We first prove that $Y$ lies on $\omega_{1}$. Let $Y^{\prime}$ be the point on ray $M D$ such that $M Y^{\prime} \cdot M D=M A^{2}$. Then triangles $M A Y^{\prime}$ and $M D A$ are oppositely similar. Since $M C^{2}=M A^{2}=M Y^{\prime} \cdot M D$, triangles $M C Y^{\prime}$ and $M D C$ are also oppositely similar. Therefore, using directed angles, we have
so that $Y^{\prime}$ lies on $\omega_{1}$. Let $Z$ be the intersection point of lines $B C$ and $A D$. Since $\measuredangle P D Z=\measuredangle P B C=\measuredangle P B Z$, point $Z$ lies on $\omega$. In addition, from $\measuredangle Y^{\prime} B Z=\measuredangle Y^{\prime} B C=\measuredangle Y^{\prime} A C=\measuredangle Y^{\prime} A M=\measuredangle Y^{\prime} D Z$, we also know that $Y^{\prime}$ lies on $\omega$. Note that $\angle A D C$ is acute implies $M A \neq M D$ so $M Y^{\prime} \neq M D$. Therefore, $Y^{\prime}$ is the second intersection of $D M$ and $\omega$. Then $Y^{\prime}=Y$ and hence $Y$ lies on $\omega_{1}$.
Next, by the Angle Bisector Theorem and the similar triangles, we have
Hence, $F Y$ is the internal angle bisector of $\angle A Y C$. Let $B^{\prime}$ be the second intersection of the internal angle bisector of $\angle C B A$ and $\omega_{1}$. Then $B^{\prime}$ is the midpoint of arc $A C$ not containing $B$. Therefore, $Y B^{\prime}$ is the external angle bisector of $\angle A Y C$, so that $B^{\prime} Y \perp F Y$.
Denote by $l$ the line through $P$ parallel to $A C$. Suppose $l$ meets line $B^{\prime} Y$ at $S$. From
the point $S$ lies on $\omega$. Similarly, the line through $X$ perpendicular to $X E$ also passes through the second intersection of $l$ and $\omega$, which is the point $S$. From $Q Y \perp Y S$ and $Q X \perp X S$, point $Q$ lies on $\omega$ and $Q S$ is a diameter of $\omega$. Therefore, $P Q \perp P S$ so that $P Q \perp A C$.
Solution 2. Denote by $\omega_{1}$ and $\omega_{2}$ the circumcircles of triangles $A B C$ and $A D C$ respectively. Since $\angle A B C=\angle A D C$, we know that $\omega_{1}$ and $\omega_{2}$ are symmetric with respect to the midpoint $M$ of $A C$.
Firstly, we show that $X$ lies on $\omega_{2}$. Let $X_{1}$ be the second intersection of ray $M B$ and $\omega_{2}$ and $X^{\prime}$ be its symmetric point with respect to $M$. Then $X^{\prime}$ lies on $\omega_{1}$ and $X^{\prime} A X_{1} C$ is a parallelogram. Hence, we have
Also, we have
These yield $\measuredangle D X_{1} B=\measuredangle D P B$ and hence $X_{1}$ lies on $\omega$. It follows that $X_{1}=X$ and $X$ lies on $\omega_{2}$. Similarly, $Y$ lies on $\omega_{1}$.
Next, we prove that $Q$ lies on $\omega$. Suppose the perpendicular bisector of $A C$ meet $\omega_{1}$ at $B^{\prime}$ and $M_{1}$ and meet $\omega_{2}$ at $D^{\prime}$ and $M_{2}$, so that $B, M_{1}$ and $D^{\prime}$ lie on the same side of $A C$. Note that $B^{\prime}$ lies on the angle bisector of $\angle A B C$ and similarly $D^{\prime}$ lies on $D P$.
If we denote the area of $W_{1} W_{2} W_{3}$ by $\left[W_{1} W_{2} W_{3}\right]$, then
As $B E$ is the angle bisector of $\angle A B C$, we have
Therefore, $X E$ is the angle bisector of $\angle A X C$, so that $M_{2}$ lies on the line joining $X, E, Q$. Analogously, $M_{1}, F, Q, Y$ are collinear. Thus,
which implies $Q$ lies on $\omega$. Finally, as $M_{1}$ and $M_{2}$ are symmetric with respect to $M$, the quadrilateral $X^{\prime} M_{2} X M_{1}$ is a parallelogram. Consequently,
This shows $Q P / / M_{2} M_{1}$. As $M_{2} M_{1} \perp A C$, we get $Q P \perp A C$. Solution 3. We first state two results which will be needed in our proof.
- Claim 1. In $\triangle X^{\prime} Y^{\prime} Z^{\prime}$ with $X^{\prime} Y^{\prime} \neq X^{\prime} Z^{\prime}$, let $N^{\prime}$ be the midpoint of $Y^{\prime} Z^{\prime}$ and $W^{\prime}$ be the foot of internal angle bisector from $X^{\prime}$. Then $\tan ^{2} \measuredangle W^{\prime} X^{\prime} Z^{\prime}=\tan \measuredangle N^{\prime} X^{\prime} W^{\prime} \tan \measuredangle Z^{\prime} W^{\prime} X^{\prime}$.
Without loss of generality, assume $X^{\prime} Y^{\prime}>X^{\prime} Z^{\prime}$. Then $W^{\prime}$ lies between $N^{\prime}$ and $Z^{\prime}$. The signs of both sides agree so it suffices to establish the relation for ordinary angles. Let $\angle W^{\prime} X^{\prime} Z^{\prime}=\alpha, \angle N^{\prime} X^{\prime} W^{\prime}=\beta$ and $\angle Z^{\prime} W^{\prime} X^{\prime}=\gamma$. We have
This implies
Expanding and simplifying, we get the desired result $\tan ^{2} \alpha=\tan \beta \tan \gamma$.
- Claim 2. Let $A^{\prime} B^{\prime} C^{\prime} D^{\prime}$ be a quadrilateral inscribed in circle $\Gamma$. Let diagonals $A^{\prime} C^{\prime}$ and $B^{\prime} D^{\prime}$ meet at $E^{\prime}$, and $F^{\prime}$ be the intersection of lines $A^{\prime} B^{\prime}$ and $C^{\prime} D^{\prime}$. Let $M^{\prime}$ be the midpoint of $E^{\prime} F^{\prime}$. Then the power of $M^{\prime}$ with respect to $\Gamma$ is equal to $\left(M^{\prime} E^{\prime}\right)^{2}$.
Let $O^{\prime}$ be the centre of $\Gamma$ and let $\Gamma^{\prime}$ be the circle with centre $M^{\prime}$ passing through $E^{\prime}$. Let $F_{1}$ be the inversion image of $F^{\prime}$ with respect to $\Gamma$. It is well-known that $E^{\prime}$ lies on the polar of $F^{\prime}$ with respect to $\Gamma$. This shows $E^{\prime} F_{1} \perp O^{\prime} F^{\prime}$ and hence $F_{1}$ lies on $\Gamma^{\prime}$. It follows that the inversion image of $\Gamma^{\prime}$ with respect to $\Gamma$ is $\Gamma^{\prime}$ itself. This shows $\Gamma^{\prime}$ is orthogonal to $\Gamma$, and thus the power of $M^{\prime}$ with respect to $\Gamma$ is the square of radius of $\Gamma^{\prime}$, which is $\left(M^{\prime} E^{\prime}\right)^{2}$.
We return to the main problem. Let $Z$ be the intersection of lines $A D$ and $B C$, and $W$ be the intersection of lines $A B$ and $C D$. Since $\measuredangle P D Z=\measuredangle P B C=\measuredangle P B Z$, point $Z$ lies on $\omega$. Similarly, $W$ lies on $\omega$. Applying Claim 2 to the cyclic quadrilateral $Z B D W$, we know that the power of $M$ with respect to $\omega$ is $M A^{2}$. Hence, $M X \cdot M B=M A^{2}$.
Suppose the line through $B$ perpendicular to $B E$ meets line $A C$ at $T$. Then $B E$ and $B T$ are the angle bisectors of $\angle C B A$. This shows $(T, E ; A, C)$ is harmonic. Thus, we have $M E \cdot M T=M A^{2}=M X \cdot M B$. It follows that $E, T, B, X$ are concyclic.

The result is trivial for the special case $A D=C D$ since $P, Q$ lie on the perpendicular bisector of $A C$ in that case. Similarly, the case $A B=C B$ 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 $A C$ be $P^{\prime}$ and $Q^{\prime}$ respectively. Then $P Q \perp A C$ if and only if $P^{\prime}=Q^{\prime}$ if and only if $\frac{E P^{\prime}}{F P^{\prime}}=\frac{E Q^{\prime}}{F Q^{\prime}}$ in terms of directed lengths. Note that
Next, we have $\frac{E Q^{\prime}}{F Q^{\prime}}=\frac{\tan \measuredangle E F Q}{\tan \measuredangle F E Q}$ where $\measuredangle F E Q=\measuredangle T E X=\measuredangle T B X=\frac{\pi}{2}+\measuredangle E B M$ and by symmetry $\measuredangle E F Q=\frac{\pi}{2}+\measuredangle F D M$. Combining all these, it suffices to show
We now apply Claim 1 twice to get
The result then follows.
G7. Let $I$ be the incentre of a non-equilateral triangle $A B C, I_{A}$ be the $A$-excentre, $I_{A}^{\prime}$ be the reflection of $I_{A}$ in $B C$, and $l_{A}$ be the reflection of line $A I_{A}^{\prime}$ in $A I$. Define points $I_{B}, I_{B}^{\prime}$ and line $l_{B}$ analogously. Let $P$ be the intersection point of $l_{A}$ and $l_{B}$. (a) Prove that $P$ lies on line $O I$ where $O$ is the circumcentre of triangle $A B C$. (b) Let one of the tangents from $P$ to the incircle of triangle $A B C$ meet the circumcircle at points $X$ and $Y$. Show that $\angle X I Y=120^{\circ}$.
Solution 1.
(a) Let $A^{\prime}$ be the reflection of $A$ in $B C$ and let $M$ be the second intersection of line $A I$ and the circumcircle $\Gamma$ of triangle $A B C$. As triangles $A B A^{\prime}$ and $A O C$ are isosceles with $\angle A B A^{\prime}=2 \angle A B C=\angle A O C$, they are similar to each other. Also, triangles $A B I_{A}$ and $A I C$ are similar. Therefore we have
Together with $\angle A^{\prime} A I_{A}=\angle I A O$, we find that triangles $A A^{\prime} I_{A}$ and $A I O$ are similar.

Denote by $P^{\prime}$ the intersection of line $A P$ and line $O I$. Using directed angles, we have
This shows $M, O, A, P^{\prime}$ are concyclic.
Denote by $R$ and $r$ the circumradius and inradius of triangle $A B C$. Then
is independent of $A$. Hence, $B P$ also meets line $O I$ at the same point $P^{\prime}$ so that $P^{\prime}=P$, and $P$ lies on $O I$. (b) By Poncelet's Porism, the other tangents to the incircle of triangle $A B C$ from $X$ and $Y$ meet at a point $Z$ on $\Gamma$. Let $T$ be the touching point of the incircle to $X Y$, and let $D$ be the midpoint of $X Y$. We have
This shows $\angle X Z Y=60^{\circ}$ and hence $\angle X I Y=120^{\circ}$.
Solution 2.
(a) Note that triangles $A I_{B} C$ and $I_{A} B C$ are similar since their corresponding interior angles are equal. Therefore, the four triangles $A I_{B}^{\prime} C, A I_{B} C, I_{A} B C$ and $I_{A}^{\prime} B C$ are all similar. From $\triangle A I_{B}^{\prime} C \sim \triangle I_{A}^{\prime} B C$, we get $\triangle A I_{A}^{\prime} C \sim \triangle I_{B}^{\prime} B C$. From $\measuredangle A B P=\measuredangle I_{B}^{\prime} B C=\measuredangle A I_{A}^{\prime} C$ and $\measuredangle B A P=\measuredangle I_{A}^{\prime} A C$, the triangles $A B P$ and $A I_{A}^{\prime} C$ are directly similar.

Consider the inversion with centre $A$ and radius $\sqrt{A B \cdot A C}$ followed by the reflection in $A I$. Then $B$ and $C$ are mapped to each other, and $I$ and $I_{A}$ are mapped to each other.
From the similar triangles obtained, we have $A P \cdot A I_{A}^{\prime}=A B \cdot A C$ so that $P$ is mapped to $I_{A}^{\prime}$ under the transformation. In addition, line $A O$ is mapped to the altitude from $A$, and hence $O$ is mapped to the reflection of $A$ in $B C$, which we call point $A^{\prime}$. Note that $A A^{\prime} I_{A} I_{A}^{\prime}$ 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 $A B C$. Note that by the above transformation, we have $\triangle A P O \sim \triangle A A^{\prime} I_{A}^{\prime}$ and $\triangle A A^{\prime} I_{A} \sim \triangle A I O$. Therefore, we find that
This shows $P O \cdot I O=R^{2}$, and it follows that $P$ and $I$ are mapped to each other under the inversion with respect to the circumcircle $\Gamma$ of triangle $A B C$. Then $P X \cdot P Y$, which is the power of $P$ with respect to $\Gamma$, equals $P I \cdot P O$. This yields $X, I, O, Y$ are concyclic.
Let $T$ be the touching point of the incircle to $X Y$, and let $D$ be the midpoint of $X Y$. Then
This shows $\angle D O X=60^{\circ}$ and hence $\angle X I Y=\angle X O Y=120^{\circ}$. 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 $O I$, or otherwise the angle is not uniquely determined as we can find another tangent from $P$ to the incircle.
G8. Let $A_{1}, B_{1}$ and $C_{1}$ be points on sides $B C, C A$ and $A B$ of an acute triangle $A B C$ respectively, such that $A A_{1}, B B_{1}$ and $C C_{1}$ are the internal angle bisectors of triangle $A B C$. Let $I$ be the incentre of triangle $A B C$, and $H$ be the orthocentre of triangle $A_{1} B_{1} C_{1}$. Show that
Solution. Without loss of generality, assume $\alpha=\angle B A C \leqslant \beta=\angle C B A \leqslant \gamma=\angle A C B$. Denote by $a, b, c$ the lengths of $B C, C A, A B$ respectively. We first show that triangle $A_{1} B_{1} C_{1}$ is acute.
Choose points $D$ and $E$ on side $B C$ such that $B_{1} D / / A B$ and $B_{1} E$ is the internal angle bisector of $\angle B B_{1} C$. As $\angle B_{1} D B=180^{\circ}-\beta$ is obtuse, we have $B B_{1}>B_{1} D$. Thus,
Therefore, $B E>B A_{1}$ and $\frac{1}{2} \angle B B_{1} C=\angle B B_{1} E>\angle B B_{1} A_{1}$. Similarly, $\frac{1}{2} \angle B B_{1} A>\angle B B_{1} C_{1}$. It follows that
is acute. By symmetry, triangle $A_{1} B_{1} C_{1}$ is acute. Let $B B_{1}$ meet $A_{1} C_{1}$ at $F$. From $\alpha \leqslant \gamma$, we get $a \leqslant c$, which implies
and hence $\angle B C_{1} A_{1} \leqslant \angle B A_{1} C_{1}$. As $B F$ is the internal angle bisector of $\angle A_{1} B C_{1}$, this shows $\angle B_{1} F C_{1}=\angle B F A_{1} \leqslant 90^{\circ}$. Hence, $H$ lies on the same side of $B B_{1}$ as $C_{1}$. This shows $H$ lies inside triangle $B B_{1} C_{1}$. Similarly, from $\alpha \leqslant \beta$ and $\beta \leqslant \gamma$, we know that $H$ lies inside triangles $C C_{1} B_{1}$ and $A A_{1} C_{1}$.

As $\alpha \leqslant \beta \leqslant \gamma$, we have $\alpha \leqslant 60^{\circ} \leqslant \gamma$. Then $\angle B I C \leqslant 120^{\circ} \leqslant \angle A I B$. Firstly, suppose $\angle A I C \geqslant 120^{\circ}$.
Rotate points $B, I, H$ through $60^{\circ}$ about $A$ to $B^{\prime}, I^{\prime}, H^{\prime}$ so that $B^{\prime}$ and $C$ lie on different sides of $A B$. Since triangle $A I^{\prime} I$ is equilateral, we have
Similarly,
As $\angle A I I^{\prime}=\angle A I^{\prime} I=60^{\circ}, \angle A I^{\prime} B^{\prime}=\angle A I B \geqslant 120^{\circ}$ and $\angle A I C \geqslant 120^{\circ}$, the quadrilateral $B^{\prime} I^{\prime} I C$ is convex and lies on the same side of $B^{\prime} C$ as $A$.
Next, since $H$ lies inside triangle $A C C_{1}, H$ lies outside $B^{\prime} I^{\prime} I C$. Also, $H$ lying inside triangle $A B I$ implies $H^{\prime}$ lies inside triangle $A B^{\prime} I^{\prime}$. This shows $H^{\prime}$ lies outside $B^{\prime} I^{\prime} I C$ and hence the convex quadrilateral $B^{\prime} I^{\prime} I C$ is contained inside the quadrilateral $B^{\prime} H^{\prime} H C$. It follows that the perimeter of $B^{\prime} I^{\prime} I C$ cannot exceed the perimeter of $B^{\prime} H^{\prime} H C$. From (1) and (2), we conclude that
For the case $\angle A I C<120^{\circ}$, we can rotate $B, I, H$ through $60^{\circ}$ about $C$ to $B^{\prime}, I^{\prime}, H^{\prime}$ so that $B^{\prime}$ and $A$ lie on different sides of $B C$. The proof is analogous to the previous case and we still get the desired inequality.
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 \geqslant 2016$, the integer $P(n)$ is positive and
Answer.
- $P(x)=c$ where $1 \leqslant c \leqslant 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 \leqslant c \leqslant 9$.
- Case 2. $\operatorname{deg} P=1$.
We have the following observation. For any positive integers $m, n$, we have
and equality holds if and only if there is no carry in the addition $m+n$. Let $P(x)=a x+b$ for some integers $a, b$ where $a \neq 0$. As $P(n)$ is positive for large $n$, we must have $a \geqslant 1$. The condition (1) becomes $S(a n+b)=a S(n)+b$ for all $n \geqslant 2016$. Setting $n=2025$ and $n=2020$ respectively, we get
On the other hand, (2) implies
These give $5 a \leqslant S(5 a)$. As $a \geqslant 1$, this holds only when $a=1$, in which case (1) reduces to $S(n+b)=S(n)+b$ for all $n \geqslant 2016$. Then we find that
If $b>0$, we choose $n$ such that $n+1+b=10^{k}$ 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-9 k$. As $n$ is a positive integer less than $10^{k}-1$, we have $S(n)<9 k$. Therefore, the right-hand side of (3) is at least $1-(9 k-1)=2-9 k$, 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.
- Case 3. $\operatorname{deg} P \geqslant 2$.
Suppose the leading term of $P$ is $a_{d} n^{d}$ where $a_{d} \neq 0$. Clearly, we have $a_{d}>0$. Consider $n=10^{k}-1$ in (1). We get $S(P(n))=P(9 k)$. Note that $P(n)$ grows asymptotically as fast as $n^{d}$, so $S(P(n))$ grows asymptotically as no faster than a constant multiple of $k$. On the other hand, $P(9 k)$ 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 \geqslant 2$.
Therefore, we conclude that $P(x)=c$ where $1 \leqslant c \leqslant 9$ is an integer, or $P(x)=x$. Solution 2. Let $P(x)=a_{d} x^{d}+a_{d-1} x^{d-1}+\cdots+a_{0}$. Clearly $a_{d}>0$. There exists an integer $m \geqslant 1$ such that $\left|a_{i}\right|<10^{m}$ for all $0 \leqslant i \leqslant d$. Consider $n=9 \times 10^{k}$ for a sufficiently large integer $k$ in (1). If there exists an index $0 \leqslant i \leqslant d-1$ such that $a_{i}<0$, then all digits of $P(n)$ in positions from $10^{i k+m+1}$ to $10^{(i+1) k-1}$ are all 9 's. Hence, we have $S(P(n)) \geqslant 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 $a_{i} \geqslant 0$ for all $0 \leqslant i \leqslant d-1$.
Hence, $P(n)$ is an integer formed by the nonnegative integers $a_{d} \times 9^{d}, a_{d-1} \times 9^{d-1}, \ldots, a_{0}$ by inserting some zeros in between. This yields
Combining with (1), we have
As $S(m) \leqslant m$ for any positive integer $m$, with equality when $1 \leqslant m \leqslant 9$, this forces each $a_{i} \times 9^{i}$ to be a positive integer between 1 and 9 . In particular, this shows $a_{i}=0$ for $i \geqslant 2$ and hence $d \leqslant 1$. Also, we have $a_{1} \leqslant 1$ and $a_{0} \leqslant 9$. If $a_{1}=1$ and $1 \leqslant a_{0} \leqslant 9$, we take $n=10^{k}+\left(10-a_{0}\right)$ for sufficiently large $k$ in (1). This yields a contradiction since
The zero polynomial is also rejected since $P(n)$ is positive for large $n$. The remaining candidates are $P(x)=x$ or $P(x)=a_{0}$ where $1 \leqslant a_{0} \leqslant 9$, all of which satisfy (1), and hence are the only solutions.
N2. Let $\tau(n)$ be the number of positive divisors of $n$. Let $\tau_{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 $\frac{\tau(10 n)}{\tau_{1}(10 n)}$.
Answer. All composite numbers together with 2. Solution. In this solution, we always use $p_{i}$ to denote primes congruent to $1 \bmod 3$, and use $q_{j}$ to denote primes congruent to $2 \bmod 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 $\tau_{1}(m)$ for a positive integer $m$.
- Claim. Let $m=3^{x} p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{s}^{a_{s}} q_{1}^{b_{1}} q_{2}^{b_{2}} \cdots q_{t}^{b_{t}}$ be the prime factorization of $m$. Then
Proof. To choose a divisor of $m$ congruent to $1 \bmod 3$, it cannot have the prime divisor 3, while there is no restriction on choosing prime factors congruent to $1 \bmod 3$. Also, we have to choose an even number of prime factors (counted with multiplicity) congruent to $2 \bmod 3$.
If $\prod_{j=1}^{t}\left(b_{j}+1\right)$ is even, then we may assume without loss of generality $b_{1}+1$ is even. We can choose the prime factors $q_{2}, q_{3}, \ldots, q_{t}$ freely in $\prod_{j=2}^{t}\left(b_{j}+1\right)$ ways. Then the parity of the number of $q_{1}$ is uniquely determined, and hence there are $\frac{1}{2}\left(b_{1}+1\right)$ ways to choose the exponent of $q_{1}$. Hence (1) is verified in this case.
If $\prod_{j=1}^{t}\left(b_{j}+1\right)$ is odd, we use induction on $t$ to count the number of choices. When $t=1$, there are $\left\lceil\frac{b_{1}+1}{2}\right\rceil$ choices for which the exponent is even and $\left\lfloor\frac{b_{1}+1}{2}\right\rfloor$ choices for which the exponent is odd. For the inductive step, we find that there are
choices with an even number of prime factors and hence $\left\lfloor\frac{1}{2} \prod_{j=1}^{t}\left(b_{j}+1\right)\right\rfloor$ choices with an odd number of prime factors. Hence (1) is also true in this case.
Let $n=3^{x} 2^{y} 5^{z} p_{1}^{a_{1}} p_{2}^{a_{2}} \cdots p_{s}^{a_{s}} q_{1}^{b_{1}} q_{2}^{b_{2}} \cdots q_{t}^{b_{t}}$. Using the well-known formula for computing the divisor function, we get
By the Claim, we have
If $c=(y+2)(z+2) \prod_{j=1}^{t}\left(b_{j}+1\right)$ is even, then (2) and (3) imply
In this case $\frac{\tau(10 n)}{\tau_{1}(10 n)}$ 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 $b_{j}$ is even, then (2) and (3) imply
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
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 $a b$ with $a, b \geqslant 3$, we may simply take $n=3^{\frac{a b-1}{2}} \cdot 2^{a-2} \cdot 5^{b-2}$ so that $\frac{\tau(10 n)}{\tau_{1}(10 n)}=a b$ 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.
N3. Define $P(n)=n^{2}+n+1$. For any positive integers $a$ and $b$, the set
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))=\left(n^{2}+n+1, n^{2}+3 n+3\right)=\left(n^{2}+n+1,2 n+2\right)$. Noting that $n^{2}+n+1$ is odd and $\left(n^{2}+n+1, n+1\right)=(1, n+1)=1$, the claim follows. (ii) $(P(n), P(n+2))=1$ for $n \not \equiv 2(\bmod 7)$ and $(P(n), P(n+2))=7$ for $n \equiv 2(\bmod 7)$.
From $(2 n+7) P(n)-(2 n-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 \equiv 0,1, \ldots, 6(\bmod 7)$ directly. (iii) $(P(n), P(n+3))=1$ for $n \not \equiv 1(\bmod 3)$ and $3 \mid(P(n), P(n+3))$ for $n \equiv 1(\bmod 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 \equiv 0,1,2(\bmod 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), \ldots, 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 \equiv 2(\bmod 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 \bmod 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
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 \mid P(7)=57$ and $19 \mid P(11)=133$ that $P(a)$ and $P(a+4)$ are divisible by 19. Therefore, the set ${P(a), P(a+1), \ldots, 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 \geqslant 6$. We present a proof here.
For each even positive integer $m$ which is not divisible by 3 , since $m^{2}+3 \equiv 3(\bmod 4)$, we can find a prime $p_{m} \equiv 3(\bmod 4)$ such that $p_{m} \mid m^{2}+3$. Clearly, $p_{m}>3$.
If $b=2 t \geqslant 6$, we choose $a$ such that $3 \mid 2(a+t)+1$ and $p_{m} \mid 2(a+t)+1$ for each $1 \leqslant m \leqslant b$ with $m \equiv 2,4(\bmod 6)$. For $0 \leqslant r \leqslant t$ and $3 \mid r$, we have $a+t \pm r \equiv 1(\bmod 3)$ so that $3 \mid P(a+t \pm r)$. For $0 \leqslant r \leqslant t$ and $(r, 3)=1$, we have
Hence, ${P(a), P(a+1), \ldots, P(a+b)}$ is fragrant. If $b=2 t+1 \geqslant 7$ (the case $b=5$ has been done in the original problem), we choose $a$ such that $3 \mid 2(a+t)+1$ and $p_{m} \mid 2(a+t)+1$ for $1 \leqslant m \leqslant b$ with $m \equiv 2,4(\bmod 6)$, and that $a+b \equiv 9(\bmod 13)$. Note that $a$ exists by the Chinese Remainder Theorem since $p_{m} \neq 13$ for all $m$. The even case shows that ${P(a), P(a+1), \ldots, P(a+b-1)}$ is fragrant. Also, one checks from $13 \mid P(9)=91$ and $13 \mid P(3)=13$ that $P(a+b)$ and $P(a+b-6)$ are divisible by 13. The proof is thus complete.
N4. Let $n, m, k$ and $l$ be positive integers with $n \neq 1$ such that $n^{k}+m n^{l}+1$ divides $n^{k+l}-1$. Prove that
- $m=1$ and $l=2 k$; or
- $l \mid k$ and $m=\frac{n^{k-l}-1}{n^{l}-1}$.
Solution 1. It is given that
This implies
We have two cases to discuss.
- Case 1. $l \geqslant k$.
Since $\left(n^{k}+m n^{l}+1, n\right)=1$,(2) yields
In particular, we get $n^{k}+m n^{l}+1 \leqslant n^{l}+m n^{l-k}+1$. As $n \geqslant 2$ and $k \geqslant 1,(m-1) n^{l}$ is at least $2(m-1) n^{l-k}$. It follows that the inequality cannot hold when $m \geqslant 2$. For $m=1$, the above divisibility becomes
Note that $n^{l}+n^{l-k}+1<n^{l}+n^{l}+1<2\left(n^{k}+n^{l}+1\right)$. Thus we must have $n^{l}+n^{l-k}+1=n^{k}+n^{l}+1$ so that $l=2 k$, which gives the first result.
- Case 2. $l<k$.
This time (2) yields
In particular, we get $n^{k}+m n^{l}+1 \leqslant n^{k}+n^{k-l}+m$, which implies
On the other hand, from (1) we may let $n^{k+l}-1=\left(n^{k}+m n^{l}+1\right) t$ for some positive integer $t$. Obviously, $t$ is less than $n^{l}$, which means $t \leqslant n^{l}-1$ as it is an integer. Then we have $n^{k+l}-1 \leqslant\left(n^{k}+m n^{l}+1\right)\left(n^{l}-1\right)$, which is the same as
Equations (3) and (4) combine to give $m=\frac{n^{k-l}-1}{n^{l}-1}$. As this is an integer, we have $l \mid k-l$. This means $l \mid k$ and it corresponds to the second result.
Solution 2. As in Solution 1, we begin with equation (2).
- Case 1. $l \geqslant k$.
Then (2) yields
Since $2\left(n^{k}+m n^{l}+1\right)>2 m n^{l}+1>n^{l}+m n^{l-k}+1$, it follows that $n^{k}+m n^{l}+1=n^{l}+m n^{l-k}+1$, that is,
If $m \geqslant 2$, then $m\left(n^{l}-n^{l-k}\right) \geqslant 2 n^{l}-2 n^{l-k} \geqslant 2 n^{l}-n^{l}>n^{l}-n^{k}$ gives a contradiction. Hence $m=1$ and $l-k=k$, which means $m=1$ and $l=2 k$.
- Case 2. $l<k$.
Then (2) yields
Since $2\left(n^{k}+m n^{l}+1\right)>2 n^{k}+m>n^{k}+n^{k-l}+m$, it follows that $n^{k}+m n^{l}+1=n^{k}+n^{k-l}+m$. This gives $m=\frac{n^{k-l}-1}{n^{l}-1}$. Note that $n^{l}-1 \mid n^{k-l}-1$ implies $l \mid k-l$ and hence $l \mid 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 \neq 1$ such that $k$ and $l$ do not divide each other. Show that $n^{k}+m n^{l}+1$ does not divide $n^{k+l}-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
for some integers $x$ and $y$ with $x>\sqrt{a}$. Denote by $B$ the set of all positive integers $k$ such that (1) is satisfied for some integers $x$ and $y$ with $0 \leqslant x<\sqrt{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 $x_{1}, y_{1}$ defined by
are integers and satisfy (1) (with $x, y$ replaced by $x_{1}, y_{1}$ respectively). Proof. Since $x_{1}+y_{1}=x-y$ and
both $x_{1}$ and $y_{1}$ are integers. Let $u=x+y$ and $v=x-y$. The relation (1) can be rewritten as
By Vieta's Theorem, the number $z=\frac{v^{2}-4 a}{u}$ satisfies
Since $x_{1}$ and $y_{1}$ are defined so that $v=x_{1}+y_{1}$ and $z=x_{1}-y_{1}$, we can reverse the process and verify (1) for $x_{1}, y_{1}$.
We first show that $B \subset A$. Take any $k \in B$ so that (1) is satisfied for some integers $x, y$ with $0 \leqslant x<\sqrt{a}$. Clearly, $y \neq 0$ and we may assume $y$ is positive. Since $a$ is not a square, we have $k>1$. Hence, we get $0 \leqslant x<y<\sqrt{a}$. Define
By the Claim, $x_{1}, y_{1}$ are integers satisfying (1). Also, we have
This implies $k \in A$ and hence $B \subset A$.
Next, we shall show that $A \subset B$. Take any $k \in A$ so that (1) is satisfied for some integers $x, y$ with $x>\sqrt{a}$. Again, we may assume $y$ is positive. Among all such representations of $k$, we choose the one with smallest $x+y$. Define
By the Claim, $x_{1}, y_{1}$ are integers satisfying (1). Since $k>1$, we get $x>y>\sqrt{a}$. Therefore, we have $y_{1}>\frac{4 a}{x+y}>0$ and $\frac{4 a}{x+y}<x+y$. It follows that
If $x_{1}>\sqrt{a}$, we get a contradiction due to the minimality of $x+y$. Therefore, we must have $0 \leqslant x_{1}<\sqrt{a}$, which means $k \in B$ so that $A \subset B$.
The two subset relations combine to give $A=B$. Solution 2. The relation (1) is equivalent to
Motivated by Pell's Equation, we prove the following, which is essentially the same as the Claim in Solution 1.
- Claim. If $\left(x_{0}, y_{0}\right)$ is a solution to $(2)$, then $\left((2 k-1) x_{0} \pm 2 k y_{0},(2 k-1) y_{0} \pm 2(k-1) x_{0}\right)$ is also a solution to (2).
Proof. We check directly that
If (2) is satisfied for some $0 \leqslant x<\sqrt{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
It satisfies $x_{1} \geqslant(2 k-1) x+2 k(x+1)=(4 k-1) x+2 k>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>\sqrt{a}$. This shows $B \subset A$.
If (2) is satisfied for some $x>\sqrt{a}$ and nonnegative integer $y$, by the Claim we consider another solution to (2) defined by
From (2), we get $\sqrt{k} y>\sqrt{k-1} x$. This implies $k y>\sqrt{k(k-1)} x>(k-1) x$ and hence $(2 k-1) x-2 k y<x$. On the other hand, the relation (1) implies $x>y$. Then it is clear that $(2 k-1) x-2 k y>-x$. These combine to give $x_{1}<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 \leqslant x<\sqrt{a}$. This shows $A \subset B$.
The desired result follows from $B \subset A$ and $A \subset B$. Solution 3. It suffices to show $A \cup B$ is a subset of $A \cap B$. We take any $k \in A \cup B$, which means there exist integers $x, y$ satisfying (1). Since $a$ is not a square, it follows that $k \neq 1$. As in Solution 2, the result follows readily once we have proved the existence of a solution $\left(x_{1}, y_{1}\right)$ to (1) with $\left|x_{1}\right|>|x|$, and, in case of $x>\sqrt{a}$, another solution $\left(x_{2}, y_{2}\right)$ with $\left|x_{2}\right|<|x|$.
Without loss of generality, assume $x, y \geqslant 0$. Let $u=x+y$ and $v=x-y$. Then $u \geqslant v$ and (1) becomes
This is the same as
Let $v_{1}=4 k u-2 u-v$. Then $u+v_{1}=4 k u-u-v \geqslant 8 u-u-v>u+v$. By Vieta's Theorem, $v_{1}$ satisfies
This gives $k=\frac{\left(u+v_{1}\right)^{2}-4 a}{4 u v_{1}}$. As $k$ is an integer, $u+v_{1}$ must be even. Therefore, $x_{1}=\frac{u+v_{1}}{2}$ and $y_{1}=\frac{v_{1}-u}{2}$ are integers. By reversing the process, we can see that $\left(x_{1}, y_{1}\right)$ is a solution to (1), with $x_{1}=\frac{u+v_{1}}{2}>\frac{u+v}{2}=x \geqslant 0$. This completes the first half of the proof.
Suppose $x>\sqrt{a}$. Then $u+v>2 \sqrt{a}$ and (3) can be rewritten as
Let $u_{2}=4 k v-2 v-u$. By Vieta's Theorem, we have $u u_{2}=v^{2}-4 a$ and
By $u>0, u+v>2 \sqrt{a}$ and (3), we have $v>0$. If $u_{2} \geqslant 0$, then $v u_{2} \leqslant u u_{2}=v^{2}-4 a<v^{2}$. This shows $u_{2}<v \leqslant u$ and $0<u_{2}+v<u+v$. If $u_{2}<0$, then $\left(u_{2}+v\right)+(u+v)=4 k v>0$ and $u_{2}+v<u+v$ imply $\left|u_{2}+v\right|<u+v$. In any case, since $u_{2}+v$ is even from (4), we can define $x_{2}=\frac{u_{2}+v}{2}$ and $y_{2}=\frac{u_{2}-v}{2}$ so that (1) is satisfied with $\left|x_{2}\right|<x$, as desired. The proof is thus complete.
N6. Denote by $\mathbb{N}$ the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that for all positive integers $m$ and $n$, the integer $f(m)+f(n)-m n$ is nonzero and divides $m f(m)+n f(n)$. Answer. $f(n)=n^{2}$ for any $n \in \mathbb{N}$. Solution. It is given that
Taking $m=n=1$ in (1), we have $2 f(1)-1 \mid 2 f(1)$. Then $2 f(1)-1 \mid 2 f(1)-(2 f(1)-1)=1$ and hence $f(1)=1$.
Let $p \geqslant 7$ be a prime. Taking $m=p$ and $n=1$ in (1), we have $f(p)-p+1 \mid p f(p)+1$ and hence
If $f(p)-p+1=p^{2}-p+1$, then $f(p)=p^{2}$. If $f(p)-p+1 \neq p^{2}-p+1$, as $p^{2}-p+1$ is an odd positive integer, we have $p^{2}-p+1 \geqslant 3(f(p)-p+1)$, that is,
Taking $m=n=p$ in (1), we have $2 f(p)-p^{2} \mid 2 p f(p)$. This implies
By (2) and $f(p) \geqslant 1$, we get
since $p \geqslant 7$. This contradicts the fact that $2 f(p)-p^{2}$ is a factor of $p^{3}$. Thus we have proved that $f(p)=p^{2}$ for all primes $p \geqslant 7$.
Let $n$ be a fixed positive integer. Choose a sufficiently large prime $p$. Consider $m=p$ in (1). We obtain
As $f(p)=p^{2}$, this implies $p^{2}-p n+f(n) \mid p\left(p^{2}-p n+n^{2}\right)$. As $p$ is sufficiently large and $n$ is fixed, $p$ cannot divide $f(n)$, and so $\left(p, p^{2}-p n+f(n)\right)=1$. It follows that $p^{2}-p n+f(n) \mid p^{2}-p n+n^{2}$ and hence
Note that $n^{2}-f(n)$ is fixed while $p^{2}-p n+f(n)$ is chosen to be sufficiently large. Therefore, we must have $n^{2}-f(n)=0$ so that $f(n)=n^{2}$ for any positive integer $n$.
Finally, we check that when $f(n)=n^{2}$ for any positive integer $n$, then
and
The latter expression is divisible by the former for any positive integers $m, n$. This shows $f(n)=n^{2}$ is the only solution.
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 $2 S$ is an integer divisible by $n$. Solution. Let $P=A_{1} A_{2} \ldots A_{k}$ and let $A_{k+i}=A_{i}$ for $i \geqslant 1$. By the Shoelace Formula, the area of any convex polygon with integral coordinates is half an integer. Therefore, $2 S$ is an integer. We shall prove by induction on $k \geqslant 3$ that $2 S$ is divisible by $n$. Clearly, it suffices to consider $n=p^{t}$ where $p$ is an odd prime and $t \geqslant 1$.
For the base case $k=3$, let the side lengths of $P$ be $\sqrt{n a}, \sqrt{n b}, \sqrt{n c}$ where $a, b, c$ are positive integers. By Heron's Formula,
This shows $16 S^{2}$ is divisible by $n^{2}$. Since $n$ is odd, $2 S$ is divisible by $n$. Assume $k \geqslant 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 $\nu_{p}(r)$ the exponent of $p$ in the prime decomposition of $r$. We claim the following.
- Claim. $\nu_{p}\left(A_{1} A_{m}^{2}\right)>\nu_{p}\left(A_{1} A_{m+1}^{2}\right)$ for $2 \leqslant m \leqslant k-1$.
Proof. The case $m=2$ is obvious since $\nu_{p}\left(A_{1} A_{2}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{1} A_{3}^{2}\right)$ by the condition and the above assumption.
Suppose $\nu_{p}\left(A_{1} A_{2}^{2}\right)>\nu_{p}\left(A_{1} A_{3}^{2}\right)>\cdots>\nu_{p}\left(A_{1} A_{m}^{2}\right)$ where $3 \leqslant m \leqslant k-1$. For the induction step, we apply Ptolemy's Theorem to the cyclic quadrilateral $A_{1} A_{m-1} A_{m} A_{m+1}$ to get
which can be rewritten as
From this, $2 A_{1} A_{m-1} \times A_{m} A_{m+1} \times A_{1} A_{m} \times A_{m-1} A_{m+1}$ is an integer. We consider the component of $p$ of each term in (1). By the inductive hypothesis, we have $\nu_{p}\left(A_{1} A_{m-1}^{2}\right)>\nu_{p}\left(A_{1} A_{m}^{2}\right)$. Also, we have $\nu_{p}\left(A_{m} A_{m+1}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{m-1} A_{m+1}^{2}\right)$. These give
Next, we have $\nu_{p}\left(4 A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2} \times A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)=\nu_{p}\left(A_{1} A_{m-1}^{2} \times A_{m} A_{m+1}^{2}\right)+$ $\nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)>2 \nu_{p}\left(A_{1} A_{m}^{2} \times A_{m-1} A_{m+1}^{2}\right)$ from (2). This implies
Combining (1), (2) and (3), we conclude that
By $\nu_{p}\left(A_{m-1} A_{m}^{2}\right) \geqslant p^{t}>\nu_{p}\left(A_{m-1} A_{m+1}^{2}\right)$, we get $\nu_{p}\left(A_{1} A_{m+1}^{2}\right)<\nu_{p}\left(A_{1} A_{m}^{2}\right)$. The Claim follows by induction.
From the Claim, we get a chain of inequalities
which yields a contradiction. Therefore, we can show by induction that $2 S$ 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 $2 S=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$.
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 $x_{1}, x_{2}, \ldots, x_{n}$ such that $\frac{1}{2}<\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}<2$ and $\frac{P\left(x_{i}\right)}{P\left(x_{j}\right)}$ is the $d$-th power of a rational number for every pair of indices $i$ and $j$ with $1 \leqslant i, j \leqslant n$.
Answer. $P(x)=a(r x+s)^{d}$ where $a, r, s$ are integers with $a \neq 0, r \geqslant 1$ and $(r, s)=1$. Solution. Let $P(x)=a_{d} x^{d}+a_{d-1} x^{d-1}+\cdots+a_{0}$. Consider the substitution $y=d a_{d} x+a_{d-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)=b_{d} y^{d}+b_{d-2} y^{d-2}+b_{d-3} y^{d-3}+\cdots+b_{0}$ and $B=\max {0 \leqslant i \leqslant d}\left{\left|b{i}\right|\right}$ (where $b_{d-1}=0$ ).
The condition shows that for each $n \geqslant 1$, there exist integers $y_{1}, y_{2}, \ldots, y_{n}$ such that $\frac{1}{2}<\frac{Q\left(y_{i}\right)}{Q\left(y_{j}\right)}<2$ and $\frac{Q\left(y_{i}\right)}{Q\left(y_{j}\right)}$ is the $d$-th power of a rational number for $1 \leqslant i, j \leqslant n$. Since $n$ can be arbitrarily large, we may assume all $x_{i}$ 's and hence $y_{i}$ '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 \equiv 2(\bmod 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 $y_{1}, y_{2}, \ldots, y_{n}$ which are congruent $\bmod p$. Without loss of generality, assume $y_{i} \equiv y_{j}(\bmod p)$ for $1 \leqslant i, j \leqslant d+1$. We shall establish the following.
- Claim. $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{y_{i}^{d}}{y_{1}^{d}}$ for $2 \leqslant i \leqslant d+1$.
Proof. Let $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l^{d}}{m^{d}}$ where $(l, m)=1$ and $l, m>0$. This can be rewritten in the expanded form
Let $c$ be the common denominator of $Q$, so that $c Q(k)$ is an integer for any integer $k$. Note that $c$ depends only on $P$ and so we may assume $(p, c)=1$. Then $y_{1} \equiv y_{i}(\bmod p)$ implies $c Q\left(y_{1}\right) \equiv c Q\left(y_{i}\right)(\bmod p)$.
- Case 1. $p \mid c Q\left(y_{1}\right)$.
In this case, there is a cancellation of $p$ in the numerator and denominator of $\frac{c Q\left(y_{i}\right)}{c Q\left(y_{1}\right)}$, so that $m^{d} \leqslant p^{-1}\left|c Q\left(y_{1}\right)\right|$. Noting $\left|Q\left(y_{1}\right)\right|<2 B y_{1}^{d}$ as $y_{1}$ is large, we get
For large $y_{1}$ and $y_{i}$, the relation $\frac{1}{2}<\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}<2$ implies
We also have
Now, the left-hand side of (1) is
Suppose on the contrary that $m y_{i}-l y_{1} \neq 0$. Then the absolute value of the above expression is at least $\left|b_{d}\right| m^{d-1} y_{i}^{d-1}$. On the other hand, the absolute value of the right-hand side of (1) is at most
by using successively (3), (4), (2) and again (3). This shows
which is a contradiction for large $p$ as $b_{d}, B, c, d$ depend only on the polynomial $P$. Therefore, we have $m y_{i}-l y_{1}=0$ in this case.
- Case 2. $\left(p, c Q\left(y_{1}\right)\right)=1$.
From $c Q\left(y_{1}\right) \equiv c Q\left(y_{i}\right)(\bmod p)$, we have $l^{d} \equiv m^{d}(\bmod p)$. Since $(p-1, d)=1$, we use Fermat Little Theorem to conclude $l \equiv m(\bmod p)$. Then $p \mid m y_{i}-l y_{1}$. Suppose on the contrary that $m y_{i}-l y_{1} \neq 0$. Then the left-hand side of (1) has absolute value at least $\left|b_{d}\right| p m^{d-1} y_{i}^{d-1}$. Similar to Case 1, the right-hand side of (1) has absolute value at most
which must be smaller than $\left|b_{d}\right| p m^{d-1} y_{i}^{d-1}$ for large $p$. Again this yields a contradiction and hence $m y_{i}-l y_{1}=0$.
In both cases, we find that $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l^{d}}{m^{d}}=\frac{y_{i}^{d}}{y_{1}^{d}}$. From the Claim, the polynomial $Q\left(y_{1}\right) y^{d}-y_{1}^{d} Q(y)$ has roots $y=y_{1}, y_{2}, \ldots, y_{d+1}$. Since its degree is at most $d$, this must be the zero polynomial. Hence, $Q(y)=b_{d} y^{d}$. This implies $P(x)=a_{d}\left(x+\frac{a_{d-1}}{d a_{d}}\right)^{d}$. Let $\frac{a_{d-1}}{d a_{d}}=\frac{s}{r}$ with integers $r, s$ where $r \geqslant 1$ and $(r, s)=1$. Since $P$ has integer coefficients, we need $r^{d} \mid a_{d}$. Let $a_{d}=r^{d} a$. Then $P(x)=a(r x+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\left(x_{i}\right)$ can be expressed in the form $u v_{i}^{d}$ where $u, v_{i}$ 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 $x_{1} \equiv x_{2} \equiv \cdots \equiv x_{d+1}(\bmod q)$ and $v_{1} \equiv v_{2} \equiv \cdots \equiv v_{d+1}(\bmod 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 $y_{1}, y_{2}, \ldots, y_{n}$. For each $2 \leqslant i \leqslant n$, let $\frac{Q\left(y_{i}\right)}{Q\left(y_{1}\right)}=\frac{l_{i}^{d}}{m_{i}^{d}}$.
As in Case 1, if there are $d$ indices $i$ such that the integers $\frac{c\left|Q\left(y_{1}\right)\right|}{m_{i}^{d}}$ are bounded below by a constant depending only on $P$, we can establish the Claim using those $y_{i}$ 's and complete the proof. Similarly, as in Case 2, if there are $d$ indices $i$ such that the integers $\left|m_{i} y_{i}-l_{i} y_{1}\right|$ are bounded below, then the proof goes the same. So it suffices to consider the case where $\frac{c\left|Q\left(y_{1}\right)\right|}{m_{i}^{d}} \leqslant M$ and $\left|m_{i} y_{i}-l_{i} y_{1}\right| \leqslant N$ for all $2 \leqslant i \leqslant n^{\prime}$ where $M, N$ are fixed constants and $n^{\prime}$ is large. Since there are only finitely many choices for $m_{i}$ and $m_{i} y_{i}-l_{i} y_{1}$, by the Pigeonhole Principle, we can assume without loss of generality $m_{i}=m$ and $m_{i} y_{i}-l_{i} y_{1}=t$ for $2 \leqslant i \leqslant d+2$. Then
so that $Q\left(y_{1}\right)(m y-t)^{d}-m^{d} y_{1}^{d} Q(y)$ has roots $y=y_{2}, y_{3}, \ldots, y_{d+2}$. Its degree is at most $d$ and hence it is the zero polynomial. Therefore, $Q(y)=\frac{b_{d}}{m^{d}}(m y-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.






