BALTIC WAY 2015
Problems and Solutions
Problem 1.
For $n \geq 2$, an equilateral triangle is divided into $n^{2}$ congruent smaller equilateral triangles. Determine all ways in which real numbers can be assigned to the $\frac{(n+1)(n+2)}{2}$ vertices so that three such numbers sum to zero whenever the three vertices form a triangle with edges parallel to the sides of the big triangle.
Solution. We label the vertices (and the corresponding real numbers) as follows.

For $n=2$, we see that
which shows that $a_{3}=a_{4}$ and similarly $a_{1}=a_{5}$ and $a_{2}=a_{6}$. Now the only additional requirement is $a_{1}+a_{2}+a_{3}=0$, so that all solutions are of the following form, for any $x, y$ and $z$ with $x+y+z=0$ :

For $n=3$, observe that $a_{1}=a_{7}=a_{10}$ since they all equal $a_{5}$. Since also $a_{1}+a_{7}+a_{10}=0$, they all equal zero. By considering the top triangle, we get $x=a_{2}=-a_{3}$ and this uniquely determines the rest. It is easily checked that, for any real $x$, this is actually a solution:

For $n \geq 3$ we can apply the same argument as above for any collection of 10 vertices. Any vertex not on the sides of the big triangle has to equal zero, since it is the centre of such a collection of 10 vertices. Any vertex $a$ on the sides of the big triangle forms some parallelogram similar to $a_{4}, a_{2}, a_{5}, a_{8}$, where the point opposite $a$ is in the interior of the big triangle. Since such opposite numbers are equal, all $a_{i}$ have to be zero in this case.
Problem 2.
Let $n$ be a positive integer and let $a_{1}, \ldots, a_{n}$ be real numbers satisfying $0 \leq a_{i} \leq 1$ for $i=1, \ldots, n$. Prove the inequality
Solution. The numbers $1-a_{i}^{n}$ are positive by assumption. AM-GM gives
By applying AM-GM again we obtain
and hence the desired inequality.
Remark. It is possible to use Jensen's inequality applied to $f(x)=\log \left(1-e^{x}\right)$.
Problem 3.
Let $n>1$ be an integer. Find all non-constant real polynomials $P(x)$ satisfying, for any real $x$, the identity
Solution. Answer: $P(x)=x^{m}$ if $n$ is even; $P(x)= \pm x^{m}$ if $n$ is odd.
Consider first the case of a monomial $P(x)=a x^{m}$ with $a \neq 0$. Then
implies $a^{n}=a$. Thus, $a=1$ when $n$ is even and $a= \pm 1$ when $n$ is odd. Obviously these polynomials satisfy the desired equality.
Suppose now that $P$ is not a monomial. Write $P(x)=a x^{m}+Q(x)$, where $Q$ is non-zero polynomial with $\operatorname{deg} Q=k<m$. We have
The highest degree of a monomial, on both sides of the equality, is $\frac{m n(n+1)}{2}$. The second highest degree in the right-hand side is
while in the left-hand side it is $\frac{k n(n+1)}{2}$. Thus
which leads to
and so $m=k$, contradicting the assumption that $m>k$. Consequently, no polynomial of the form $a x^{m}+Q(x)$ fulfils the given condition.
Problem 4.
A family wears clothes of three colours: red, blue and green, with a separate, identical laundry bin for each colour. At the beginning of the first week, all bins are empty. Each week, the family generates a total of $10 \mathrm{~kg}$ of laundry (the proportion of each colour is subject to variation). The laundry is sorted by colour and placed in the bins. Next, the heaviest bin (only one of them, if there are several that are heaviest) is emptied and its contents washed. What is the minimal possible storing capacity required of the laundry bins in order for them never to overflow?
Solution. Answer: $25 \mathrm{~kg}$.
Each week, the accumulation of laundry increases the total amount by $K=10$, after which the washing decreases it by at least one third, because, by the pigeon-hole principle, the bin with the most laundry must contain at least a third of the total. Hence the amount of laundry post-wash after the $n$th week is bounded above by the sequence $a_{n+1}=\frac{2}{3}\left(a_{n}+K\right)$ with $a_{0}=0$, which is clearly bounded above by $2 K$. The total amount of laundry is less than $2 K$ post-wash and $3 K$ pre-wash.
Now suppose pre-wash state $(a, b, c)$ precedes post-wash state $(a, b, 0)$, which precedes pre-wash state $\left(a^{\prime}, b^{\prime}, c^{\prime}\right)$. The relations $a \leq c$ and $a^{\prime} \leq a+K$ lead to
and similarly for $b^{\prime}$, whence $a^{\prime}, b^{\prime}<\frac{5}{2} K$. Since also $c^{\prime} \leq K$, a pre-wash bin, and a fortiori a post-wash bin, always contains less than $\frac{5}{2} K$.
Consider now the following scenario. For a start, we keep packing the three bins equally full before washing. Initialising at $(0,0,0)$, the first week will end at $\left(\frac{1}{3} K, \frac{1}{3} K, \frac{1}{3} K\right)$ pre-wash and $\left(\frac{1}{3} K, \frac{1}{3} K, 0\right)$ post-wash, the second week at $\left(\frac{5}{9} K, \frac{5}{9} K, \frac{5}{9} K\right)$ pre-wash and $\left(\frac{5}{9} K, \frac{5}{9} K, 0\right)$ post-wash, &c. Following this scheme, we can get arbitrarily close to the state $(K, K, 0)$ after washing. Supposing this accomplished, placing $\frac{1}{2} K \mathrm{kg}$ of laundry in each of the non-empty bins leaves us in a state close to $\left(\frac{3}{2} K, \frac{3}{2} K, 0\right)$ pre-wash and $\left(\frac{3}{2} K, 0,0\right)$ post-wash. Finally, the next week's worth of laundry is directed solely to the single non-empty bin. It may thus contain any amount of laundry below $\frac{5}{2} K \mathrm{kg}$.
Problem 5.
Find all functions $f: \mathbf{R} \rightarrow \mathbf{R}$ satisfying the equation
for all real numbers $x$ and $y$.
Solution. Answer: all functions $f(x)=c(|x|-x)$, where $c \geq 0$.
Choosing $x=y=0$, we find
Denote $a=f(0)$, so that $f(a)=-2 a$, and choose $y=0$ in the initial equation:
In particular, $f(1)=2 a$. Choose $(x, y)=\left(z^{2}, 1\right)$ in the initial equation:
The right-hand side is constant, while the left-hand side is a quadratic function in $z$, which can only happen if $a=0$. (Choose $z=1$ and then $z=0$.)
We now conclude that $f\left(x^{2}\right)=0$, and so $f(x)=0$ for all non-negative $x$. In particular, $f(0)=0$. Choosing $x=0$ in the initial equation, we find $f(f(y))=0$ for all $y$. Simplifying the original equation and swapping $x$ and $y$ leads to
Choose $y=-1$ and put $c=\frac{f(-1)}{2}$ :
One easily verifies that these functions satisfy the functional equation for any parameter $c \geq 0$.
Problem 6.
Two players take alternate turns in the following game. At the outset there are two piles, containing 10,000 and 20,000 tokens, respectively. A move consists of removing any positive number of tokens from a single pile or removing $x>0$ tokens from one pile and $y>0$ tokens from the other, where $x+y$ is divisible by 2015. The player who cannot make a move loses. Which player has a winning strategy?
Solution. The first player wins.
He should present his opponent with one of the following positions:
All these positions have different total numbers of tokens modulo 2015. Therefore, if the game starts from two piles of arbitrary sizes, it is possible to obtain one of these positions just by the first move. In our case
and the first player can leave to his opponent the position $(895,895)$.
Now the second type of move can no longer be carried out. If the second player removes $n$ tokens from one pile, the first player may always respond be removing $n$ tokens from the other pile.
Problem 7.
There are 100 members in a ladies' club. Each lady has had tea (in private) with exactly 56 of the other members of the club. The Board, consisting of the 50 most distinguished ladies, have all had tea with one another. Prove that the entire club may be split into two groups in such a way that, within each group, any lady has had tea with any other.
Solution. Each lady in the Board has had tea with 49 ladies within the Board, and 7 ladies without. Each lady not in the Board has had tea with at most 49 ladies not in the Board, and at least 7 ladies in the Board. Comparing these two observations, we conclude that each lady not in the Board has had tea with exactly 49 ladies not in the Board and exactly 7 ladies in the Board. Hence the club may be split into Board members and non-members.
Problem 8.
With inspiration drawn from the rectilinear network of streets in New York, the Manhattan distance between two points $(a, b)$ and $(c, d)$ in the plane is defined to be
Suppose only two distinct Manhattan distances occur between all pairs of distinct points of some point set. What is the maximal number of points in such a set?
Solution. Answer: nine.
Let
be the set, and suppose $m \geq 10$.
A special case of the Erdős-Szekeres Theorem asserts that a real sequence of length $n^{2}+1$ contains a monotonic subsequence of length $n+1$. (Proof: Given a sequence $a_{1} \ldots, a_{n^{2}+1}$, let $p_{i}$ denote the length of the longest increasing subsequence ending with $a_{i}$, and $q_{i}$ the length of the longest decreasing subsequence ending with $a_{i}$. If $i<j$ and $a_{i} \leq a_{j}$, then $p_{i}<p_{j}$. If $a_{i} \geq a_{j}$, then $q_{i}<q_{j}$. Hence all $n^{2}+1$ pairs $\left(p_{i}, q_{i}\right)$ are distinct. If all of them were to satisfy $1 \leq p_{i}, q_{i} \leq n$, it would violate the Pigeon-Hole Principle.)
Applied to the sequence $y_{1}, \ldots, y_{m}$, this will produce a subsequence
One of the shortest paths from $\left(x_{i}, y_{i}\right)$ to $\left(x_{l}, y_{l}\right)$ will pass through first $\left(x_{j}, y_{j}\right)$ and then $\left(x_{k}, y_{k}\right)$. At least three distinct Manhattan distances will occur.
Conversely, among the nine points
only the Manhattan distances 2 and 4 occur.
Problem 9.
Let $n>2$ be an integer. A deck contains $\frac{n(n-1)}{2}$ cards, numbered
Two cards form a magic pair if their numbers are consecutive, or if their numbers are 1 and $\frac{n(n-1)}{2}$.
For which $n$ is it possible to distribute the cards into $n$ stacks in such a manner that, among the cards in any two stacks, there is exactly one magic pair?
Solution 1. Answer: for all odd $n$.
First assume a stack contains two cards that form a magic pair; say cards number $i$ and $i+1$. Among the cards in this stack and the stack with card number $i+2$ (they might be identical), there are two magic pairs - a contradiction. Hence no stack contains a magic pair.
Each card forms a magic pair with exactly two other cards. Hence if $n$ is even, each stack must contain at least $\left\lceil\frac{n-1}{2}\right\rceil=\frac{n}{2}$ cards, since there are $n-1$ other stacks. But then we need at least $n \frac{n}{2}>\frac{n(n-1)}{2}$ cards - a contradiction.
In the odd case we distribute the cards like this: Let $a_{1}, a_{2}, \ldots, a_{n}$ be the $n$ stacks and let $n=2 m+1$. Card number 1 is put into stack $a_{1}$. If card number $k m+i$, for $i=1,2, \ldots, m$, is put into stack $a_{j}$, then card number $k m+i+1$ is put into stack number $a_{j+i}$, where the indices are calculated modulo $n$.
There are
cards. If we look at all the card numbers of the form $k m+1$, there are exactly $n=2 m+1$ of these, and we claim that there is exactly one in each stack. Card number 1 is in stack $a_{1}$, and card number $k m+1$ is in stack
Since
and $\operatorname{gcd}\left(2 m+1, \frac{m(m+1)}{2}\right)=1$, all the indices
are different modulo $n=2 m+1$. In the same way we see that each stack contains exactly one of the $2 m+1$ cards with the numbers $k m+i$ for a given $i=2,3, \ldots, m$.
Now look at two different stacks $a_{v}$ and $a_{u}$. Then, without loss of generality, we may assume that $u=v+i$ for some $i=1,2, \ldots, m$ (again we consider the index modulo $n=2 m+1$ ). Since there is a card in stack $a_{v}$ with number $k m+i$, the card $k m+i+1$ is in stack $a_{v+i}=a_{u}$. Hence among the cards in any two stacks there is at least one magic pair. Since there is the same number of pairs of stacks as of magic pairs, there must be exactly one magic pair among the cards of any two stacks.
Solution 2 (found by Saint Petersburg). For the case of $n$ odd, consider the complete graph on the vertices $1, \ldots, n$ with $\frac{n(n-1)}{2}$ edges. The degree of each vertex is $n-1$, which is even, hence an Euler cycle $v_{1} v_{2} \cdots v_{\frac{n(n-1)}{2}} v_{1}$ exists. Place card number $i$ into stack number $v_{i}$. The magic pairs correspond to edges in the cycle.
Problem 10.
A subset $S$ of ${1,2, \ldots, n}$ is called balanced if for every $a \in S$ there exists some $b \in S, b \neq a$, such that $\frac{a+b}{2} \in S$ as well.
(a) Let $k>1$ be an integer and let $n=2^{k}$. Show that every subset $S$ of ${1,2, \ldots, n}$ with $|S|>\frac{3 n}{4}$ is balanced.
(b) Does there exist an $n=2^{k}$, with $k>1$ an integer, for which every subset $S$ of ${1,2, \ldots, n}$ with $|S|>\frac{2 n}{3}$ is balanced?
Solution of part (a). Let $m=n-|S|$, thus $m<\frac{n}{4}$ and (as $n$ is a multiple of 4 ) $m \leq \frac{n}{4}-1$. Let $a \in S$. There are $\frac{n}{2}-1$ elements in ${1,2, \ldots, n}$ distinct from $a$ and with the same parity as $a$. At most $m$ of those elements are not in $S$, hence at least $\frac{n}{2}-1-m \geq \frac{n}{4}$ of them are in $S$. For each such $b$, the number $\frac{a+b}{2}$ is an integer, and all of these at least $\frac{n}{4}$ numbers are distinct. But at most $m<\frac{n}{4}$ of them are not in $S$, so at least one is a member of $S$. Hence $S$ is balanced.
Solution 1 of part (b). For convenience we work with ${0,1, \ldots, n-1}$ rather than ${1,2, \ldots, n}$; this does not change the problem. We show that one can always find an unbalanced subset containing more than $\frac{2 n}{3}$ elements.
Let $\operatorname{ord}_{2}(i)$ denote the number of factors 2 occurring in the prime factorisation of $i$. We set
Then we choose
Observe that $\left|T_{j}\right|=\frac{n}{2^{j+1}}$, so
We show that $S$ is not balanced. Take $a=0 \in S$, and consider a $0 \neq b \in S$. If $b$ is odd, then $\frac{0+b}{2}$ is not integral. If $b$ is even, then $b \in T_{2} \cup T_{4} \cup \cdots$, so $\frac{b}{2} \in T_{1} \cup T_{3} \cup \cdots$, hence $\frac{b}{2} \notin S$. Thus $S$ is not balanced.
Solution 2 of part (b). We define the sets
and set
Note that $A_{j} \subseteq{1,2, \ldots, n}$ whenever $j \leq k$, and that $\left|A_{j}\right|=2^{j-1}$. We find
We show that $S$ is not balanced. Take $a=1 \in S$, and consider a $1 \neq b \in S$. Then $b \in A_{j}$ for some $j$. If $b$ is even, then $\frac{1+b}{2}$ is not integral. If $b$ is odd, then also $1+b \in A_{j}$, so $\frac{1+b}{2} \in A_{j-1}$ and does not lie in $S$. Thus $S$ is not balanced.
Solution 3 of part (b). Let us introduce the concept of lonely element as an $a \in S$ for which there does not exist a $b \in S$, distinct from $a$, such that $\frac{a+b}{2} \in S$.
We will construct an unbalanced set $S$ with $|S|>\frac{2 n}{3}$ for all $k$. For $n=4$ we can use $S={1,2,4}$ (all elements are lonely), and for $n=8$ we can use $S={1,2,3,5,6,7}$ (2 and 6 are lonely).
We now construct an unbalanced set $S \subseteq{1,2, \ldots, 4 n}$, given an unbalanced set $T \subseteq{1,2, \ldots, n}$ with $|T|>\frac{2 n}{3}$. Take
Then
Figure 1: Problem 11.
Supposing $a \in T$ is lonely, we will show that $4 a-2 \in S$ is lonely. Indeed, suppose $4 a-2 \neq b \in S$ with
Then $b$ must be even, so $b=4 t-2$ for some $a \neq t \in T$. But then
again an even element. However, as $a$ is lonely we know that $\frac{a+t}{2} \notin T$, and hence $4 \frac{a+t}{2}-2 \notin S$. We conclude that $4 a-2$ is lonely in $S$.
Thus $S$ is an unbalanced set, and by induction we can find an unbalanced set of size exceeding $\frac{2 n}{3}$ for all $k>1$.
Problem 11.
The diagonals of the parallelogram $A B C D$ intersect at $E$. The bisectors of $\angle D A E$ and $\angle E B C$ intersect at $F$. Assume that $E C F D$ is a parallelogram. Determine the ratio $A B: A D$.
Solution. Since $E C F D$ is a parallelogram, we have $E D | C F$ and $\angle C F B=\angle E B F=\angle F B C(B F$ bisects $\angle D B C$ ). So $C F B$ is an isosceles triangle and $B C=C F=E D$ (ECFD is a parallelogram). In a similar manner, $E C=A D$. But since $A B C D$ is a parallelogram, $A D=B C$, whence $E C=E D$. So the diagonals of $A B C D$ are equal, which means that $A B C D$ is in fact a rectangle. Also, the triangles $E D A$ and $E B C$ are equilateral, and so $A B$ is twice the altitude of $E D A$, or $A B=\sqrt{3} \cdot A D$.
Problem 12.
A circle passes through vertex $B$ of the triangle $A B C$, intersects its sides $A B$ and $B C$ at points $K$ and $L$, respectively, and touches the side $A C$ at its midpoint $M$. The point $N$ on the $\operatorname{arc} B L$ (which does not contain $K)$ is such that $\angle L K N=\angle A C B$. Find $\angle B A C$ given that the triangle $C K N$ is equilateral.
Solution. Answer: $\angle B A C=75^{\circ}$.
Since $\angle A C B=\angle L K N=\angle L B N$, the lines $A C$ and $B N$ are parallel. Hence $A C N B$ is a trapezium. Moreover, $A C N B$ is an isosceles trapezium, because the segment $A C$ touches the circle $s$ in the midpoint (and so the trapezium is symmetrical with respect to the perpendicular bisectors of $B N$ ).

