17. G2 (KAZ) The circle $\Gamma$ and the line $\ell$ do not intersect. Let $A B$ be the diameter of $\Gamma$ perpendicular to $\ell$, with $B$ closer to $\ell$ than $A$. An arbitrary point $C \neq A, B$ is chosen on $\Gamma$. The line $A C$ intersects $\ell$ at $D$. The line $D E$ is tangent to $\Gamma$ at $E$, with $B$ and $E$ on the same side of $A C$. Let $B E$ intersect $\ell$ at $F$, and let $A F$ intersect $\Gamma$ at $G \neq A$. Prove that the reflection of $G$ in $A B$ lies on the line $C F$.

Solution: 17. Let $H$ be the reflection of $G$ about $A B(G H \| \ell)$. Let $M$ be the intersection of $A B$ and $\ell$. Since $\angle F E A=\angle F M A=90^{\circ}$, it follows that $A E M F$ is cyclic and hence $\angle D F E=\angle B A E=\angle D E F$. The last equality holds because $D E$ is tangent to $\Gamma$. It follows that $D E=$ $D F$ and hence $D F^{2}=D E^{2}=$ ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-731.jpg?height=396&width=459&top_left_y=1591&top_left_x=841) $D C \cdot D A$ (the power of $D$ with respect to $\Gamma$ ). It then follows that $\angle D C F=\angle D F A=\angle H G A=\angle H C A$. Thus it follows that $H$ lies on $C F$ as desired.


18. G3 (KOR) Let $O$ be the circumcenter of an acute-angled triangle $A B C$ with $\angle B<\angle C$. The line $A O$ meets the side $B C$ at $D$. The circumcenters of the triangles $A B D$ and $A C D$ are $E$ and $F$, respectively. Extend the sides $B A$ and $C A$ beyond $A$, and choose on the respective extension points $G$ and $H$ such that $A G=A C$ and $A H=A B$. Prove that the quadrilateral $E F G H$ is a rectangle if and only if $\angle A C B-\angle A B C=60^{\circ}$.

Solution: 18. It is important to note that since $\beta<\gamma, \angle A D C=90^{\circ}-\gamma+\beta$ is acute. It is elementary that $\angle C A O=90^{\circ}-\beta$. Let $X$ and $Y$ respectively be the intersections of $F E$ and $G H$ with $A D$. We trivially get $X \in E F \perp A D$ and $\triangle A G H \cong \triangle A C B$. Consequently, $\angle G A Y=\angle O A B=90^{\circ}-\gamma=$ $90^{\circ}-\angle A G Y$. Hence, $G H \perp A D$ and thus $G H \| F E$. That $E F G H$ is a rectangle is now equivalent to $F X=G Y$ and $E X=H Y$. We have that $G Y=A G \sin \gamma=A C \sin \gamma$ and $F X=A F \sin \gamma$ (since $\angle A F X=\gamma$ ). Thus,  $$ F X=G Y \Leftrightarrow C F=A F=A C \Leftrightarrow \angle A F C=60^{\circ} \Leftrightarrow \angle A D C=30^{\circ} . $$  Since $\angle A D C=180^{\circ}-\angle D C A-\angle D A C=180^{\circ}-\gamma-\left(90^{\circ}-\beta\right)$, it immediately follows that $F X=G Y \Leftrightarrow \gamma-\beta=60^{\circ}$. We similarly obtain $E X=H Y \Leftrightarrow \gamma-\beta=60^{\circ}$, proving the statement of the problem.


19. $\mathbf{G} 4 \mathbf{( P O L})^{\mathrm{IMO}}$ In a convex quadrilateral $A B C D$ the diagonal $B D$ does not bisect the angles $A B C$ and $C D A$. The point $P$ lies inside $A B C D$ and satisfies  $$ \angle P B C=\angle D B A \quad \text { and } \quad \angle P D C=\angle B D A . $$  Prove that $A B C D$ is a cyclic quadrilateral if and only if $A P=C P$.

Solution: 19. Assume first that the points $A, B, C, D$ are concyclic. Let the lines $B P$ and $D P$ meet the circumcircle of $A B C D$ again at $E$ and $F$, respectively. Then it follows from the given conditions that $\widehat{A B}=\widehat{C F}$ and $\widehat{A D}=\widehat{C E}$; hence $B F \| A C$ and $D E \| A C$. Therefore $B F E D$ and $B F A C$ are isosceles trapezoids and thus $P=B E \cap D F$ lies on the common bisector of segments $B F, E D, A C$. Hence $A P=C P$. Assume in turn that $A P=C P$. Let $P$ w.l.o.g. lie in the triangles $A C D$ and $B C D$. Let $B P$ and $D P$ meet $A C$ at $K$ and $L$, respectively. The points $A$ and $C$ are isogonal conjugates with respect to $\triangle B D P$, which implies that $\angle A P K=\angle C P L$. Since $A P=C P$, we infer that $K$ and $L$ are symmetric with respect to the perpendicular bisector $p$ of $A C$. Let $E$ be the reflection of $D$ in $p$. Then $E$ lies on the line $B P$, and the triangles $A P D$ and $C P E$ are congruent. Thus $\angle B D C=\angle A D P=\angle B E C$, which means that the points $B, C, E, D$ are concyclic. Moreover, $A, C, E, D$ are also concyclic. Hence, $A B C D$ is a cyclic quadrilateral.


2. A2 (ROM) An infinite sequence $a_{0}, a_{1}, a_{2}, \ldots$ of real numbers satisfies the condition  $$ a_{n}=\left|a_{n+1}-a_{n+2}\right| \text { for every } n \geq 0 $$  with $a_{0}$ and $a_{1}$ positive and distinct. Can this sequence be bounded?

Solution: 2. We claim that the sequence $\left\{a_{n}\right\}$ must be unbounded.  The condition of the sequence is equivalent to $a_{n}>0$ and $a_{n+1}=a_{n}+a_{n-1}$ or $a_{n}-a_{n-1}$. In particular, if $a_{n}<a_{n-1}$, then $a_{n+1}>\max \left\{a_{n}, a_{n-1}\right\}$. Let us remove all $a_{n}$ such that $a_{n}<a_{n-1}$. The obtained sequence $\left(b_{m}\right)_{m \in \mathbb{N}}$ is strictly increasing. Thus the statement of the problem will follow if we prove that $b_{m+1}-b_{m} \geq b_{m}-b_{m-1}$ for all $m \geq 2$. Let $b_{m+1}=a_{n+2}$ for some $n$. Then $a_{n+2}>a_{n+1}$. We distinguish two cases: (i) If $a_{n+1}>a_{n}$, we have $b_{m}=a_{n+1}$ and $b_{m-1} \geq a_{n-1}$ (since $b_{m-1}$ is either $a_{n-1}$ or $a_{n}$ ). Then $b_{m+1}-b_{m}=a_{n+2}-a_{n+1}=a_{n}=a_{n+1}-$ $a_{n-1}=b_{m}-a_{n-1} \geq b_{m}-b_{m-1}$. (ii) If $a_{n+1}<a_{n}$, we have $b_{m}=a_{n}$ and $b_{m-1} \geq a_{n-1}$. Consequently, $b_{m+1}-b_{m}=a_{n+2}-a_{n}=a_{n+1}=a_{n}-a_{n-1}=b_{m}-a_{n-1} \geq b_{m}-b_{m-1}$.


20. G5 (SMN) Let $A_{1} A_{2} \ldots A_{n}$ be a regular $n$-gon. The points $B_{1}, \ldots, B_{n-1}$ are defined as follows: (i) If $i=1$ or $i=n-1$, then $B_{i}$ is the midpoint of the side $A_{i} A_{i+1}$. (ii) If $i \neq 1, i \neq n-1$, and $S$ is the intersection point of $A_{1} A_{i+1}$ and $A_{n} A_{i}$, then $B_{i}$ is the intersection point of the bisector of the angle $A_{i} S A_{i+1}$ with $A_{i} A_{i+1}$. Prove the equality  $$ \angle A_{1} B_{1} A_{n}+\angle A_{1} B_{2} A_{n}+\cdots+\angle A_{1} B_{n-1} A_{n}=180^{\circ} . $$

Solution: 20. We first establish the following lemma.  Lemma. Let $A B C D$ be an isosceles trapezoid with bases $A B$ and $C D$. The diagonals $A C$ and $B D$ intersect at $S$. Let $M$ be the midpoint of $B C$, and let the bisector of the angle $B S C$ intersect $B C$ at $N$. Then $\angle A M D=\angle A N D$. Proof. It suffices to show that the points $A, D, M, N$ are concyclic. The statement is trivial for $A D \| B C$. Let us now assume that $A D$ and $B C$ meet at $X$, and let $X A=X B=a, X C=X D=b$. Since $S N$ is the bisector of $\angle C S B$, we have  $$ \frac{a-X N}{X N-b}=\frac{B N}{C N}=\frac{B S}{C S}=\frac{A B}{C D}=\frac{a}{b} $$  and an easy computation yields $X N=\frac{2 a b}{a+b}$. We also have $X M=\frac{a+b}{2}$; hence $X M \cdot X N=X A \cdot X D$. Therefore $A, D, M, N$ are concyclic, as needed.  Denote by $C_{i}$ the midpoint of the side $A_{i} A_{i+1}, i=1, \ldots, n-1$. By definition $C_{1}=B_{1}$ and $C_{n-1}=B_{n-1}$. Since $A_{1} A_{i} A_{i+1} A_{n}$ is an isosceles trapezoid with $A_{1} A_{i} \| A_{i+1} A_{n}$ for $i=2, \ldots, n-2$, it follows from the lemma that $\angle A_{1} B_{i} A_{n}=\angle A_{1} C_{i} A_{n}$ for all $i$. The sum in consideration thus equals $\angle A_{1} C_{1} A_{n}+\angle A_{1} C_{2} A_{n}+\cdots+$ $\angle A_{1} C_{n-1} A_{n}$. Moreover, the triangles $A_{1} C_{i} A_{n}$ and $A_{n+2-i} C_{1} A_{n+1-i}$ are congruent (a rotation about the center of the $n$-gon carries the first one to the second), and consequently  $$ \angle A_{1} C_{i} A_{n}=\angle A_{n+2-i} C_{1} A_{n+1-i} $$  ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-733.jpg?height=417&width=470&top_left_y=415&top_left_x=847) for $i=2, \ldots, n-1$. Hence $\Sigma=\angle A_{1} C_{1} A_{n}+\angle A_{n} C_{1} A_{n-1}+\cdots+\angle A_{3} C_{1} A_{2}=\angle A_{1} C_{1} A_{2}=180^{\circ}$.


21. G6 (GBR) Let $\mathcal{P}$ be a convex polygon. Prove that there is a convex hexagon that is contained in $\mathcal{P}$ and that occupies at least 75 percent of the area of $\mathcal{P}$.

Solution: 21. Let $A B C$ be the triangle of maximum area $S$ contained in $\mathcal{P}$ (it exists because of compactness of $\mathcal{P}$ ). Draw parallels to $B C, C A, A B$ through $A, B, C$, respectively, and denote the triangle thus obtained by $A_{1} B_{1} C_{1}$ ( $A \in B_{1} C_{1}$, etc.). Since each triangle with vertices in $\mathcal{P}$ has area at most $S$, the entire polygon $\mathcal{P}$ is contained in $A_{1} B_{1} C_{1}$. Next, draw lines of support of $\mathcal{P}$ parallel to $B C, C A, A B$ and not intersecting the triangle $A B C$. They determine a convex hexagon $U_{a} V_{a} U_{b} V_{b} U_{c} V_{c}$ containing $\mathcal{P}$, with $V_{b}, U_{c} \in B_{1} C_{1}, V_{c}, U_{a} \in C_{1} A_{1}, V_{a}, U_{b} \in A_{1} B_{1}$. Each of the line segments $U_{a} V_{a}, U_{b} V_{b}, U_{c} V_{c}$ contains points of $\mathcal{P}$. Choose such points $A_{0}, B_{0}, C_{0}$ on $U_{a} V_{a}, U_{b} V_{b}, U_{c} V_{c}$, respectively. The convex hexagon $A C_{0} B A_{0} C B_{0}$ is contained in $\mathcal{P}$, because the latter is convex. We prove that $A C_{0} B A_{0} C B_{0}$ has area at least $3 / 4$ the area of $\mathcal{P}$. Let $x, y, z$ denote the areas of triangles $U_{a} B C, U_{b} C A$, and $U_{c} A B$. Then $S_{1}=S_{A C_{0} B A_{0} C B_{0}}=S+x+y+z$. On the other hand, the triangle $A_{1} U_{a} V_{a}$ is similar to $\triangle A_{1} B C$ with similitude $\tau=(S-x) / S$, and hence its area is $\tau^{2} S=(S-x)^{2} / S$. Thus the area of quadrilateral $U_{a} V_{a} C B$ is $S-(S-x)^{2} / S=2 z-z^{2} / S$. Analogous formulas hold for quadrilaterals $U_{b} V_{b} A C$ and $U_{c} V_{c} B A$. Therefore  $$ \begin{aligned} S_{\mathcal{P}} & \leq S_{U_{a} V_{a} U_{b} V_{b} U_{c} V_{c}}=S+S_{U_{a} V_{a} C B}+S_{U_{b} V_{b} A C}+S_{U_{c} V_{c} B A} \\ & =S+2(x+y+z)-\frac{x^{2}+y^{2}+z^{2}}{S} \\ & \leq S+2(x+y+z)-\frac{(x+y+z)^{2}}{3 S} . \end{aligned} $$  Now $4 S_{1}-3 S_{\mathcal{P}} \geq=S-2(x+y+z)+(x+y+z)^{2} / S=(S-x-y-z)^{2} / S \geq 0$; i.e., $S_{1} \geq 3 S_{\mathcal{P}} / 4$, as claimed.


22. G7 (RUS) For a given triangle $A B C$, let $X$ be a variable point on the line $B C$ such that $C$ lies between $B$ and $X$ and the incircles of the triangles $A B X$ and $A C X$ intersect at two distinct points $P$ and $Q$. Prove that the line $P Q$ passes through a point independent of $X$.