Figure 2: Problem 12.
Denote by $K^{\prime}$ the intersection point of $s$ and $C N$. Then the line $K K^{\prime}$ is parallel to the bases of the trapezium. Hence $M$ is the midpoint of $\operatorname{arc} K K^{\prime}$ and the line $N M$ is an angle bisector of the equilateral triangle $K N C$.
Thus we obtain that $M C=M K$. Therefore the length of median $K M$ of the triangle $A K C$ equals $\frac{1}{2} A C$; hence $\angle A K C=90^{\circ}$. We have
and so $\angle A=75^{\circ}$.
Problem 13.
Let $D$ be the footpoint of the altitude from $B$ in the triangle $A B C$, where $A B=1$. The incentre of triangle $B C D$ coincides with the centroid of triangle $A B C$. Find the lengths of $A C$ and $B C$.
Solution. Answer: $A C=B C=\sqrt{\frac{5}{2}}$.
The centroid of $A B C$ lies on the median $C C^{\prime}$. It will also, by the assumption, lie on the angle bisector through $C$. Since the median and the angle bisector coincide, $A B C$ is isosceles with $A C=$ $B C=a$.
Furthermore, the centroid lies on the median $B B^{\prime}$ and the bisector of $\angle D B C$, again by hypothesis. By the Angle Bisector Theorem,
The triangles $A B D \sim A C C^{\prime}$ since they have equal angles, whence
Using the fact that the length of the altitude $C C^{\prime}$ is $\sqrt{a^{2}-\frac{1}{4}}$, this leads to
or, equivalently,
Clearly, $a>1$, and the only solution is $a=\sqrt{\frac{5}{2}}$.
Problem 14.
In the non-isosceles triangle $A B C$ the altitude from $A$ meets side $B C$ in $D$. Let $M$ be the midpoint of $B C$ and let $N$ be the reflection of $M$ in $D$. The circumcircle of the triangle $A M N$ intersects the side $A B$ in $P \neq A$ and the side $A C$ in $Q \neq A$. Prove that $A N, B Q$ and $C P$ are concurrent.
Solution 1. Without loss of generality, we assume the order of the points on $B C$ to be $B, M, D, N$, $C$. This implies that $P$ is on the segment $A B$ and $Q$ is on the segment $A C$.
Since $D$ is the midpoint of $M N$ and $A D$ is perpendicular to $M N$, the line $A D$ is the perpendicular bisector of $M N$, which contains the circumcentre of $\triangle A M N$. As $A$ is on the perpendicular bisector of $M N$, we have $|A M|=|A N|$. We now have $\angle A P M=\angle A Q N$. Therefore
Furthermore, as $N M P Q$ is cyclic, we have
Hence
Similarly,
Now we have $\triangle A P Q \sim \triangle A C B$. So
Furthermore, $\angle M A B=\angle M A P=\angle M N P=\angle B N P$, so $\triangle B M A \sim \triangle B P N$, and hence
We also have $\angle C A M=\angle Q A M=180^{\circ}-\angle Q N M=\angle Q N C$. This implies $\triangle C M A \sim \triangle C Q N$, so
Putting everything together, we find
As $|B M|=|C M|$, the right-hand side is equal to 1 . This means that
With Ceva's theorem we can conclude that $A N, B Q$ and $C P$ are concurrent.
Solution 2. We consider the same configuration as in Solution 1. Let $K$ be the second intersection of $A D$ with the circumcircle of $\triangle A M N$. Since $D$ is the midpoint of $M N$ and $A D$ is perpendicular to $M N$, the line $A D$ is the perpendicular bisector of $M N$, which contains the circumcentre of $\triangle A M N$. So $A K$ is a diameter of this circumcircle. Now we have $\angle B P K=90^{\circ}=\angle B D K$, so $B P D K$ is a cyclic quadrilateral. Also, $A, M, N, K, P$ and $Q$ are concyclic. Using both circles, we find
This implies that $B P Q C$ is cyclic as well. Using the power theorem we find $A P \cdot A B=A Q \cdot A C$, with directed lengths. Also, $B N \cdot B M=B P \cdot B A$ and $C N \cdot C M=C Q \cdot C A$. Hence
Changing the signs of all six lengths on the right-hand side and replacing $M C$ by $B M$, we find
Cleaning this up, we have
implying
With Ceva's theorem we can conclude that $A N, B Q$ and $C P$ are concurrent.
Problem 15.
In triangle $A B C$, the interior and exterior angle bisectors of $\angle B A C$ intersect the line $B C$ in $D$ and $E$, respectively. Let $F$ be the second point of intersection of the line $A D$ with the circumcircle of the triangle $A B C$. Let $O$ be the circumcentre of the triangle $A B C$ and let $D^{\prime}$ be the reflection of $D$ in $O$. Prove that $\angle D^{\prime} F E=90^{\circ}$.
Solution 1. Note that $A B \neq A C$, since otherwise the exterior angle bisector of $\angle B A C$ would be parallel to $B C$. So assume without loss of generality that $A B<A C$. Let $M$ be the midpoint of $B C$ and let $F^{\prime}$ the reflection of $F$ in $O$, which is also the second intersection of the line $A E$ with the circumcircle of $\triangle A B C$. We now have
Since $\angle D M F^{\prime}=90^{\circ}=\angle D A F^{\prime}$, the quadrilateral $M D A F^{\prime}$ is cyclic, thus
Furthermore, $\angle F M E=90^{\circ}=\angle F A E$, so $F M A E$ is cyclic as well. This implies that
Combining these three equalities we find that $\angle D^{\prime} F O=\angle M E F$, thus
Solution 2. Again, assume $A B<A C$ and define $F^{\prime}$ as in the previous solution. Let $G$ be the intersection of the lines $D F^{\prime}$ and $E F$.
We can easily see that $F A$ is perpendicular to $E F^{\prime}$, and $B C$ to $F F^{\prime}$. Now, in triangle $\triangle E F F^{\prime}$, we have that $F D$ and $E D$ are altitudes, so $D$ is the orthocentre of this triangle. Now, $F^{\prime} D$ is an altitude
as well and we find that $F^{\prime} G$ is perpendicular to $E F$. Since $F F^{\prime}$ is a diameter of the circumcircle of $\triangle A B C, G$ must lie on this circle as well.
We now find
Also, $\angle D F^{\prime} F=\angle D^{\prime} F F^{\prime}$. This implies that
Now, in triangle $\triangle A F F^{\prime}$ we have
as required.
Solution 3. Again, assume $A B<A C$. We first consider the case $\angle B A C=90^{\circ}$. Define $F^{\prime}$ as in the previous solution. Now $O$ and $D^{\prime}$ lie on $B C$, so $\triangle D^{\prime} F O$ and $\triangle D F O$ are mirror images with respect to $F F^{\prime}$, while $\triangle O F E$ and $\triangle O F^{\prime} E$ are mirror images with respect to $B C$. We find that
Now assume that $\angle B A C \neq 90^{\circ}$. We consider the configuration where $\angle B A C<90^{\circ}$. Let $M$, $N$ and $L$ be the midpoints of the line segments $B C, D E$ and $D F$, respectively. Note that $N$ is the circumcentre of $\triangle A D E$, so we find
Hence $N A$ is tangent to the circumcircle of $\triangle A B C$, thus $N A \perp O A$. Furthermore, we have $N M \perp$ $O M$, so $A O M N$ is cyclic with $O N$ as diameter. Now, since $L$ is the circumcentre of $\triangle D M F$, we find
so $A N L M$ is cyclic. Combining this with what we found before, we now conclude that $A O M L N$ is cyclic with $O N$ as diameter, thus $\angle O L N=90^{\circ}$. Using a dilation with centre $D$ and factor 2 we now can conclude $\angle D^{\prime} F E=\angle O L N=90^{\circ}$.
In case $\angle B A C>90^{\circ}$, the proof is similar (the cyclic quadrilateral will this time be $A M O N$ ).
Solution 4. We consider the configuration where $C, D, B$ and $E$ are on the line $B C$ in that order. The other configuration can be solved analogously. Let $P$ and $R$ be the feet of the perpendiculars from $D^{\prime}$ and $O$ to the line $A D$, respectively, and let $Q$ and $S$ be the feet of the perpendiculars from $D^{\prime}$ and $O$ to the line $C D$, respectively. Since $D^{\prime}$ is the reflection of $D$ with respect to $O$, we have $P R=R D$. Since we also have $O A=O F$ and therefore $R A=R F$, we obtain $A D=P F$. Similarly, $C D=B Q$. By Pythagoras's theorem,
and
And since $\angle E A F=90^{\circ}$ we have
As $O A=O B$, we conclude that
By Pythagoras's theorem again, we obtain $A E^{2}+A D^{2}=E D^{2}$, and hence
We have
By the internal and external bisector theorems, we have
hence
So
which implies that $\angle D^{\prime} F E=90^{\circ}$.
Problem 16.
Denote by $P(n)$ the greatest prime divisor of $n$. Find all integers $n \geq 2$ for which
(Note: $\lfloor x\rfloor$ denotes the greatest integer less than or equal to $x$.)
Solution. Answer: The equality holds only for $n=3$.
It is easy to see that $P(n) \neq P(n+1)$. Therefore we need also that $\lfloor\sqrt{n}\rfloor \neq\lfloor\sqrt{n+1}\rfloor$ in order for equality to hold. This is only possible if $n+1$ is a perfect square. In this case,
and hence $P(n)=P(n+1)+1$. As both $P(n)$ and $P(n+1)$ are primes, it must be that $P(n)=3$ and $P(n+1)=2$.
It follows that $n=3^{a}$ and $n+1=2^{b}$, and we are required to solve the equation $3^{a}=2^{b}-1$. Calculating modulo 3 , we find that $b$ is even. Put $b=2 c$ :
As both factors cannot be divisible by 3 (their difference is 2 ), $2^{c}-1=1$. From this we get $c=1$, which leads to $n=3$.
Problem 17.
Find all positive integers $n$ for which $n^{n-1}-1$ is divisible by $2^{2015}$, but not by $2^{2016}$.
Solution. Since $n$ must be odd, write $n=2^{d} u+1$, where $u, d \in \mathbf{N}$ and $u$ is odd. Now
and hence $2^{2015} |\left(n^{n-1}-1\right)$ iff $2^{2015} |\left(n^{2^{d}}-1\right)$. (The notation $p^{k} | m$ denotes that $p^{k} \mid m$ and $p^{k+1} \nmid m$.)
We factorise once more:
If $k \geq 1$, then $2 | n^{2^{k}}+1$, and so from the above
It is easy to see that this is the case exactly when $d=1$ and $u=2^{2013} v-1$, where $v$ is odd.
Hence the required numbers are those of the form
for $v$ a positive odd number.
Problem 18.
Let $f(x)=x^{n}+a_{n-1} x^{n-1}+\cdots+a_{0}$ be a polynomial of degree $n \geq 1$ with $n$ (not necessarily distinct) integer roots. Assume that there exist distinct primes $p_{0}, p_{1}, \ldots, p_{n-1}$ such that $a_{i}>1$ is a power of $p_{i}$, for all $i=0, \ldots, n-1$. Find all possible values of $n$.
Solution. Obviously all the roots have to be negative by the positivity of the coefficients. If at least two of the roots are unequal to -1 , then both of them have to be powers of $p_{0}$. Now Vieta's formulæ yield $p_{0} \mid a_{1}$, which is a contradiction. Thus we can factor $f$ as
Expanding yields
If $n \geq 5$, we see that $2 \neq n-2$ and so the two coefficients above are relatively prime, being powers of two distinct primes. However, depending on the parity of $n$, we have that $a_{2}$ and $a_{n-2}$ are both divisible by $n-1$ or $\frac{n-1}{2}$, which is a contradiction.
For $n=1,2,3,4$, the following polynomials meet the requirements:
Problem 19.
Three pairwise distinct positive integers $a, b, c$, with $\operatorname{gcd}(a, b, c)=1$, satisfy
Prove that there does not exist a non-degenerate triangle with side lengths $a, b, c$.
Solution. First observe that these numbers are pairwise coprime. Indeed, if, say, $a$ and $b$ are divisible by a prime $p$, then $p$ divides $b$, which divides $(a-c)^{2}$; hence $p$ divides $a-c$, and therefore $p$ divides $c$. Thus, $p$ is a common divisor of these three numbers, a contradiction.
Now consider the number
It is clear from the problem condition that $M$ is divisible by $a, b, c$, and therefore $M$ is divisible by $a b c$.
Assume that a triangle with sides $a, b, c$ exists. Then $a<b+c$, and so $a^{2}<a b+a c$. Analogously, we have $b^{2}<b c+b a$ and $c^{2}<c a+c b$. Summing these three inequalities leads to $M>0$, and hence $M \geq a b c$.
On the other hand,
and therefore $M<a b+b c+a c$. Supposing, with no loss of generality, $a>b>c$, we must have $M<3 a b$. Taking into account the inequality $M \geq a b c$, we conclude that $c=1$ or $c=2$ are the only possibilities.
For $c=1$ we have $b<a<b+1$ (the first inequality is our assumption, the second is the triangle inequality), a contradiction.
For $c=2$ we have $b<a<b+2$, i.e. $a=b+1$. But then $1=(a-b)^{2}$ is not divisible by $c=2$.
Problem 20.
For any integer $n \geq 2$, we define $A_{n}$ to be the number of positive integers $m$ with the following property: the distance from $n$ to the nearest non-negative multiple of $m$ is equal to the distance from $n^{3}$ to the nearest non-negative multiple of $m$. Find all integers $n \geq 2$ for which $A_{n}$ is odd.
(Note: The distance between two integers $a$ and $b$ is defined as $|a-b|$.)
Solution. For an integer $m$ we consider the distance $d$ from $n$ to the nearest multiple of $m$. Then $m \mid n \pm d$, which means $n \equiv \pm d \bmod m$. So if, for some $m$, the distance from $n$ to the nearest multiple of $m$ is equal to the distance from $n^{3}$ to the nearest multiple of $m$, then $n \equiv \pm n^{3} \bmod m$.
On the other hand, if $n \equiv \pm n^{3} \bmod m$, then there exists a $0 \leq d \leq \frac{1}{2} m$ such that $n \equiv \pm d \bmod m$ and $n^{3} \equiv \pm d \bmod m$, so the distance from $n$ to the nearest multiple of $m$ is equal to the distance from $n^{3}$ to the nearest multiple of $m$.
We conclude that we need to count the number of positive integers $m$ such that $n \equiv \pm n^{3} \bmod m$, or, equivalently, $m \mid n^{3}-n$ or $m \mid n^{3}+n$. That is,
where $\tau(k)$ denotes the number of (positive) divisors of a positive integer $k$.
Recall that $\tau(k)$ is odd if and only if $k$ is a square. Furthermore, we have
So if $n^{3} \pm n$ were a square, then both $n$ and $n^{2} \pm 1$ would be squares. But $n^{2} \pm 1$ is not a square, since $n \geq 2$ and the only consecutive squares are 0,1 . Hence neither $n^{3}-n$ nor $n^{3}+n$ is a square, so the first two terms $\tau\left(n^{3}-n\right)$ and $\tau\left(n^{3}+n\right)$ are both even. Hence $A_{n}$ is odd if and only if $\operatorname{gcd}\left(n^{3}-n, n^{3}+n\right)$ is a square.
We have
Hence,
Note that $2 n$ for $n$ odd is never a square, since it has exactly one factor of 2 . We conclude that $A_{n}$ is odd if and only if $n$ is an even square.