Solution: 22. The proof uses the following observation:  Lemma. In a triangle $A B C$, let $K, L$ be the midpoints of the sides $A C, A B$, respectively, and let the incircle of the triangle touch $B C, C A$ at $D, E$, respectively. Then the lines $K L$ and $D E$ intersect on the bisector of the angle $A B C$. Proof. Let the bisector $\ell_{b}$ of $\angle A B C$ meet $D E$ at $T$. One can assume that $A B \neq B C$, or else $T \equiv K \in K L$. Note that the incenter $I$ of $\triangle A B C$ is between $B$ and $T$, and also $T \neq E$. From the triangles $B D T$ and $D E C$ we obtain $\angle I T D=\alpha / 2=\angle I A E$, which implies that $A, I, T, E$ are concyclic. Then $\angle A T B=\angle A E I=90^{\circ}$. Thus $L$ is the circumcenter of $\triangle A T B$ from which $\angle L T B=\angle L B T=\angle T B C \Rightarrow L T \| B C \Rightarrow T \in$ $K L$, which is what we were supposed to prove. Let the incircles of $\triangle A B X$ and $\triangle A C X$ touch $B X$ at $D$ and $F$, respectively, and let them touch $A X$ at $E$ and $G$, respectively. Clearly, $D E$ and $F G$ are parallel. If the line $P Q$ intersects $B X$ and $A X$ at $M$ and $N$, respectively, then $M D^{2}=M P \cdot M Q=M F^{2}$, i.e., $M D=M F$ and analogously $N E=N G$. It follows that $P Q$ is parallel to $D E$ and $F G$ and equidistant from them. The midpoints of $A B, A C$, and $A X$ lie on the same line $m$, parallel to $B C$. Applying the lemma to $\triangle A B X$, we conclude that $D E$ passes through the common point $U$ of $m$ and the bisector of $\angle A B X$. Analogously, $F G$ passes through the common point $V$ of $m$ and the bisector of $\angle A C X$. Therefore $P Q$ passes through the midpoint $W$ of the line segment $U V$. Since $U, V$ do not depend on $X$, neither does $W$.


23. G8 (SMN) A cyclic quadrilateral $A B C D$ is given. The lines $A D$ and $B C$ intersect at $E$, with $C$ between $B$ and $E$; the diagonals $A C$ and $B D$ intersect at $F$. Let $M$ be the midpoint of the side $C D$, and let $N \neq M$ be a point on the circumcircle of the triangle $A B M$ such that $A N / B N=$ $A M / B M$. Prove that the points $E, F$, and $N$ are collinear.

Solution: 23. To start with, note that point $N$ is uniquely determined by the imposed properties. Indeed, $f(X)=A X / B X$ is a monotone function on both arcs $A B$ of the circumcircle of $\triangle A B M$. Denote by $P$ and $Q$ respectively the second points of intersection of the line $E F$ with the circumcircles of $\triangle A B E$ and $\triangle A B F$. The problem is equivalent to showing that $N \in P Q$. In fact, we shall prove that $N$ coincides with the midpoint $\bar{N}$ of segment $P Q$. The cyclic quadrilaterals $A P B E$, $A Q B F$, and $A B C D$ yield $\angle A P Q=$ $180^{\circ}-\angle A P E=180^{\circ}-\angle A B E=$ $\angle A D C$ and $\angle A Q P=\angle A Q F=$ $\angle A B F=\angle A C D$. It follows that $\triangle A P Q \sim \triangle A D C$, and consequently $\triangle A \bar{N} P \sim \triangle A M D$. Analo- ![](https://cdn.mathpix.com/cropped/2024_11_18_8e985d6b9c83aa3e9d0eg-734.jpg?height=604&width=446&top_left_y=1342&top_left_x=857) gously $\triangle B \bar{N} P \sim \triangle B M C$. Therefore $A \bar{N} / A M=P Q / D C=B \bar{N} / B M$, i.e., $A \bar{N} / B \bar{N}=A M / B M$. Moreover, $\angle A \bar{N} B=\angle A \bar{N} P+\angle P \bar{N} B=$ $\angle A M D+\angle B M C=180^{\circ}-\angle A M B$, which means that point $\bar{N}$ lies on the circumcircle of $\triangle A M B$. By the uniqueness of $N$, we conclude that $\bar{N} \equiv N$, which completes the solution.


24. N1 (BLR) Let $\tau(n)$ denote the number of positive divisors of the positive integer $n$. Prove that there exist infinitely many positive integers $a$ such that the equation  $$ \tau(a n)=n $$  does not have a positive integer solution $n$.

Solution: 24. Setting $m=a n$ we reduce the given equation to $m / \tau(m)=a$.  Let us show that for $a=p^{p-1}$ the above equation has no solutions in $\mathbb{N}$ if $p>3$ is a prime. Assume to the contrary that $m \in \mathbb{N}$ is such that $m=p^{p-1} \tau(m)$. Then $p^{p-1} \mid m$, so we may set $m=p^{\alpha} k$, where $\alpha, k \in \mathbb{N}$, $\alpha \geq p-1$, and $p \nmid k$. Let $k=p_{1}^{\alpha_{1}} \cdots p_{r}^{\alpha_{r}}$ be the decomposition of $k$ into primes. Then $\tau(k)=\left(\alpha_{1}+1\right) \cdots\left(\alpha_{r}+1\right)$ and $\tau(m)=(\alpha+1) \tau(k)$. Our equation becomes  $$ p^{\alpha-p+1} k=(\alpha+1) \tau(k) . $$  We observe that $\alpha \neq p-1$ : otherwise the RHS would be divisible by $p$ and the LHS would not be so. It follows that $\alpha \geq p$, which also easily implies that $p^{\alpha-p+1} \geq \frac{p}{p+1}(\alpha+1)$. Furthermore, since $\alpha+1$ cannot be divisible by $p^{\alpha-p+1}$ for any $\alpha \geq p$, it follows that $p \mid \tau(k)$. Thus if $p \mid \tau(k)$, then at least one $\alpha_{i}+1$ is divisible by $p$ and consequently $\alpha_{i} \geq p-1$ for some $i$. Hence $k \geq \frac{p_{i}^{\alpha_{i}}}{\alpha_{i}+1} \tau(k) \geq \frac{2^{p-1}}{p} \tau(k)$. But then we have  $$ p^{\alpha-p+1} k \geq \frac{p}{p+1}(\alpha+1) \cdot \frac{2^{p-1}}{p} \tau(k)>(\alpha+1) \tau(k), $$  contradicting (1). Therefore (1) has no solutions in $\mathbb{N}$. Remark. There are many other values of $a$ for which the considered equation has no solutions in $\mathbb{N}$ : for example, $a=6 p$ for a prime $p \geq 5$.


25. N2 (RUS) The function $\psi$ from the set $\mathbb{N}$ of positive integers into itself is defined by the equality  $$ \psi(n)=\sum_{k=1}^{n}(k, n), \quad n \in \mathbb{N} $$  where $(k, n)$ denotes the greatest common divisor of $k$ and $n$. (a) Prove that $\psi(m n)=\psi(m) \psi(n)$ for every two relatively prime $m, n \in$ $\mathbb{N}$. (b) Prove that for each $a \in \mathbb{N}$ the equation $\psi(x)=a x$ has a solution. (c) Find all $a \in \mathbb{N}$ such that the equation $\psi(x)=a x$ has a unique solution.

Solution: 25. Let $n$ be a natural number. For each $k=1,2, \ldots, n$, the number $(k, n)$ is a divisor of $n$. Consider any divisor $d$ of $n$. If $(k, n)=n / d$, then $k=n l / d$ for some $l \in \mathbb{N}$, and $(k, n)=(l, d) n / d$, which implies that $l$ is coprime to $d$ and $l \leq d$. It follows that $(k, n)$ is equal to $n / d$ for exactly $\varphi(d)$ natural numbers $k \leq n$. Therefore  $$ \psi(n)=\sum_{k=1}^{n}(k, n)=\sum_{d \mid n} \varphi(d) \frac{n}{d}=n \sum_{d \mid n} \frac{\varphi(d)}{d} $$  (a) Let $n, m$ be coprime. Then each divisor $f$ of $m n$ can be uniquely expressed as $f=d e$, where $d \mid n$ and $e \mid m$. We now have by (1)  $$ \begin{aligned} \psi(m n) & =m n \sum_{f \mid m n} \frac{\varphi(f)}{f}=m n \sum_{d|n, e| m} \frac{\varphi(d e)}{d e} \\ & =m n \sum_{d|n, e| m} \frac{\varphi(d)}{d} \frac{\varphi(e)}{e}=\left(n \sum_{d \mid n} \frac{\varphi(d)}{d}\right)\left(m \sum_{e \mid m} \frac{\varphi(e)}{e}\right) \\ & =\psi(m) \psi(n) . \end{aligned} $$  (b) Let $n=p^{k}$, where $p$ is a prime and $k$ a positive integer. According to (1),  $$ \frac{\psi(n)}{n}=\sum_{i=0}^{k} \frac{\varphi\left(p^{i}\right)}{p^{i}}=1+\frac{k(p-1)}{p} $$  Setting $p=2$ and $k=2(a-1)$ we obtain $\psi(n)=a n$ for $n=2^{2(a-1)}$. (c) We note that $\psi\left(p^{p}\right)=p^{p+1}$ if $p$ is a prime. Hence, if $a$ has an odd prime factor $p$ and $a_{1}=a / p$, then $x=p^{p} 2^{2 a_{1}-2}$ is a solution of $\psi(x)=a x$ different from $x=2^{2 a-2}$. Now assume that $a=2^{k}$ for some $k \in \mathbb{N}$. Suppose $x=2^{\alpha} y$ is a positive integer such that $\psi(x)=2^{k} x$. Then $2^{\alpha+k} y=\psi(x)=\psi\left(2^{\alpha}\right) \psi(y)=$ $(\alpha+2) 2^{\alpha-1} \psi(y)$, i.e., $2^{k+1} y=(\alpha+2) \psi(y)$. We notice that for each odd $y, \psi(y)$ is (by definition) the sum of an odd number of odd summands and therefore odd. It follows that $\psi(y) \mid y$. On the other hand, $\psi(y)>$ $y$ for $y>1$, so we must have $y=1$. Consequently $\alpha=2^{k+1}-2=2 a-2$, giving us the unique solution $x=2^{2 a-2}$. Thus $\psi(x)=a x$ has a unique solution if and only if $a$ is a power of 2 .


26. N3 (IRN) A function $f$ from the set of positive integers $\mathbb{N}$ into itself is such that for all $m, n \in \mathbb{N}$ the number $\left(m^{2}+n\right)^{2}$ is divisible by $f^{2}(m)+$ $f(n)$. Prove that $f(n)=n$ for each $n \in \mathbb{N}$.

Solution: 26. For $m=n=1$ we obtain that $f(1)^{2}+f(1)$ divides $\left(1^{2}+1\right)^{2}=4$, from which we find that $f(1)=1$. Next, we show that $f(p-1)=p-1$ for each prime $p$. By the hypothesis for $m=1$ and $n=p-1, f(p-1)+1$ divides $p^{2}$, so $f(p-1)$ equals either $p-1$ or $p^{2}-1$. If $f(p-1)=p^{2}-1$, then $f(1)+f(p-1)^{2}=p^{4}-2 p^{2}+2$ divides $\left(1+(p-1)^{2}\right)^{2}<p^{4}-2 p^{2}+2$, giving a contradiction. Hence $f(p-1)=p-1$. Let us now consider an arbitrary $n \in \mathbb{N}$. By the hypothesis for $m=p-1$, $A=f(n)+(p-1)^{2}$ divides $\left(n+(p-1)^{2}\right)^{2} \equiv(n-f(n))^{2}(\bmod A)$, and hence $A$ divides $(n-f(n))^{2}$ for any prime $p$. Taking $p$ large enough, we can obtain $A$ to be greater than $(n-f(n))^{2}$, which implies that $(n-f(n))^{2}=0$, i.e., $f(n)=n$ for every $n$.


27. N4 (POL) Let $k$ be a fixed integer greater than 1 , and let $m=4 k^{2}-5$. Show that there exist positive integers $a$ and $b$ such that the sequence $\left(x_{n}\right)$ defined by  $$ x_{0}=a, \quad x_{1}=b, \quad x_{n+2}=x_{n+1}+x_{n} \quad \text { for } \quad n=0,1,2, \ldots $$  has all of its terms relatively prime to $m$.

Solution: 27. Set $a=1$ and assume that $b \in \mathbb{N}$ is such that $b^{2} \equiv b+1(\bmod m)$. An easy induction gives us $x_{n} \equiv b^{n}(\bmod m)$ for all $n \in \mathbb{N}_{0}$. Moreover, $b$ is obviously coprime to $m$, and hence each $x_{n}$ is coprime to $m$. It remains to show the existence of $b$. The congruence $b^{2} \equiv b+1(\bmod$ $m)$ is equivalent to $(2 b-1)^{2} \equiv 5(\bmod m)$. Taking $2 b-1 \equiv 2 k$, i.e., $b \equiv 2 k^{2}+k-2(\bmod m)$, does the job. Remark. A desired $b$ exists whenever 5 is a quadratic residue modulo $m$, in particular, when $m$ is a prime of the form $10 k \pm 1$.


28. N5 (IRN) ${ }^{\mathrm{IMO} 6}$ We call a positive integer alternate if its decimal digits are alternately odd and even. Find all positive integers $n$ such that $n$ has an alternate multiple.

Solution: 28. If $n$ is divisible by 20 , then every multiple of $n$ has two last digits even and hence it is not alternate. We shall show that any other $n$ has an alternate multiple. (i) Let $n$ be coprime to 10 . For each $k$ there exists a number $A_{k}(n)=$ $\overline{10 \ldots 010 \ldots 01 \ldots 0 \ldots 01}=\frac{10^{m k}-1}{10^{k}-1}(m \in \mathbb{N})$ that is divisible by $n$ (by Euler's theorem, choose $\left.m=\varphi\left[n\left(10^{k}-1\right)\right]\right)$. In particular, $A_{2}(n)$ is alternate. (ii) Let $n=2 \cdot 5^{r} \cdot n_{1}$, where $r \geq 1$ and $\left(n_{1}, 10\right)=1$. We shall show by induction that, for each $k$, there exists an alternative $k$-digit odd number $M_{k}$ that is divisible by $5^{k}$. Choosing the number $10 A_{2 r}\left(n_{1}\right) M_{2 r}$ will then solve this case, since it is clearly alternate and divisible by $n$. We can trivially choose $M_{1}=5$. Let there be given an alternate $r$-digit multiple $M_{r}$ of $5^{r}$, and let $c \in\{0,1,2,3,4\}$ be such that $M_{r} / 5^{r} \equiv$ $-c \cdot 2^{r}(\bmod 5)$. Then the $(r+1)$ digit numbers $M_{r}+c \cdot 10^{r}$ and $M_{r}+(5+c) \cdot 10^{r}$ are respectively equal to $5^{r}\left(M_{r} / 5^{r}+2^{r} \cdot c\right)$ and $5^{r}\left(M_{r} / 5^{r}+2^{r} \cdot c+5 \cdot 2^{r}\right)$, and hence they are divisible by $5^{r+1}$ and exactly one of them is alternate: we set it to be $M_{r+1}$. (iii) Let $n=2^{r} \cdot n_{1}$, where $r \geq 1$ and $\left(n_{1}, 10\right)=1$. We show that there exists an alternate $2 r$-digit number $N_{r}$ that is divisible by $2^{2 r+1}$. Choosing the number $A_{2 r}\left(n_{1}\right) N_{r}$ will then solve this case. We choose $N_{1}=16$, and given $N_{r}$, we can prove that one of $N_{r}+$ $m \cdot 10^{2 r}$, for $m \in\{10,12,14,16\}$, is divisible by $2^{2 r+3}$ and therefore suitable for $N_{r+1}$. Indeed, for $N_{r}=2^{2 r+1} d$ we have $N_{r}+m \cdot 10^{2 r}=$ $2^{2 r+1}\left(d+5^{r} m / 2\right)$ and $d+5^{r} m / 2 \equiv 0(\bmod 4)$ has a solution $m / 2 \in$ $\{5,6,7,8\}$ for each $d$ and $r$. Remark. The idea is essentially the same as in (SL94-24).


29. N6 (IRE) Given an integer $n>1$, denote by $P_{n}$ the product of all positive integers $x$ less than $n$ and such that $n$ divides $x^{2}-1$. For each $n>1$, find the remainder of $P_{n}$ on division by $n$.

Solution: 29. Let $S_{n}=\left\{x \in \mathbb{N}|x \leq n, n| x^{2}-1\right\}$. It is easy to check that $P_{n} \equiv 1$ $(\bmod n)$ for $n=2$ and $P_{n} \equiv-1(\bmod n)$ for $n \in\{3,4\}$, so from now on we assume $n>4$. We note that if $x \in S_{n}$, then also $n-x \in S_{n}$ and $(x, n)=1$. Thus $S_{n}$ splits into pairs $\{x, n-x\}$, where $x \in S_{n}$ and $x \leq n / 2$. In each of these pairs the product of elements gives remainder -1 upon division by $n$. Therefore $P_{n} \equiv(-1)^{m}$, where $S_{n}$ has $2 m$ elements. It remains to find the parity of $m$. Suppose first that $n>4$ is divisible by 4 . Whenever $x \in S_{n}$, the numbers $|n / 2-x|, n-x, n-|n / 2-x|$ also belong to $S_{n}$ (indeed, $n \mid(n / 2-x)^{2}-1=$ $n^{2} / 4-n x+x^{2}-1$ because $n \mid n^{2} / 4$, etc.). In this way the set $S_{n}$ splits into four-element subsets $\{x, n / 2-x, n / 2+x, n-x\}$, where $x \in S_{n}$ and $x<n / 4$ (elements of these subsets are different for $x \neq n / 4$, and $n / 4$ doesn't belong to $S_{n}$ for $\left.n>4\right)$. Therefore $m=\left|S_{n}\right| / 2$ is even and $P_{n} \equiv 1$ $(\bmod m)$. Now let $n$ be odd. If $n \mid x^{2}-1=(x-1)(x+1)$, then there exist natural numbers $a, b$ such that $a b=n, a|x-1, b| x+1$. Obviously $a$ and $b$ are coprime. Conversely, given any odd $a, b \in \mathbb{N}$ such that $(a, b)=1$ and $a b=n$, by the Chinese remainder theorem there exists $x \in\{1,2, \ldots, n-1\}$ such that $a \mid x-1$ and $b \mid x+1$. This gives a bijection between all ordered pairs $(a, b)$ with $a b=n$ and $(a, b)=1$ and the elements of $S_{n}$. Now if $n=p_{1}^{\alpha_{1}} \cdots p_{k}^{\alpha_{k}}$ is the decomposition of $n$ into primes, the number of pairs $(a, b)$ is equal to $2^{k}$ (since for every $i$, either $p_{i}^{\alpha_{i}} \mid a$ or $p_{i}^{\alpha_{i}} \mid b$ ), and hence $m=2^{k-1}$. Thus $P_{n} \equiv-1(\bmod n)$ if $n$ is a power of an odd prime, and $P_{n} \equiv 1$ otherwise. Finally, let $n$ be even but not divisible by 4 . Then $x \in S_{n}$ if and only if $x$ or $n-x$ belongs to $S_{n / 2}$ and $x$ is odd. Since $n / 2$ is odd, for each $x \in S_{n / 2}$ either $x$ or $x+n / 2$ belongs to $S_{n}$, and by the case of $n$ odd we have $S_{n} \equiv \pm 1(\bmod n / 2)$, depending on whether or not $n / 2$ is a power of a prime. Since $S_{n}$ is odd, it follows that $P_{n} \equiv-1(\bmod n)$ if $n / 2$ is a power of a prime, and $P_{n} \equiv 1$ otherwise. Second solution. Obviously $S_{n}$ is closed under multiplication modulo $n$. This implies that $S_{n}$ with multiplication modulo $n$ is a subgroup of $\mathbb{Z}_{n}$, and therefore there exist elements $a_{1}=-1, a_{2}, \ldots, a_{k} \in S_{n}$ that generate $S_{n}$. In other words, since the $a_{i}$ are of order two, $S_{n}$ consists of products $\prod_{i \in A} a_{i}$, where $A$ runs over all subsets of $\{1,2, \ldots, k\}$. Thus $S_{n}$ has $2^{k}$ elements, and the product of these elements equals $P_{n} \equiv\left(a_{1} a_{2} \cdots a_{k}\right)^{2^{k-1}}$ $(\bmod n)$. Since $a_{i}^{2} \equiv 1(\bmod n)$, it follows that $P_{n} \equiv 1$ if $k \geq 2$, i.e., if $\left|S_{n}\right|>2$. Otherwise $P_{n} \equiv-1(\bmod n)$. We note that $\left|S_{n}\right|>2$ is equivalent to the existence of $a \in S_{n}$ with $1<a<n-1$. It is easy to find that such an $a$ exists if and only if neither of $n, n / 2$ is a power of an odd prime.


3. A3 (CAN) Does there exist a function $s: \mathbb{Q} \rightarrow\{-1,1\}$ such that if $x$ and $y$ are distinct rational numbers satisfying $x y=1$ or $x+y \in\{0,1\}$, then $s(x) s(y)=-1$ ? Justify your answer.

Solution: 3. The answer is yes. Every rational number $x>0$ can be uniquely expressed as a continued fraction of the form $a_{0}+1 /\left(a_{1}+1 /\left(a_{2}+1 /\left(\cdots+1 / a_{n}\right)\right)\right)$ (where $a_{0} \in \mathbb{N}_{0}, a_{1}, \ldots, a_{n} \in \mathbb{N}$ ). Then we write $x=\left[a_{0} ; a_{1}, a_{2}, \ldots, a_{n}\right]$. Since $n$ depends only on $x$, the function $s(x)=(-1)^{n}$ is well-defined. For $x<0$ we define $s(x)=-s(-x)$, and set $s(0)=1$. We claim that this $s(x)$ satisfies the requirements of the problem. The equality $s(x) s(y)=-1$ trivially holds if $x+y=0$. Suppose that $x y=1$. We may assume w.l.o.g. that $x>y>0$. Then $x>1$, so if $x=\left[a_{0} ; a_{1}, a_{2}, \ldots, a_{n}\right]$, then $a_{0} \geq 1$ and $y=0+1 / x=$ $\left[0 ; a_{0}, a_{1}, a_{2}, \ldots, a_{n}\right]$. It follows that $s(x)=(-1)^{n}, s(y)=(-1)^{n+1}$, and hence $s(x) s(y)=-1$. Finally, suppose that $x+y=1$. We consider two cases: (i) Let $x, y>0$. We may assume w.l.o.g. that $x>1 / 2$. Then there exist natural numbers $a_{2}, \ldots, a_{n}$ such that $x=\left[0 ; 1, a_{2}, \ldots, a_{n}\right]=$ $1 /(1+1 / t)$, where $t=\left[a_{2}, \ldots, a_{n}\right]$. Since $y=1-x=1 /(1+t)=$ $\left[0 ; 1+a_{2}, a_{3}, \ldots, a_{n}\right]$, we have $s(x)=(-1)^{n}$ and $s(y)=(-1)^{n-1}$, giving us $s(x) s(y)=-1$. (ii) Let $x>0>y$. If $a_{0}, \ldots, a_{n} \in \mathbb{N}$ are such that $-y=\left[a_{0} ; a_{1}, \ldots, a_{n}\right]$, then $x=\left[1+a_{0} ; a_{1}, \ldots, a_{n}\right]$. Thus $s(y)=-s(-y)=-(-1)^{n}$ and $s(x)=(-1)^{n}$, so again $s(x) s(y)=-1$.


30. N7 (BUL) Let $p$ be an odd prime and $n$ a positive integer. In the coordinate plane, eight distinct points with integer coordinates lie on a circle with diameter of length $p^{n}$. Prove that there exists a triangle with vertices at three of the given points such that the squares of its side lengths are integers divisible by $p^{n+1}$.

Solution: 30. We shall denote by $k$ the given circle with diameter $p^{n}$.  Let $A, B$ be lattice points (i.e., points with integer coordinates). We shall denote by $\mu(A B)$ the exponent of the highest power of $p$ that divides the integer $A B^{2}$. We observe that if $S$ is the area of a triangle $A B C$ where $A, B, C$ are lattice points, then $2 S$ is an integer. According to Heron's formula and the formula for the circumradius, a triangle $A B C$ whose circumcenter has diameter $p^{n}$ satisfies  $$ 2 A B^{2} B C^{2}+2 B C^{2} C A^{2}+2 C A^{2} A B^{2}-A B^{4}-B C^{4}-C A^{4}=16 S^{2} $$  and  $$ A B^{2} \cdot B C^{2} \cdot C A^{2}=(2 S)^{2} p^{2 n} $$  Lemma 1. Let $A, B$, and $C$ be lattice points on $k$. If none of $A B^{2}, B C^{2}$, $C A^{2}$ is divisible by $p^{n+1}$, then $\mu(A B), \mu(B C), \mu(C A)$ are $0, n, n$ in some order. Proof. Let $k=\min \{\mu(A B), \mu(B C), \mu(C A)\}$. By (1), $(2 S)^{2}$ is divisible by $p^{2 k}$. Together with (2), this gives us $\mu(A B)+\mu(B C)+\mu(C A)=$ $2 k+2 n$. On the other hand, if none of $A B^{2}, B C^{2}, C A^{2}$ is divisible by $p^{n+1}$, then $\mu(A B)+\mu(B C)+\mu(C A) \leq k+2 n$. Therefore $k=0$ and the remaining two of $\mu(A B), \mu(B C), \mu(C A)$ are equal to $n$. Lemma 2. Among every four lattice points on $k$, there exist two, say $M, N$, such that $\mu(M N) \geq n+1$. Proof. Assume that this doesn't hold for some points $A, B, C, D$ on $k$. By Lemma $1, \mu$ for some of the segments $A B, A C, \ldots, C D$ is 0 , say $\mu(A C)=0$. It easily follows by Lemma 1 that then $\mu(B D)=0$ and $\mu(A B)=\mu(B C)=\mu(C D)=\mu(D A)=n$. Let $a, b, c, d, e, f \in \mathbb{N}$ be such that $A B^{2}=p^{n} a, B C^{2}=p^{n} b, C D^{2}=p^{n} c, D A^{2}=p^{n} d, A C^{2}=e$, $B D^{2}=f$. By Ptolemy's theorem we have $\sqrt{e f}=p^{n}(\sqrt{a c}+\sqrt{b d})$. Taking squares, we get that $\frac{e f}{p^{2 n}}=(\sqrt{a c}+\sqrt{b d})^{2}=a c+b d+2 \sqrt{a b c d}$ is rational and hence an integer. It follows that ef is divisible by $p^{2 n}$, a contradiction. Now we consider eight lattice points $A_{1}, A_{2}, \ldots, A_{8}$ on $k$. We color each segment $A_{i} A_{j}$ red if $\mu\left(A_{i} A_{j}\right)>n$ and black otherwise, and thus obtain a graph $G$. The degree of a point $X$ will be the number of red segments with an endpoint in $X$. We distinguish three cases: (i) There is a point, say $A_{8}$, whose degree is at most 1 . We may suppose w.l.o.g. that $A_{8} A_{7}$ is red and $A_{8} A_{1}, \ldots, A_{8} A_{6}$ black. By a well-known fact, the segments joining vertices $A_{1}, A_{2}, \ldots, A_{6}$ determine either a red triangle, in which case there is nothing to prove, or a black triangle, say $A_{1} A_{2} A_{3}$. But in the latter case the four points $A_{1}, A_{2}, A_{3}, A_{8}$ do not determine any red segment, a contradiction to Lemma 2 . (ii) All points have degree 2. Then the set of red segments partitions into cycles. If one of these cycles has length 3 , then the proof is complete. If all the cycles have length at least 4 , then we have two possibilities: two 4 -cycles, say $A_{1} A_{2} A_{3} A_{4}$ and $A_{5} A_{6} A_{7} A_{8}$, or one 8-cycle, $A_{1} A_{2} \ldots A_{8}$. In both cases, the four points $A_{1}, A_{3}, A_{5}, A_{7}$ do not determine any red segment, a contradiction. (iii) There is a point of degree at least 3 , say $A_{1}$. Suppose that $A_{1} A_{2}$, $A_{1} A_{3}$, and $A_{1} A_{4}$ are red. We claim that $A_{2}, A_{3}, A_{4}$ determine at least one red segment, which will complete the solution. If not, by Lemma $1, \mu\left(A_{2} A_{3}\right), \mu\left(A_{3} A_{4}\right), \mu\left(A_{4} A_{2}\right)$ are $n, n, 0$ in some order. Assuming w.l.o.g. that $\mu\left(A_{2} A_{3}\right)=0$, denote by $S$ the area of triangle $A_{1} A_{2} A_{3}$. Now by formula (1), $2 S$ is not divisible by $p$. On the other hand, since $\mu\left(A_{1} A_{2}\right) \geq n+1$ and $\mu\left(A_{1} A_{3}\right) \geq n+1$, it follows from (2) that $2 S$ is divisible by $p$, a contradiction.


4. A4 (KOR) ${ }^{\mathrm{IMO} 2}$ Find all polynomials $P(x)$ with real coefficients that satisfy the equality  $$ P(a-b)+P(b-c)+P(c-a)=2 P(a+b+c) $$  for all triples $a, b, c$ of real numbers such that $a b+b c+c a=0$.

Solution: 4. Let $P(x)=a_{0}+a_{1} x+\cdots+a_{n} x^{n}$. For every $x \in \mathbb{R}$ the triple $(a, b, c)=$ $(6 x, 3 x,-2 x)$ satisfies the condition $a b+b c+c a=0$. Then the condition on $P$ gives us $P(3 x)+P(5 x)+P(-8 x)=2 P(7 x)$ for all $x$, implying that for all $i=0,1,2, \ldots, n$ the following equality holds:  $$ \left(3^{i}+5^{i}+(-8)^{i}-2 \cdot 7^{i}\right) a_{i}=0 $$  Suppose that $a_{i} \neq 0$. Then $K(i)=3^{i}+5^{i}+(-8)^{i}-2 \cdot 7^{i}=0$. But $K(i)$ is negative for $i$ odd and positive for $i=0$ or $i \geq 6$ even. Only for $i=2$ and $i=4$ do we have $K(i)=0$. It follows that $P(x)=a_{2} x^{2}+a_{4} x^{4}$ for some real numbers $a_{2}, a_{4}$. It is easily verified that all such $P(x)$ satisfy the required condition.


5. A5 (THA) Let $a, b, c>0$ and $a b+b c+c a=1$. Prove the inequality  $$ \sqrt[3]{\frac{1}{a}+6 b}+\sqrt[3]{\frac{1}{b}+6 c}+\sqrt[3]{\frac{1}{c}+6 a} \leq \frac{1}{a b c} $$

Solution: 5. By the general mean inequality $\left(M_{1} \leq M_{3}\right)$, the LHS of the inequality to be proved does not exceed  $$ E=\frac{3}{\sqrt[3]{3}} \sqrt[3]{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}+6(a+b+c)} $$  From $a b+b c+c a=1$ we obtain that $3 a b c(a+b+c)=3(a b \cdot a c+$ $a b \cdot b c+a c \cdot b c) \leq(a b+a c+b c)^{2}=1$; hence $6(a+b+c) \leq \frac{2}{a b c}$. Since $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=\frac{a b+b c+c a}{a b c}=\frac{1}{a b c}$, it follows that  $$ E \leq \frac{3}{\sqrt[3]{3}} \sqrt[3]{\frac{3}{a b c}} \leq \frac{1}{a b c} $$  where the last inequality follows from the AM-GM inequality $1=a b+b c+$ $c a \geq 3 \sqrt[3]{(a b c)^{2}}$, i.e., $a b c \leq 1 /(3 \sqrt{3})$. The desired inequality now follows. Equality holds if and only if $a=b=c=1 / \sqrt{3}$.


6. A6 (RUS) Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying the equation  $$ f\left(x^{2}+y^{2}+2 f(x y)\right)=(f(x+y))^{2} \quad \text { for all } x, y \in \mathbb{R} $$

Solution: 6. Let us make the substitution $z=x+y, t=x y$. Given $z, t \in \mathbb{R}, x, y$ are real if and only if $4 t \leq z^{2}$. Define $g(x)=2(f(x)-x)$. Now the given functional equation transforms into  $$ f\left(z^{2}+g(t)\right)=(f(z))^{2} \text { for all } t, z \in \mathbb{R} \text { with } z^{2} \geq 4 t $$  Let us set $c=g(0)=2 f(0)$. Substituting $t=0$ into (1) gives us  $$ f\left(z^{2}+c\right)=(f(z))^{2} \text { for all } z \in \mathbb{R} $$  If $c<0$, then taking $z$ such that $z^{2}+c=0$, we obtain from (2) that $f(z)^{2}=c / 2$, which is impossible; hence $c \geq 0$. We also observe that  $$ x>c \quad \text { implies } \quad f(x) \geq 0 $$  If $g$ is a constant function, we easily find that $c=0$ and therefore $f(x)=x$, which is indeed a solution. Suppose $g$ is nonconstant, and let $a, b \in \mathbb{R}$ be such that $g(a)-g(b)=d>0$. For some sufficiently large $K$ and each $u, v \geq K$ with $v^{2}-u^{2}=d$ the equality $u^{2}+g(a)=v^{2}+g(b)$ by (1) and (3) implies $f(u)=f(v)$. This further leads to $g(u)-g(v)=2(v-u)=\frac{d}{u+\sqrt{u^{2}+d}}$. Therefore every value from some suitably chosen segment $[\delta, 2 \delta]$ can be expressed as $g(u)-g(v)$, with $u$ and $v$ bounded from above by some $M$. Consider any $x, y$ with $y>x \geq 2 \sqrt{M}$ and $\delta<y^{2}-x^{2}<2 \delta$. By the above considerations, there exist $u, v \leq M$ such that $g(u)-g(v)=y^{2}-x^{2}$, i.e., $x^{2}+g(u)=y^{2}+g(v)$. Since $x^{2} \geq 4 u$ and $y^{2} \geq 4 v$, (1) leads to $f(x)^{2}=f(y)^{2}$. Moreover, if we assume w.l.o.g. that $4 M \geq c^{2}$, we conclude from (3) that $f(x)=f(y)$. Since this holds for any $x, y \geq 2 \sqrt{M}$ with $y^{2}-x^{2} \in[\delta, 2 \delta]$, it follows that $f(x)$ is eventually constant, say $f(x)=k$ for $x \geq N=2 \sqrt{M}$. Setting $x>N$ in (2) we obtain $k^{2}=k$, so $k=0$ or $k=1$ 。 By (2) we have $f(-z)= \pm f(z)$, and thus $|f(z)| \leq 1$ for all $z \leq-N$. Hence $g(u)=2 f(u)-2 u \geq-2-2 u$ for $u \leq-N$, which implies that $g$ is unbounded. Hence for each $z$ there exists $t$ such that $z^{2}+g(t)>N$, and consequently $f(z)^{2}=f\left(z^{2}+g(t)\right)=k=k^{2}$. Therefore $f(z)= \pm k$ for each $z$. If $k=0$, then $f(x) \equiv 0$, which is clearly a solution. Assume $k=1$. Then $c=2 f(0)=2$ (because $c \geq 0$ ), which together with (3) implies $f(x)=1$ for all $x \geq 2$. Suppose that $f(t)=-1$ for some $t<2$. Then $t-g(t)=3 t+2>4 t$. If also $t-g(t) \geq 0$, then for some $z \in \mathbb{R}$ we have $z^{2}=t-g(t)>4 t$, which by (1) leads to $f(z)^{2}=f\left(z^{2}+g(t)\right)=f(t)=-1$, which is impossible. Hence $t-g(t)<0$, giving us $t<-2 / 3$. On the other hand, if $X$ is any subset of $(-\infty,-2 / 3)$, the function $f$ defined by $f(x)=-1$ for $x \in X$ and $f(x)=1$ satisfies the requirements of the problem. To sum up, the solutions are $f(x)=x, f(x)=0$ and all functions of the form  $$ f(x)= \begin{cases}1, & x \notin X \\ -1, & x \in X\end{cases} $$  where $X \subset(-\infty,-2 / 3)$.


7. A7 (IRE) Let $a_{1}, a_{2}, \ldots, a_{n}$ be positive real numbers, $n>1$. Denote by $g_{n}$ their geometric mean, and by $A_{1}, A_{2}, \ldots, A_{n}$ the sequence of arithmetic means defined by $A_{k}=\frac{a_{1}+a_{2}+\cdots+a_{k}}{k}, k=1,2, \ldots, n$. Let $G_{n}$ be the geometric mean of $A_{1}, A_{2}, \ldots, A_{n}$. Prove the inequality  $$ n \sqrt[n]{\frac{G_{n}}{A_{n}}}+\frac{g_{n}}{G_{n}} \leq n+1 $$  and establish the cases of equality.

Solution: 7. Let us set $c_{k}=A_{k-1} / A_{k}$ for $k=1,2, \ldots, n$, where we define $A_{0}=0$. We observe that $a_{k} / A_{k}=\left(k A_{k}-(k-1) A_{k-1}\right) / A_{k}=k-(k-1) c_{k}$. Now we can write the LHS of the inequality to be proved in terms of $c_{k}$, as follows:  $$ \sqrt[n]{\frac{G_{n}}{A_{n}}}=\sqrt[n^{2}]{c_{2} c_{3}^{2} \cdots c_{n}^{n-1}} \text { and } \frac{g_{n}}{G_{n}}=\sqrt[n]{\prod_{k=1}^{n}\left(k-(k-1) c_{k}\right)} $$  By the $A M-G M$ inequality we have  $$ \begin{aligned} n \sqrt[n^{2}]{1^{n(n+1) / 2} c_{2} c_{3}^{2} \ldots c_{n}^{n-1}} & \leq \frac{1}{n}\left(\frac{n(n+1)}{2}+\sum_{k=2}^{n}(k-1) c_{k}\right) \\ & =\frac{n+1}{2}+\frac{1}{n} \sum_{k=1}^{n}(k-1) c_{k} . \end{aligned} $$  Also by the AM-GM inequality, we have  $$ \sqrt[n]{\prod_{k=1}^{n}\left(k-(k-1) c_{k}\right)} \leq \frac{n+1}{2}-\frac{1}{n} \sum_{k=1}^{n}(k-1) c_{k} $$  Adding (1) and (2), we obtain the desired inequality. Equality holds if and only if $a_{1}=a_{2}=\cdots=a_{n}$.


8. C1 (PUR) There are 10001 students at a university. Some students join together to form several clubs (a student may belong to different clubs). Some clubs join together to form several societies (a club may belong to different societies). There are a total of $k$ societies. Suppose that the following conditions hold: (i) Each pair of students are in exactly one club. (ii) For each student and each society, the student is in exactly one club of the society. (iii) Each club has an odd number of students. In addition, a club with $2 m+1$ students ( $m$ is a positive integer) is in exactly $m$ societies. Find all possible values of $k$.

Solution: 8. Let us write $n=10001$. Denote by $\mathcal{T}$ the set of ordered triples $(a, C, \mathcal{S})$, where $a$ is a student, $C$ a club, and $\mathcal{S}$ a society such that $a \in C$ and $C \in \mathcal{S}$. We shall count $|\mathcal{T}|$ in two different ways. Fix a student $a$ and a society $\mathcal{S}$. By (ii), there is a unique club $C$ such that $(a, C, \mathcal{S}) \in \mathcal{T}$. Since the ordered pair $(a, \mathcal{S})$ can be chosen in $n k$ ways, we have that $|\mathcal{T}|=n k$. Now fix a club $C$. By (iii), $C$ is in exactly $(|C|-1) / 2$ societies, so there are $|C|(|C|-1) / 2$ triples from $\mathcal{T}$ with second coordinate $C$. If $\mathcal{C}$ is the set of all clubs, we obtain $|\mathcal{T}|=\sum_{C \in \mathcal{C}} \frac{|C|(|C|-1)}{2}$. But we also conclude from (i) that  $$ \sum_{C \in \mathcal{C}} \frac{|C|(|C|-1)}{2}=\frac{n(n-1)}{2} $$  Therefore $n(n-1) / 2=n k$, i.e., $k=(n-1) / 2=5000$. On the other hand, for $k=(n-1) / 2$ there is a desired configuration with only one club $C$ that contains all students and $k$ identical societies with only one element (the club $C$ ). It is easy to verify that (i)-(iii) hold.


9. C2 (GER) Let $n$ and $k$ be positive integers. There are given $n$ circles in the plane. Every two of them intersect at two distinct points, and all points of intersection they determine are distinct. Each intersection point must be colored with one of $n$ distinct colors so that each color is used at least once, and exactly $k$ distinct colors occur on each circle. Find all values of $n \geq 2$ and $k$ for which such a coloring is possible.

Solution: 9. Obviously we must have $2 \leq k \leq n$. We shall prove that the possible values for $k$ and $n$ are $2 \leq k \leq n \leq 3$ and $3 \leq k \leq n$. Denote all colors and circles by $1, \ldots, n$. Let $F(i, j)$ be the set of colors of the common points of circles $i$ and $j$. Suppose that $k=2<n$. Consider the ordered pairs $(i, j)$ such that color $j$ appears on the circle $i$. Since $k=2$, clearly there are exactly $2 n$ such pairs. On the other hand, each of the $n$ colors appears on at least two circles, so there are at least $2 n$ pairs $(i, j)$, and equality holds only if each color appears on exactly 2 circles. But then at most two points receive each of the $n$ colors and there are $n(n-1)$ points, implying that $n(n-1)=2 n$, i.e., $n=3$. It is easy to find examples for $k=2$ and $n=2$ or 3 .  Next, let $k=3$. An example for $n=3$ is given by $F(i, j)=\{i, j\}$ for each $1 \leq i<j \leq 3$. Assume $n \geq 4$. Then an example is given by $F(1,2)=$ $\{1,2\}, F(i, i+1)=\{i\}$ for $i=2, \ldots, n-2, F(n-1, n)=\{n-2, n-1\}$ and $F(i, j)=n$ for all other $i, j>i$. We now prove by induction on $k$ that a desired coloring exists for each $n \geq k \geq 3$. Let there be given $n$ circles. By the inductive hypothesis, circles $1,2, \ldots, n-1$ can be colored in $n-1$ colors, $k$ of which appear on each circle, such that color $i$ appears on circle $i$. Then we set $F(i, n)=\{i, n\}$ for $i=1, \ldots, k$ and $F(i, n)=\{n\}$ for $i>n$. We thus obtain a coloring of the $n$ circles in $n$ colors, such that $k+1$ colors (including color $i$ ) appear on each circle $i$.