olympiads-ref / IMO_SL /md /en-IMO2009SL.md
beichen0426's picture
Duplicate from AI-MO/olympiads-ref
63c5bce verified

Bremen

International Mathematical Olympiad

Germany

10 to 22 July 2009

Problem Shortlist with solutions

Problem Shortlist with Solutions

We insistently ask everybody to consider the following IMO Regulations rule:

These Shortlist Problems
have to be kept strictly confidential until IMO 2010.

The Problem Selection Committee

Konrad Engel, Karl Fegert, Andreas Felgenhauer, Hans-Dietrich Gronau, Roger Labahn, Bernd Mulansky, Jürgen Prestin, Christian Reiher, Peter Scholze, Eckard Specht, Robert Strich, Martin Welk gratefully received 132 problem proposals submitted by 39 countries: Algeria, Australia, Austria, Belarus, Belgium, Bulgaria, Colombia, Croatia, Czech Republic, El Salvador, Estonia, Finland, France, Greece, Hong Kong, Hungary, India, Ireland, Islamic Republic of Iran, Japan, Democratic People's Republic of Korea, Lithuania, Luxembourg, The former Yugoslav Republic of Macedonia, Mongolia, Netherlands, New Zealand, Pakistan, Peru, Poland, Romania, Russian Federation, Slovenia, South Africa, Taiwan, Turkey, Ukraine, United Kingdom, United States of America.

Layout: Roger Labahn with $\mathrm{LATE}{\mathrm{E}} \mathrm{X}$ & $\mathrm{T}{\mathrm{E}} \mathrm{X}$ Drawings: Eckard Specht with nicefig 2.0

The Problem Selection Committee

Contents

Problem Shortlist 4 Algebra 12 Combinatorics 26 Geometry 47 Number Theory 69

Algebra

A1 CZE (Czech Republic)

Find the largest possible integer $k$, such that the following statement is true: Let 2009 arbitrary non-degenerated triangles be given. In every triangle the three sides are colored, such that one is blue, one is red and one is white. Now, for every color separately, let us sort the lengths of the sides. We obtain

b1b2b2009 the lengths of the blue sides, r1r2r2009 the lengths of the red sides,  and w1w2w2009 the lengths of the white sides.  \begin{aligned} & b_{1} \leq b_{2} \\ & \leq \ldots \leq b_{2009} \quad \text { the lengths of the blue sides, } \\ r_{1} & \leq r_{2} \leq \ldots \leq r_{2009} \quad \text { the lengths of the red sides, } \\ \text { and } \quad w_{1} & \leq w_{2} \leq \ldots \leq w_{2009} \quad \text { the lengths of the white sides. } \end{aligned}

Then there exist $k$ indices $j$ such that we can form a non-degenerated triangle with side lengths $b_{j}, r_{j}, w_{j}$ 。

A2 EST (Estonia)

Let $a, b, c$ be positive real numbers such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$. Prove that

1(2a+b+c)2+1(2b+c+a)2+1(2c+a+b)2316 \frac{1}{(2 a+b+c)^{2}}+\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \leq \frac{3}{16}

A3 FRA (France)

Determine all functions $f$ from the set of positive integers into the set of positive integers such that for all $x$ and $y$ there exists a non degenerated triangle with sides of lengths

x,f(y) and f(y+f(x)1) x, \quad f(y) \quad \text { and } \quad f(y+f(x)-1)

A4 BLR (Belarus)

Let $a, b, c$ be positive real numbers such that $a b+b c+c a \leq 3 a b c$. Prove that

a2+b2a+b+b2+c2b+c+c2+a2c+a+32(a+b+b+c+c+a). \sqrt{\frac{a^{2}+b^{2}}{a+b}}+\sqrt{\frac{b^{2}+c^{2}}{b+c}}+\sqrt{\frac{c^{2}+a^{2}}{c+a}}+3 \leq \sqrt{2}(\sqrt{a+b}+\sqrt{b+c}+\sqrt{c+a}) .

A5 BLR (Belarus)

Let $f$ be any function that maps the set of real numbers into the set of real numbers. Prove that there exist real numbers $x$ and $y$ such that

f(xf(y))>yf(x)+x f(x-f(y))>y f(x)+x

A6 USA (United States of America)

Suppose that $s_{1}, s_{2}, s_{3}, \ldots$ is a strictly increasing sequence of positive integers such that the subsequences

ss1,ss2,ss3, and ss1+1,ss2+1,ss3+1, s_{s_{1}}, s_{s_{2}}, s_{s_{3}}, \ldots \quad \text { and } \quad s_{s_{1}+1}, s_{s_{2}+1}, s_{s_{3}+1}, \ldots

are both arithmetic progressions. Prove that $s_{1}, s_{2}, s_{3}, \ldots$ is itself an arithmetic progression.

A7 JPN (Japan)

Find all functions $f$ from the set of real numbers into the set of real numbers which satisfy for all real $x, y$ the identity

f(xf(x+y))=f(yf(x))+x2 f(x f(x+y))=f(y f(x))+x^{2}

Combinatorics

C1 NZL (New Zealand)

Consider 2009 cards, each having one gold side and one black side, lying in parallel on a long table. Initially all cards show their gold sides. Two players, standing by the same long side of the table, play a game with alternating moves. Each move consists of choosing a block of 50 consecutive cards, the leftmost of which is showing gold, and turning them all over, so those which showed gold now show black and vice versa. The last player who can make a legal move wins. (a) Does the game necessarily end? (b) Does there exist a winning strategy for the starting player?

C2 ROU (Romania)

For any integer $n \geq 2$, let $N(n)$ be the maximal number of triples $\left(a_{i}, b_{i}, c_{i}\right), i=1, \ldots, N(n)$, consisting of nonnegative integers $a_{i}, b_{i}$ and $c_{i}$ such that the following two conditions are satisfied: (1) $a_{i}+b_{i}+c_{i}=n$ for all $i=1, \ldots, N(n)$, (2) If $i \neq j$, then $a_{i} \neq a_{j}, b_{i} \neq b_{j}$ and $c_{i} \neq c_{j}$.

Determine $N(n)$ for all $n \geq 2$.

Comment. The original problem was formulated for $m$-tuples instead for triples. The numbers $N(m, n)$ are then defined similarly to $N(n)$ in the case $m=3$. The numbers $N(3, n)$ and $N(n, n)$ should be determined. The case $m=3$ is the same as in the present problem. The upper bound for $N(n, n)$ can be proved by a simple generalization. The construction of a set of triples attaining the bound can be easily done by induction from $n$ to $n+2$.

C3 RUS (Russian Federation)

Let $n$ be a positive integer. Given a sequence $\varepsilon_{1}, \ldots, \varepsilon_{n-1}$ with $\varepsilon_{i}=0$ or $\varepsilon_{i}=1$ for each $i=1, \ldots, n-1$, the sequences $a_{0}, \ldots, a_{n}$ and $b_{0}, \ldots, b_{n}$ are constructed by the following rules:

a0=b0=1,a1=b1=7,ai+1={2ai1+3ai, if εi=0,3ai1+ai, if εi=1, for each i=1,,n1,bi+1={2bi1+3bi, if εni=0,3bi1+bi, if εni=1, for each i=1,,n1. \begin{gathered} a_{0}=b_{0}=1, \quad a_{1}=b_{1}=7, \\ a_{i+1}=\left\{\begin{array}{ll} 2 a_{i-1}+3 a_{i}, & \text { if } \varepsilon_{i}=0, \\ 3 a_{i-1}+a_{i}, & \text { if } \varepsilon_{i}=1, \end{array} \text { for each } i=1, \ldots, n-1,\right. \\ b_{i+1}=\left\{\begin{array}{ll} 2 b_{i-1}+3 b_{i}, & \text { if } \varepsilon_{n-i}=0, \\ 3 b_{i-1}+b_{i}, & \text { if } \varepsilon_{n-i}=1, \end{array} \text { for each } i=1, \ldots, n-1 .\right. \end{gathered}

Prove that $a_{n}=b_{n}$.

C4 NLD (Netherlands)

For an integer $m \geq 1$, we consider partitions of a $2^{m} \times 2^{m}$ chessboard into rectangles consisting of cells of the chessboard, in which each of the $2^{m}$ cells along one diagonal forms a separate rectangle of side length 1 . Determine the smallest possible sum of rectangle perimeters in such a partition.

C5 NLD (Netherlands)

Five identical empty buckets of 2-liter capacity stand at the vertices of a regular pentagon. Cinderella and her wicked Stepmother go through a sequence of rounds: At the beginning of every round, the Stepmother takes one liter of water from the nearby river and distributes it arbitrarily over the five buckets. Then Cinderella chooses a pair of neighboring buckets, empties them into the river, and puts them back. Then the next round begins. The Stepmother's goal is to make one of these buckets overflow. Cinderella's goal is to prevent this. Can the wicked Stepmother enforce a bucket overflow?

C6 BGR (Bulgaria)

On a $999 \times 999$ board a limp rook can move in the following way: From any square it can move to any of its adjacent squares, i.e. a square having a common side with it, and every move must be a turn, i.e. the directions of any two consecutive moves must be perpendicular. A nonintersecting route of the limp rook consists of a sequence of pairwise different squares that the limp rook can visit in that order by an admissible sequence of moves. Such a non-intersecting route is called cyclic, if the limp rook can, after reaching the last square of the route, move directly to the first square of the route and start over. How many squares does the longest possible cyclic, non-intersecting route of a limp rook visit?

C7 RUS (Russian Federation)

Variant 1. A grasshopper jumps along the real axis. He starts at point 0 and makes 2009 jumps to the right with lengths $1,2, \ldots, 2009$ in an arbitrary order. Let $M$ be a set of 2008 positive integers less than 1005 - 2009. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$.

Variant 2. Let $n$ be a nonnegative integer. A grasshopper jumps along the real axis. He starts at point 0 and makes $n+1$ jumps to the right with pairwise different positive integral lengths $a_{1}, a_{2}, \ldots, a_{n+1}$ in an arbitrary order. Let $M$ be a set of $n$ positive integers in the interval $(0, s)$, where $s=a_{1}+a_{2}+\cdots+a_{n+1}$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$.

C8 AUT (Austria)

For any integer $n \geq 2$, we compute the integer $h(n)$ by applying the following procedure to its decimal representation. Let $r$ be the rightmost digit of $n$. (1) If $r=0$, then the decimal representation of $h(n)$ results from the decimal representation of $n$ by removing this rightmost digit 0 . (2) If $1 \leq r \leq 9$ we split the decimal representation of $n$ into a maximal right part $R$ that solely consists of digits not less than $r$ and into a left part $L$ that either is empty or ends with a digit strictly smaller than $r$. Then the decimal representation of $h(n)$ consists of the decimal representation of $L$, followed by two copies of the decimal representation of $R-1$. For instance, for the number $n=17,151,345,543$, we will have $L=17,151, R=345,543$ and $h(n)=17,151,345,542,345,542$. Prove that, starting with an arbitrary integer $n \geq 2$, iterated application of $h$ produces the integer 1 after finitely many steps.

Geometry

G1 BEL (Belgium)

Let $A B C$ be a triangle with $A B=A C$. The angle bisectors of $A$ and $B$ meet the sides $B C$ and $A C$ in $D$ and $E$, respectively. Let $K$ be the incenter of triangle $A D C$. Suppose that $\angle B E K=45^{\circ}$. Find all possible values of $\angle B A C$.

G2 RUS (Russian Federation)

Let $A B C$ be a triangle with circumcenter $O$. The points $P$ and $Q$ are interior points of the sides $C A$ and $A B$, respectively. The circle $k$ passes through the midpoints of the segments $B P$, $C Q$, and $P Q$. Prove that if the line $P Q$ is tangent to circle $k$ then $O P=O Q$.

G3 IRN (Islamic Republic of Iran)

Let $A B C$ be a triangle. The incircle of $A B C$ touches the sides $A B$ and $A C$ at the points $Z$ and $Y$, respectively. Let $G$ be the point where the lines $B Y$ and $C Z$ meet, and let $R$ and $S$ be points such that the two quadrilaterals $B C Y R$ and $B C S Z$ are parallelograms. Prove that $G R=G S$.

G4 UNK (United Kingdom)

Given a cyclic quadrilateral $A B C D$, let the diagonals $A C$ and $B D$ meet at $E$ and the lines $A D$ and $B C$ meet at $F$. The midpoints of $A B$ and $C D$ are $G$ and $H$, respectively. Show that $E F$ is tangent at $E$ to the circle through the points $E, G$, and $H$.

G5 POL (Poland)

Let $P$ be a polygon that is convex and symmetric to some point $O$. Prove that for some parallelogram $R$ satisfying $P \subset R$ we have

RP2 \frac{|R|}{|P|} \leq \sqrt{2}

where $|R|$ and $|P|$ denote the area of the sets $R$ and $P$, respectively.

G6 UKR (Ukraine)

Let the sides $A D$ and $B C$ of the quadrilateral $A B C D$ (such that $A B$ is not parallel to $C D$ ) intersect at point $P$. Points $O_{1}$ and $O_{2}$ are the circumcenters and points $H_{1}$ and $H_{2}$ are the orthocenters of triangles $A B P$ and $D C P$, respectively. Denote the midpoints of segments $O_{1} H_{1}$ and $O_{2} H_{2}$ by $E_{1}$ and $E_{2}$, respectively. Prove that the perpendicular from $E_{1}$ on $C D$, the perpendicular from $E_{2}$ on $A B$ and the line $H_{1} H_{2}$ are concurrent.

G7 IRN (Islamic Republic of Iran)

Let $A B C$ be a triangle with incenter $I$ and let $X, Y$ and $Z$ be the incenters of the triangles $B I C, C I A$ and $A I B$, respectively. Let the triangle $X Y Z$ be equilateral. Prove that $A B C$ is equilateral too.

G8 BGR (Bulgaria)

Let $A B C D$ be a circumscribed quadrilateral. Let $g$ be a line through $A$ which meets the segment $B C$ in $M$ and the line $C D$ in $N$. Denote by $I_{1}, I_{2}$, and $I_{3}$ the incenters of $\triangle A B M$, $\triangle M N C$, and $\triangle N D A$, respectively. Show that the orthocenter of $\triangle I_{1} I_{2} I_{3}$ lies on $g$.

Number Theory

N1 AUS (Australia)

A social club has $n$ members. They have the membership numbers $1,2, \ldots, n$, respectively. From time to time members send presents to other members, including items they have already received as presents from other members. In order to avoid the embarrassing situation that a member might receive a present that he or she has sent to other members, the club adds the following rule to its statutes at one of its annual general meetings: "A member with membership number $a$ is permitted to send a present to a member with membership number $b$ if and only if $a(b-1)$ is a multiple of $n$." Prove that, if each member follows this rule, none will receive a present from another member that he or she has already sent to other members.

Alternative formulation: Let $G$ be a directed graph with $n$ vertices $v_{1}, v_{2}, \ldots, v_{n}$, such that there is an edge going from $v_{a}$ to $v_{b}$ if and only if $a$ and $b$ are distinct and $a(b-1)$ is a multiple of $n$. Prove that this graph does not contain a directed cycle.

N2 PER (Peru)

A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$. (a) Prove that there exist distinct positive integers $a$ and $b$ such that all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced. (b) Prove that if $P(n)$ is balanced for all positive integers $n$, then $a=b$.

N3 EST (Estonia)

Let $f$ be a non-constant function from the set of positive integers into the set of positive integers, such that $a-b$ divides $f(a)-f(b)$ for all distinct positive integers $a, b$. Prove that there exist infinitely many primes $p$ such that $p$ divides $f(c)$ for some positive integer $c$.

N4 PRK (Democratic People's Republic of Korea)

Find all positive integers $n$ such that there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{n}$ satisfying

ak+1=ak2+1ak1+11 a_{k+1}=\frac{a_{k}^{2}+1}{a_{k-1}+1}-1

for every $k$ with $2 \leq k \leq n-1$.

N5 HUN (Hungary)

Let $P(x)$ be a non-constant polynomial with integer coefficients. Prove that there is no function $T$ from the set of integers into the set of integers such that the number of integers $x$ with $T^{n}(x)=x$ is equal to $P(n)$ for every $n \geq 1$, where $T^{n}$ denotes the $n$-fold application of $T$.

N6 TUR (Turkey)

Let $k$ be a positive integer. Show that if there exists a sequence $a_{0}, a_{1}, \ldots$ of integers satisfying the condition

an=an1+nkn for all n1 a_{n}=\frac{a_{n-1}+n^{k}}{n} \quad \text { for all } n \geq 1

then $k-2$ is divisible by 3 .

N7 MNG (Mongolia)

Let $a$ and $b$ be distinct integers greater than 1 . Prove that there exists a positive integer $n$ such that $\left(a^{n}-1\right)\left(b^{n}-1\right)$ is not a perfect square.

Algebra

A1 CZE (Czech Republic)

Find the largest possible integer $k$, such that the following statement is true: Let 2009 arbitrary non-degenerated triangles be given. In every triangle the three sides are colored, such that one is blue, one is red and one is white. Now, for every color separately, let us sort the lengths of the sides. We obtain

b1b2b2009 the lengths of the blue sides, r1r2r2009 the lengths of the red sides, w1w2w2009 the lengths of the white sides.  \begin{array}{rlrl} b_{1} & \leq b_{2} & \leq \ldots \leq b_{2009} \quad & \\ & & \text { the lengths of the blue sides, } \\ r_{1} & \leq r_{2} & \leq \ldots \leq r_{2009} \quad \text { the lengths of the red sides, } \\ w_{1} & \leq w_{2} & \leq \ldots \leq w_{2009} \quad \text { the lengths of the white sides. } \end{array}

Then there exist $k$ indices $j$ such that we can form a non-degenerated triangle with side lengths $b_{j}, r_{j}, w_{j}$ 。

Solution. We will prove that the largest possible number $k$ of indices satisfying the given condition is one. Firstly we prove that $b_{2009}, r_{2009}, w_{2009}$ are always lengths of the sides of a triangle. Without loss of generality we may assume that $w_{2009} \geq r_{2009} \geq b_{2009}$. We show that the inequality $b_{2009}+r_{2009}>w_{2009}$ holds. Evidently, there exists a triangle with side lengths $w, b, r$ for the white, blue and red side, respectively, such that $w_{2009}=w$. By the conditions of the problem we have $b+r>w, b_{2009} \geq b$ and $r_{2009} \geq r$. From these inequalities it follows

b2009+r2009b+r>w=w2009 b_{2009}+r_{2009} \geq b+r>w=w_{2009}

Secondly we will describe a sequence of triangles for which $w_{j}, b_{j}, r_{j}$ with $j<2009$ are not the lengths of the sides of a triangle. Let us define the sequence $\Delta_{j}, j=1,2, \ldots, 2009$, of triangles, where $\Delta_{j}$ has a blue side of length $2 j$, a red side of length $j$ for all $j \leq 2008$ and 4018 for $j=2009$, and a white side of length $j+1$ for all $j \leq 2007$, 4018 for $j=2008$ and 1 for $j=2009$. Since

(j+1)+j>2jj+1>j, if j20072j+j>4018>2j>j, if j=20084018+1>2j=4018>1, if j=2009 \begin{array}{rrrl} (j+1)+j>2 j & \geq j+1>j, & \text { if } & j \leq 2007 \\ 2 j+j>4018>2 j \quad>j, & \text { if } & j=2008 \\ 4018+1>2 j & =4018>1, & \text { if } & j=2009 \end{array}

such a sequence of triangles exists. Moreover, $w_{j}=j, r_{j}=j$ and $b_{j}=2 j$ for $1 \leq j \leq 2008$. Then

wj+rj=j+j=2j=bj w_{j}+r_{j}=j+j=2 j=b_{j}

i.e., $b_{j}, r_{j}$ and $w_{j}$ are not the lengths of the sides of a triangle for $1 \leq j \leq 2008$.

A2 EST (Estonia)

Let $a, b, c$ be positive real numbers such that $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$. Prove that

1(2a+b+c)2+1(2b+c+a)2+1(2c+a+b)2316 \frac{1}{(2 a+b+c)^{2}}+\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \leq \frac{3}{16}

Solution 1. For positive real numbers $x, y, z$, from the arithmetic-geometric-mean inequality,

2x+y+z=(x+y)+(x+z)2(x+y)(x+z) 2 x+y+z=(x+y)+(x+z) \geq 2 \sqrt{(x+y)(x+z)}

we obtain

1(2x+y+z)214(x+y)(x+z) \frac{1}{(2 x+y+z)^{2}} \leq \frac{1}{4(x+y)(x+z)}

Applying this to the left-hand side terms of the inequality to prove, we get

1(2a+b+c)2+1(2b+c+a)2+1(2c+a+b)214(a+b)(a+c)+14(b+c)(b+a)+14(c+a)(c+b)=(b+c)+(c+a)+(a+b)4(a+b)(b+c)(c+a)=a+b+c2(a+b)(b+c)(c+a). \begin{aligned} \frac{1}{(2 a+b+c)^{2}} & +\frac{1}{(2 b+c+a)^{2}}+\frac{1}{(2 c+a+b)^{2}} \\ & \leq \frac{1}{4(a+b)(a+c)}+\frac{1}{4(b+c)(b+a)}+\frac{1}{4(c+a)(c+b)} \\ & =\frac{(b+c)+(c+a)+(a+b)}{4(a+b)(b+c)(c+a)}=\frac{a+b+c}{2(a+b)(b+c)(c+a)} . \end{aligned}

A second application of the inequality of the arithmetic-geometric mean yields

a2b+a2c+b2a+b2c+c2a+c2b6abc a^{2} b+a^{2} c+b^{2} a+b^{2} c+c^{2} a+c^{2} b \geq 6 a b c

or, equivalently,

9(a+b)(b+c)(c+a)8(a+b+c)(ab+bc+ca) 9(a+b)(b+c)(c+a) \geq 8(a+b+c)(a b+b c+c a)

The supposition $\frac{1}{a}+\frac{1}{b}+\frac{1}{c}=a+b+c$ can be written as

ab+bc+ca=abc(a+b+c). a b+b c+c a=a b c(a+b+c) .

Applying the arithmetic-geometric-mean inequality $x^{2} y^{2}+x^{2} z^{2} \geq 2 x^{2} y z$ thrice, we get

a2b2+b2c2+c2a2a2bc+ab2c+abc2 a^{2} b^{2}+b^{2} c^{2}+c^{2} a^{2} \geq a^{2} b c+a b^{2} c+a b c^{2}

which is equivalent to

(ab+bc+ca)23abc(a+b+c) (a b+b c+c a)^{2} \geq 3 a b c(a+b+c)

Combining (1), (2), (3), and (4), we will finish the proof:

a+b+c2(a+b)(b+c)(c+a)=(a+b+c)(ab+bc+ca)2(a+b)(b+c)(c+a)ab+bc+caabc(a+b+c)abc(a+b+c)(ab+bc+ca)2928113=316 \begin{aligned} \frac{a+b+c}{2(a+b)(b+c)(c+a)} & =\frac{(a+b+c)(a b+b c+c a)}{2(a+b)(b+c)(c+a)} \cdot \frac{a b+b c+c a}{a b c(a+b+c)} \cdot \frac{a b c(a+b+c)}{(a b+b c+c a)^{2}} \\ & \leq \frac{9}{2 \cdot 8} \cdot 1 \cdot \frac{1}{3}=\frac{3}{16} \end{aligned}

Solution 2. Equivalently, we prove the homogenized inequality

(a+b+c)2(2a+b+c)2+(a+b+c)2(a+2b+c)2+(a+b+c)2(a+b+2c)2316(a+b+c)(1a+1b+1c) \frac{(a+b+c)^{2}}{(2 a+b+c)^{2}}+\frac{(a+b+c)^{2}}{(a+2 b+c)^{2}}+\frac{(a+b+c)^{2}}{(a+b+2 c)^{2}} \leq \frac{3}{16}(a+b+c)\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)

for all positive real numbers $a, b, c$. Without loss of generality we choose $a+b+c=1$. Thus, the problem is equivalent to prove for all $a, b, c>0$, fulfilling this condition, the inequality

1(1+a)2+1(1+b)2+1(1+c)2316(1a+1b+1c). \frac{1}{(1+a)^{2}}+\frac{1}{(1+b)^{2}}+\frac{1}{(1+c)^{2}} \leq \frac{3}{16}\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) .

Applying Jensen's inequality to the function $f(x)=\frac{x}{(1+x)^{2}}$, which is concave for $0 \leq x \leq 2$ and increasing for $0 \leq x \leq 1$, we obtain

αa(1+a)2+βb(1+b)2+γc(1+c)2(α+β+γ)A(1+A)2, where A=αa+βb+γcα+β+γ \alpha \frac{a}{(1+a)^{2}}+\beta \frac{b}{(1+b)^{2}}+\gamma \frac{c}{(1+c)^{2}} \leq(\alpha+\beta+\gamma) \frac{A}{(1+A)^{2}}, \quad \text { where } \quad A=\frac{\alpha a+\beta b+\gamma c}{\alpha+\beta+\gamma}

Choosing $\alpha=\frac{1}{a}, \beta=\frac{1}{b}$, and $\gamma=\frac{1}{c}$, we can apply the harmonic-arithmetic-mean inequality

A=31a+1b+1ca+b+c3=13<1 A=\frac{3}{\frac{1}{a}+\frac{1}{b}+\frac{1}{c}} \leq \frac{a+b+c}{3}=\frac{1}{3}<1

Finally we prove (5):

1(1+a)2+1(1+b)2+1(1+c)2(1a+1b+1c)A(1+A)2(1a+1b+1c)13(1+13)2=316(1a+1b+1c). \begin{aligned} \frac{1}{(1+a)^{2}}+\frac{1}{(1+b)^{2}}+\frac{1}{(1+c)^{2}} & \leq\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) \frac{A}{(1+A)^{2}} \\ & \leq\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) \frac{\frac{1}{3}}{\left(1+\frac{1}{3}\right)^{2}}=\frac{3}{16}\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right) . \end{aligned}

A3 FRA (France)

Determine all functions $f$ from the set of positive integers into the set of positive integers such that for all $x$ and $y$ there exists a non degenerated triangle with sides of lengths

x,f(y) and f(y+f(x)1). x, \quad f(y) \quad \text { and } \quad f(y+f(x)-1) .

Solution. The identity function $f(x)=x$ is the only solution of the problem. If $f(x)=x$ for all positive integers $x$, the given three lengths are $x, y=f(y)$ and $z=$ $f(y+f(x)-1)=x+y-1$. Because of $x \geq 1, y \geq 1$ we have $z \geq \max {x, y}>|x-y|$ and $z<x+y$. From this it follows that a triangle with these side lengths exists and does not degenerate. We prove in several steps that there is no other solution.

Step 1. We show $f(1)=1$. If we had $f(1)=1+m>1$ we would conclude $f(y)=f(y+m)$ for all $y$ considering the triangle with the side lengths $1, f(y)$ and $f(y+m)$. Thus, $f$ would be $m$-periodic and, consequently, bounded. Let $B$ be a bound, $f(x) \leq B$. If we choose $x>2 B$ we obtain the contradiction $x>2 B \geq f(y)+f(y+f(x)-1)$.

Step 2. For all positive integers $z$, we have $f(f(z))=z$. Setting $x=z$ and $y=1$ this follows immediately from Step 1.

Step 3. For all integers $z \geq 1$, we have $f(z) \leq z$. Let us show, that the contrary leads to a contradiction. Assume $w+1=f(z)>z$ for some $z$. From Step 1 we know that $w \geq z \geq 2$. Let $M=\max {f(1), f(2), \ldots, f(w)}$ be the largest value of $f$ for the first $w$ integers. First we show, that no positive integer $t$ exists with

f(t)>z1wt+M f(t)>\frac{z-1}{w} \cdot t+M

otherwise we decompose the smallest value $t$ as $t=w r+s$ where $r$ is an integer and $1 \leq s \leq w$. Because of the definition of $M$, we have $t>w$. Setting $x=z$ and $y=t-w$ we get from the triangle inequality

z+f(tw)>f((tw)+f(z)1)=f(tw+w)=f(t) z+f(t-w)>f((t-w)+f(z)-1)=f(t-w+w)=f(t)

Hence,

f(tw)f(t)(z1)>z1w(tw)+M f(t-w) \geq f(t)-(z-1)>\frac{z-1}{w}(t-w)+M

a contradiction to the minimality of $t$. Therefore the inequality (1) fails for all $t \geq 1$, we have proven

f(t)z1wt+M f(t) \leq \frac{z-1}{w} \cdot t+M

instead.

Now, using (2), we finish the proof of Step 3. Because of $z \leq w$ we have $\frac{z-1}{w}<1$ and we can choose an integer $t$ sufficiently large to fulfill the condition

(z1w)2t+(z1w+1)M<t. \left(\frac{z-1}{w}\right)^{2} t+\left(\frac{z-1}{w}+1\right) M<t .

Applying (2) twice we get

f(f(t))z1wf(t)+Mz1w(z1wt+M)+M<t f(f(t)) \leq \frac{z-1}{w} f(t)+M \leq \frac{z-1}{w}\left(\frac{z-1}{w} t+M\right)+M<t

in contradiction to Step 2, which proves Step 3.

Final step. Thus, following Step 2 and Step 3, we obtain

z=f(f(z))f(z)z z=f(f(z)) \leq f(z) \leq z

and $f(z)=z$ for all positive integers $z$ is proven.

A4 BLR (Belarus)

Let $a, b, c$ be positive real numbers such that $a b+b c+c a \leq 3 a b c$. Prove that

a2+b2a+b+b2+c2b+c+c2+a2c+a+32(a+b+b+c+c+a). \sqrt{\frac{a^{2}+b^{2}}{a+b}}+\sqrt{\frac{b^{2}+c^{2}}{b+c}}+\sqrt{\frac{c^{2}+a^{2}}{c+a}}+3 \leq \sqrt{2}(\sqrt{a+b}+\sqrt{b+c}+\sqrt{c+a}) .

Solution. Starting with the terms of the right-hand side, the quadratic-arithmetic-mean inequality yields

2a+b=2aba+b12(2+a2+b2ab)2aba+b12(2+a2+b2ab)=2aba+b+a2+b2a+b \begin{aligned} \sqrt{2} \sqrt{a+b} & =2 \sqrt{\frac{a b}{a+b}} \sqrt{\frac{1}{2}\left(2+\frac{a^{2}+b^{2}}{a b}\right)} \\ & \geq 2 \sqrt{\frac{a b}{a+b}} \cdot \frac{1}{2}\left(\sqrt{2}+\sqrt{\frac{a^{2}+b^{2}}{a b}}\right)=\sqrt{\frac{2 a b}{a+b}}+\sqrt{\frac{a^{2}+b^{2}}{a+b}} \end{aligned}

and, analogously,

2b+c2bcb+c+b2+c2b+c,2c+a2cac+a+c2+a2c+a. \sqrt{2} \sqrt{b+c} \geq \sqrt{\frac{2 b c}{b+c}}+\sqrt{\frac{b^{2}+c^{2}}{b+c}}, \quad \sqrt{2} \sqrt{c+a} \geq \sqrt{\frac{2 c a}{c+a}}+\sqrt{\frac{c^{2}+a^{2}}{c+a}} .

Applying the inequality between the arithmetic mean and the squared harmonic mean will finish the proof:

2aba+b+2bcb+c+2cac+a33a+b2ab2+b+c2bc2+c+a2ca2=33abcab+bc+ca3. \sqrt{\frac{2 a b}{a+b}}+\sqrt{\frac{2 b c}{b+c}}+\sqrt{\frac{2 c a}{c+a}} \geq 3 \cdot \sqrt{\frac{3}{\sqrt{\frac{a+b}{2 a b}}^{2}+\sqrt{\frac{b+c}{2 b c}}^{2}+\sqrt{\frac{c+a}{2 c a}}}}{ }^{2}=3 \cdot \sqrt{\frac{3 a b c}{a b+b c+c a}} \geq 3 .

A5 BLR (Belarus)

Let $f$ be any function that maps the set of real numbers into the set of real numbers. Prove that there exist real numbers $x$ and $y$ such that

f(xf(y))>yf(x)+x f(x-f(y))>y f(x)+x

Solution 1. Assume that

f(xf(y))yf(x)+x for all real x,y f(x-f(y)) \leq y f(x)+x \quad \text { for all real } x, y

Let $a=f(0)$. Setting $y=0$ in (1) gives $f(x-a) \leq x$ for all real $x$ and, equivalently,

f(y)y+a for all real y f(y) \leq y+a \quad \text { for all real } y

Setting $x=f(y)$ in (1) yields in view of (2)

a=f(0)yf(f(y))+f(y)yf(f(y))+y+a. a=f(0) \leq y f(f(y))+f(y) \leq y f(f(y))+y+a .

This implies $0 \leq y(f(f(y))+1)$ and thus

f(f(y))1 for all y>0 f(f(y)) \geq-1 \quad \text { for all } y>0

From (2) and (3) we obtain $-1 \leq f(f(y)) \leq f(y)+a$ for all $y>0$, so

f(y)a1 for all y>0 f(y) \geq-a-1 \quad \text { for all } y>0

Now we show that

f(x)0 for all real x f(x) \leq 0 \quad \text { for all real } x

Assume the contrary, i.e. there is some $x$ such that $f(x)>0$. Take any $y$ such that

y<xa and y<ax1f(x) y<x-a \quad \text { and } \quad y<\frac{-a-x-1}{f(x)}

Then in view of (2)

xf(y)x(y+a)>0 x-f(y) \geq x-(y+a)>0

and with (1) and (4) we obtain

yf(x)+xf(xf(y))a1, y f(x)+x \geq f(x-f(y)) \geq-a-1,

whence

yax1f(x) y \geq \frac{-a-x-1}{f(x)}

contrary to our choice of $y$. Thereby, we have established (5). Setting $x=0$ in (5) leads to $a=f(0) \leq 0$ and (2) then yields

f(x)x for all real x f(x) \leq x \quad \text { for all real } x

Now choose $y$ such that $y>0$ and $y>-f(-1)-1$ and set $x=f(y)-1$. From (11), (5) and (6) we obtain

f(1)=f(xf(y))yf(x)+x=yf(f(y)1)+f(y)1y(f(y)1)1y1, f(-1)=f(x-f(y)) \leq y f(x)+x=y f(f(y)-1)+f(y)-1 \leq y(f(y)-1)-1 \leq-y-1,

i.e. $y \leq-f(-1)-1$, a contradiction to the choice of $y$.

Solution 2. Assume that

f(xf(y))yf(x)+x for all real x,y f(x-f(y)) \leq y f(x)+x \quad \text { for all real } x, y

Let $a=f(0)$. Setting $y=0$ in (7) gives $f(x-a) \leq x$ for all real $x$ and, equivalently,

f(y)y+a for all real y f(y) \leq y+a \quad \text { for all real } y

Now we show that

f(z)0 for all z1 f(z) \geq 0 \quad \text { for all } z \geq 1

Let $z \geq 1$ be fixed, set $b=f(z)$ and assume that $b<0$. Setting $x=w+b$ and $y=z$ in (7) gives

f(w)zf(w+b)w+b for all real w f(w)-z f(w+b) \leq w+b \quad \text { for all real } w

Applying (10) to $w, w+b, \ldots, w+(n-1) b$, where $n=1,2, \ldots$, leads to

f(w)znf(w+nb)=(f(w)zf(w+b))+z(f(w+b)zf(w+2b))++zn1(f(w+(n1)b)zf(w+nb))(w+b)+z(w+2b)++zn1(w+nb) \begin{gathered} f(w)-z^{n} f(w+n b)=(f(w)-z f(w+b))+z(f(w+b)-z f(w+2 b)) \\ +\cdots+z^{n-1}(f(w+(n-1) b)-z f(w+n b)) \\ \leq(w+b)+z(w+2 b)+\cdots+z^{n-1}(w+n b) \end{gathered}

From (8) we obtain

f(w+nb)w+nb+a f(w+n b) \leq w+n b+a

and, thus, we have for all positive integers $n$

f(w)(1+z++zn1+zn)w+(1+2z++nzn1+nzn)b+zna. f(w) \leq\left(1+z+\cdots+z^{n-1}+z^{n}\right) w+\left(1+2 z+\cdots+n z^{n-1}+n z^{n}\right) b+z^{n} a .

With $w=0$ we get

a(1+2z++nzn1+nzn)b+azn. a \leq\left(1+2 z+\cdots+n z^{n-1}+n z^{n}\right) b+a z^{n} .

In view of the assumption $b<0$ we find some $n$ such that

a>(nb+a)zn a>(n b+a) z^{n}

because the right hand side tends to $-\infty$ as $n \rightarrow \infty$. Now (12) and (13) give the desired contradiction and (9) is established. In addition, we have for $z=1$ the strict inequality

f(1)>0 f(1)>0 \text {. }

Indeed, assume that $f(1)=0$. Then setting $w=-1$ and $z=1$ in (11) leads to

f(1)(n+1)+a f(-1) \leq-(n+1)+a

which is false if $n$ is sufficiently large. To complete the proof we set $t=\min {-a,-2 / f(1)}$. Setting $x=1$ and $y=t$ in (7) gives

f(1f(t))tf(1)+12+1=1. f(1-f(t)) \leq t f(1)+1 \leq-2+1=-1 .

On the other hand, by (8) and the choice of $t$ we have $f(t) \leq t+a \leq 0$ and hence $1-f(t) \geq 1$. The inequality (9) yields

f(1f(t))0 f(1-f(t)) \geq 0

which contradicts (15).

A6 USA (United States of America)

Suppose that $s_{1}, s_{2}, s_{3}, \ldots$ is a strictly increasing sequence of positive integers such that the subsequences

ss1,ss2,ss3, and ss1+1,ss2+1,ss3+1, s_{s_{1}}, s_{s_{2}}, s_{s_{3}}, \ldots \quad \text { and } \quad s_{s_{1}+1}, s_{s_{2}+1}, s_{s_{3}+1}, \ldots

are both arithmetic progressions. Prove that $s_{1}, s_{2}, s_{3}, \ldots$ is itself an arithmetic progression.

Solution 1. Let $D$ be the common difference of the progression $s_{s_{1}}, s_{s_{2}}, \ldots$. Let for $n=$ 1, 2, ...

dn=sn+1sn d_{n}=s_{n+1}-s_{n}

We have to prove that $d_{n}$ is constant. First we show that the numbers $d_{n}$ are bounded. Indeed, by supposition $d_{n} \geq 1$ for all $n$. Thus, we have for all $n$

dn=sn+1sndsn+dsn+1++dsn+11=ssn+1ssn=D. d_{n}=s_{n+1}-s_{n} \leq d_{s_{n}}+d_{s_{n}+1}+\cdots+d_{s_{n+1}-1}=s_{s_{n+1}}-s_{s_{n}}=D .

The boundedness implies that there exist

m=min{dn:n=1,2,} and M=max{dn:n=1,2,} m=\min \left\{d_{n}: n=1,2, \ldots\right\} \quad \text { and } \quad M=\max \left\{d_{n}: n=1,2, \ldots\right\}

It suffices to show that $m=M$. Assume that $m<M$. Choose $n$ such that $d_{n}=m$. Considering a telescoping sum of $m=d_{n}=s_{n+1}-s_{n}$ items not greater than $M$ leads to

D=ssn+1ssn=ssn+mssn=dsn+dsn+1++dsn+m1mM D=s_{s_{n+1}}-s_{s_{n}}=s_{s_{n}+m}-s_{s_{n}}=d_{s_{n}}+d_{s_{n}+1}+\cdots+d_{s_{n}+m-1} \leq m M

and equality holds if and only if all items of the sum are equal to $M$. Now choose $n$ such that $d_{n}=M$. In the same way, considering a telescoping sum of $M$ items not less than $m$ we obtain

D=ssn+1ssn=ssn+Mssn=dsn+dsn+1++dsn+M1Mm D=s_{s_{n+1}}-s_{s_{n}}=s_{s_{n}+M}-s_{s_{n}}=d_{s_{n}}+d_{s_{n}+1}+\cdots+d_{s_{n}+M-1} \geq M m

and equality holds if and only if all items of the sum are equal to $m$. The inequalities (1) and (2) imply that $D=M m$ and that

dsn=dsn+1==dsn+11=M if dn=m,dsn=dsn+1==dsn+11=m if dn=M. \begin{aligned} d_{s_{n}}=d_{s_{n}+1}=\cdots=d_{s_{n+1}-1}=M & \text { if } d_{n}=m, \\ d_{s_{n}}=d_{s_{n}+1}=\cdots=d_{s_{n+1}-1}=m & \text { if } d_{n}=M . \end{aligned}

Hence, $d_{n}=m$ implies $d_{s_{n}}=M$. Note that $s_{n} \geq s_{1}+(n-1) \geq n$ for all $n$ and moreover $s_{n}>n$ if $d_{n}=n$, because in the case $s_{n}=n$ we would have $m=d_{n}=d_{s_{n}}=M$ in contradiction to the assumption $m<M$. In the same way $d_{n}=M$ implies $d_{s_{n}}=m$ and $s_{n}>n$. Consequently, there is a strictly increasing sequence $n_{1}, n_{2}, \ldots$ such that

dsn1=M,dsn2=m,dsn3=M,dsn4=m, d_{s_{n_{1}}}=M, \quad d_{s_{n_{2}}}=m, \quad d_{s_{n_{3}}}=M, \quad d_{s_{n_{4}}}=m, \quad \ldots

The sequence $d_{s_{1}}, d_{s_{2}}, \ldots$ is the sequence of pairwise differences of $s_{s_{1}+1}, s_{s_{2}+1}, \ldots$ and $s_{s_{1}}, s_{s_{2}}, \ldots$, hence also an arithmetic progression. Thus $m=M$.

Solution 2. Let the integers $D$ and $E$ be the common differences of the progressions $s_{s_{1}}, s_{s_{2}}, \ldots$ and $s_{s_{1}+1}, s_{s_{2}+1}, \ldots$, respectively. Let briefly $A=s_{s_{1}}-D$ and $B=s_{s_{1}+1}-E$. Then, for all positive integers $n$,

ssn=A+nD,ssn+1=B+nE s_{s_{n}}=A+n D, \quad s_{s_{n}+1}=B+n E

Since the sequence $s_{1}, s_{2}, \ldots$ is strictly increasing, we have for all positive integers $n$

ssn<ssn+1ssn+1 s_{s_{n}}<s_{s_{n}+1} \leq s_{s_{n+1}}

which implies

A+nD<B+nEA+(n+1)D A+n D<B+n E \leq A+(n+1) D

and thereby

0<BA+n(ED)D 0<B-A+n(E-D) \leq D

which implies $D-E=0$ and thus

0BAD 0 \leq B-A \leq D

Let $m=\min \left{s_{n+1}-s_{n}: n=1,2, \ldots\right}$. Then

BA=(ss1+1E)(ss1D)=ss1+1ss1m B-A=\left(s_{s_{1}+1}-E\right)-\left(s_{s_{1}}-D\right)=s_{s_{1}+1}-s_{s_{1}} \geq m

and

D=A+(s1+1)D(A+s1D)=sss1+1sss1=sB+DsA+Dm(BA) D=A+\left(s_{1}+1\right) D-\left(A+s_{1} D\right)=s_{s_{s_{1}+1}}-s_{s_{s_{1}}}=s_{B+D}-s_{A+D} \geq m(B-A)

From (3) we consider two cases. Case 1. $B-A=D$. Then, for each positive integer $n, s_{s_{n}+1}=B+n D=A+(n+1) D=s_{s_{n+1}}$, hence $s_{n+1}=s_{n}+1$ and $s_{1}, s_{2}, \ldots$ is an arithmetic progression with common difference 1 .

Case 2. $B-A<D$. Choose some positive integer $N$ such that $s_{N+1}-s_{N}=m$. Then

m(AB+D1)=m((A+(N+1)D)(B+ND+1))sA+(N+1)DsB+ND+1=sssN+1sssN+1+1=(A+sN+1D)(B+(sN+1)D)=(sN+1sN)D+ABD=mD+ABD, \begin{aligned} m(A-B+D-1) & =m((A+(N+1) D)-(B+N D+1)) \\ & \leq s_{A+(N+1) D}-s_{B+N D+1}=s_{s_{s_{N+1}}}-s_{s_{s_{N}+1}+1} \\ & =\left(A+s_{N+1} D\right)-\left(B+\left(s_{N}+1\right) D\right)=\left(s_{N+1}-s_{N}\right) D+A-B-D \\ & =m D+A-B-D, \end{aligned}

i.e.,

(BAm)+(Dm(BA))0 (B-A-m)+(D-m(B-A)) \leq 0

The inequalities (4)-(6) imply that

BA=m and D=m(BA) B-A=m \quad \text { and } \quad D=m(B-A)

Assume that there is some positive integer $n$ such that $s_{n+1}>s_{n}+m$. Then $\left.m(m+1) \leq m\left(s_{n+1}-s_{n}\right) \leq s_{s_{n+1}}-s_{s_{n}}=(A+(n+1) D)-(A+n D)\right)=D=m(B-A)=m^{2}$, a contradiction. Hence $s_{1}, s_{2}, \ldots$ is an arithmetic progression with common difference $m$.

A7 JPN (Japan)

Find all functions $f$ from the set of real numbers into the set of real numbers which satisfy for all real $x, y$ the identity

f(xf(x+y))=f(yf(x))+x2 f(x f(x+y))=f(y f(x))+x^{2}

Solution 1. It is no hard to see that the two functions given by $f(x)=x$ and $f(x)=-x$ for all real $x$ respectively solve the functional equation. In the sequel, we prove that there are no further solutions. Let $f$ be a function satisfying the given equation. It is clear that $f$ cannot be a constant. Let us first show that $f(0)=0$. Suppose that $f(0) \neq 0$. For any real $t$, substituting $(x, y)=\left(0, \frac{t}{f(0)}\right)$ into the given functional equation, we obtain

f(0)=f(t) f(0)=f(t)

contradicting the fact that $f$ is not a constant function. Therefore, $f(0)=0$. Next for any $t$, substituting $(x, y)=(t, 0)$ and $(x, y)=(t,-t)$ into the given equation, we get

f(tf(t))=f(0)+t2=t2 f(t f(t))=f(0)+t^{2}=t^{2}

and

f(tf(0))=f(tf(t))+t2 f(t f(0))=f(-t f(t))+t^{2}

respectively. Therefore, we conclude that

f(tf(t))=t2,f(tf(t))=t2, for every real t f(t f(t))=t^{2}, \quad f(-t f(t))=-t^{2}, \quad \text { for every real } t

Consequently, for every real $v$, there exists a real $u$, such that $f(u)=v$. We also see that if $f(t)=0$, then $0=f(t f(t))=t^{2}$ so that $t=0$, and thus 0 is the only real number satisfying $f(t)=0$. We next show that for any real number $s$,

f(s)=f(s) f(-s)=-f(s)

This is clear if $f(s)=0$. Suppose now $f(s)<0$, then we can find a number $t$ for which $f(s)=-t^{2}$. As $t \neq 0$ implies $f(t) \neq 0$, we can also find number $a$ such that $a f(t)=s$. Substituting $(x, y)=(t, a)$ into the given equation, we get

f(tf(t+a))=f(af(t))+t2=f(s)+t2=0 f(t f(t+a))=f(a f(t))+t^{2}=f(s)+t^{2}=0

and therefore, $t f(t+a)=0$, which implies $t+a=0$, and hence $s=-t f(t)$. Consequently, $f(-s)=f(t f(t))=t^{2}=-\left(-t^{2}\right)=-f(s)$ holds in this case. Finally, suppose $f(s)>0$ holds. Then there exists a real number $t \neq 0$ for which $f(s)=t^{2}$. Choose a number $a$ such that $t f(a)=s$. Substituting $(x, y)=(t, a-t)$ into the given equation, we get $f(s)=f(t f(a))=f((a-t) f(t))+t^{2}=f((a-t) f(t))+f(s)$. So we have $f((a-t) f(t))=0$, from which we conclude that $(a-t) f(t)=0$. Since $f(t) \neq 0$, we get $a=t$ so that $s=t f(t)$ and thus we see $f(-s)=f(-t f(t))=-t^{2}=-f(s)$ holds in this case also. This observation finishes the proof of (3). By substituting $(x, y)=(s, t),(x, y)=(t,-s-t)$ and $(x, y)=(-s-t, s)$ into the given equation, we obtain

f(sf(s+t)))=f(tf(s))+s2f(tf(s))=f((st)f(t))+t2 \begin{array}{r} f(s f(s+t)))=f(t f(s))+s^{2} \\ f(t f(-s))=f((-s-t) f(t))+t^{2} \end{array}

and

f((st)f(t))=f(sf(st))+(s+t)2 f((-s-t) f(-t))=f(s f(-s-t))+(s+t)^{2}

respectively. Using the fact that $f(-x)=-f(x)$ holds for all $x$ to rewrite the second and the third equation, and rearranging the terms, we obtain

f(tf(s))f(sf(s+t))=s2f(tf(s))f((s+t)f(t))=t2f((s+t)f(t))+f(sf(s+t))=(s+t)2 \begin{aligned} f(t f(s))-f(s f(s+t)) & =-s^{2} \\ f(t f(s))-f((s+t) f(t)) & =-t^{2} \\ f((s+t) f(t))+f(s f(s+t)) & =(s+t)^{2} \end{aligned}

Adding up these three equations now yields $2 f(t f(s))=2 t s$, and therefore, we conclude that $f(t f(s))=t s$ holds for every pair of real numbers $s, t$. By fixing $s$ so that $f(s)=1$, we obtain $f(x)=s x$. In view of the given equation, we see that $s= \pm 1$. It is easy to check that both functions $f(x)=x$ and $f(x)=-x$ satisfy the given functional equation, so these are the desired solutions.

Solution 2. As in Solution 1 we obtain (1), (2) and (3). Now we prove that $f$ is injective. For this purpose, let us assume that $f(r)=f(s)$ for some $r \neq s$. Then, by (2)

r2=f(rf(r))=f(rf(s))=f((sr)f(r))+r2 r^{2}=f(r f(r))=f(r f(s))=f((s-r) f(r))+r^{2}

where the last statement follows from the given functional equation with $x=r$ and $y=s-r$. Hence, $h=(s-r) f(r)$ satisfies $f(h)=0$ which implies $h^{2}=f(h f(h))=f(0)=0$, i.e., $h=0$. Then, by $s \neq r$ we have $f(r)=0$ which implies $r=0$, and finally $f(s)=f(r)=f(0)=0$. Analogously, it follows that $s=0$ which gives the contradiction $r=s$. To prove $|f(1)|=1$ we apply (2) with $t=1$ and also with $t=f(1)$ and obtain $f(f(1))=1$ and $(f(1))^{2}=f(f(1) \cdot f(f(1)))=f(f(1))=1$. Now we choose $\eta \in{-1,1}$ with $f(1)=\eta$. Using that $f$ is odd and the given equation with $x=1, y=z$ (second equality) and with $x=-1, y=z+2$ (fourth equality) we obtain

f(z)+2η=η(f(zη)+2)=η(f(f(z+1))+1)=η(f(f(z+1))+1)=ηf((z+2)f(1))=ηf((z+2)(η))=ηf((z+2)η)=f(z+2) \begin{aligned} & f(z)+2 \eta=\eta(f(z \eta)+2)=\eta(f(f(z+1))+1)=\eta(-f(-f(z+1))+1) \\ & =-\eta f((z+2) f(-1))=-\eta f((z+2)(-\eta))=\eta f((z+2) \eta)=f(z+2) \end{aligned}

Hence,

f(z+2η)=ηf(ηz+2)=η(f(ηz)+2η)=f(z)+2 f(z+2 \eta)=\eta f(\eta z+2)=\eta(f(\eta z)+2 \eta)=f(z)+2

Using this argument twice we obtain

f(z+4η)=f(z+2η)+2=f(z)+4 f(z+4 \eta)=f(z+2 \eta)+2=f(z)+4

Substituting $z=2 f(x)$ we have

f(2f(x))+4=f(2f(x)+4η)=f(2f(x+2)) f(2 f(x))+4=f(2 f(x)+4 \eta)=f(2 f(x+2))

where the last equality follows from (4). Applying the given functional equation we proceed to

f(2f(x+2))=f(xf(2))+4=f(2ηx)+4 f(2 f(x+2))=f(x f(2))+4=f(2 \eta x)+4

where the last equality follows again from (4) with $z=0$, i.e., $f(2)=2 \eta$. Finally, $f(2 f(x))=$ $f(2 \eta x)$ and by injectivity of $f$ we get $2 f(x)=2 \eta x$ and hence the two solutions.

Combinatorics

C1 NZL (New Zealand)

Consider 2009 cards, each having one gold side and one black side, lying in parallel on a long table. Initially all cards show their gold sides. Two players, standing by the same long side of the table, play a game with alternating moves. Each move consists of choosing a block of 50 consecutive cards, the leftmost of which is showing gold, and turning them all over, so those which showed gold now show black and vice versa. The last player who can make a legal move wins. (a) Does the game necessarily end? (b) Does there exist a winning strategy for the starting player?

Solution. (a) We interpret a card showing black as the digit 0 and a card showing gold as the digit 1. Thus each position of the 2009 cards, read from left to right, corresponds bijectively to a nonnegative integer written in binary notation of 2009 digits, where leading zeros are allowed. Each move decreases this integer, so the game must end. (b) We show that there is no winning strategy for the starting player. We label the cards from right to left by $1, \ldots, 2009$ and consider the set $S$ of cards with labels $50 i, i=1,2, \ldots, 40$. Let $g_{n}$ be the number of cards from $S$ showing gold after $n$ moves. Obviously, $g_{0}=40$. Moreover, $\left|g_{n}-g_{n+1}\right|=1$ as long as the play goes on. Thus, after an odd number of moves, the nonstarting player finds a card from $S$ showing gold and hence can make a move. Consequently, this player always wins.

C2 ROU (Romania)

For any integer $n \geq 2$, let $N(n)$ be the maximal number of triples $\left(a_{i}, b_{i}, c_{i}\right), i=1, \ldots, N(n)$, consisting of nonnegative integers $a_{i}, b_{i}$ and $c_{i}$ such that the following two conditions are satisfied: (1) $a_{i}+b_{i}+c_{i}=n$ for all $i=1, \ldots, N(n)$, (2) If $i \neq j$, then $a_{i} \neq a_{j}, b_{i} \neq b_{j}$ and $c_{i} \neq c_{j}$.

Determine $N(n)$ for all $n \geq 2$.

Comment. The original problem was formulated for $m$-tuples instead for triples. The numbers $N(m, n)$ are then defined similarly to $N(n)$ in the case $m=3$. The numbers $N(3, n)$ and $N(n, n)$ should be determined. The case $m=3$ is the same as in the present problem. The upper bound for $N(n, n)$ can be proved by a simple generalization. The construction of a set of triples attaining the bound can be easily done by induction from $n$ to $n+2$.

Solution. Let $n \geq 2$ be an integer and let $\left{T_{1}, \ldots, T_{N}\right}$ be any set of triples of nonnegative integers satisfying the conditions (1) and (2). Since the $a$-coordinates are pairwise distinct we have

i=1Naii=1N(i1)=N(N1)2 \sum_{i=1}^{N} a_{i} \geq \sum_{i=1}^{N}(i-1)=\frac{N(N-1)}{2}

Analogously,

i=1NbiN(N1)2 and i=1NciN(N1)2 \sum_{i=1}^{N} b_{i} \geq \frac{N(N-1)}{2} \quad \text { and } \quad \sum_{i=1}^{N} c_{i} \geq \frac{N(N-1)}{2}

Summing these three inequalities and applying (1) yields

3N(N1)2i=1Nai+i=1Nbi+i=1Nci=i=1N(ai+bi+ci)=nN, 3 \frac{N(N-1)}{2} \leq \sum_{i=1}^{N} a_{i}+\sum_{i=1}^{N} b_{i}+\sum_{i=1}^{N} c_{i}=\sum_{i=1}^{N}\left(a_{i}+b_{i}+c_{i}\right)=n N,

hence $3 \frac{N-1}{2} \leq n$ and, consequently,

N2n3+1 N \leq\left\lfloor\frac{2 n}{3}\right\rfloor+1

By constructing examples, we show that this upper bound can be attained, so $N(n)=\left\lfloor\frac{2 n}{3}\right\rfloor+1$.

We distinguish the cases $n=3 k-1, n=3 k$ and $n=3 k+1$ for $k \geq 1$ and present the extremal examples in form of a table.

$n=3 k-1$
$\left\lfloor\frac{2 n}{3}\right\rfloor+1=2 k$
$a_{i}$ $b_{i}$ $c_{i}$
0 $k+1$ $2 k-2$
1 $k+2$ $2 k-4$
$\vdots$ $\vdots$ $\vdots$
$k-1$ $2 k$ 0
$k$ 0 $2 k-1$
$k+1$ 1 $2 k-3$
$\vdots$ $\vdots$ $\vdots$
$2 k-1$ $k-1$ 1
$n=3 k$
$\rfloor+1=2 k+1$
$a_{i}$ $b_{i}$ $c_{i}$
0 $k$ $2 k$
1 $k+1$ $2 k-2$
$\vdots$ $\vdots$ $\vdots$
$k$ $2 k$ 0
$k+1$ 0 $2 k-1$
$k+2$ 1 $2 k-3$
$\vdots$ $\vdots$ $\vdots$
$2 k$ $k-1$ 1
$n=3 k+1$
$\left\lfloor\left\lfloor\frac{2 n}{3}\right\rfloor+1=2 k+1\right.$
$a_{i}$ $b_{i}$ $c_{i}$
0 $k$ $2 k+1$
1 $k+1$ $2 k-1$
$\vdots$ $\vdots$ $\vdots$
$k$ $2 k$ 1
$k+1$ 0 $2 k$
$k+2$ 1 $2 k-2$
$\vdots$ $\vdots$ $\vdots$
$2 k$ $k-1$ 2

It can be easily seen that the conditions (1) and (2) are satisfied and that we indeed have $\left\lfloor\frac{2 n}{3}\right\rfloor+1$ triples in each case.

Comment. A cute combinatorial model is given by an equilateral triangle, partitioned into $n^{2}$ congruent equilateral triangles by $n-1$ equidistant parallels to each of its three sides. Two chess-like bishops placed at any two vertices of the small triangles are said to menace one another if they lie on a same parallel. The problem is to determine the largest number of bishops that can be placed so that none menaces another. A bishop may be assigned three coordinates $a, b, c$, namely the numbers of sides of small triangles they are off each of the sides of the big triangle. It is readily seen that the sum of these coordinates is always $n$, therefore fulfilling the requirements.

C3 RUS (Russian Federation)

Let $n$ be a positive integer. Given a sequence $\varepsilon_{1}, \ldots, \varepsilon_{n-1}$ with $\varepsilon_{i}=0$ or $\varepsilon_{i}=1$ for each $i=1, \ldots, n-1$, the sequences $a_{0}, \ldots, a_{n}$ and $b_{0}, \ldots, b_{n}$ are constructed by the following rules:

a0=b0=1,a1=b1=7,ai+1={2ai1+3ai, if εi=0,3ai1+ai, if εi=1, for each i=1,,n1,bi+1={2bi1+3bi, if εni=0,3bi1+bi, if εni=1, for each i=1,,n1. \begin{gathered} a_{0}=b_{0}=1, \quad a_{1}=b_{1}=7, \\ a_{i+1}=\left\{\begin{array}{ll} 2 a_{i-1}+3 a_{i}, & \text { if } \varepsilon_{i}=0, \\ 3 a_{i-1}+a_{i}, & \text { if } \varepsilon_{i}=1, \end{array} \text { for each } i=1, \ldots, n-1,\right. \\ b_{i+1}=\left\{\begin{array}{ll} 2 b_{i-1}+3 b_{i}, & \text { if } \varepsilon_{n-i}=0, \\ 3 b_{i-1}+b_{i}, & \text { if } \varepsilon_{n-i}=1, \end{array} \text { for each } i=1, \ldots, n-1 .\right. \end{gathered}

Prove that $a_{n}=b_{n}$.

Solution. For a binary word $w=\sigma_{1} \ldots \sigma_{n}$ of length $n$ and a letter $\sigma \in{0,1}$ let $w \sigma=$ $\sigma_{1} \ldots \sigma_{n} \sigma$ and $\sigma w=\sigma \sigma_{1} \ldots \sigma_{n}$. Moreover let $\bar{w}=\sigma_{n} \ldots \sigma_{1}$ and let $\emptyset$ be the empty word (of length 0 and with $\bar{\emptyset}=\emptyset$ ). Let $(u, v)$ be a pair of two real numbers. For binary words $w$ we define recursively the numbers $(u, v)^{w}$ as follows:

(u,v)=v,(u,v)0=2u+3v,(u,v)1=3u+v,(u,v)wσε={3(u,v)w+3(u,v)wσ, if ε=0,3(u,v)w+(u,v)wσ, if ε=1 \begin{gathered} (u, v)^{\emptyset}=v, \quad(u, v)^{0}=2 u+3 v, \quad(u, v)^{1}=3 u+v, \\ (u, v)^{w \sigma \varepsilon}= \begin{cases}3(u, v)^{w}+3(u, v)^{w \sigma}, & \text { if } \varepsilon=0, \\ 3(u, v)^{w}+(u, v)^{w \sigma}, & \text { if } \varepsilon=1\end{cases} \end{gathered}

It easily follows by induction on the length of $w$ that for all real numbers $u_{1}, v_{1}, u_{2}, v_{2}, \lambda_{1}$ and $\lambda_{2}$

(λ1u1+λ2u2,λ1v1+λ2v2)w=λ1(u1,v1)w+λ2(u2,v2)w \left(\lambda_{1} u_{1}+\lambda_{2} u_{2}, \lambda_{1} v_{1}+\lambda_{2} v_{2}\right)^{w}=\lambda_{1}\left(u_{1}, v_{1}\right)^{w}+\lambda_{2}\left(u_{2}, v_{2}\right)^{w}

and that for $\varepsilon \in{0,1}$

(u,v)εw=(v,(u,v)ε)w. (u, v)^{\varepsilon w}=\left(v,(u, v)^{\varepsilon}\right)^{w} .

Obviously, for $n \geq 1$ and $w=\varepsilon_{1} \ldots \varepsilon_{n-1}$, we have $a_{n}=(1,7)^{w}$ and $b_{n}=(1,7)^{\bar{w}}$. Thus it is sufficient to prove that

(1,7)w=(1,7)wˉ (1,7)^{w}=(1,7)^{\bar{w}}

for each binary word $w$. We proceed by induction on the length of $w$. The assertion is obvious if $w$ has length 0 or 1 . Now let $w \sigma \varepsilon$ be a binary word of length $n \geq 2$ and suppose that the assertion is true for all binary words of length at most $n-1$. Note that $(2,1)^{\sigma}=7=(1,7)^{\emptyset}$ for $\sigma \in{0,1},(1,7)^{0}=23$, and $(1,7)^{1}=10$. First let $\varepsilon=0$. Then in view of the induction hypothesis and the equalities (1) and (2), we obtain

(1,7)wσ0=2(1,7)w+3(1,7)wσ=2(1,7)wˉ+3(1,7)σwˉ=2(2,1)σwˉ+3(1,7)σwˉ=(7,23)σwˉ=(1,7)0σwˉ \begin{aligned} &(1,7)^{w \sigma 0}=2(1,7)^{w}+3(1,7)^{w \sigma}=2(1,7)^{\bar{w}}+3(1,7)^{\sigma \bar{w}}=2(2,1)^{\sigma \bar{w}}+3(1,7)^{\sigma \bar{w}} \\ &=(7,23)^{\sigma \bar{w}}=(1,7)^{0 \sigma \bar{w}} \end{aligned}

Now let $\varepsilon=1$. Analogously, we obtain

(1,7)wσ1=3(1,7)w+(1,7)wσ=3(1,7)wˉ+(1,7)σwˉ=3(2,1)σwˉ+(1,7)σwˉ=(7,10)σwˉ=(1,7)1σwˉ \begin{aligned} &(1,7)^{w \sigma 1}=3(1,7)^{w}+(1,7)^{w \sigma}=3(1,7)^{\bar{w}}+(1,7)^{\sigma \bar{w}}=3(2,1)^{\sigma \bar{w}}+(1,7)^{\sigma \bar{w}} \\ &=(7,10)^{\sigma \bar{w}}=(1,7)^{1 \sigma \bar{w}} \end{aligned}

Thus the induction step is complete, (3) and hence also $a_{n}=b_{n}$ are proved.

Comment. The original solution uses the relation

(1,7)αβw=((1,7)w,(1,7)βw)α,α,β{0,1} (1,7)^{\alpha \beta w}=\left((1,7)^{w},(1,7)^{\beta w}\right)^{\alpha}, \quad \alpha, \beta \in\{0,1\}

which can be proved by induction on the length of $w$. Then (3) also follows by induction on the length of $w$ :

(1,7)αβw=((1,7)w,(1,7)βw)α=((1,7)wˉ,(1,7)wˉβ)α=(1,7)wˉβα. (1,7)^{\alpha \beta w}=\left((1,7)^{w},(1,7)^{\beta w}\right)^{\alpha}=\left((1,7)^{\bar{w}},(1,7)^{\bar{w} \beta}\right)^{\alpha}=(1,7)^{\bar{w} \beta \alpha} .

Here $w$ may be the empty word.

C4 NLD (Netherlands)

For an integer $m \geq 1$, we consider partitions of a $2^{m} \times 2^{m}$ chessboard into rectangles consisting of cells of the chessboard, in which each of the $2^{m}$ cells along one diagonal forms a separate rectangle of side length 1 . Determine the smallest possible sum of rectangle perimeters in such a partition.

Solution 1. For a $k \times k$ chessboard, we introduce in a standard way coordinates of the vertices of the cells and assume that the cell $C_{i j}$ in row $i$ and column $j$ has vertices $(i-1, j-1),(i-$ $1, j),(i, j-1),(i, j)$, where $i, j \in{1, \ldots, k}$. Without loss of generality assume that the cells $C_{i i}$, $i=1, \ldots, k$, form a separate rectangle. Then we may consider the boards $B_{k}=\bigcup_{1 \leq i<j \leq k} C_{i j}$ below that diagonal and the congruent board $B_{k}^{\prime}=\bigcup_{1 \leq j<i \leq k} C_{i j}$ above that diagonal separately because no rectangle can simultaneously cover cells from $B_{k}$ and $B_{k}^{\prime}$. We will show that for $k=2^{m}$ the smallest total perimeter of a rectangular partition of $B_{k}$ is $m 2^{m+1}$. Then the overall answer to the problem is $2 \cdot m 2^{m+1}+4 \cdot 2^{m}=(m+1) 2^{m+2}$. First we inductively construct for $m \geq 1$ a partition of $B_{2^{m}}$ with total perimeter $m 2^{m+1}$. If $m=0$, the board $B_{2^{m}}$ is empty and the total perimeter is 0 . For $m \geq 0$, the board $B_{2^{m+1}}$ consists of a $2^{m} \times 2^{m}$ square in the lower right corner with vertices $\left(2^{m}, 2^{m}\right),\left(2^{m}, 2^{m+1}\right),\left(2^{m+1}, 2^{m}\right)$, $\left(2^{m+1}, 2^{m+1}\right)$ to which two boards congruent to $B_{2^{m}}$ are glued along the left and the upper margin. The square together with the inductive partitions of these two boards yield a partition with total perimeter $4 \cdot 2^{m}+2 \cdot m 2^{m+1}=(m+1) 2^{m+2}$ and the induction step is complete. Let

Dk=2klog2k D_{k}=2 k \log _{2} k

Note that $D_{k}=m 2^{m+1}$ if $k=2^{m}$. Now we show by induction on $k$ that the total perimeter of a rectangular partition of $B_{k}$ is at least $D_{k}$. The case $k=1$ is trivial (see $m=0$ from above). Let the assertion be true for all positive integers less than $k$. We investigate a fixed rectangular partition of $B_{k}$ that attains the minimal total perimeter. Let $R$ be the rectangle that covers the cell $C_{1 k}$ in the lower right corner. Let $(i, j)$ be the upper left corner of $R$. First we show that $i=j$. Assume that $i<j$. Then the line from $(i, j)$ to $(i+1, j)$ or from $(i, j)$ to $(i, j-1)$ must belong to the boundary of some rectangle in the partition. Without loss of generality assume that this is the case for the line from $(i, j)$ to $(i+1, j)$. Case 1. No line from $(i, l)$ to $(i+1, l)$ where $j<l<k$ belongs to the boundary of some rectangle of the partition. Then there is some rectangle $R^{\prime}$ of the partition that has with $R$ the common side from $(i, j)$ to $(i, k)$. If we join these two rectangles to one rectangle we get a partition with smaller total perimeter, a contradiction. Case 2. There is some $l$ such that $j<l<k$ and the line from $(i, l)$ to $(i+1, l)$ belongs to the boundary of some rectangle of the partition. Then we replace the upper side of $R$ by the line $(i+1, j)$ to $(i+1, k)$ and for the rectangles whose lower side belongs to the line from $(i, j)$ to $(i, k)$ we shift the lower side upwards so that the new lower side belongs to the line from $(i+1, j)$ to $(i+1, k)$. In such a way we obtain a rectangular partition of $B_{k}$ with smaller total perimeter, a contradiction. Now the fact that the upper left corner of $R$ has the coordinates $(i, i)$ is established. Consequently, the partition consists of $R$, of rectangles of a partition of a board congruent to $B_{i}$ and of rectangles of a partition of a board congruent to $B_{k-i}$. By the induction hypothesis, its total perimeter is at least

2(ki)+2i+Di+Dki2k+2ilog2i+2(ki)log2(ki). 2(k-i)+2 i+D_{i}+D_{k-i} \geq 2 k+2 i \log _{2} i+2(k-i) \log _{2}(k-i) .

Since the function $f(x)=2 x \log {2} x$ is convex for $x>0$, JEnSEN's inequality immediately shows that the minimum of the right hand sight of (1) is attained for $i=k / 2$. Hence the total perimeter of the optimal partition of $B{k}$ is at least $2 k+2 k / 2 \log _{2} k / 2+2(k / 2) \log {2}(k / 2)=D{k}$.

Solution 2. We start as in Solution 1 and present another proof that $m 2^{m+1}$ is a lower bound for the total perimeter of a partition of $B_{2^{m}}$ into $n$ rectangles. Let briefly $M=2^{m}$. For $1 \leq i \leq M$, let $r_{i}$ denote the number of rectangles in the partition that cover some cell from row $i$ and let $c_{j}$ be the number of rectangles that cover some cell from column $j$. Note that the total perimeter $p$ of all rectangles in the partition is

p=2(i=1Mri+i=1Mci). p=2\left(\sum_{i=1}^{M} r_{i}+\sum_{i=1}^{M} c_{i}\right) .

No rectangle can simultaneously cover cells from row $i$ and from column $i$ since otherwise it would also cover the cell $C_{i i}$. We classify subsets $S$ of rectangles of the partition as follows. We say that $S$ is of type $i, 1 \leq i \leq M$, if $S$ contains all $r_{i}$ rectangles that cover some cell from row $i$, but none of the $c_{i}$ rectangles that cover some cell from column $i$. Altogether there are $2^{n-r_{i}-c_{i}}$ subsets of type $i$. Now we show that no subset $S$ can be simultaneously of type $i$ and of type $j$ if $i \neq j$. Assume the contrary and let without loss of generality $i<j$. The cell $C_{i j}$ must be covered by some rectangle $R$. The subset $S$ is of type $i$, hence $R$ is contained in $S$. $S$ is of type $j$, thus $R$ does not belong to $S$, a contradiction. Since there are $2^{n}$ subsets of rectangles of the partition, we infer

2ni=1M2nrici=2ni=1M2(ri+ci) 2^{n} \geq \sum_{i=1}^{M} 2^{n-r_{i}-c_{i}}=2^{n} \sum_{i=1}^{M} 2^{-\left(r_{i}+c_{i}\right)}

By applying Jensen's inequality to the convex function $f(x)=2^{-x}$ we derive

1Mi=1M2(ri+ci)21Mi=1M(ri+ci)=2p2M \frac{1}{M} \sum_{i=1}^{M} 2^{-\left(r_{i}+c_{i}\right)} \geq 2^{-\frac{1}{M} \sum_{i=1}^{M}\left(r_{i}+c_{i}\right)}=2^{-\frac{p}{2 M}}

From (2) and (3) we obtain

1M2p2M 1 \geq M 2^{-\frac{p}{2 M}}

and equivalently

pm2m+1 p \geq m 2^{m+1}

C5 NLD (Netherlands)

Five identical empty buckets of 2-liter capacity stand at the vertices of a regular pentagon. Cinderella and her wicked Stepmother go through a sequence of rounds: At the beginning of every round, the Stepmother takes one liter of water from the nearby river and distributes it arbitrarily over the five buckets. Then Cinderella chooses a pair of neighboring buckets, empties them into the river, and puts them back. Then the next round begins. The Stepmother's goal is to make one of these buckets overflow. Cinderella's goal is to prevent this. Can the wicked Stepmother enforce a bucket overflow?

Solution 1. No, the Stepmother cannot enforce a bucket overflow and Cinderella can keep playing forever. Throughout we denote the five buckets by $B_{0}, B_{1}, B_{2}, B_{3}$, and $B_{4}$, where $B_{k}$ is adjacent to bucket $B_{k-1}$ and $B_{k+1}(k=0,1,2,3,4)$ and all indices are taken modulo 5 . Cinderella enforces that the following three conditions are satisfied at the beginning of every round: (1) Two adjacent buckets (say $B_{1}$ and $B_{2}$ ) are empty. (2) The two buckets standing next to these adjacent buckets (here $B_{0}$ and $B_{3}$ ) have total contents at most 1. (3) The remaining bucket (here $B_{4}$ ) has contents at most 1 .

These conditions clearly hold at the beginning of the first round, when all buckets are empty. Assume that Cinderella manages to maintain them until the beginning of the $r$-th round $(r \geq 1)$. Denote by $x_{k}(k=0,1,2,3,4)$ the contents of bucket $B_{k}$ at the beginning of this round and by $y_{k}$ the corresponding contents after the Stepmother has distributed her liter of water in this round. By the conditions, we can assume $x_{1}=x_{2}=0, x_{0}+x_{3} \leq 1$ and $x_{4} \leq 1$. Then, since the Stepmother adds one liter, we conclude $y_{0}+y_{1}+y_{2}+y_{3} \leq 2$. This inequality implies $y_{0}+y_{2} \leq 1$ or $y_{1}+y_{3} \leq 1$. For reasons of symmetry, we only consider the second case. Then Cinderella empties buckets $B_{0}$ and $B_{4}$. At the beginning of the next round $B_{0}$ and $B_{4}$ are empty (condition (1) is fulfilled), due to $y_{1}+y_{3} \leq 1$ condition (2) is fulfilled and finally since $x_{2}=0$ we also must have $y_{2} \leq 1$ (condition (3) is fulfilled).

Therefore, Cinderella can indeed manage to maintain the three conditions (1)-(3) also at the beginning of the $(r+1)$-th round. By induction, she thus manages to maintain them at the beginning of every round. In particular she manages to keep the contents of every single bucket at most 1 liter. Therefore, the buckets of 2-liter capacity will never overflow.

Solution 2. We prove that Cinderella can maintain the following two conditions and hence she can prevent the buckets from overflow: (1') Every two non-adjacent buckets contain a total of at most 1. (2') The total contents of all five buckets is at most $\frac{3}{2}$. We use the same notations as in the first solution. The two conditions again clearly hold at the beginning. Assume that Cinderella maintained these two conditions until the beginning of the $r$-th round. A pair of non-neighboring buckets $\left(B_{i}, B_{i+2}\right), i=0,1,2,3,4$ is called critical if $y_{i}+y_{i+2}>1$. By condition $\left(2^{\prime}\right)$, after the Stepmother has distributed her water we have $y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$. Therefore,

(y0+y2)+(y1+y3)+(y2+y4)+(y3+y0)+(y4+y1)=2(y0+y1+y2+y3+y4)5 \left(y_{0}+y_{2}\right)+\left(y_{1}+y_{3}\right)+\left(y_{2}+y_{4}\right)+\left(y_{3}+y_{0}\right)+\left(y_{4}+y_{1}\right)=2\left(y_{0}+y_{1}+y_{2}+y_{3}+y_{4}\right) \leq 5

and hence there is a pair of non-neighboring buckets which is not critical, say $\left(B_{0}, B_{2}\right)$. Now, if both of the pairs $\left(B_{3}, B_{0}\right)$ and $\left(B_{2}, B_{4}\right)$ are critical, we must have $y_{1}<\frac{1}{2}$ and Cinderella can empty the buckets $B_{3}$ and $B_{4}$. This clearly leaves no critical pair of buckets and the total contents of all the buckets is then $y_{1}+\left(y_{0}+y_{2}\right) \leq \frac{3}{2}$. Therefore, conditions $\left(1^{\prime}\right)$ and $\left(2^{\prime}\right)$ are fulfilled.

Now suppose that without loss of generality the pair $\left(B_{3}, B_{0}\right)$ is not critical. If in this case $y_{0} \leq \frac{1}{2}$, then one of the inequalities $y_{0}+y_{1}+y_{2} \leq \frac{3}{2}$ and $y_{0}+y_{3}+y_{4} \leq \frac{3}{2}$ must hold. But then Cinderella can empty $B_{3}$ and $B_{4}$ or $B_{1}$ and $B_{2}$, respectively and clearly fulfill the conditions. Finally consider the case $y_{0}>\frac{1}{2}$. By $y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$, at least one of the pairs $\left(B_{1}, B_{3}\right)$ and $\left(B_{2}, B_{4}\right)$ is not critical. Without loss of generality let this be the pair $\left(B_{1}, B_{3}\right)$. Since the pair $\left(B_{3}, B_{0}\right)$ is not critical and $y_{0}>\frac{1}{2}$, we must have $y_{3} \leq \frac{1}{2}$. But then, as before, Cinderella can maintain the two conditions at the beginning of the next round by either emptying $B_{1}$ and $B_{2}$ or $B_{4}$ and $B_{0}$.

Comments on GREEDY approaches. A natural approach for Cinderella would be a GREEDY strategy as for example: Always remove as much water as possible from the system. It is straightforward to prove that GREEDY can avoid buckets of capacity $\frac{5}{2}$ from overflowing: If before the Stepmothers move one has $x_{0}+x_{1}+x_{2}+x_{3}+x_{4} \leq \frac{3}{2}$ then after her move the inequality $Y=y_{0}+y_{1}+y_{2}+y_{3}+y_{4} \leq \frac{5}{2}$ holds. If now Cinderella removes the two adjacent buckets with maximum total contents she removes at least $\frac{2 Y}{5}$ and thus the remaining buckets contain at most $\frac{3}{5} \cdot Y \leq \frac{3}{2}$. But GREEDY is in general not strong enough to settle this problem as can be seen in the following example:

  • In an initial phase, the Stepmother brings all the buckets (after her move) to contents of at least $\frac{1}{2}-2 \epsilon$, where $\epsilon$ is an arbitrary small positive number. This can be done by always splitting the 1 liter she has to distribute so that all buckets have the same contents. After her $r$-th move the total contents of each of the buckets is then $c_{r}$ with $c_{1}=1$ and $c_{r+1}=1+\frac{3}{5} \cdot c_{r}$ and hence $c_{r}=\frac{5}{2}-\frac{3}{2} \cdot\left(\frac{3}{5}\right)^{r-1}$. So the contents of each single bucket indeed approaches $\frac{1}{2}$ (from below). In particular, any two adjacent buckets have total contents strictly less than 1 which enables the Stepmother to always refill the buckets that Cinderella just emptied and then distribute the remaining water evenly over all buckets.
  • After that phase GREEDY faces a situation like this ( $\left.\frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon\right)$ and leaves a situation of the form $\left(x_{0}, x_{1}, x_{2}, x_{3}, x_{4}\right)=\left(\frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, \frac{1}{2}-2 \epsilon, 0,0\right)$.
  • Then the Stepmother can add the amounts $\left(0, \frac{1}{4}+\epsilon, \epsilon, \frac{3}{4}-2 \epsilon, 0\right)$ to achieve a situation like this: $\left(y_{0}, y_{1}, y_{2}, y_{3}, y_{4}\right)=\left(\frac{1}{2}-2 \epsilon, \frac{3}{4}-\epsilon, \frac{1}{2}-\epsilon, \frac{3}{4}-2 \epsilon, 0\right)$.
  • Now $B_{1}$ and $B_{2}$ are the adjacent buckets with the maximum total contents and thus GREEDY empties them to yield $\left(x_{0}, x_{1}, x_{2}, x_{3}, x_{4}\right)=\left(\frac{1}{2}-2 \epsilon, 0,0, \frac{3}{4}-2 \epsilon, 0\right)$.
  • Then the Stepmother adds $\left(\frac{5}{8}, 0,0, \frac{3}{8}, 0\right)$, which yields $\left(\frac{9}{8}-2 \epsilon, 0,0, \frac{9}{8}-2 \epsilon, 0\right)$.
  • Now GREEDY can only empty one of the two nonempty buckets and in the next step the Stepmother adds her liter to the other bucket and brings it to $\frac{17}{8}-2 \epsilon$, i.e. an overflow.

A harder variant. Five identical empty buckets of capacity $b$ stand at the vertices of a regular pentagon. Cinderella and her wicked Stepmother go through a sequence of rounds: At the beginning of every round, the Stepmother takes one liter of water from the nearby river and distributes it arbitrarily over the five buckets. Then Cinderella chooses a pair of neighboring buckets, empties them into the river, and puts them back. Then the next round begins. The Stepmother's goal is to make one of these buckets overflow. Cinderella's goal is to prevent this. Determine all bucket capacities $b$ for which the Stepmother can enforce a bucket to overflow.

Solution to the harder variant. The answer is $b<2$. The previous proof shows that for all $b \geq 2$ the Stepmother cannot enforce overflowing. Now if $b<2$, let $R$ be a positive integer such that $b<2-2^{1-R}$. In the first $R$ rounds the Stepmother now ensures that at least one of the (nonadjacent) buckets $B_{1}$ and $B_{3}$ have contents of at least $1-2^{1-r}$ at the beginning of round $r(r=1,2, \ldots, R)$. This is trivial for $r=1$ and if it holds at the beginning of round $r$, she can fill the bucket which contains at least $1-2^{1-r}$ liters with another $2^{-r}$ liters and put the rest of her water $-1-2^{-r}$ liters - in the other bucket. As Cinderella now can remove the water of at most one of the two buckets, the other bucket carries its contents into the next round. At the beginning of the $R$-th round there are $1-2^{1-R}$ liters in $B_{1}$ or $B_{3}$. The Stepmother puts the entire liter into that bucket and produces an overflow since $b<2-2^{1-R}$.

C6 BGR (Bulgaria)

On a $999 \times 999$ board a limp rook can move in the following way: From any square it can move to any of its adjacent squares, i.e. a square having a common side with it, and every move must be a turn, i.e. the directions of any two consecutive moves must be perpendicular. A nonintersecting route of the limp rook consists of a sequence of pairwise different squares that the limp rook can visit in that order by an admissible sequence of moves. Such a non-intersecting route is called cyclic, if the limp rook can, after reaching the last square of the route, move directly to the first square of the route and start over. How many squares does the longest possible cyclic, non-intersecting route of a limp rook visit?

Solution. The answer is $998^{2}-4=4 \cdot\left(499^{2}-1\right)$ squares. First we show that this number is an upper bound for the number of cells a limp rook can visit. To do this we color the cells with four colors $A, B, C$ and $D$ in the following way: for $(i, j) \equiv(0,0) \bmod 2$ use $A$, for $(i, j) \equiv(0,1) \bmod 2$ use $B$, for $(i, j) \equiv(1,0) \bmod 2$ use $C$ and for $(i, j) \equiv(1,1) \bmod 2$ use $D$. From an $A$-cell the rook has to move to a $B$-cell or a $C$-cell. In the first case, the order of the colors of the cells visited is given by $A, B, D, C, A, B, D, C, A, \ldots$, in the second case it is $A, C, D, B, A, C, D, B, A, \ldots$ Since the route is closed it must contain the same number of cells of each color. There are only $499^{2} A$-cells. In the following we will show that the rook cannot visit all the $A$-cells on its route and hence the maximum possible number of cells in a route is $4 \cdot\left(499^{2}-1\right)$. Assume that the route passes through every single $A$-cell. Color the $A$-cells in black and white in a chessboard manner, i.e. color any two $A$-cells at distance 2 in different color. Since the number of $A$-cells is odd the rook cannot always alternate between visiting black and white $A$-cells along its route. Hence there are two $A$-cells of the same color which are four rook-steps apart that are visited directly one after the other. Let these two $A$-cells have row and column numbers $(a, b)$ and $(a+2, b+2)$ respectively.

There is up to reflection only one way the rook can take from $(a, b)$ to $(a+2, b+2)$. Let this way be $(a, b) \rightarrow(a, b+1) \rightarrow(a+1, b+1) \rightarrow(a+1, b+2) \rightarrow(a+2, b+2)$. Also let without loss of generality the color of the cell $(a, b+1)$ be $B$ (otherwise change the roles of columns and rows). Now consider the $A$-cell $(a, b+2)$. The only way the rook can pass through it is via $(a-1, b+2) \rightarrow$ $(a, b+2) \rightarrow(a, b+3)$ in this order, since according to our assumption after every $A$-cell the rook passes through a $B$-cell. Hence, to connect these two parts of the path, there must be a path connecting the cell $(a, b+3)$ and $(a, b)$ and also a path connecting $(a+2, b+2)$ and $(a-1, b+2)$.

But these four cells are opposite vertices of a convex quadrilateral and the paths are outside of that quadrilateral and hence they must intersect. This is due to the following fact: The path from $(a, b)$ to $(a, b+3)$ together with the line segment joining these two cells form a closed loop that has one of the cells $(a-1, b+2)$ and $(a+2, b+2)$ in its inside and the other one on the outside. Thus the path between these two points must cross the previous path. But an intersection is only possible if a cell is visited twice. This is a contradiction. Hence the number of cells visited is at most $4 \cdot\left(499^{2}-1\right)$. The following picture indicates a recursive construction for all $n \times n$-chessboards with $n \equiv 3$ $\bmod 4$ which clearly yields a path that misses exactly one $A$-cell (marked with a dot, the center cell of the $15 \times 15$-chessboard) and hence, in the case of $n=999$ crosses exactly $4 \cdot\left(499^{2}-1\right)$ cells.

C7 RUS (Russian Federation)

Variant 1. A grasshopper jumps along the real axis. He starts at point 0 and makes 2009 jumps to the right with lengths $1,2, \ldots, 2009$ in an arbitrary order. Let $M$ be a set of 2008 positive integers less than $1005 \cdot 2009$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$.

Variant 2. Let $n$ be a nonnegative integer. A grasshopper jumps along the real axis. He starts at point 0 and makes $n+1$ jumps to the right with pairwise different positive integral lengths $a_{1}, a_{2}, \ldots, a_{n+1}$ in an arbitrary order. Let $M$ be a set of $n$ positive integers in the interval $(0, s)$, where $s=a_{1}+a_{2}+\cdots+a_{n+1}$. Prove that the grasshopper can arrange his jumps in such a way that he never lands on a point from $M$.

Solution of Variant 1. We construct the set of landing points of the grasshopper. Case 1. $M$ does not contain numbers divisible by 2009. We fix the numbers $2009 k$ as landing points, $k=1,2, \ldots, 1005$. Consider the open intervals $I_{k}=(2009(k-1), 2009 k), k=1,2, \ldots, 1005$. We show that we can choose exactly one point outside of $M$ as a landing point in 1004 of these intervals such that all lengths from 1 to 2009 are realized. Since there remains one interval without a chosen point, the length 2009 indeed will appear. Each interval has length 2009, hence a new landing point in an interval yields with a length $d$ also the length $2009-d$. Thus it is enough to implement only the lengths from $D={1,2, \ldots, 1004}$. We will do this in a greedy way. Let $n_{k}, k=1,2, \ldots, 1005$, be the number of elements of $M$ that belong to the interval $I_{k}$. We order these numbers in a decreasing way, so let $p_{1}, p_{2}, \ldots, p_{1005}$ be a permutation of ${1,2, \ldots, 1005}$ such that $n_{p_{1}} \geq n_{p_{2}} \geq \cdots \geq n_{p_{1005}}$. In $I_{p_{1}}$ we do not choose a landing point. Assume that landing points have already been chosen in the intervals $I_{p_{2}}, \ldots, I_{p_{m}}$ and the lengths $d_{2}, \ldots, d_{m}$ from $D$ are realized, $m=1, \ldots, 1004$. We show that there is some $d \in D \backslash\left{d_{2}, \ldots, d_{m}\right}$ that can be implemented with a new landing point in $I_{p_{m+1}}$. Assume the contrary. Then the $1004-(m-1)$ other lengths are obstructed by the $n_{p_{m+1}}$ points of $M$ in $I_{p_{m+1}}$. Each length $d$ can be realized by two landing points, namely $2009\left(p_{m+1}-1\right)+d$ and $2009 p_{m+1}-d$, hence

npm+12(1005m) n_{p_{m+1}} \geq 2(1005-m)

Moreover, since $|M|=2008=n_{1}+\cdots+n_{1005}$,

2008np1+np2++npm+1(m+1)npm+1 2008 \geq n_{p_{1}}+n_{p_{2}}+\cdots+n_{p_{m+1}} \geq(m+1) n_{p_{m+1}}

Consequently, by (1) and (2),

20082(m+1)(1005m) 2008 \geq 2(m+1)(1005-m)

The right hand side of the last inequality obviously attains its minimum for $m=1004$ and this minimum value is greater than 2008, a contradiction. Case 2. $M$ does contain a number $\mu$ divisible by 2009. By the pigeonhole principle there exists some $r \in{1, \ldots, 2008}$ such that $M$ does not contain numbers with remainder $r$ modulo 2009. We fix the numbers $2009(k-1)+r$ as landing points, $k=1,2, \ldots, 1005$. Moreover, $1005 \cdot 2009$ is a landing point. Consider the open intervals $I_{k}=(2009(k-1)+r, 2009 k+r), k=1,2, \ldots, 1004$. Analogously to Case 1 , it is enough to show that we can choose in 1003 of these intervals exactly one landing point outside of $M \backslash{\mu}$ such that each of the lengths of $D={1,2, \ldots, 1004} \backslash{r}$ are implemented. Note that $r$ and $2009-r$ are realized by the first and last jump and that choosing $\mu$ would realize these two differences again. Let $n_{k}, k=1,2, \ldots, 1004$, be the number of elements of $M \backslash{\mu}$ that belong to the interval $I_{k}$ and $p_{1}, p_{2}, \ldots, p_{1004}$ be a permutation of ${1,2, \ldots, 1004}$ such that $n_{p_{1}} \geq n_{p_{2}} \geq \cdots \geq n_{p_{1004}}$. With the same reasoning as in Case 1 we can verify that a greedy choice of the landing points in $I_{p_{2}}, I_{p_{3}}, \ldots, I_{p_{1004}}$ is possible. We only have to replace (1) by

npm+12(1004m) n_{p_{m+1}} \geq 2(1004-m)

( $D$ has one element less) and (2) by

2007np1+np2++npm+1(m+1)npm+1 2007 \geq n_{p_{1}}+n_{p_{2}}+\cdots+n_{p_{m+1}} \geq(m+1) n_{p_{m+1}}

Comment. The cardinality 2008 of $M$ in the problem is the maximum possible value. For $M={1,2, \ldots, 2009}$, the grasshopper necessarily lands on a point from $M$.

Solution of Variant 2. First of all we remark that the statement in the problem implies a strengthening of itself: Instead of $|M|=n$ it is sufficient to suppose that $|M \cap(0, s-\bar{a}]| \leq n$, where $\bar{a}=\min \left{a_{1}, a_{2}, \ldots, a_{n+1}\right}$. This fact will be used in the proof. We prove the statement by induction on $n$. The case $n=0$ is obvious. Let $n>0$ and let the assertion be true for all nonnegative integers less than $n$. Moreover let $a_{1}, a_{2}, \ldots, a_{n+1}, s$ and $M$ be given as in the problem. Without loss of generality we may assume that $a_{n+1}<a_{n}<$ $\cdots<a_{2}<a_{1}$. Set

Tk=i=1kai for k=0,1,,n+1 T_{k}=\sum_{i=1}^{k} a_{i} \quad \text { for } k=0,1, \ldots, n+1

Note that $0=T_{0}<T_{1}<\cdots<T_{n+1}=s$. We will make use of the induction hypothesis as follows:

Claim 1. It suffices to show that for some $m \in{1,2, \ldots, n+1}$ the grasshopper is able to do at least $m$ jumps without landing on a point of $M$ and, in addition, after these $m$ jumps he has jumped over at least $m$ points of $M$. Proof. Note that $m=n+1$ is impossible by $|M|=n$. Now set $n^{\prime}=n-m$. Then $0 \leq n^{\prime}<n$. The remaining $n^{\prime}+1$ jumps can be carried out without landing on one of the remaining at most $n^{\prime}$ forbidden points by the induction hypothesis together with a shift of the origin. This proves the claim. An integer $k \in{1,2, \ldots, n+1}$ is called smooth, if the grasshopper is able to do $k$ jumps with the lengths $a_{1}, a_{2}, \ldots, a_{k}$ in such a way that he never lands on a point of $M$ except for the very last jump, when he may land on a point of $M$. Obviously, 1 is smooth. Thus there is a largest number $k^{}$, such that all the numbers $1,2, \ldots, k^{}$ are smooth. If $k^{}=n+1$, the proof is complete. In the following let $k^{} \leq n$. Claim 2. We have

TkM and M(0,Tk)k. T_{k^{*}} \in M \quad \text { and } \quad\left|M \cap\left(0, T_{k^{*}}\right)\right| \geq k^{*} .

Proof. In the case $T_{k^{}} \notin M$ any sequence of jumps that verifies the smoothness of $k^{}$ can be extended by appending $a_{k^{}+1}$, which is a contradiction to the maximality of $k^{}$. Therefore we have $T_{k^{}} \in M$. If $\left|M \cap\left(0, T_{k^{}}\right)\right|<k^{}$, there exists an $l \in\left{1,2, \ldots, k^{}\right}$ with $T_{k^{}+1}-a_{l} \notin M$. By the induction hypothesis with $k^{}-1$ instead of $n$, the grasshopper is able to reach $T_{k^{}+1}-a_{l}$ with $k^{}$ jumps of lengths from $\left{a_{1}, a_{2}, \ldots, a_{k^{}+1}\right} \backslash\left{a_{l}\right}$ without landing on any point of $M$. Therefore $k^{}+1$ is also smooth, which is a contradiction to the maximality of $k^{}$. Thus Claim 2 is proved. Now, by Claim 2, there exists a smallest integer $\bar{k} \in\left{1,2, \ldots, k^{}\right}$ with

TkˉM and M(0,Tkˉ)kˉ T_{\bar{k}} \in M \quad \text { and } \quad\left|M \cap\left(0, T_{\bar{k}}\right)\right| \geq \bar{k}

Claim 3. It is sufficient to consider the case

M(0,Tkˉ1]kˉ1 \left|M \cap\left(0, T_{\bar{k}-1}\right]\right| \leq \bar{k}-1

Proof. If $\bar{k}=1$, then (4) is clearly satisfied. In the following let $\bar{k}>1$. If $T_{\bar{k}-1} \in M$, then (4.) follows immediately by the minimality of $\bar{k}$. If $T_{\bar{k}-1} \notin M$, by the smoothness of $\bar{k}-1$, we obtain a situation as in Claim 1 with $m=\bar{k}-1$ provided that $\mid M \cap\left(0, T_{\bar{k}-1}| | \geq \bar{k}-1\right.$. Hence, we may even restrict ourselves to $\mid M \cap\left(0, T_{\bar{k}-1} \mid \leq \bar{k}-2\right.$ in this case and Claim 3 is proved. Choose an integer $v \geq 0$ with $\left|M \cap\left(0, T_{\bar{k}}\right)\right|=\bar{k}+v$. Let $r_{1}>r_{2}>\cdots>r_{l}$ be exactly those indices $r$ from ${\bar{k}+1, \bar{k}+2, \ldots, n+1}$ for which $T_{\bar{k}}+a_{r} \notin M$. Then

n=M=M(0,Tkˉ)+1+M(Tkˉ,s)kˉ+v+1+(n+1kˉl) n=|M|=\left|M \cap\left(0, T_{\bar{k}}\right)\right|+1+\left|M \cap\left(T_{\bar{k}}, s\right)\right| \geq \bar{k}+v+1+(n+1-\bar{k}-l)

and consequently $l \geq v+2$. Note that $T_{\bar{k}}+a_{r_{1}}-a_{1}<T_{\bar{k}}+a_{r_{1}}-a_{2}<\cdots<T_{\bar{k}}+a_{r_{1}}-a_{\bar{k}}<T_{\bar{k}}+a_{r_{2}}-a_{\bar{k}}<\cdots<T_{\bar{k}}+a_{r_{v+2}}-a_{\bar{k}}<T_{\bar{k}}$ and that this are $\bar{k}+v+1$ numbers from $\left(0, T_{\bar{k}}\right)$. Therefore we find some $r \in{\bar{k}+1, \bar{k}+$ $2, \ldots, n+1}$ and some $s \in{1,2, \ldots, \bar{k}}$ with $T_{\bar{k}}+a_{r} \notin M$ and $T_{\bar{k}}+a_{r}-a_{s} \notin M$. Consider the set of jump lengths $B=\left{a_{1}, a_{2}, \ldots, a_{\bar{k}}, a_{r}\right} \backslash\left{a_{s}\right}$. We have

xBx=Tkˉ+aras \sum_{x \in B} x=T_{\bar{k}}+a_{r}-a_{s}

and

Tkˉ+arasmin(B)=TkˉasTkˉ1. T_{\bar{k}}+a_{r}-a_{s}-\min (B)=T_{\bar{k}}-a_{s} \leq T_{\bar{k}-1} .

By (4) and the strengthening, mentioned at the very beginning with $\bar{k}-1$ instead of $n$, the grasshopper is able to reach $T_{\bar{k}}+a_{r}-a_{s}$ by $\bar{k}$ jumps with lengths from $B$ without landing on any point of $M$. From there he is able to jump to $T_{\bar{k}}+a_{r}$ and therefore we reach a situation as in Claim 1 with $m=\bar{k}+1$, which completes the proof.

C8 AUT (Austria)

For any integer $n \geq 2$, we compute the integer $h(n)$ by applying the following procedure to its decimal representation. Let $r$ be the rightmost digit of $n$. (1) If $r=0$, then the decimal representation of $h(n)$ results from the decimal representation of $n$ by removing this rightmost digit 0 . (2) If $1 \leq r \leq 9$ we split the decimal representation of $n$ into a maximal right part $R$ that solely consists of digits not less than $r$ and into a left part $L$ that either is empty or ends with a digit strictly smaller than $r$. Then the decimal representation of $h(n)$ consists of the decimal representation of $L$, followed by two copies of the decimal representation of $R-1$. For instance, for the number $n=17,151,345,543$, we will have $L=17,151, R=345,543$ and $h(n)=17,151,345,542,345,542$. Prove that, starting with an arbitrary integer $n \geq 2$, iterated application of $h$ produces the integer 1 after finitely many steps.

Solution 1. We identify integers $n \geq 2$ with the digit-strings, briefly strings, of their decimal representation and extend the definition of $h$ to all non-empty strings with digits from 0 to 9. We recursively define ten functions $f_{0}, \ldots, f_{9}$ that map some strings into integers for $k=$ $9,8, \ldots, 1,0$. The function $f_{9}$ is only defined on strings $x$ (including the empty string $\varepsilon$ ) that entirely consist of nines. If $x$ consists of $m$ nines, then $f_{9}(x)=m+1, m=0,1, \ldots$ For $k \leq 8$, the domain of $f_{k}(x)$ is the set of all strings consisting only of digits that are $\geq k$. We write $x$ in the form $x_{0} k x_{1} k x_{2} k \ldots x_{m-1} k x_{m}$ where the strings $x_{s}$ only consist of digits $\geq k+1$. Note that some of these strings might equal the empty string $\varepsilon$ and that $m=0$ is possible, i.e. the digit $k$ does not appear in $x$. Then we define

fk(x)=s=0m4fk+1(xs) f_{k}(x)=\sum_{s=0}^{m} 4^{f_{k+1}\left(x_{s}\right)}

We will use the following obvious fact: Fact 1. If $x$ does not contain digits smaller than $k$, then $f_{i}(x)=4^{f_{i+1}(x)}$ for all $i=0, \ldots, k-1$. In particular, $f_{i}(\varepsilon)=4^{9-i}$ for all $i=0,1, \ldots, 9$. Moreover, by induction on $k=9,8, \ldots, 0$ it follows easily: Fact 2. If the nonempty string $x$ does not contain digits smaller than $k$, then $f_{i}(x)>f_{i}(\varepsilon)$ for all $i=0, \ldots, k$. We will show the essential fact: Fact 3. $f_{0}(n)>f_{0}(h(n))$. Then the empty string will necessarily be reached after a finite number of applications of $h$. But starting from a string without leading zeros, $\varepsilon$ can only be reached via the strings $1 \rightarrow 00 \rightarrow 0 \rightarrow \varepsilon$. Hence also the number 1 will appear after a finite number of applications of $h$. Proof of Fact 3. If the last digit $r$ of $n$ is 0 , then we write $n=x_{0} 0 \ldots 0 x_{m-1} 0 \varepsilon$ where the $x_{i}$ do not contain the digit 0 . Then $h(n)=x_{0} 0 \ldots 0 x_{m-1}$ and $f_{0}(n)-f_{0}(h(n))=f_{0}(\varepsilon)>0$. So let the last digit $r$ of $n$ be at least 1 . Let $L=y k$ and $R=z r$ be the corresponding left and right parts where $y$ is some string, $k \leq r-1$ and the string $z$ consists only of digits not less than $r$. Then $n=y k z r$ and $h(n)=y k z(r-1) z(r-1)$. Let $d(y)$ be the smallest digit of $y$. We consider two cases which do not exclude each other.

Case 1. $d(y) \geq k$. Then

fk(n)fk(h(n))=fk(zr)fk(z(r1)z(r1)). f_{k}(n)-f_{k}(h(n))=f_{k}(z r)-f_{k}(z(r-1) z(r-1)) .

In view of Fact 1 this difference is positive if and only if

fr1(zr)fr1(z(r1)z(r1))>0 f_{r-1}(z r)-f_{r-1}(z(r-1) z(r-1))>0

We have, using Fact 2,

fr1(zr)=4fr(zr)=4fr(z)+4fr+1(z)44fr(z)>4fr(z)+4fr(z)+4fr(z)=fr1(z(r1)z(r1)). f_{r-1}(z r)=4^{f_{r}(z r)}=4^{f_{r}(z)+4^{f_{r+1}(z)}} \geq 4 \cdot 4^{f_{r}(z)}>4^{f_{r}(z)}+4^{f_{r}(z)}+4^{f_{r}(z)}=f_{r-1}(z(r-1) z(r-1)) .

Here we use the additional definition $f_{10}(\varepsilon)=0$ if $r=9$. Consequently, $f_{k}(n)-f_{k}(h(n))>0$ and according to Fact $1, f_{0}(n)-f_{0}(h(n))>0$. Case 2. $d(y) \leq k$. We prove by induction on $d(y)=k, k-1, \ldots, 0$ that $f_{i}(n)-f_{i}(h(n))>0$ for all $i=0, \ldots, d(y)$. By Fact 1, it suffices to do so for $i=d(y)$. The initialization $d(y)=k$ was already treated in Case 1. Let $t=d(y)<k$. Write $y$ in the form utv where $v$ does not contain digits $\leq t$. Then, in view of the induction hypothesis,

ft(n)ft(h(n))=ft(vkzr)ft(vkz(r1)z(r1))=4ft+1(vkzr)4ft+1(vkz(r1)z(r1))>0 f_{t}(n)-f_{t}(h(n))=f_{t}(v k z r)-f_{t}(v k z(r-1) z(r-1))=4^{f_{t+1}(v k z r)}-4^{f_{t+1}(v k z(r-1) z(r-1))}>0

Thus the inequality $f_{d(y)}(n)-f_{d(y)}(h(n))>0$ is established and from Fact 1 it follows that $f_{0}(n)-f_{0}(h(n))>0$.

Solution 2. We identify integers $n \geq 2$ with the digit-strings, briefly strings, of their decimal representation and extend the definition of $h$ to all non-empty strings with digits from 0 to 9. Moreover, let us define that the empty string, $\varepsilon$, is being mapped to the empty string. In the following all functions map the set of strings into the set of strings. For two functions $f$ and $g$ let $g \circ f$ be defined by $(g \circ f)(x)=g(f(x))$ for all strings $x$ and let, for non-negative integers $n$, $f^{n}$ denote the $n$-fold application of $f$. For any string $x$ let $s(x)$ be the smallest digit of $x$, and for the empty string let $s(\varepsilon)=\infty$. We define nine functions $g_{1}, \ldots, g_{9}$ as follows: Let $k \in{1, \ldots, 9}$ and let $x$ be a string. If $x=\varepsilon$ then $g_{k}(x)=\varepsilon$. Otherwise, write $x$ in the form $x=y z r$ where $y$ is either the empty string or ends with a digit smaller than $k, s(z) \geq k$ and $r$ is the rightmost digit of $x$. Then $g_{k}(x)=z r$.

Lemma 1. We have $g_{k} \circ h=g_{k} \circ h \circ g_{k}$ for all $k=1, \ldots, 9$. Proof of Lemma 1. Let $x=y z r$ be as in the definition of $g_{k}$. If $y=\varepsilon$, then $g_{k}(x)=x$, whence

gk(h(x))=gk(h(gk(x)). g_{k}(h(x))=g_{k}\left(h\left(g_{k}(x)\right) .\right.

So let $y \neq \varepsilon$. Case 1. $z$ contains a digit smaller than $r$. Let $z=u a v$ where $a<r$ and $s(v) \geq r$. Then

h(x)={ yuav  if r=0yuav(r1)v(r1) if r>0 h(x)= \begin{cases}\text { yuav } & \text { if } r=0 \\ \operatorname{yuav}(r-1) v(r-1) & \text { if } r>0\end{cases}

and

h(gk(x))=h(zr)=h( uavr )={uav if r=0uav(r1)v(r1) if r>0 h\left(g_{k}(x)\right)=h(z r)=h(\text { uavr })= \begin{cases}\operatorname{uav} & \text { if } r=0 \\ \operatorname{uav}(r-1) v(r-1) & \text { if } r>0\end{cases}

Since $y$ ends with a digit smaller than $k$, (1) is obviously true. Case 2. $z$ does not contain a digit smaller than $r$. Let $y=u v$ where $u$ is either the empty string or ends with a digit smaller than $r$ and $s(v) \geq r$. We have

h(x)={uvz if r=0uvz(r1)vz(r1) if r>0 h(x)= \begin{cases}u v z & \text { if } r=0 \\ u v z(r-1) v z(r-1) & \text { if } r>0\end{cases}

and

h(gk(x))=h(zr)={z if r=0z(r1)z(r1) if r>0 h\left(g_{k}(x)\right)=h(z r)= \begin{cases}z & \text { if } r=0 \\ z(r-1) z(r-1) & \text { if } r>0\end{cases}

Recall that $y$ and hence $v$ ends with a digit smaller than $k$, but all digits of $v$ are at least $r$. Now if $r>k$, then $v=\varepsilon$, whence the terminal digit of $u$ is smaller than $k$, which entails

gk(h(x))=z(r1)z(r1)=gk(h(gk(x))). g_{k}(h(x))=z(r-1) z(r-1)=g_{k}\left(h\left(g_{k}(x)\right)\right) .

If $r \leq k$, then

gk(h(x))=z(r1)=gk(h(gk(x))), g_{k}(h(x))=z(r-1)=g_{k}\left(h\left(g_{k}(x)\right)\right),

so that in both cases (1) is true. Thus Lemma 1 is proved. Lemma 2. Let $k \in{1, \ldots, 9}$, let $x$ be a non-empty string and let $n$ be a positive integer. If $h^{n}(x)=\varepsilon$ then $\left(g_{k} \circ h\right)^{n}(x)=\varepsilon$. Proof of Lemma 2. We proceed by induction on $n$. If $n=1$ we have

ε=h(x)=gk(h(x))=(gkh)(x). \varepsilon=h(x)=g_{k}(h(x))=\left(g_{k} \circ h\right)(x) .

Now consider the step from $n-1$ to $n$ where $n \geq 2$. Let $h^{n}(x)=\varepsilon$ and let $y=h(x)$. Then $h^{n-1}(y)=\varepsilon$ and by the induction hypothesis $\left(g_{k} \circ h\right)^{n-1}(y)=\varepsilon$. In view of Lemma 1 ,

ε=(gkh)n2((gkh)(y))=(gkh)n2(gk(h(y))=(gkh)n2(gk(h(gk(y)))=(gkh)n2(gk(h(gk(h(x))))=(gkh)n(x) \begin{aligned} & \varepsilon=\left(g_{k} \circ h\right)^{n-2}\left(\left(g_{k} \circ h\right)(y)\right)=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}(h(y))\right. \\ &=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}\left(h\left(g_{k}(y)\right)\right)=\left(g_{k} \circ h\right)^{n-2}\left(g_{k}\left(h\left(g_{k}(h(x))\right)\right)=\left(g_{k} \circ h\right)^{n}(x)\right.\right. \end{aligned}

Thus the induction step is complete and Lemma 2 is proved. We say that the non-empty string $x$ terminates if $h^{n}(x)=\varepsilon$ for some non-negative integer $n$. Lemma 3. Let $x=y z r$ where $s(y) \geq k, s(z) \geq k, y$ ends with the digit $k$ and $z$ is possibly empty. If $y$ and $z r$ terminate then also $x$ terminates. Proof of Lemma 3. Suppose that $y$ and $z r$ terminate. We proceed by induction on $k$. Let $k=0$. Obviously, $h(y w)=y h(w)$ for any non-empty string $w$. Let $h^{n}(z r)=\epsilon$. It follows easily by induction on $m$ that $h^{m}(y z r)=y h^{m}(z r)$ for $m=1, \ldots, n$. Consequently, $h^{n}(y z r)=y$. Since $y$ terminates, also $x=y z r$ terminates. Now let the assertion be true for all nonnegative integers less than $k$ and let us prove it for $k$ where $k \geq 1$. It turns out that it is sufficient to prove that $y g_{k}(h(z r))$ terminates. Indeed: Case 1. $r=0$. Then $h(y z r)=y z=y g_{k}(h(z r))$. Case 2. $0<r \leq k$. We have $h(z r)=z(r-1) z(r-1)$ and $g_{k}(h(z r))=z(r-1)$. Then $h(y z r)=y z(r-1) y z(r-$ $1)=y g_{k}(h(z r)) y g_{k}(h(z r))$ and we may apply the induction hypothesis to see that if $\left.y g_{k} h(z r)\right)$ terminates, then $h(y z r)$ terminates.

Case 3. $r>k$. Then $h(y z r)=y h(z r)=y g_{k}(h(z r))$. Note that $y g_{k}(h(z r))$ has the form $y z^{\prime} r^{\prime}$ where $s\left(z^{\prime}\right) \geq k$. By the same arguments it is sufficient to prove that $y g_{k}\left(h\left(z^{\prime} r^{\prime}\right)\right)=y\left(g_{k} \circ h\right)^{2}(z r)$ terminates and, by induction, that $y\left(g_{k} \circ h\right)^{m}(z r)$ terminates for some positive integer $m$. In view of Lemma 2 there is some $m$ such that $\left(g_{k} \circ\right.$ $h)^{m}(z r)=\epsilon$, so $x=y z r$ terminates if $y$ terminates. Thus Lemma 3 is proved. Now assume that there is some string $x$ that does not terminate. We choose $x$ minimal. If $x \geq 10$, we can write $x$ in the form $x=y z r$ of Lemma 3 and by this lemma $x$ terminates since $y$ and $z r$ are smaller than $x$. If $x \leq 9$, then $h(x)=(x-1)(x-1)$ and $h(x)$ terminates again by Lemma 3 and the minimal choice of $x$.

Solution 3. We commence by introducing some terminology. Instead of integers, we will consider the set $S$ of all strings consisting of the digits $0,1, \ldots, 9$, including the empty string $\epsilon$. If $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ is a nonempty string, we let $\rho(a)=a_{n}$ denote the terminal digit of $a$ and $\lambda(a)$ be the string with the last digit removed. We also define $\lambda(\epsilon)=\epsilon$ and denote the set of non-negative integers by $\mathbb{N}{0}$. Now let $k \in{0,1,2, \ldots, 9}$ denote any digit. We define a function $f{k}: S \longrightarrow S$ on the set of strings: First, if the terminal digit of $n$ belongs to ${0,1, \ldots, k}$, then $f_{k}(n)$ is obtained from $n$ by deleting this terminal digit, i.e $f_{k}(n)=\lambda(n)$. Secondly, if the terminal digit of $n$ belongs to ${k+1, \ldots, 9}$, then $f_{k}(n)$ is obtained from $n$ by the process described in the problem. We also define $f_{k}(\epsilon)=\epsilon$. Note that up to the definition for integers $n \leq 1$, the function $f_{0}$ coincides with the function $h$ in the problem, through interpreting integers as digit strings. The argument will be roughly as follows. We begin by introducing a straightforward generalization of our claim about $f_{0}$. Then it will be easy to see that $f_{9}$ has all these stronger properties, which means that is suffices to show for $k \in{0,1, \ldots, 8}$ that $f_{k}$ possesses these properties provided that $f_{k+1}$ does. We continue to use $k$ to denote any digit. The operation $f_{k}$ is said to be separating, if the followings holds: Whenever $a$ is an initial segment of $b$, there is some $N \in \mathbb{N}{0}$ such that $f{k}^{N}(b)=a$. The following two notions only apply to the case where $f_{k}$ is indeed separating, otherwise they remain undefined. For every $a \in S$ we denote the least $N \in \mathbb{N}{0}$ for which $f{k}^{N}(a)=\epsilon$ occurs by $g_{k}(a)$ (because $\epsilon$ is an initial segment of $a$, such an $N$ exists if $f_{k}$ is separating). If for every two strings $a$ and $b$ such that $a$ is a terminal segment of $b$ one has $g_{k}(a) \leq g_{k}(b)$, we say that $f_{k}$ is coherent. In case that $f_{k}$ is separating and coherent we call the digit $k$ seductive. As $f_{9}(a)=\lambda(a)$ for all $a$, it is obvious that 9 is seductive. Hence in order to show that 0 is seductive, which clearly implies the statement of the problem, it suffices to take any $k \in{0,1, \ldots, 8}$ such that $k+1$ is seductive and to prove that $k$ has to be seductive as well. Note that in doing so, we have the function $g_{k+1}$ at our disposal. We have to establish two things and we begin with

Step 1. $f_{k}$ is separating.

Before embarking on the proof of this, we record a useful observation which is easily proved by induction on $M$.

Claim 1. For any strings $A, B$ and any positive integer $M$ such that $f_{k}^{M-1}(B) \neq \epsilon$, we have

fkM(AkB)=AkfkM(B) f_{k}^{M}(A k B)=A k f_{k}^{M}(B)

Now we call a pair $(a, b)$ of strings wicked provided that $a$ is an initial segment of $b$, but there is no $N \in \mathbb{N}{0}$ such that $f{k}^{N}(b)=a$. We need to show that there are none, so assume that there were such pairs. Choose a wicked pair $(a, b)$ for which $g_{k+1}(b)$ attains its minimal possible value. Obviously $b \neq \epsilon$ for any wicked pair $(a, b)$. Let $z$ denote the terminal digit of $b$. Observe that $a \neq b$, which means that $a$ is also an initial segment of $\lambda(b)$. To facilitate the construction of the eventual contradiction, we prove Claim 2. There cannot be an $N \in \mathbb{N}_{0}$ such that

fkN(b)=λ(b) f_{k}^{N}(b)=\lambda(b)

Proof of Claim 2. For suppose that such an $N$ existed. Because $g_{k+1}(\lambda(b))<g_{k+1}(b)$ in view of the coherency of $f_{k+1}$, the pair $(a, \lambda(b))$ is not wicked. But then there is some $N^{\prime}$ for which $f_{k}^{N^{\prime}}(\lambda(b))=a$ which entails $f_{k}^{N+N^{\prime}}(b)=a$, contradiction. Hence Claim 2 is proved.

It follows that $z \leq k$ is impossible, for otherwise $N=1$ violated Claim 2. Also $z>k+1$ is impossible: Set $B=f_{k}(b)$. Then also $f_{k+1}(b)=B$, but $g_{k+1}(B)<g_{k+1}(b)$ and $a$ is an initial segment of $B$. Thus the pair $(a, B)$ is not wicked. Hence there is some $N \in \mathbb{N}{0}$ with $a=f{k}^{N}(B)$, which, however, entails $a=f_{k}^{N+1}(b)$. We are left with the case $z=k+1$. Let $L$ denote the left part and $R=R^{*}(k+1)$ the right part of $b$. Then we have symbolically

fk(b)=LRkRk,fk2(b)=LRkR and fk+1(b)=LR. f_{k}(b)=L R^{*} k R^{*} k, f_{k}^{2}(b)=L R^{*} k R^{*} \quad \text { and } \quad f_{k+1}(b)=L R^{*} .

Using that $R^{}$ is a terminal segment of $L R^{}$ and the coherency of $f_{k+1}$, we infer

gk+1(R)gk+1(LR)<gk+1(b) g_{k+1}\left(R^{*}\right) \leq g_{k+1}\left(L R^{*}\right)<g_{k+1}(b)

Hence the pair $\left(\epsilon, R^{}\right)$ is not wicked, so there is some minimal $M \in \mathbb{N}{0}$ with $f{k}^{M}\left(R^{}\right)=\epsilon$ and by Claim 1 it follows that $f_{k}^{2+M}(b)=L R^{} k$. Finally, we infer that $\lambda(b)=L R^{}=f_{k}\left(L R^{*} k\right)=$ $f_{k}^{3+M}(b)$, which yields a contradiction to Claim 2. This final contradiction establishes that $f_{k}$ is indeed separating.

Step 2. $f_{k}$ is coherent.

To prepare the proof of this, we introduce some further pieces of terminology. A nonempty string $\left(a_{1}, a_{2}, \ldots, a_{n}\right)$ is called a hypostasis, if $a_{n}<a_{i}$ for all $i=1, \ldots, n-1$. Reading an arbitrary string $a$ backwards, we easily find a, possibly empty, sequence $\left(A_{1}, A_{2}, \ldots, A_{m}\right)$ of hypostases such that $\rho\left(A_{1}\right) \leq \rho\left(A_{2}\right) \leq \cdots \leq \rho\left(A_{m}\right)$ and, symbolically, $a=A_{1} A_{2} \ldots A_{m}$. The latter sequence is referred to as the decomposition of $a$. So, for instance, $(20,0,9)$ is the decomposition of 2009 and the string 50 is a hypostasis. Next we explain when we say about two strings $a$ and $b$ that $a$ is injectible into $b$. The definition is by induction on the length of $b$. Let $\left(B_{1}, B_{2}, \ldots, B_{n}\right)$ be the decomposition of $b$ into hypostases. Then $a$ is injectible into $b$ if for the decomposition $\left(A_{1}, A_{2}, \ldots, A_{m}\right)$ of $a$ there is a strictly increasing function $H:{1,2, \ldots, m} \longrightarrow{1,2, \ldots, n}$ satisfying

ρ(Ai)=ρ(BH(i)) for all i=1,,m \rho\left(A_{i}\right)=\rho\left(B_{H(i)}\right) \text { for all } i=1, \ldots, m \text {; }

$\lambda\left(A_{i}\right)$ is injectible into $\lambda\left(B_{H(i)}\right)$ for all $i=1, \ldots, m$. If one can choose $H$ with $H(m)=n$, then we say that $a$ is strongly injectible into $b$. Obviously, if $a$ is a terminal segment of $b$, then $a$ is strongly injectible into $b$. Claim 3. If $a$ and $b$ are two nonempty strings such that $a$ is strongly injectible into $b$, then $\lambda(a)$ is injectible into $\lambda(b)$.

Proof of Claim 3. Let $\left(B_{1}, B_{2}, \ldots, B_{n}\right)$ be the decomposition of $b$ and let $\left(A_{1}, A_{2}, \ldots, A_{m}\right)$ be the decomposition of $a$. Take a function $H$ exemplifying that $a$ is strongly injectible into $b$. Let $\left(C_{1}, C_{2}, \ldots, C_{r}\right)$ be the decomposition of $\lambda\left(A_{m}\right)$ and let $\left(D_{1}, D_{2}, \ldots, D_{s}\right)$ be the decomposition of $\lambda\left(B_{n}\right)$. Choose a strictly increasing $H^{\prime}:{1,2, \ldots, r} \longrightarrow{1,2, \ldots s}$ witnessing that $\lambda\left(A_{m}\right)$ is injectible into $\lambda\left(B_{n}\right)$. Clearly, $\left(A_{1}, A_{2}, \ldots, A_{m-1}, C_{1}, C_{2}, \ldots, C_{r}\right)$ is the decomposition of $\lambda(a)$ and $\left(B_{1}, B_{2}, \ldots, B_{n-1}, D_{1}, D_{2}, \ldots, D_{s}\right)$ is the decomposition of $\lambda(b)$. Then the function $H^{\prime \prime}:{1,2, \ldots, m+r-1} \longrightarrow{1,2, \ldots, n+s-1}$ given by $H^{\prime \prime}(i)=H(i)$ for $i=1,2, \ldots, m-1$ and $H^{\prime \prime}(m-1+i)=n-1+H^{\prime}(i)$ for $i=1,2, \ldots, r$ exemplifies that $\lambda(a)$ is injectible into $\lambda(b)$, which finishes the proof of the claim.

A pair $(a, b)$ of strings is called aggressive if $a$ is injectible into $b$ and nevertheless $g_{k}(a)>g_{k}(b)$. Observe that if $f_{k}$ was incoherent, which we shall assume from now on, then such pairs existed. Now among all aggressive pairs we choose one, say $(a, b)$, for which $g_{k}(b)$ attains its least possible value. Obviously $f_{k}(a)$ cannot be injectible into $f_{k}(b)$, for otherwise the pair $\left(f_{k}(a), f_{k}(b)\right)$ was aggressive and contradicted our choice of $(a, b)$. Let $\left(A_{1}, A_{2}, \ldots, A_{m}\right)$ and $\left(B_{1}, B_{2}, \ldots, B_{n}\right)$ be the decompositions of $a$ and $b$ and take a function $H:{1,2, \ldots, m} \longrightarrow{1,2, \ldots, n}$ exemplifying that $a$ is indeed injectible into $b$. If we had $H(m)<n$, then $a$ was also injectible into the number $b^{\prime}$ whose decomposition is $\left(B_{1}, B_{2}, \ldots, B_{n-1}\right)$ and by separativity of $f_{k}$ we obtained $g_{k}\left(b^{\prime}\right)<g_{k}(b)$, whence the pair ( $a, b^{\prime}$ ) was also aggressive, contrary to the minimality condition imposed on $b$. Therefore $a$ is strongly injectible into $b$. In particular, $a$ and $b$ have a common terminal digit, say $z$. If we had $z \leq k$, then $f_{k}(a)=\lambda(a)$ and $f_{k}(b)=\lambda(b)$, so that by Claim $3, f_{k}(a)$ was injectible into $f_{k}(b)$, which is a contradiction. Hence, $z \geq k+1$. Now let $r$ be the minimal element of ${1,2, \ldots, m}$ for which $\rho\left(A_{r}\right)=z$. Then the maximal right part of $a$ consisting of digits $\geq z$ is equal to $R_{a}$, the string whose decomposition is $\left(A_{r}, A_{r+1}, \ldots, A_{m}\right)$. Then $R_{a}-1$ is a hypostasis and $\left(A_{1}, \ldots, A_{r-1}, R_{a}-1, R_{a}-1\right)$ is the decomposition of $f_{k}(a)$. Defining $s$ and $R_{b}$ in a similar fashion with respect to $b$, we see that $\left(B_{1}, \ldots, B_{s-1}, R_{b}-1, R_{b}-1\right)$ is the decomposition of $f_{k}(b)$. The definition of injectibility then easily entails that $R_{a}$ is strongly injectible into $R_{b}$. It follows from Claim 3 that $\lambda\left(R_{a}\right)=$ $\lambda\left(R_{a}-1\right)$ is injectible into $\lambda\left(R_{b}\right)=\lambda\left(R_{b}-1\right)$, whence the function $H^{\prime}:{1,2, \ldots, r+1} \longrightarrow$ ${1,2, \ldots, s+1}$, given by $H^{\prime}(i)=H(i)$ for $i=1,2, \ldots, r-1, H^{\prime}(r)=s$ and $H^{\prime}(r+1)=s+1$ exemplifies that $f_{k}(a)$ is injectible into $f_{k}(b)$, which yields a contradiction as before. This shows that aggressive pairs cannot exist, whence $f_{k}$ is indeed coherent, which finishes the proof of the seductivity of $k$, whereby the problem is finally solved.

Geometry

G1 BEL (Belgium)

Let $A B C$ be a triangle with $A B=A C$. The angle bisectors of $A$ and $B$ meet the sides $B C$ and $A C$ in $D$ and $E$, respectively. Let $K$ be the incenter of triangle $A D C$. Suppose that $\angle B E K=45^{\circ}$. Find all possible values of $\angle B A C$.

Solution 1. Answer: $\angle B A C=60^{\circ}$ or $\angle B A C=90^{\circ}$ are possible values and the only possible values.

Let $I$ be the incenter of triangle $A B C$, then $K$ lies on the line $C I$. Let $F$ be the point, where the incircle of triangle $A B C$ touches the side $A C$; then the segments $I F$ and $I D$ have the same length and are perpendicular to $A C$ and $B C$, respectively.

Figure 1

Figure 2

Let $P, Q$ and $R$ be the points where the incircle of triangle $A D C$ touches the sides $A D, D C$ and $C A$, respectively. Since $K$ and $I$ lie on the angle bisector of $\angle A C D$, the segments $I D$ and $I F$ are symmetric with respect to the line $I C$. Hence there is a point $S$ on $I F$ where the incircle of triangle $A D C$ touches the segment $I F$. Then segments $K P, K Q, K R$ and $K S$ all have the same length and are perpendicular to $A D, D C, C A$ and $I F$, respectively. So - regardless of the value of $\angle B E K$ - the quadrilateral $K R F S$ is a square and $\angle S F K=\angle K F C=45^{\circ}$. Consider the case $\angle B A C=60^{\circ}$ (see Figure 1). Then triangle $A B C$ is equilateral. Furthermore we have $F=E$, hence $\angle B E K=\angle I F K=\angle S E K=45^{\circ}$. So $60^{\circ}$ is a possible value for $\angle B A C$. Now consider the case $\angle B A C=90^{\circ}$ (see Figure 2). Then $\angle C B A=\angle A C B=45^{\circ}$. Furthermore, $\angle K I E=\frac{1}{2} \angle C B A+\frac{1}{2} \angle A C B=45^{\circ}, \angle A E B=180^{\circ}-90^{\circ}-22.5^{\circ}=67.5^{\circ}$ and $\angle E I A=\angle B I D=180^{\circ}-90^{\circ}-22.5^{\circ}=67.5^{\circ}$. Hence triangle $I E A$ is isosceles and a reflection of the bisector of $\angle I A E$ takes $I$ to $E$ and $K$ to itself. So triangle $I K E$ is symmetric with respect to this axis, i.e. $\angle K I E=\angle I E K=\angle B E K=45^{\circ}$. So $90^{\circ}$ is a possible value for $\angle B A C$, too. If, on the other hand, $\angle B E K=45^{\circ}$ then $\angle B E K=\angle I E K=\angle I F K=45^{\circ}$. Then

  • either $F=E$, which makes the angle bisector $B I$ be an altitude, i.e., which makes triangle $A B C$ isosceles with base $A C$ and hence equilateral and so $\angle B A C=60^{\circ}$,
  • or $E$ lies between $F$ and $C$, which makes the points $K, E, F$ and $I$ concyclic, so $45^{\circ}=$ $\angle K F C=\angle K F E=\angle K I E=\angle C B I+\angle I C B=2 \cdot \angle I C B=90^{\circ}-\frac{1}{2} \angle B A C$, and so $\angle B A C=90^{\circ}$,
  • or $F$ lies between $E$ and $C$, then again, $K, E, F$ and $I$ are concyclic, so $45^{\circ}=\angle K F C=$ $180^{\circ}-\angle K F E=\angle K I E$, which yields the same result $\angle B A C=90^{\circ}$. (However, for $\angle B A C=90^{\circ} E$ lies, in fact, between $F$ and $C$, see Figure 2. So this case does not occur.) This proves $90^{\circ}$ and $60^{\circ}$ to be the only possible values for $\angle B A C$.

Solution 2. Denote angles at $A, B$ and $C$ as usual by $\alpha, \beta$ and $\gamma$. Since triangle $A B C$ is isosceles, we have $\beta=\gamma=90^{\circ}-\frac{\alpha}{2}<90^{\circ}$, so $\angle E C K=45^{\circ}-\frac{\alpha}{4}=\angle K C D$. Since $K$ is the incenter of triangle $A D C$, we have $\angle C D K=\angle K D A=45^{\circ}$; furthermore $\angle D I C=45^{\circ}+\frac{\alpha}{4}$. Now, if $\angle B E K=45^{\circ}$, easy calculations within triangles $B C E$ and $K C E$ yield

KEC=180β245β=13532β=32(90β)=34α,IKE=34α+45α4=45+α2. \begin{aligned} & \angle K E C=180^{\circ}-\frac{\beta}{2}-45^{\circ}-\beta=135^{\circ}-\frac{3}{2} \beta=\frac{3}{2}\left(90^{\circ}-\beta\right)=\frac{3}{4} \alpha, \\ & \angle I K E=\frac{3}{4} \alpha+45^{\circ}-\frac{\alpha}{4}=45^{\circ}+\frac{\alpha}{2} . \end{aligned}

So in triangles $I C E, I K E, I D K$ and $I D C$ we have (see Figure 3)

ICIE=sinIECsinECI=sin(45+34α)sin(45α4),IEIK=sinEKIsinIEK=sin(45+α2)sin45IKID=sinKDIsinIKD=sin45sin(90α4),IDIC=sinICDsinCDI=sin(45α4)sin90 \begin{array}{ll} \frac{I C}{I E}=\frac{\sin \angle I E C}{\sin \angle E C I}=\frac{\sin \left(45^{\circ}+\frac{3}{4} \alpha\right)}{\sin \left(45^{\circ}-\frac{\alpha}{4}\right)}, & \frac{I E}{I K}=\frac{\sin \angle E K I}{\sin \angle I E K}=\frac{\sin \left(45^{\circ}+\frac{\alpha}{2}\right)}{\sin 45^{\circ}} \\ \frac{I K}{I D}=\frac{\sin \angle K D I}{\sin \angle I K D}=\frac{\sin 45^{\circ}}{\sin \left(90^{\circ}-\frac{\alpha}{4}\right)}, & \frac{I D}{I C}=\frac{\sin \angle I C D}{\sin \angle C D I}=\frac{\sin \left(45^{\circ}-\frac{\alpha}{4}\right)}{\sin 90^{\circ}} \end{array}

Figure 3 Multiplication of these four equations yields

1=sin(45+34α)sin(45+α2)sin(90α4) 1=\frac{\sin \left(45^{\circ}+\frac{3}{4} \alpha\right) \sin \left(45^{\circ}+\frac{\alpha}{2}\right)}{\sin \left(90^{\circ}-\frac{\alpha}{4}\right)}

But, since

sin(90α4)=cosα4=cos((45+34α)(45+α2))=cos(45+34α)cos(45+α2)+sin(45+34α)sin(45+α2) \begin{aligned} \sin \left(90^{\circ}-\frac{\alpha}{4}\right) & =\cos \frac{\alpha}{4}=\cos \left(\left(45^{\circ}+\frac{3}{4} \alpha\right)-\left(45^{\circ}+\frac{\alpha}{2}\right)\right) \\ & =\cos \left(45^{\circ}+\frac{3}{4} \alpha\right) \cos \left(45^{\circ}+\frac{\alpha}{2}\right)+\sin \left(45^{\circ}+\frac{3}{4} \alpha\right) \sin \left(45^{\circ}+\frac{\alpha}{2}\right) \end{aligned}

this is equivalent to

sin(45+34α)sin(45+α2)=cos(45+34α)cos(45+α2)+sin(45+34α)sin(45+α2) \sin \left(45^{\circ}+\frac{3}{4} \alpha\right) \sin \left(45^{\circ}+\frac{\alpha}{2}\right)=\cos \left(45^{\circ}+\frac{3}{4} \alpha\right) \cos \left(45^{\circ}+\frac{\alpha}{2}\right)+\sin \left(45^{\circ}+\frac{3}{4} \alpha\right) \sin \left(45^{\circ}+\frac{\alpha}{2}\right)

and finally

cos(45+34α)cos(45+α2)=0 \cos \left(45^{\circ}+\frac{3}{4} \alpha\right) \cos \left(45^{\circ}+\frac{\alpha}{2}\right)=0

But this means $\cos \left(45^{\circ}+\frac{3}{4} \alpha\right)=0$, hence $45^{\circ}+\frac{3}{4} \alpha=90^{\circ}$, i.e. $\alpha=60^{\circ}$ or $\cos \left(45^{\circ}+\frac{\alpha}{2}\right)=0$, hence $45^{\circ}+\frac{\alpha}{2}=90^{\circ}$, i.e. $\alpha=90^{\circ}$. So these values are the only two possible values for $\alpha$. On the other hand, both $\alpha=90^{\circ}$ and $\alpha=60^{\circ}$ yield $\angle B E K=45^{\circ}$, this was shown in Solution 1.

G2 RUS (Russian Federation)

Let $A B C$ be a triangle with circumcenter $O$. The points $P$ and $Q$ are interior points of the sides $C A$ and $A B$, respectively. The circle $k$ passes through the midpoints of the segments $B P$, $C Q$, and $P Q$. Prove that if the line $P Q$ is tangent to circle $k$ then $O P=O Q$.

Solution 1. Let $K, L, M, B^{\prime}, C^{\prime}$ be the midpoints of $B P, C Q, P Q, C A$, and $A B$, respectively (see Figure 1). Since $C A | L M$, we have $\angle L M P=\angle Q P A$. Since $k$ touches the segment $P Q$ at $M$, we find $\angle L M P=\angle L K M$. Thus $\angle Q P A=\angle L K M$. Similarly it follows from $A B | M K$ that $\angle P Q A=\angle K L M$. Therefore, triangles $A P Q$ and $M K L$ are similar, hence

APAQ=MKML=QB2PC2=QBPC \frac{A P}{A Q}=\frac{M K}{M L}=\frac{\frac{Q B}{2}}{\frac{P C}{2}}=\frac{Q B}{P C}

Now (1) is equivalent to $A P \cdot P C=A Q \cdot Q B$ which means that the power of points $P$ and $Q$ with respect to the circumcircle of $\triangle A B C$ are equal, hence $O P=O Q$.

Figure 1

Comment. The last argument can also be established by the following calculation:

OP2OQ2=OB2+BP2OC2CQ2=(OA2AB2)+BP2(OA2AC2)CQ2=(AC2CQ2)(AB2BP2)=(ACCQ)(AC+CQ)(ABBP)(AB+BP)=AQQBAPPC. \begin{aligned} O P^{2}-O Q^{2} & =O B^{\prime 2}+B^{\prime} P^{2}-O C^{2}-C^{\prime} Q^{2} \\ & =\left(O A^{2}-A B^{2}\right)+B^{\prime} P^{2}-\left(O A^{2}-A C^{\prime 2}\right)-C^{\prime} Q^{2} \\ & =\left(A C^{\prime 2}-C^{\prime} Q^{2}\right)-\left(A B^{\prime 2}-B^{\prime} P^{2}\right) \\ & =\left(A C^{\prime}-C^{\prime} Q\right)\left(A C^{\prime}+C^{\prime} Q\right)-\left(A B^{\prime}-B^{\prime} P\right)\left(A B^{\prime}+B^{\prime} P\right) \\ & =A Q \cdot Q B-A P \cdot P C . \end{aligned}

With (1), we conclude $O P^{2}-O Q^{2}=0$, as desired.

Solution 2. Again, denote by $K, L, M$ the midpoints of segments $B P, C Q$, and $P Q$, respectively. Let $O, S, T$ be the circumcenters of triangles $A B C, K L M$, and $A P Q$, respectively (see Figure 2). Note that $M K$ and $L M$ are the midlines in triangles $B P Q$ and $C P Q$, respectively, so $\overrightarrow{M K}=\frac{1}{2} \overrightarrow{Q B}$ and $\overrightarrow{M L}=\frac{1}{2} \overrightarrow{P C}$. Denote by $\operatorname{pr}{l}(\vec{v})$ the projection of vector $\vec{v}$ onto line $l$. Then $\operatorname{pr}{A B}(\overrightarrow{O T})=\operatorname{pr}{A B}(\overrightarrow{O A}-\overrightarrow{T A})=\frac{1}{2} \overrightarrow{B A}-\frac{1}{2} \overrightarrow{Q A}=\frac{1}{2} \overrightarrow{B Q}=\overrightarrow{K M}$ and $\operatorname{pr}{A B}(\overrightarrow{S M})=\operatorname{pr}{M K}(\overrightarrow{S M})=$ $\frac{1}{2} \overrightarrow{K M}=\frac{1}{2} \operatorname{pr}{A B}(\overrightarrow{O T})$. Analogously we get $\operatorname{pr}{C A}(\overrightarrow{S M})=\frac{1}{2} \operatorname{pr}{C A}(\overrightarrow{O T})$. Since $A B$ and $C A$ are not parallel, this implies that $\overrightarrow{S M}=\frac{1}{2} \overrightarrow{O T}$.

Figure 2 Now, since the circle $k$ touches $P Q$ at $M$, we get $S M \perp P Q$, hence $O T \perp P Q$. Since $T$ is equidistant from $P$ and $Q$, the line $O T$ is a perpendicular bisector of segment $P Q$, and hence $O$ is equidistant from $P$ and $Q$ which finishes the proof.

G3 IRN (Islamic Republic of Iran)

Let $A B C$ be a triangle. The incircle of $A B C$ touches the sides $A B$ and $A C$ at the points $Z$ and $Y$, respectively. Let $G$ be the point where the lines $B Y$ and $C Z$ meet, and let $R$ and $S$ be points such that the two quadrilaterals $B C Y R$ and $B C S Z$ are parallelograms. Prove that $G R=G S$.

Solution 1. Denote by $k$ the incircle and by $k_{a}$ the excircle opposite to $A$ of triangle $A B C$. Let $k$ and $k_{a}$ touch the side $B C$ at the points $X$ and $T$, respectively, let $k_{a}$ touch the lines $A B$ and $A C$ at the points $P$ and $Q$, respectively. We use several times the fact that opposing sides of a parallelogram are of equal length, that points of contact of the excircle and incircle to a side of a triangle lie symmetric with respect to the midpoint of this side and that segments on two tangents to a circle defined by the points of contact and their point of intersection have the same length. So we conclude

ZP=ZB+BP=XB+BT=BX+CX=ZS and CQ=CT=BX=BZ=CS. \begin{gathered} Z P=Z B+B P=X B+B T=B X+C X=Z S \text { and } \\ C Q=C T=B X=B Z=C S . \end{gathered}

So for each of the points $Z, C$, their distances to $S$ equal the length of a tangent segment from this point to $k_{a}$. It is well-known, that all points with this property lie on the line $Z C$, which is the radical axis of $S$ and $k_{a}$. Similar arguments yield that $B Y$ is the radical axis of $R$ and $k_{a}$. So the point of intersection of $Z C$ and $B Y$, which is $G$ by definition, is the radical center of $R, S$ and $k_{a}$, from which the claim $G R=G S$ follows immediately.

Solution 2. Denote $x=A Z=A Y, y=B Z=B X, z=C X=C Y, p=Z G, q=G C$. Several lengthy calculations (Menelaos' theorem in triangle $A Z C$, law of Cosines in triangles $A B C$ and $A Z C$ and Stewart's theorem in triangle $Z C S$ ) give four equations for $p, q, \cos \alpha$ and $G S$ in terms of $x, y$, and $z$ that can be resolved for $G S$. The result is symmetric in $y$ and $z$, so $G R=G S$. More in detail this means: The line $B Y$ intersects the sides of triangle $A Z C$, so Menelaos' theorem yields $\frac{p}{q} \cdot \frac{z}{x} \cdot \frac{x+y}{y}=1$, hence

pq=xyyz+zx. \frac{p}{q}=\frac{x y}{y z+z x} .

Since we only want to show that the term for $G S$ is symmetric in $y$ and $z$, we abbreviate terms that are symmetric in $y$ and $z$ by capital letters, starting with $N=x y+y z+z x$. So (1) implies

pp+q=xyxy+yz+zx=xyN and qp+q=yz+zxxy+yz+zx=yz+zxN. \frac{p}{p+q}=\frac{x y}{x y+y z+z x}=\frac{x y}{N} \quad \text { and } \quad \frac{q}{p+q}=\frac{y z+z x}{x y+y z+z x}=\frac{y z+z x}{N} .

Now the law of Cosines in triangle $A B C$ yields

cosα=(x+y)2+(x+z)2(y+z)22(x+y)(x+z)=2x2+2xy+2xz2yz2(x+y)(x+z)=12yz(x+y)(x+z). \cos \alpha=\frac{(x+y)^{2}+(x+z)^{2}-(y+z)^{2}}{2(x+y)(x+z)}=\frac{2 x^{2}+2 x y+2 x z-2 y z}{2(x+y)(x+z)}=1-\frac{2 y z}{(x+y)(x+z)} .

We use this result to apply the law of Cosines in triangle $A Z C$ :

(p+q)2=x2+(x+z)22x(x+z)cosα=x2+(x+z)22x(x+z)(12yz(x+y)(x+z))=z2+4xyzx+y. \begin{aligned} (p+q)^{2} & =x^{2}+(x+z)^{2}-2 x(x+z) \cos \alpha \\ & =x^{2}+(x+z)^{2}-2 x(x+z) \cdot\left(1-\frac{2 y z}{(x+y)(x+z)}\right) \\ & =z^{2}+\frac{4 x y z}{x+y} . \end{aligned}

Now in triangle $Z C S$ the segment $G S$ is a cevian, so with StEWART's theorem we have $p y^{2}+q(y+z)^{2}=(p+q)\left(G S^{2}+p q\right)$, hence

GS2=pp+qy2+qp+q(y+z)2pp+qqp+q(p+q)2. G S^{2}=\frac{p}{p+q} \cdot y^{2}+\frac{q}{p+q} \cdot(y+z)^{2}-\frac{p}{p+q} \cdot \frac{q}{p+q} \cdot(p+q)^{2} .

Replacing the $p$ 's and $q$ 's herein by (2) and (3) yields

GS2=xyNy2+yz+zxN(y+z)2xyNyz+zxN(z2+4xyzx+y)=xy3N+yz(y+z)2NM1+zx(y+z)2Nxyz3(x+y)N24x2y2z2N2M2=xy3+zx(y+z)2Nxyz3(x+y)N2+M1M2=x(y3+y2z+yz2+z3)NM3+xyz2NN2xyz3(x+y)N2+M1M2=x2y2z2+xy2z3+x2yz3x2yz3xy2z3N2+M1M2+M3=x2y2z2N2+M1M2+M3, \begin{aligned} G S^{2} & =\frac{x y}{N} y^{2}+\frac{y z+z x}{N}(y+z)^{2}-\frac{x y}{N} \cdot \frac{y z+z x}{N} \cdot\left(z^{2}+\frac{4 x y z}{x+y}\right) \\ & =\frac{x y^{3}}{N}+\underbrace{\frac{y z(y+z)^{2}}{N}}_{M_{1}}+\frac{z x(y+z)^{2}}{N}-\frac{x y z^{3}(x+y)}{N^{2}}-\underbrace{\frac{4 x^{2} y^{2} z^{2}}{N^{2}}}_{M_{2}} \\ & =\frac{x y^{3}+z x(y+z)^{2}}{N}-\frac{x y z^{3}(x+y)}{N^{2}}+M_{1}-M_{2} \\ & =\underbrace{\frac{x\left(y^{3}+y^{2} z+y z^{2}+z^{3}\right)}{N}}_{M_{3}}+\frac{x y z^{2} N}{N^{2}}-\frac{x y z^{3}(x+y)}{N^{2}}+M_{1}-M_{2} \\ & =\frac{x^{2} y^{2} z^{2}+x y^{2} z^{3}+x^{2} y z^{3}-x^{2} y z^{3}-x y^{2} z^{3}}{N^{2}}+M_{1}-M_{2}+M_{3} \\ & =\frac{x^{2} y^{2} z^{2}}{N^{2}}+M_{1}-M_{2}+M_{3}, \end{aligned}

a term that is symmetric in $y$ and $z$, indeed.

Comment. $G$ is known as GERGONnE's point of $\triangle A B C$.

G4 UNK (United Kingdom)

Given a cyclic quadrilateral $A B C D$, let the diagonals $A C$ and $B D$ meet at $E$ and the lines $A D$ and $B C$ meet at $F$. The midpoints of $A B$ and $C D$ are $G$ and $H$, respectively. Show that $E F$ is tangent at $E$ to the circle through the points $E, G$, and $H$.

Solution 1. It suffices to show that $\angle H E F=\angle H G E$ (see Figure 1), since in circle $E G H$ the angle over the chord $E H$ at $G$ equals the angle between the tangent at $E$ and $E H$.

First, $\angle B A D=180^{\circ}-\angle D C B=\angle F C D$. Since triangles $F A B$ and $F C D$ have also a common interior angle at $F$, they are similar.

Figure 1 Denote by $\mathcal{T}$ the transformation consisting of a reflection at the bisector of $\angle D F C$ followed by a dilation with center $F$ and factor of $\frac{F A}{F C}$. Then $\mathcal{T}$ maps $F$ to $F, C$ to $A, D$ to $B$, and $H$ to $G$. To see this, note that $\triangle F C A \sim \triangle F D B$, so $\frac{F A}{F C}=\frac{F B}{F D}$. Moreover, as $\angle A D B=\angle A C B$, the image of the line $D E$ under $\mathcal{T}$ is parallel to $A C$ (and passes through $B$ ) and similarly the image of $C E$ is parallel to $D B$ and passes through $A$. Hence $E$ is mapped to the point $X$ which is the fourth vertex of the parallelogram $B E A X$. Thus, in particular $\angle H E F=\angle F X G$. As $G$ is the midpoint of the diagonal $A B$ of the parallelogram $B E A X$, it is also the midpoint of $E X$. In particular, $E, G, X$ are collinear, and $E X=2 \cdot E G$. Denote by $Y$ the fourth vertex of the parallelogram $D E C Y$. By an analogous reasoning as before, it follows that $\mathcal{T}$ maps $Y$ to $E$, thus $E, H, Y$ are collinear with $E Y=2 \cdot E H$. Therefore, by the intercept theorem, $H G | X Y$. From the construction of $\mathcal{T}$ it is clear that the lines $F X$ and $F E$ are symmetric with respect to the bisector of $\angle D F C$, as are $F Y$ and $F E$. Thus, $F, X, Y$ are collinear, which together with $H G | X Y$ implies $\angle F X E=\angle H G E$. This completes the proof.

Solution 2. We use the following Lemma (Gauß). Let $A B C D$ be a quadrilateral. Let $A B$ and $C D$ intersect at $P$, and $B C$ and $D A$ intersect at $Q$. Then the midpoints $K, L, M$ of $A C, B D$, and $P Q$, respectively, are collinear.

Proof: Let us consider the points $Z$ that fulfill the equation

(ABZ)+(CDZ)=(BCZ)+(DAZ) (A B Z)+(C D Z)=(B C Z)+(D A Z)

where $(R S T)$ denotes the oriented area of the triangle $R S T$ (see Figure 2).

Figure 2 As (1) is linear in $Z$, it can either characterize a line, or be contradictory, or be trivially fulfilled for all $Z$ in the plane. If (1) was fulfilled for all $Z$, then it would hold for $Z=A, Z=B$, which gives $(C D A)=(B C A),(C D B)=(D A B)$, respectively, i.e. the diagonals of $A B C D$ would bisect each other, thus $A B C D$ would be a parallelogram. This contradicts the hypothesis that $A D$ and $B C$ intersect. Since $E, F, G$ fulfill (1), it is the equation of a line which completes the proof of the lemma. Now consider the parallelograms $E A X B$ and $E C Y D$ (see Figure 1). Then $G, H$ are the midpoints of $E X, E Y$, respectively. Let $M$ be the midpoint of $E F$. By applying the Lemma to the (re-entrant) quadrilateral $A D B C$, it is evident that $G, H$, and $M$ are collinear. A dilation by a factor of 2 with center $E$ shows that $X, Y, F$ are collinear. Since $A X | D E$ and $B X | C E$, we have pairwise equal interior angles in the quadrilaterals $F D E C$ and $F B X A$. Since we have also $\angle E B A=\angle D C A=\angle C D Y$, the quadrilaterals are similar. Thus, $\angle F X A=\angle C E F$. Clearly the parallelograms $E C Y D$ and $E B X A$ are similar, too, thus $\angle E X A=\angle C E Y$. Consequently, $\angle F X E=\angle F X A-\angle E X A=\angle C E F-\angle C E Y=\angle Y E F$. By the converse of the tangent-chord angle theorem $E F$ is tangent to the circle $X E Y$. A dilation by a factor of $\frac{1}{2}$ completes the proof.

Solution 3. As in Solution $2, G, H, M$ are proven to be collinear. It suffices to show that $M E^{2}=M G \cdot M H$. If $\boldsymbol{p}=\overrightarrow{O P}$ denotes the vector from circumcenter $O$ to point $P$, the claim becomes

(ef2)2=(e+f2a+b2)(e+f2c+d2) \left(\frac{\boldsymbol{e}-\boldsymbol{f}}{2}\right)^{2}=\left(\frac{\boldsymbol{e}+\boldsymbol{f}}{2}-\frac{\boldsymbol{a}+\boldsymbol{b}}{2}\right)\left(\frac{\boldsymbol{e}+\boldsymbol{f}}{2}-\frac{\boldsymbol{c}+\boldsymbol{d}}{2}\right)

or equivalently

4(e+f)(a+b+c+d)+(a+b)(c+d)=0 4 \boldsymbol{e f}-(\boldsymbol{e}+\boldsymbol{f})(\boldsymbol{a}+\boldsymbol{b}+\boldsymbol{c}+\boldsymbol{d})+(\boldsymbol{a}+\boldsymbol{b})(\boldsymbol{c}+\boldsymbol{d})=0

With $R$ as the circumradius of $A B C D$, we obtain for the powers $\mathcal{P}(E)$ and $\mathcal{P}(F)$ of $E$ and $F$, respectively, with respect to the circumcircle

P(E)=(ea)(ec)=(eb)(ed)=e2R2P(F)=(fa)(fd)=(fb)(fc)=f2R2 \begin{aligned} & \mathcal{P}(E)=(\boldsymbol{e}-\boldsymbol{a})(\boldsymbol{e}-\boldsymbol{c})=(\boldsymbol{e}-\boldsymbol{b})(\boldsymbol{e}-\boldsymbol{d})=\boldsymbol{e}^{2}-R^{2} \\ & \mathcal{P}(F)=(\boldsymbol{f}-\boldsymbol{a})(\boldsymbol{f}-\boldsymbol{d})=(\boldsymbol{f}-\boldsymbol{b})(\boldsymbol{f}-\boldsymbol{c})=\boldsymbol{f}^{2}-R^{2} \end{aligned}

hence

(ea)(ec)=e2R2(eb)(ed)=e2R2(fa)(fd)=f2R2(fb)(fc)=f2R2 \begin{aligned} & (\boldsymbol{e}-\boldsymbol{a})(\boldsymbol{e}-\boldsymbol{c})=\boldsymbol{e}^{2}-R^{2} \\ & (\boldsymbol{e}-\boldsymbol{b})(\boldsymbol{e}-\boldsymbol{d})=\boldsymbol{e}^{2}-R^{2} \\ & (\boldsymbol{f}-\boldsymbol{a})(\boldsymbol{f}-\boldsymbol{d})=\boldsymbol{f}^{2}-R^{2} \\ & (\boldsymbol{f}-\boldsymbol{b})(\boldsymbol{f}-\boldsymbol{c})=\boldsymbol{f}^{2}-R^{2} \end{aligned}

Since $F$ lies on the polar to $E$ with respect to the circumcircle, we have

4ef=4R2 4 \boldsymbol{e} \boldsymbol{f}=4 R^{2}

Adding up (3) to (7) yields (2), as desired.

G5 POL (Poland)

Let $P$ be a polygon that is convex and symmetric to some point $O$. Prove that for some parallelogram $R$ satisfying $P \subset R$ we have

RP2 \frac{|R|}{|P|} \leq \sqrt{2}

where $|R|$ and $|P|$ denote the area of the sets $R$ and $P$, respectively.

Solution 1. We will construct two parallelograms $R_{1}$ and $R_{3}$, each of them containing $P$, and prove that at least one of the inequalities $\left|R_{1}\right| \leq \sqrt{2}|P|$ and $\left|R_{3}\right| \leq \sqrt{2}|P|$ holds (see Figure 1). First we will construct a parallelogram $R_{1} \supseteq P$ with the property that the midpoints of the sides of $R_{1}$ are points of the boundary of $P$. Choose two points $A$ and $B$ of $P$ such that the triangle $O A B$ has maximal area. Let $a$ be the line through $A$ parallel to $O B$ and $b$ the line through $B$ parallel to $O A$. Let $A^{\prime}, B^{\prime}, a^{\prime}$ and $b^{\prime}$ be the points or lines, that are symmetric to $A, B, a$ and $b$, respectively, with respect to $O$. Now let $R_{1}$ be the parallelogram defined by $a, b, a^{\prime}$ and $b^{\prime}$.

Figure 1 Obviously, $A$ and $B$ are located on the boundary of the polygon $P$, and $A, B, A^{\prime}$ and $B^{\prime}$ are midpoints of the sides of $R_{1}$. We note that $P \subseteq R_{1}$. Otherwise, there would be a point $Z \in P$ but $Z \notin R_{1}$, i.e., one of the lines $a, b, a^{\prime}$ or $b^{\prime}$ were between $O$ and $Z$. If it is $a$, we have $|O Z B|>|O A B|$, which is contradictory to the choice of $A$ and $B$. If it is one of the lines $b, a^{\prime}$ or $b^{\prime}$ almost identical arguments lead to a similar contradiction. Let $R_{2}$ be the parallelogram $A B A^{\prime} B^{\prime}$. Since $A$ and $B$ are points of $P$, segment $A B \subset P$ and so $R_{2} \subset R_{1}$. Since $A, B, A^{\prime}$ and $B^{\prime}$ are midpoints of the sides of $R_{1}$, an easy argument yields

R1=2R2 \left|R_{1}\right|=2 \cdot\left|R_{2}\right|

Let $R_{3}$ be the smallest parallelogram enclosing $P$ defined by lines parallel to $A B$ and $B A^{\prime}$. Obviously $R_{2} \subset R_{3}$ and every side of $R_{3}$ contains at least one point of the boundary of $P$. Denote by $C$ the intersection point of $a$ and $b$, by $X$ the intersection point of $A B$ and $O C$, and by $X^{\prime}$ the intersection point of $X C$ and the boundary of $R_{3}$. In a similar way denote by $D$ the intersection point of $b$ and $a^{\prime}$, by $Y$ the intersection point of $A^{\prime} B$ and $O D$, and by $Y^{\prime}$ the intersection point of $Y D$ and the boundary of $R_{3}$. Note that $O C=2 \cdot O X$ and $O D=2 \cdot O Y$, so there exist real numbers $x$ and $y$ with $1 \leq x, y \leq 2$ and $O X^{\prime}=x \cdot O X$ and $O Y^{\prime}=y \cdot O Y$. Corresponding sides of $R_{3}$ and $R_{2}$ are parallel which yields

R3=xyR2 \left|R_{3}\right|=x y \cdot\left|R_{2}\right|

The side of $R_{3}$ containing $X^{\prime}$ contains at least one point $X^{}$ of $P$; due to the convexity of $P$ we have $A X^{} B \subset P$. Since this side of the parallelogram $R_{3}$ is parallel to $A B$ we have $\left|A X^{*} B\right|=\left|A X^{\prime} B\right|$, so $\left|O A X^{\prime} B\right|$ does not exceed the area of $P$ confined to the sector defined by the rays $O B$ and $O A$. In a similar way we conclude that $\left|O B^{\prime} Y^{\prime} A^{\prime}\right|$ does not exceed the area of $P$ confined to the sector defined by the rays $O B$ and $O A^{\prime}$. Putting things together we have $\left|O A X^{\prime} B\right|=x \cdot|O A B|,\left|O B D A^{\prime}\right|=y \cdot\left|O B A^{\prime}\right|$. Since $|O A B|=\left|O B A^{\prime}\right|$, we conclude that $|P| \geq 2 \cdot\left|A X^{\prime} B Y^{\prime} A^{\prime}\right|=2 \cdot\left(x \cdot|O A B|+y \cdot\left|O B A^{\prime}\right|\right)=4 \cdot \frac{x+y}{2} \cdot|O A B|=\frac{x+y}{2} \cdot R_{2}$; this is in short

x+y2R2P \frac{x+y}{2} \cdot\left|R_{2}\right| \leq|P|

Since all numbers concerned are positive, we can combine (1)-(3). Using the arithmetic-geometric-mean inequality we obtain

R1R3=2R2xyR22R22(x+y2)22P2 \left|R_{1}\right| \cdot\left|R_{3}\right|=2 \cdot\left|R_{2}\right| \cdot x y \cdot\left|R_{2}\right| \leq 2 \cdot\left|R_{2}\right|^{2}\left(\frac{x+y}{2}\right)^{2} \leq 2 \cdot|P|^{2}

This implies immediately the desired result $\left|R_{1}\right| \leq \sqrt{2} \cdot|P|$ or $\left|R_{3}\right| \leq \sqrt{2} \cdot|P|$.

Solution 2. We construct the parallelograms $R_{1}, R_{2}$ and $R_{3}$ in the same way as in Solution 1 and will show that $\frac{\left|R_{1}\right|}{|P|} \leq \sqrt{2}$ or $\frac{\left|R_{3}\right|}{|P|} \leq \sqrt{2}$.

Figure 2 Recall that affine one-to-one maps of the plane preserve the ratio of areas of subsets of the plane. On the other hand, every parallelogram can be transformed with an affine map onto a square. It follows that without loss of generality we may assume that $R_{1}$ is a square (see Figure 2). Then $R_{2}$, whose vertices are the midpoints of the sides of $R_{1}$, is a square too, and $R_{3}$, whose sides are parallel to the diagonals of $R_{1}$, is a rectangle. Let $a>0, b \geq 0$ and $c \geq 0$ be the distances introduced in Figure 2. Then $\left|R_{1}\right|=2 a^{2}$ and $\left|R_{3}\right|=(a+2 b)(a+2 c)$. Points $A, A^{\prime}, B$ and $B^{\prime}$ are in the convex polygon $P$. Hence the square $A B A^{\prime} B^{\prime}$ is a subset of $P$. Moreover, each of the sides of the rectangle $R_{3}$ contains a point of $P$, otherwise $R_{3}$ would not be minimal. It follows that

Pa2+2ab2+2ac2=a(a+b+c) |P| \geq a^{2}+2 \cdot \frac{a b}{2}+2 \cdot \frac{a c}{2}=a(a+b+c)

Now assume that both $\frac{\left|R_{1}\right|}{|P|}>\sqrt{2}$ and $\frac{\left|R_{3}\right|}{|P|}>\sqrt{2}$, then

2a2=R1>2P2a(a+b+c) 2 a^{2}=\left|R_{1}\right|>\sqrt{2} \cdot|P| \geq \sqrt{2} \cdot a(a+b+c)

and

(a+2b)(a+2c)=R3>2P2a(a+b+c) (a+2 b)(a+2 c)=\left|R_{3}\right|>\sqrt{2} \cdot|P| \geq \sqrt{2} \cdot a(a+b+c)

All numbers concerned are positive, so after multiplying these inequalities we get

2a2(a+2b)(a+2c)>2a2(a+b+c)2 2 a^{2}(a+2 b)(a+2 c)>2 a^{2}(a+b+c)^{2}

But the arithmetic-geometric-mean inequality implies the contradictory result

2a2(a+2b)(a+2c)2a2((a+2b)+(a+2c)2)2=2a2(a+b+c)2 2 a^{2}(a+2 b)(a+2 c) \leq 2 a^{2}\left(\frac{(a+2 b)+(a+2 c)}{2}\right)^{2}=2 a^{2}(a+b+c)^{2}

Hence $\frac{\left|R_{1}\right|}{|P|} \leq \sqrt{2}$ or $\frac{\left|R_{3}\right|}{|P|} \leq \sqrt{2}$, as desired.

G6 UKR (Ukraine)

Let the sides $A D$ and $B C$ of the quadrilateral $A B C D$ (such that $A B$ is not parallel to $C D$ ) intersect at point $P$. Points $O_{1}$ and $O_{2}$ are the circumcenters and points $H_{1}$ and $H_{2}$ are the orthocenters of triangles $A B P$ and $D C P$, respectively. Denote the midpoints of segments $O_{1} H_{1}$ and $O_{2} H_{2}$ by $E_{1}$ and $E_{2}$, respectively. Prove that the perpendicular from $E_{1}$ on $C D$, the perpendicular from $E_{2}$ on $A B$ and the line $H_{1} H_{2}$ are concurrent.

Solution 1. We keep triangle $A B P$ fixed and move the line $C D$ parallel to itself uniformly, i.e. linearly dependent on a single parameter $\lambda$ (see Figure 1). Then the points $C$ and $D$ also move uniformly. Hence, the points $O_{2}, H_{2}$ and $E_{2}$ move uniformly, too. Therefore also the perpendicular from $E_{2}$ on $A B$ moves uniformly. Obviously, the points $O_{1}, H_{1}, E_{1}$ and the perpendicular from $E_{1}$ on $C D$ do not move at all. Hence, the intersection point $S$ of these two perpendiculars moves uniformly. Since $H_{1}$ does not move, while $H_{2}$ and $S$ move uniformly along parallel lines (both are perpendicular to $C D$ ), it is sufficient to prove their collinearity for two different positions of $C D$.

Figure 1 Let $C D$ pass through either point $A$ or point $B$. Note that by hypothesis these two cases are different. We will consider the case $A \in C D$, i.e. $A=D$. So we have to show that the perpendiculars from $E_{1}$ on $A C$ and from $E_{2}$ on $A B$ intersect on the altitude $A H$ of triangle $A B C$ (see Figure 2).

Figure 2

To this end, we consider the midpoints $A_{1}, B_{1}, C_{1}$ of $B C, C A, A B$, respectively. As $E_{1}$ is the center of Feuerbach's circle (nine-point circle) of $\triangle A B P$, we have $E_{1} C_{1}=E_{1} H$. Similarly, $E_{2} B_{1}=E_{2} H$. Note further that a point $X$ lies on the perpendicular from $E_{1}$ on $A_{1} C_{1}$ if and only if

XC12XA12=E1C12E1A12 X C_{1}^{2}-X A_{1}^{2}=E_{1} C_{1}^{2}-E_{1} A_{1}^{2}

Similarly, the perpendicular from $E_{2}$ on $A_{1} B_{1}$ is characterized by

XA12XB12=E2A12E2B12 X A_{1}^{2}-X B_{1}^{2}=E_{2} A_{1}^{2}-E_{2} B_{1}^{2}

The line $H_{1} H_{2}$, which is perpendicular to $B_{1} C_{1}$ and contains $A$, is given by

XB12XC12=AB12AC12 X B_{1}^{2}-X C_{1}^{2}=A B_{1}^{2}-A C_{1}^{2}

The three lines are concurrent if and only if

0=XC12XA12+XA12XB12+XB12XC12=E1C12E1A12+E2A12E2B12+AB12AC12=E1A12+E2A12+E1H2E2H2+AB12AC12 \begin{aligned} 0 & =X C_{1}^{2}-X A_{1}^{2}+X A_{1}^{2}-X B_{1}^{2}+X B_{1}^{2}-X C_{1}^{2} \\ & =E_{1} C_{1}^{2}-E_{1} A_{1}^{2}+E_{2} A_{1}^{2}-E_{2} B_{1}^{2}+A B_{1}^{2}-A C_{1}^{2} \\ & =-E_{1} A_{1}^{2}+E_{2} A_{1}^{2}+E_{1} H^{2}-E_{2} H^{2}+A B_{1}^{2}-A C_{1}^{2} \end{aligned}

i.e. it suffices to show that

E1A12E2A12E1H2+E2H2=AC2AB24 E_{1} A_{1}^{2}-E_{2} A_{1}^{2}-E_{1} H^{2}+E_{2} H^{2}=\frac{A C^{2}-A B^{2}}{4}

We have

AC2AB24=HC2HB24=(HC+HB)(HCHB)4=HA1BC2 \frac{A C^{2}-A B^{2}}{4}=\frac{H C^{2}-H B^{2}}{4}=\frac{(H C+H B)(H C-H B)}{4}=\frac{H A_{1} \cdot B C}{2}

Let $F_{1}, F_{2}$ be the projections of $E_{1}, E_{2}$ on $B C$. Obviously, these are the midpoints of $H P_{1}$, $H P_{2}$, where $P_{1}, P_{2}$ are the midpoints of $P B$ and $P C$ respectively. Then

E1A12E2A12E1H2+E2H2=F1A12F1H2F2A12+F2H2=(F1A1F1H)(F1A1+F1H)(F2A1F2H)(F2A1+F2H)=A1H(A1P1A1P2)=A1HBC2=AC2AB24 \begin{aligned} & E_{1} A_{1}^{2}-E_{2} A_{1}^{2}-E_{1} H^{2}+E_{2} H^{2} \\ & =F_{1} A_{1}^{2}-F_{1} H^{2}-F_{2} A_{1}^{2}+F_{2} H^{2} \\ & =\left(F_{1} A_{1}-F_{1} H\right)\left(F_{1} A_{1}+F_{1} H\right)-\left(F_{2} A_{1}-F_{2} H\right)\left(F_{2} A_{1}+F_{2} H\right) \\ & =A_{1} H \cdot\left(A_{1} P_{1}-A_{1} P_{2}\right) \\ & =\frac{A_{1} H \cdot B C}{2} \\ & =\frac{A C^{2}-A B^{2}}{4} \end{aligned}

which proves the claim.

Solution 2. Let the perpendicular from $E_{1}$ on $C D$ meet $P H_{1}$ at $X$, and the perpendicular from $E_{2}$ on $A B$ meet $P H_{2}$ at $Y$ (see Figure 3). Let $\varphi$ be the intersection angle of $A B$ and $C D$. Denote by $M, N$ the midpoints of $P H_{1}, P H_{2}$ respectively.

Figure 3 We will prove now that triangles $E_{1} X M$ and $E_{2} Y N$ have equal angles at $E_{1}, E_{2}$, and supplementary angles at $X, Y$. In the following, angles are understood as oriented, and equalities of angles modulo $180^{\circ}$. Let $\alpha=\angle H_{2} P D, \psi=\angle D P C, \beta=\angle C P H_{1}$. Then $\alpha+\psi+\beta=\varphi, \angle E_{1} X H_{1}=\angle H_{2} Y E_{2}=\varphi$, thus $\angle M X E_{1}+\angle N Y E_{2}=180^{\circ}$. By considering the Feuerbach circle of $\triangle A B P$ whose center is $E_{1}$ and which goes through $M$, we have $\angle E_{1} M H_{1}=\psi+2 \beta$. Analogous considerations with the Feuerbach circle of $\triangle D C P$ yield $\angle H_{2} N E_{2}=\psi+2 \alpha$. Hence indeed $\angle X E_{1} M=\varphi-(\psi+2 \beta)=(\psi+2 \alpha)-\varphi=\angle Y E_{2} N$. It follows now that

XMME1=YNNE2 \frac{X M}{M E_{1}}=\frac{Y N}{N E_{2}}

Furthermore, $M E_{1}$ is half the circumradius of $\triangle A B P$, while $P H_{1}$ is the distance of $P$ to the orthocenter of that triangle, which is twice the circumradius times the cosine of $\psi$. Together with analogous reasoning for $\triangle D C P$ we have

ME1PH1=14cosψ=NE2PH2 \frac{M E_{1}}{P H_{1}}=\frac{1}{4 \cos \psi}=\frac{N E_{2}}{P H_{2}}

By multiplication,

XMPH1=YNPH2 \frac{X M}{P H_{1}}=\frac{Y N}{P H_{2}}

and therefore

PXXH1=H2YYP \frac{P X}{X H_{1}}=\frac{H_{2} Y}{Y P}

Let $E_{1} X, E_{2} Y$ meet $H_{1} H_{2}$ in $R, S$ respectively. Applying the intercept theorem to the parallels $E_{1} X, P H_{2}$ and center $H_{1}$ gives

H2RRH1=PXXH1 \frac{H_{2} R}{R H_{1}}=\frac{P X}{X H_{1}}

while with parallels $E_{2} Y, P H_{1}$ and center $H_{2}$ we obtain

H2SSH1=H2YYP \frac{H_{2} S}{S H_{1}}=\frac{H_{2} Y}{Y P}

Combination of the last three equalities yields that $R$ and $S$ coincide.

G7 IRN (Islamic Republic of Iran)

Let $A B C$ be a triangle with incenter $I$ and let $X, Y$ and $Z$ be the incenters of the triangles $B I C, C I A$ and $A I B$, respectively. Let the triangle $X Y Z$ be equilateral. Prove that $A B C$ is equilateral too.

Solution. $A Z, A I$ and $A Y$ divide $\angle B A C$ into four equal angles; denote them by $\alpha$. In the same way we have four equal angles $\beta$ at $B$ and four equal angles $\gamma$ at $C$. Obviously $\alpha+\beta+\gamma=\frac{180^{\circ}}{4}=45^{\circ}$; and $0^{\circ}<\alpha, \beta, \gamma<45^{\circ}$.

Easy calculations in various triangles yield $\angle B I C=180^{\circ}-2 \beta-2 \gamma=180^{\circ}-\left(90^{\circ}-2 \alpha\right)=$ $90^{\circ}+2 \alpha$, hence (for $X$ is the incenter of triangle $B C I$, so $I X$ bisects $\angle B I C$ ) we have $\angle X I C=$ $\angle B I X=\frac{1}{2} \angle B I C=45^{\circ}+\alpha$ and with similar aguments $\angle C I Y=\angle Y I A=45^{\circ}+\beta$ and $\angle A I Z=\angle Z I B=45^{\circ}+\gamma$. Furthermore, we have $\angle X I Y=\angle X I C+\angle C I Y=\left(45^{\circ}+\alpha\right)+$ $\left(45^{\circ}+\beta\right)=135^{\circ}-\gamma, \angle Y I Z=135^{\circ}-\alpha$, and $\angle Z I X=135^{\circ}-\beta$. Now we calculate the lengths of $I X, I Y$ and $I Z$ in terms of $\alpha, \beta$ and $\gamma$. The perpendicular from $I$ on $C X$ has length $I X \cdot \sin \angle C X I=I X \cdot \sin \left(90^{\circ}+\beta\right)=I X \cdot \cos \beta$. But $C I$ bisects $\angle Y C X$, so the perpendicular from $I$ on $C Y$ has the same length, and we conclude

IXcosβ=IYcosα I X \cdot \cos \beta=I Y \cdot \cos \alpha

To make calculations easier we choose a length unit that makes $I X=\cos \alpha$. Then $I Y=\cos \beta$ and with similar arguments $I Z=\cos \gamma$. Since $X Y Z$ is equilateral we have $Z X=Z Y$. The law of Cosines in triangles $X Y I, Y Z I$ yields

ZX2=ZY2IZ2+IX22IZIXcosZIX=IZ2+IY22IZIYcosYIZIX2IY2=2IZ(IXcosZIXIYcosYIZ)cos2αcos2βL.H.S. =2cosγ(cosαcos(135β)cosβcos(135α))R.H.S. . \begin{aligned} & Z X^{2}=Z Y^{2} \\ \Longrightarrow & I Z^{2}+I X^{2}-2 \cdot I Z \cdot I X \cdot \cos \angle Z I X=I Z^{2}+I Y^{2}-2 \cdot I Z \cdot I Y \cdot \cos \angle Y I Z \\ \Longrightarrow & I X^{2}-I Y^{2}=2 \cdot I Z \cdot(I X \cdot \cos \angle Z I X-I Y \cdot \cos \angle Y I Z) \\ \Longrightarrow & \underbrace{\cos ^{2} \alpha-\cos ^{2} \beta}_{\text {L.H.S. }}=\underbrace{2 \cdot \cos \gamma \cdot\left(\cos \alpha \cdot \cos \left(135^{\circ}-\beta\right)-\cos \beta \cdot \cos \left(135^{\circ}-\alpha\right)\right)}_{\text {R.H.S. }} . \end{aligned}

A transformation of the left-hand side (L.H.S.) yields

 L.H.S. =cos2α(sin2β+cos2β)cos2β(sin2α+cos2α)=cos2αsin2βcos2βsin2α \begin{aligned} \text { L.H.S. } & =\cos ^{2} \alpha \cdot\left(\sin ^{2} \beta+\cos ^{2} \beta\right)-\cos ^{2} \beta \cdot\left(\sin ^{2} \alpha+\cos ^{2} \alpha\right) \\ & =\cos ^{2} \alpha \cdot \sin ^{2} \beta-\cos ^{2} \beta \cdot \sin ^{2} \alpha \end{aligned}

=(cosαsinβ+cosβsinα)(cosαsinβcosβsinα)=sin(β+α)sin(βα)=sin(45γ)sin(βα) \begin{aligned} & =(\cos \alpha \cdot \sin \beta+\cos \beta \cdot \sin \alpha) \cdot(\cos \alpha \cdot \sin \beta-\cos \beta \cdot \sin \alpha) \\ & =\sin (\beta+\alpha) \cdot \sin (\beta-\alpha)=\sin \left(45^{\circ}-\gamma\right) \cdot \sin (\beta-\alpha) \end{aligned}

whereas a transformation of the right-hand side (R.H.S.) leads to

 R.H.S. =2cosγ(cosα(cos(45+β))cosβ(cos(45+α)))=222cosγ(cosα(sinβcosβ)+cosβ(cosαsinα))=2cosγ(cosαsinβcosβsinα)=2cosγsin(βα) \begin{aligned} \text { R.H.S. } & =2 \cdot \cos \gamma \cdot\left(\cos \alpha \cdot\left(-\cos \left(45^{\circ}+\beta\right)\right)-\cos \beta \cdot\left(-\cos \left(45^{\circ}+\alpha\right)\right)\right) \\ & =2 \cdot \frac{\sqrt{2}}{2} \cdot \cos \gamma \cdot(\cos \alpha \cdot(\sin \beta-\cos \beta)+\cos \beta \cdot(\cos \alpha-\sin \alpha)) \\ & =\sqrt{2} \cdot \cos \gamma \cdot(\cos \alpha \cdot \sin \beta-\cos \beta \cdot \sin \alpha) \\ & =\sqrt{2} \cdot \cos \gamma \cdot \sin (\beta-\alpha) \end{aligned}

Equating L.H.S. and R.H.S. we obtain

sin(45γ)sin(βα)=2cosγsin(βα)sin(βα)(2cosγsin(45γ))=0α=β or 2cosγ=sin(45γ). \begin{aligned} & \sin \left(45^{\circ}-\gamma\right) \cdot \sin (\beta-\alpha)=\sqrt{2} \cdot \cos \gamma \cdot \sin (\beta-\alpha) \\ \Longrightarrow & \sin (\beta-\alpha) \cdot\left(\sqrt{2} \cdot \cos \gamma-\sin \left(45^{\circ}-\gamma\right)\right)=0 \\ \Longrightarrow & \alpha=\beta \quad \text { or } \quad \sqrt{2} \cdot \cos \gamma=\sin \left(45^{\circ}-\gamma\right) . \end{aligned}

But $\gamma<45^{\circ}$; so $\sqrt{2} \cdot \cos \gamma>\cos \gamma>\cos 45^{\circ}=\sin 45^{\circ}>\sin \left(45^{\circ}-\gamma\right)$. This leaves $\alpha=\beta$. With similar reasoning we have $\alpha=\gamma$, which means triangle $A B C$ must be equilateral.

G8 BGR (Bulgaria)

Let $A B C D$ be a circumscribed quadrilateral. Let $g$ be a line through $A$ which meets the segment $B C$ in $M$ and the line $C D$ in $N$. Denote by $I_{1}, I_{2}$, and $I_{3}$ the incenters of $\triangle A B M$, $\triangle M N C$, and $\triangle N D A$, respectively. Show that the orthocenter of $\triangle I_{1} I_{2} I_{3}$ lies on $g$.

Solution 1. Let $k_{1}, k_{2}$ and $k_{3}$ be the incircles of triangles $A B M, M N C$, and $N D A$, respectively (see Figure 1). We shall show that the tangent $h$ from $C$ to $k_{1}$ which is different from $C B$ is also tangent to $k_{3}$.

Figure 1 To this end, let $X$ denote the point of intersection of $g$ and $h$. Then $A B C X$ and $A B C D$ are circumscribed quadrilaterals, whence

CDCX=(AB+CD)(AB+CX)=(BC+AD)(BC+AX)=ADAX C D-C X=(A B+C D)-(A B+C X)=(B C+A D)-(B C+A X)=A D-A X

i.e.

AX+CD=CX+AD A X+C D=C X+A D

which in turn reveals that the quadrilateral $A X C D$ is also circumscribed. Thus $h$ touches indeed the circle $k_{3}$. Moreover, we find that $\angle I_{3} C I_{1}=\angle I_{3} C X+\angle X C I_{1}=\frac{1}{2}(\angle D C X+\angle X C B)=\frac{1}{2} \angle D C B=$ $\frac{1}{2}\left(180^{\circ}-\angle M C N\right)=180^{\circ}-\angle M I_{2} N=\angle I_{3} I_{2} I_{1}$, from which we conclude that $C, I_{1}, I_{2}, I_{3}$ are concyclic. Let now $L_{1}$ and $L_{3}$ be the reflection points of $C$ with respect to the lines $I_{2} I_{3}$ and $I_{1} I_{2}$ respectively. Since $I_{1} I_{2}$ is the angle bisector of $\angle N M C$, it follows that $L_{3}$ lies on $g$. By analogous reasoning, $L_{1}$ lies on $g$. Let $H$ be the orthocenter of $\triangle I_{1} I_{2} I_{3}$. We have $\angle I_{2} L_{3} I_{1}=\angle I_{1} C I_{2}=\angle I_{1} I_{3} I_{2}=180^{\circ}-\angle I_{1} H I_{2}$, which entails that the quadrilateral $I_{2} H I_{1} L_{3}$ is cyclic. Analogously, $I_{3} H L_{1} I_{2}$ is cyclic.

Then, working with oriented angles modulo $180^{\circ}$, we have

L3HI2=L3I1I2=I2I1C=I2I3C=L1I3I2=L1HI2, \angle L_{3} H I_{2}=\angle L_{3} I_{1} I_{2}=\angle I_{2} I_{1} C=\angle I_{2} I_{3} C=\angle L_{1} I_{3} I_{2}=\angle L_{1} H I_{2},

whence $L_{1}, L_{3}$, and $H$ are collinear. By $L_{1} \neq L_{3}$, the claim follows.

Comment. The last part of the argument essentially reproves the following fact: The Simson line of a point $P$ lying on the circumcircle of a triangle $A B C$ with respect to that triangle bisects the line segment connecting $P$ with the orthocenter of $A B C$.

Solution 2. We start by proving that $C, I_{1}, I_{2}$, and $I_{3}$ are concyclic.

Figure 2 To this end, notice first that $I_{2}, M, I_{1}$ are collinear, as are $N, I_{2}, I_{3}$ (see Figure 2). Denote by $\alpha, \beta, \gamma, \delta$ the internal angles of $A B C D$. By considerations in triangle $C M N$, it follows that $\angle I_{3} I_{2} I_{1}=\frac{\gamma}{2}$. We will show that $\angle I_{3} C I_{1}=\frac{\gamma}{2}$, too. Denote by $I$ the incenter of $A B C D$. Clearly, $I_{1} \in B I, I_{3} \in D I, \angle I_{1} A I_{3}=\frac{\alpha}{2}$. Using the abbreviation $[X, Y Z]$ for the distance from point $X$ to the line $Y Z$, we have because of $\angle B A I_{1}=\angle I A I_{3}$ and $\angle I_{1} A I=\angle I_{3} A D$ that

[I1,AB][I1,AI]=[I3,AI][I3,AD] \frac{\left[I_{1}, A B\right]}{\left[I_{1}, A I\right]}=\frac{\left[I_{3}, A I\right]}{\left[I_{3}, A D\right]}

Furthermore, consideration of the angle sums in $A I B, B I C, C I D$ and $D I A$ implies $\angle A I B+$ $\angle C I D=\angle B I C+\angle D I A=180^{\circ}$, from which we see

[I1,AI][I3,CI]=I1II3I=[I1,CI][I3,AI]. \frac{\left[I_{1}, A I\right]}{\left[I_{3}, C I\right]}=\frac{I_{1} I}{I_{3} I}=\frac{\left[I_{1}, C I\right]}{\left[I_{3}, A I\right]} .

Because of $\left[I_{1}, A B\right]=\left[I_{1}, B C\right],\left[I_{3}, A D\right]=\left[I_{3}, C D\right]$, multiplication yields

[I1,BC][I3,CI]=[I1,CI][I3,CD]. \frac{\left[I_{1}, B C\right]}{\left[I_{3}, C I\right]}=\frac{\left[I_{1}, C I\right]}{\left[I_{3}, C D\right]} .

By $\angle D C I=\angle I C B=\gamma / 2$ it follows that $\angle I_{1} C B=\angle I_{3} C I$ which concludes the proof of the above statement. Let the perpendicular from $I_{1}$ on $I_{2} I_{3}$ intersect $g$ at $Z$. Then $\angle M I_{1} Z=90^{\circ}-\angle I_{3} I_{2} I_{1}=$ $90^{\circ}-\gamma / 2=\angle M C I_{2}$. Since we have also $\angle Z M I_{1}=\angle I_{2} M C$, triangles $M Z I_{1}$ and $M I_{2} C$ are similar. From this one easily proves that also $M I_{2} Z$ and $M C I_{1}$ are similar. Because $C, I_{1}, I_{2}$, and $I_{3}$ are concyclic, $\angle M Z I_{2}=\angle M I_{1} C=\angle N I_{3} C$, thus $N I_{2} Z$ and $N C I_{3}$ are similar, hence $N C I_{2}$ and $N I_{3} Z$ are similar. We conclude $\angle Z I_{3} I_{2}=\angle I_{2} C N=90^{\circ}-\gamma / 2$, hence $I_{1} I_{2} \perp Z I_{3}$. This completes the proof.

Number Theory

N1 AUS (Australia)

A social club has $n$ members. They have the membership numbers $1,2, \ldots, n$, respectively. From time to time members send presents to other members, including items they have already received as presents from other members. In order to avoid the embarrassing situation that a member might receive a present that he or she has sent to other members, the club adds the following rule to its statutes at one of its annual general meetings: "A member with membership number $a$ is permitted to send a present to a member with membership number $b$ if and only if $a(b-1)$ is a multiple of $n$." Prove that, if each member follows this rule, none will receive a present from another member that he or she has already sent to other members.

Alternative formulation: Let $G$ be a directed graph with $n$ vertices $v_{1}, v_{2}, \ldots, v_{n}$, such that there is an edge going from $v_{a}$ to $v_{b}$ if and only if $a$ and $b$ are distinct and $a(b-1)$ is a multiple of $n$. Prove that this graph does not contain a directed cycle.

Solution 1. Suppose there is an edge from $v_{i}$ to $v_{j}$. Then $i(j-1)=i j-i=k n$ for some integer $k$, which implies $i=i j-k n$. If $\operatorname{gcd}(i, n)=d$ and $\operatorname{gcd}(j, n)=e$, then $e$ divides $i j-k n=i$ and thus $e$ also divides $d$. Hence, if there is an edge from $v_{i}$ to $v_{j}$, then $\operatorname{gcd}(j, n) \mid \operatorname{gcd}(i, n)$. If there is a cycle in $G$, say $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$, then we have

gcd(i1,n)gcd(ir,n)gcd(ir1,n)gcd(i2,n)gcd(i1,n) \operatorname{gcd}\left(i_{1}, n\right)\left|\operatorname{gcd}\left(i_{r}, n\right)\right| \operatorname{gcd}\left(i_{r-1}, n\right)|\ldots| \operatorname{gcd}\left(i_{2}, n\right) \mid \operatorname{gcd}\left(i_{1}, n\right)

which implies that all these greatest common divisors must be equal, say be equal to $t$. Now we pick any of the $i_{k}$, without loss of generality let it be $i_{1}$. Then $i_{r}\left(i_{1}-1\right)$ is a multiple of $n$ and hence also (by dividing by $t$ ), $i_{1}-1$ is a multiple of $\frac{n}{t}$. Since $i_{1}$ and $i_{1}-1$ are relatively prime, also $t$ and $\frac{n}{t}$ are relatively prime. So, by the Chinese remainder theorem, the value of $i_{1}$ is uniquely determined modulo $n=t \cdot \frac{n}{t}$ by the value of $t$. But, as $i_{1}$ was chosen arbitrarily among the $i_{k}$, this implies that all the $i_{k}$ have to be equal, a contradiction.

Solution 2. If $a, b, c$ are integers such that $a b-a$ and $b c-b$ are multiples of $n$, then also $a c-a=a(b c-b)+(a b-a)-(a b-a) c$ is a multiple of $n$. This implies that if there is an edge from $v_{a}$ to $v_{b}$ and an edge from $v_{b}$ to $v_{c}$, then there also must be an edge from $v_{a}$ to $v_{c}$. Therefore, if there are any cycles at all, the smallest cycle must have length 2. But suppose the vertices $v_{a}$ and $v_{b}$ form such a cycle, i. e., $a b-a$ and $a b-b$ are both multiples of $n$. Then $a-b$ is also a multiple of $n$, which can only happen if $a=b$, which is impossible.

Solution 3. Suppose there was a cycle $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$. Then $i_{1}\left(i_{2}-1\right)$ is a multiple of $n$, i.e., $i_{1} \equiv i_{1} i_{2} \bmod n$. Continuing in this manner, we get $i_{1} \equiv i_{1} i_{2} \equiv$ $i_{1} i_{2} i_{3} \equiv i_{1} i_{2} i_{3} \ldots i_{r} \bmod n$. But the same holds for all $i_{k}$, i. e., $i_{k} \equiv i_{1} i_{2} i_{3} \ldots i_{r} \bmod n$. Hence $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \bmod n$, which means $i_{1}=i_{2}=\cdots=i_{r}$, a contradiction.

Solution 4. Let $n=k$ be the smallest value of $n$ for which the corresponding graph has a cycle. We show that $k$ is a prime power. If $k$ is not a prime power, it can be written as a product $k=d e$ of relatively prime integers greater than 1. Reducing all the numbers modulo $d$ yields a single vertex or a cycle in the corresponding graph on $d$ vertices, because if $a(b-1) \equiv 0 \bmod k$ then this equation also holds modulo $d$. But since the graph on $d$ vertices has no cycles, by the minimality of $k$, we must have that all the indices of the cycle are congruent modulo $d$. The same holds modulo $e$ and hence also modulo $k=d e$. But then all the indices are equal, which is a contradiction. Thus $k$ must be a prime power $k=p^{m}$. There are no edges ending at $v_{k}$, so $v_{k}$ is not contained in any cycle. All edges not starting at $v_{k}$ end at a vertex belonging to a non-multiple of $p$, and all edges starting at a non-multiple of $p$ must end at $v_{1}$. But there is no edge starting at $v_{1}$. Hence there is no cycle.

Solution 5. Suppose there was a cycle $v_{i_{1}} \rightarrow v_{i_{2}} \rightarrow \cdots \rightarrow v_{i_{r}} \rightarrow v_{i_{1}}$. Let $q=p^{m}$ be a prime power dividing $n$. We claim that either $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \equiv 0 \bmod q$ or $i_{1} \equiv i_{2} \equiv \cdots \equiv i_{r} \equiv$ $1 \bmod q$. Suppose that there is an $i_{s}$ not divisible by $q$. Then, as $i_{s}\left(i_{s+1}-1\right)$ is a multiple of $q, i_{s+1} \equiv$ $1 \bmod p$. Similarly, we conclude $i_{s+2} \equiv 1 \bmod p$ and so on. So none of the labels is divisible by $p$, but since $i_{s}\left(i_{s+1}-1\right)$ is a multiple of $q=p^{m}$ for all $s$, all $i_{s+1}$ are congruent to 1 modulo $q$. This proves the claim. Now, as all the labels are congruent modulo all the prime powers dividing $n$, they must all be equal by the Chinese remainder theorem. This is a contradiction.

N2 PER (Peru)

A positive integer $N$ is called balanced, if $N=1$ or if $N$ can be written as a product of an even number of not necessarily distinct primes. Given positive integers $a$ and $b$, consider the polynomial $P$ defined by $P(x)=(x+a)(x+b)$. (a) Prove that there exist distinct positive integers $a$ and $b$ such that all the numbers $P(1), P(2)$, ..., $P(50)$ are balanced. (b) Prove that if $P(n)$ is balanced for all positive integers $n$, then $a=b$.

Solution. Define a function $f$ on the set of positive integers by $f(n)=0$ if $n$ is balanced and $f(n)=1$ otherwise. Clearly, $f(n m) \equiv f(n)+f(m) \bmod 2$ for all positive integers $n, m$. (a) Now for each positive integer $n$ consider the binary sequence $(f(n+1), f(n+2), \ldots, f(n+$ $50)$ ). As there are only $2^{50}$ different such sequences there are two different positive integers $a$ and $b$ such that

(f(a+1),f(a+2),,f(a+50))=(f(b+1),f(b+2),,f(b+50)) (f(a+1), f(a+2), \ldots, f(a+50))=(f(b+1), f(b+2), \ldots, f(b+50))

But this implies that for the polynomial $P(x)=(x+a)(x+b)$ all the numbers $P(1), P(2)$, $\ldots, P(50)$ are balanced, since for all $1 \leq k \leq 50$ we have $f(P(k)) \equiv f(a+k)+f(b+k) \equiv$ $2 f(a+k) \equiv 0 \bmod 2$. (b) Now suppose $P(n)$ is balanced for all positive integers $n$ and $a<b$. Set $n=k(b-a)-a$ for sufficiently large $k$, such that $n$ is positive. Then $P(n)=k(k+1)(b-a)^{2}$, and this number can only be balanced, if $f(k)=f(k+1)$ holds. Thus, the sequence $f(k)$ must become constant for sufficiently large $k$. But this is not possible, as for every prime $p$ we have $f(p)=1$ and for every square $t^{2}$ we have $f\left(t^{2}\right)=0$. Hence $a=b$.

Comment. Given a positive integer $k$, a computer search for the pairs of positive integers $(a, b)$, for which $P(1), P(2), \ldots, P(k)$ are all balanced yields the following results with minimal sum $a+b$ and $a<b$ :

$k$ 3 4 5 10 20
$(a, b)$ $(2,4)$ $(6,11)$ $(8,14)$ $(20,34)$ $(1751,3121)$

Therefore, trying to find $a$ and $b$ in part (a) of the problem cannot be done by elementary calculations.

N3 EST (Estonia)

Let $f$ be a non-constant function from the set of positive integers into the set of positive integers, such that $a-b$ divides $f(a)-f(b)$ for all distinct positive integers $a, b$. Prove that there exist infinitely many primes $p$ such that $p$ divides $f(c)$ for some positive integer $c$.

Solution 1. Denote by $v_{p}(a)$ the exponent of the prime $p$ in the prime decomposition of $a$. Assume that there are only finitely many primes $p_{1}, p_{2}, \ldots, p_{m}$ that divide some function value produced of $f$. There are infinitely many positive integers $a$ such that $v_{p_{i}}(a)>v_{p_{i}}(f(1))$ for all $i=1,2, \ldots, m$, e.g. $a=\left(p_{1} p_{2} \ldots p_{m}\right)^{\alpha}$ with $\alpha$ sufficiently large. Pick any such $a$. The condition of the problem then yields $a \mid(f(a+1)-f(1))$. Assume $f(a+1) \neq f(1)$. Then we must have $v_{p_{i}}(f(a+1)) \neq$ $v_{p_{i}}(f(1))$ for at least one $i$. This yields $v_{p_{i}}(f(a+1)-f(1))=\min \left{v_{p_{i}}(f(a+1)), v_{p_{i}}(f(1))\right} \leq$ $v_{p_{1}}(f(1))<v_{p_{i}}(a)$. But this contradicts the fact that $a \mid(f(a+1)-f(1))$. Hence we must have $f(a+1)=f(1)$ for all such $a$. Now, for any positive integer $b$ and all such $a$, we have $(a+1-b) \mid(f(a+1)-f(b))$, i.e., $(a+1-b) \mid(f(1)-f(b))$. Since this is true for infinitely many positive integers $a$ we must have $f(b)=f(1)$. Hence $f$ is a constant function, a contradiction. Therefore, our initial assumption was false and there are indeed infinitely many primes $p$ dividing $f(c)$ for some positive integer c.

Solution 2. Assume that there are only finitely many primes $p_{1}, p_{2}, \ldots, p_{m}$ that divide some function value of $f$. Since $f$ is not identically 1 , we must have $m \geq 1$. Then there exist non-negative integers $\alpha_{1}, \ldots, \alpha_{m}$ such that

f(1)=p1α1p2α2pmαm f(1)=p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{m}^{\alpha_{m}}

We can pick a positive integer $r$ such that $f(r) \neq f(1)$. Let

M=1+p1α1+1p2α2+1pmαm+1(f(r)+r) M=1+p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1} \cdot(f(r)+r)

Then for all $i \in{1, \ldots, m}$ we have that $p_{i}^{\alpha_{i}+1}$ divides $M-1$ and hence by the condition of the problem also $f(M)-f(1)$. This implies that $f(M)$ is divisible by $p_{i}^{\alpha_{i}}$ but not by $p_{i}^{\alpha_{i}+1}$ for all $i$ and therefore $f(M)=f(1)$. Hence

Mr>p1α1+1p2α2+1pmαm+1(f(r)+r)rp1α1+1p2α2+1pmαm+1+(f(r)+r)r>p1α1p2α2pmαm+f(r)f(M)f(r). \begin{aligned} M-r & >p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1} \cdot(f(r)+r)-r \\ & \geq p_{1}^{\alpha_{1}+1} p_{2}^{\alpha_{2}+1} \ldots p_{m}^{\alpha_{m}+1}+(f(r)+r)-r \\ & >p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{m}^{\alpha_{m}}+f(r) \\ & \geq|f(M)-f(r)| . \end{aligned}

But since $M-r$ divides $f(M)-f(r)$ this can only be true if $f(r)=f(M)=f(1)$, which contradicts the choice of $r$.

Comment. In the case that $f$ is a polynomial with integer coefficients the result is well-known, see e.g. W. Schwarz, Einführung in die Methoden der Primzahltheorie, 1969.

N4 PRK (Democratic People's Republic of Korea)

Find all positive integers $n$ such that there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{n}$ satisfying

ak+1=ak2+1ak1+11 a_{k+1}=\frac{a_{k}^{2}+1}{a_{k-1}+1}-1

for every $k$ with $2 \leq k \leq n-1$.

Solution 1. Such a sequence exists for $n=1,2,3,4$ and no other $n$. Since the existence of such a sequence for some $n$ implies the existence of such a sequence for all smaller $n$, it suffices to prove that $n=5$ is not possible and $n=4$ is possible. Assume first that for $n=5$ there exists a sequence of positive integers $a_{1}, a_{2}, \ldots, a_{5}$ satisfying the conditions

a22+1=(a1+1)(a3+1),a32+1=(a2+1)(a4+1),a42+1=(a3+1)(a5+1). \begin{aligned} & a_{2}^{2}+1=\left(a_{1}+1\right)\left(a_{3}+1\right), \\ & a_{3}^{2}+1=\left(a_{2}+1\right)\left(a_{4}+1\right), \\ & a_{4}^{2}+1=\left(a_{3}+1\right)\left(a_{5}+1\right) . \end{aligned}

Assume $a_{1}$ is odd, then $a_{2}$ has to be odd as well and as then $a_{2}^{2}+1 \equiv 2 \bmod 4, a_{3}$ has to be even. But this is a contradiction, since then the even number $a_{2}+1$ cannot divide the odd number $a_{3}^{2}+1$. Hence $a_{1}$ is even. If $a_{2}$ is odd, $a_{3}^{2}+1$ is even (as a multiple of $a_{2}+1$ ) and hence $a_{3}$ is odd, too. Similarly we must have $a_{4}$ odd as well. But then $a_{3}^{2}+1$ is a product of two even numbers $\left(a_{2}+1\right)\left(a_{4}+1\right)$ and thus is divisible by 4 , which is a contradiction as for odd $a_{3}$ we have $a_{3}^{2}+1 \equiv 2 \bmod 4$. Hence $a_{2}$ is even. Furthermore $a_{3}+1$ divides the odd number $a_{2}^{2}+1$ and so $a_{3}$ is even. Similarly, $a_{4}$ and $a_{5}$ are even as well. Now set $x=a_{2}$ and $y=a_{3}$. From the given condition we get $(x+1) \mid\left(y^{2}+1\right)$ and $(y+1) \mid\left(x^{2}+1\right)$. We will prove that there is no pair of positive even numbers $(x, y)$ satisfying these two conditions, thus yielding a contradiction to the assumption. Assume there exists a pair $\left(x_{0}, y_{0}\right)$ of positive even numbers satisfying the two conditions $\left(x_{0}+1\right) \mid\left(y_{0}^{2}+1\right)$ and $\left(y_{0}+1\right) \mid\left(x_{0}^{2}+1\right)$. Then one has $\left(x_{0}+1\right) \mid\left(y_{0}^{2}+1+x_{0}^{2}-1\right)$, i.e., $\left(x_{0}+1\right) \mid\left(x_{0}^{2}+y_{0}^{2}\right)$, and similarly $\left(y_{0}+1\right) \mid\left(x_{0}^{2}+y_{0}^{2}\right)$. Any common divisor $d$ of $x_{0}+1$ and $y_{0}+1$ must hence also divide the number $\left(x_{0}^{2}+1\right)+\left(y_{0}^{2}+1\right)-\left(x_{0}^{2}+y_{0}^{2}\right)=2$. But as $x_{0}+1$ and $y_{0}+1$ are both odd, we must have $d=1$. Thus $x_{0}+1$ and $y_{0}+1$ are relatively prime and therefore there exists a positive integer $k$ such that

k(x+1)(y+1)=x2+y2 k(x+1)(y+1)=x^{2}+y^{2}

has the solution $\left(x_{0}, y_{0}\right)$. We will show that the latter equation has no solution $(x, y)$ in positive even numbers.

Assume there is a solution. Pick the solution $\left(x_{1}, y_{1}\right)$ with the smallest sum $x_{1}+y_{1}$ and assume $x_{1} \geq y_{1}$. Then $x_{1}$ is a solution to the quadratic equation

x2k(y1+1)x+y12k(y1+1)=0. x^{2}-k\left(y_{1}+1\right) x+y_{1}^{2}-k\left(y_{1}+1\right)=0 .

Let $x_{2}$ be the second solution, which by Vieta's theorem fulfills $x_{1}+x_{2}=k\left(y_{1}+1\right)$ and $x_{1} x_{2}=y_{1}^{2}-k\left(y_{1}+1\right)$. If $x_{2}=0$, the second equation implies $y_{1}^{2}=k\left(y_{1}+1\right)$, which is impossible, as $y_{1}+1>1$ cannot divide the relatively prime number $y_{1}^{2}$. Therefore $x_{2} \neq 0$. Also we get $\left(x_{1}+1\right)\left(x_{2}+1\right)=x_{1} x_{2}+x_{1}+x_{2}+1=y_{1}^{2}+1$ which is odd, and hence $x_{2}$ must be even and positive. Also we have $x_{2}+1=\frac{y_{1}^{2}+1}{x_{1}+1} \leq \frac{y_{1}^{2}+1}{y_{1}+1} \leq y_{1} \leq x_{1}$. But this means that the pair $\left(x^{\prime}, y^{\prime}\right)$ with $x^{\prime}=y_{1}$ and $y^{\prime}=x_{2}$ is another solution of $k(x+1)(y+1)=x^{2}+y^{2}$ in even positive numbers with $x^{\prime}+y^{\prime}<x_{1}+y_{1}$, a contradiction. Therefore we must have $n \leq 4$. When $n=4$, a possible example of a sequence is $a_{1}=4, a_{2}=33, a_{3}=217$ and $a_{4}=1384$.

Solution 2. It is easy to check that for $n=4$ the sequence $a_{1}=4, a_{2}=33, a_{3}=217$ and $a_{4}=1384$ is possible. Now assume there is a sequence with $n \geq 5$. Then we have in particular

a22+1=(a1+1)(a3+1),a32+1=(a2+1)(a4+1),a42+1=(a3+1)(a5+1). \begin{aligned} & a_{2}^{2}+1=\left(a_{1}+1\right)\left(a_{3}+1\right), \\ & a_{3}^{2}+1=\left(a_{2}+1\right)\left(a_{4}+1\right), \\ & a_{4}^{2}+1=\left(a_{3}+1\right)\left(a_{5}+1\right) . \end{aligned}

Also assume without loss of generality that among all such quintuples $\left(a_{1}, a_{2}, a_{3}, a_{4}, a_{5}\right)$ we have chosen one with minimal $a_{1}$. One shows quickly the following fact: If three positive integers $x, y, z$ fulfill $y^{2}+1=(x+1)(z+1)$ and if $y$ is even, then $x$ and $z$ are even as well and either $x<y<z$ or $z<y<x$ holds. Indeed, the first part is obvious and from $x<y$ we conclude

z+1=y2+1x+1y2+1y>y z+1=\frac{y^{2}+1}{x+1} \geq \frac{y^{2}+1}{y}>y

and similarly in the other case. Now, if $a_{3}$ was odd, then $\left(a_{2}+1\right)\left(a_{4}+1\right)=a_{3}^{2}+1 \equiv 2 \bmod 4$ would imply that one of $a_{2}$ or $a_{4}$ is even, this contradicts (1). Thus $a_{3}$ and hence also $a_{1}, a_{2}, a_{4}$ and $a_{5}$ are even. According to (1), one has $a_{1}<a_{2}<a_{3}<a_{4}<a_{5}$ or $a_{1}>a_{2}>a_{3}>a_{4}>a_{5}$ but due to the minimality of $a_{1}$ the first series of inequalities must hold. Consider the identity $\left(a_{3}+1\right)\left(a_{1}+a_{3}\right)=a_{3}^{2}-1+\left(a_{1}+1\right)\left(a_{3}+1\right)=a_{2}^{2}+a_{3}^{2}=a_{2}^{2}-1+\left(a_{2}+1\right)\left(a_{4}+1\right)=\left(a_{2}+1\right)\left(a_{2}+a_{4}\right)$. Any common divisor of the two odd numbers $a_{2}+1$ and $a_{3}+1$ must also divide $\left(a_{2}+1\right)\left(a_{4}+\right.$ $1)-\left(a_{3}+1\right)\left(a_{3}-1\right)=2$, so these numbers are relatively prime. Hence the last identity shows that $a_{1}+a_{3}$ must be a multiple of $a_{2}+1$, i.e. there is an integer $k$ such that

a1+a3=k(a2+1) a_{1}+a_{3}=k\left(a_{2}+1\right)

Now set $a_{0}=k\left(a_{1}+1\right)-a_{2}$. This is an integer and we have

(a0+1)(a2+1)=k(a1+1)(a2+1)(a21)(a2+1)=(a1+1)(a1+a3)(a1+1)(a3+1)+2=(a1+1)(a11)+2=a12+1 \begin{aligned} \left(a_{0}+1\right)\left(a_{2}+1\right) & =k\left(a_{1}+1\right)\left(a_{2}+1\right)-\left(a_{2}-1\right)\left(a_{2}+1\right) \\ & =\left(a_{1}+1\right)\left(a_{1}+a_{3}\right)-\left(a_{1}+1\right)\left(a_{3}+1\right)+2 \\ & =\left(a_{1}+1\right)\left(a_{1}-1\right)+2=a_{1}^{2}+1 \end{aligned}

Thus $a_{0} \geq 0$. If $a_{0}>0$, then by (1) we would have $a_{0}<a_{1}<a_{2}$ and then the quintuple $\left(a_{0}, a_{1}, a_{2}, a_{3}, a_{4}\right)$ would contradict the minimality of $a_{1}$. Hence $a_{0}=0$, implying $a_{2}=a_{1}^{2}$. But also $a_{2}=k\left(a_{1}+1\right)$, which finally contradicts the fact that $a_{1}+1>1$ is relatively prime to $a_{1}^{2}$ and thus cannot be a divisior of this number. Hence $n \geq 5$ is not possible.

Comment 1. Finding the example for $n=4$ is not trivial and requires a tedious calculation, but it can be reduced to checking a few cases. The equations $\left(a_{1}+1\right)\left(a_{3}+1\right)=a_{2}^{2}+1$ and $\left(a_{2}+1\right)\left(a_{4}+1\right)=a_{3}^{2}+1$ imply, as seen in the proof, that $a_{1}$ is even and $a_{2}, a_{3}, a_{4}$ are odd. The case $a_{1}=2$ yields $a_{2}^{2} \equiv-1 \bmod 3$ which is impossible. Hence $a_{1}=4$ is the smallest possibility. In this case $a_{2}^{2} \equiv-1 \bmod 5$ and $a_{2}$ is odd, which implies $a_{2} \equiv 3$ or $a_{2} \equiv 7 \bmod 10$. Hence we have to start checking $a_{2}=7,13,17,23,27,33$ and in the last case we succeed.

Comment 2. The choice of $a_{0}=k\left(a_{1}+1\right)-a_{2}$ in the second solution appears more natural if one considers that by the previous calculations one has $a_{1}=k\left(a_{2}+1\right)-a_{3}$ and $a_{2}=k\left(a_{3}+1\right)-a_{4}$. Alternatively, one can solve the equation (2) for $a_{3}$ and use $a_{2}^{2}+1=\left(a_{1}+1\right)\left(a_{3}+1\right)$ to get $a_{2}^{2}-k\left(a_{1}+1\right) a_{2}+a_{1}^{2}-k\left(a_{1}+1\right)=0$. Now $a_{0}$ is the second solution to this quadratic equation in $a_{2}$ (Vieta jumping).

N5 HUN (Hungary)

Let $P(x)$ be a non-constant polynomial with integer coefficients. Prove that there is no function $T$ from the set of integers into the set of integers such that the number of integers $x$ with $T^{n}(x)=x$ is equal to $P(n)$ for every $n \geq 1$, where $T^{n}$ denotes the $n$-fold application of $T$.

Solution 1. Assume there is a polynomial $P$ of degree at least 1 with the desired property for a given function $T$. Let $A(n)$ denote the set of all $x \in \mathbb{Z}$ such that $T^{n}(x)=x$ and let $B(n)$ denote the set of all $x \in \mathbb{Z}$ for which $T^{n}(x)=x$ and $T^{k}(x) \neq x$ for all $1 \leq k<n$. Both sets are finite under the assumption made. For each $x \in A(n)$ there is a smallest $k \geq 1$ such that $T^{k}(x)=x$, i.e., $x \in B(k)$. Let $d=\operatorname{gcd}(k, n)$. There are positive integers $r, s$ such that $r k-s n=d$ and hence $x=T^{r k}(x)=T^{s n+d}(x)=T^{d}\left(T^{s n}(x)\right)=T^{d}(x)$. The minimality of $k$ implies $d=k$, i.e., $k \mid n$. On the other hand one clearly has $B(k) \subset A(n)$ if $k \mid n$ and thus we have $A(n)=\bigcup_{d \mid n} B(d)$ as a disjoint union and hence

A(n)=dnB(d) |A(n)|=\sum_{d \mid n}|B(d)|

Furthermore, for every $x \in B(n)$ the elements $x, T^{1}(x), T^{2}(x), \ldots, T^{n-1}(x)$ are $n$ distinct elements of $B(n)$. The fact that they are in $A(n)$ is obvious. If for some $k<n$ and some $0 \leq i<n$ we had $T^{k}\left(T^{i}(x)\right)=T^{i}(x)$, i.e. $\quad T^{k+i}(x)=T^{i}(x)$, that would imply $x=T^{n}(x)=T^{n-i}\left(T^{i}(x)\right)=T^{n-i}\left(T^{k+i}(x)\right)=T^{k}\left(T^{n}(x)\right)=T^{k}(x)$ contradicting the minimality of $n$. Thus $T^{i}(x) \in B(n)$ and $T^{i}(x) \neq T^{j}(x)$ for $0 \leq i<j \leq n-1$. So indeed, $T$ permutes the elements of $B(n)$ in (disjoint) cycles of length $n$ and in particular one has $n||B(n)|$. Now let $P(x)=\sum_{i=0}^{k} a_{i} x^{i}, a_{i} \in \mathbb{Z}, k \geq 1, a_{k} \neq 0$ and suppose that $|A(n)|=P(n)$ for all $n \geq 1$. Let $p$ be any prime. Then

p2B(p2)=A(p2)A(p)=a1(p2p)+a2(p4p2)+ p^{2}| | B\left(p^{2}\right)\left|=\left|A\left(p^{2}\right)\right|-|A(p)|=a_{1}\left(p^{2}-p\right)+a_{2}\left(p^{4}-p^{2}\right)+\ldots\right.

Hence $p \mid a_{1}$ and since this is true for all primes we must have $a_{1}=0$. Now consider any two different primes $p$ and $q$. Since $a_{1}=0$ we have that

A(p2q)A(pq)=a2(p4q2p2q2)+a3(p6q3p3q3)+ \left|A\left(p^{2} q\right)\right|-|A(p q)|=a_{2}\left(p^{4} q^{2}-p^{2} q^{2}\right)+a_{3}\left(p^{6} q^{3}-p^{3} q^{3}\right)+\ldots

is a multiple of $p^{2} q$. But we also have

p2qB(p2q)=A(p2q)A(pq)B(p2) p^{2} q| | B\left(p^{2} q\right)\left|=\left|A\left(p^{2} q\right)\right|-|A(p q)|-\left|B\left(p^{2}\right)\right|\right.

This implies

p2qB(p2)=A(p2)A(p)=a2(p4p2)+a3(p6p3)++ak(p2kpk) p^{2} q| | B\left(p^{2}\right)\left|=\left|A\left(p^{2}\right)\right|-|A(p)|=a_{2}\left(p^{4}-p^{2}\right)+a_{3}\left(p^{6}-p^{3}\right)+\cdots+a_{k}\left(p^{2 k}-p^{k}\right)\right.

Since this is true for every prime $q$ we must have $a_{2}\left(p^{4}-p^{2}\right)+a_{3}\left(p^{6}-p^{3}\right)+\cdots+a_{k}\left(p^{2 k}-p^{k}\right)=0$ for every prime $p$. Since this expression is a polynomial in $p$ of degree $2 k$ (because $a_{k} \neq 0$ ) this is a contradiction, as such a polynomial can have at most $2 k$ zeros.

Comment. The last contradiction can also be reached via

ak=limp1p2k(a2(p4p2)+a3(p6p3)++ak(p2kpk))=0. a_{k}=\lim _{p \rightarrow \infty} \frac{1}{p^{2 k}}\left(a_{2}\left(p^{4}-p^{2}\right)+a_{3}\left(p^{6}-p^{3}\right)+\cdots+a_{k}\left(p^{2 k}-p^{k}\right)\right)=0 .

Solution 2. As in the first solution define $A(n)$ and $B(n)$ and assume that a polynomial $P$ with the required property exists. This again implies that $|A(n)|$ and $|B(n)|$ is finite for all positive integers $n$ and that

P(n)=A(n)=dnB(d) and nB(n). P(n)=|A(n)|=\sum_{d \mid n}|B(d)| \quad \text { and } \quad n||B(n)| .

Now, for any two distinct primes $p$ and $q$, we have

P(0)P(pq)B(1)+B(p)+B(q)+B(pq)B(1)+B(p)q P(0) \equiv P(p q) \equiv|B(1)|+|B(p)|+|B(q)|+|B(p q)| \equiv|B(1)|+|B(p)| \quad \bmod q

Thus, for any fixed $p$, the expression $P(0)-|B(1)|-|B(p)|$ is divisible by arbitrarily large primes $q$ which means that $P(0)=|B(1)|+|B(p)|=P(p)$ for any prime $p$. This implies that the polynomial $P$ is constant, a contradiction.

N6 TUR (Turkey)

Let $k$ be a positive integer. Show that if there exists a sequence $a_{0}, a_{1}, \ldots$ of integers satisfying the condition

an=an1+nkn for all n1 a_{n}=\frac{a_{n-1}+n^{k}}{n} \quad \text { for all } n \geq 1

then $k-2$ is divisible by 3 .

Solution 1. Part $A$. For each positive integer $k$, there exists a polynomial $P_{k}$ of degree $k-1$ with integer coefficients, i. e., $P_{k} \in \mathbb{Z}[x]$, and an integer $q_{k}$ such that the polynomial identity

xPk(x)=xk+Pk(x1)+qk x P_{k}(x)=x^{k}+P_{k}(x-1)+q_{k}

is satisfied. To prove this, for fixed $k$ we write

Pk(x)=bk1xk1++b1x+b0 P_{k}(x)=b_{k-1} x^{k-1}+\cdots+b_{1} x+b_{0}

and determine the coefficients $b_{k-1}, b_{k-2}, \ldots, b_{0}$ and the number $q_{k}$ successively. Obviously, we have $b_{k-1}=1$. For $m=k-1, k-2, \ldots, 1$, comparing the coefficients of $x^{m}$ in the identity $\left(I_{k}\right)$ results in an expression of $b_{m-1}$ as an integer linear combination of $b_{k-1}, \ldots, b_{m}$, and finally $q_{k}=-P_{k}(-1)$. Part $B$. Let $k$ be a positive integer, and let $a_{0}, a_{1}, \ldots$ be a sequence of real numbers satisfying the recursion given in the problem. This recursion can be written as

anPk(n)=an1Pk(n1)nqkn for all n1 a_{n}-P_{k}(n)=\frac{a_{n-1}-P_{k}(n-1)}{n}-\frac{q_{k}}{n} \quad \text { for all } n \geq 1

which by induction gives

anPk(n)=a0Pk(0)n!qki=0n1i!n! for all n1 a_{n}-P_{k}(n)=\frac{a_{0}-P_{k}(0)}{n!}-q_{k} \sum_{i=0}^{n-1} \frac{i!}{n!} \text { for all } n \geq 1

Therefore, the numbers $a_{n}$ are integers for all $n \geq 1$ only if

a0=Pk(0) and qk=0 a_{0}=P_{k}(0) \quad \text { and } \quad q_{k}=0

Part $C$. Multiplying the identity $\left(I_{k}\right)$ by $x^{2}+x$ and subtracting the identities $\left(I_{k+1}\right),\left(I_{k+2}\right)$ and $q_{k} x^{2}=q_{k} x^{2}$ therefrom, we obtain

xTk(x)=Tk(x1)+2x(Pk(x1)+qk)(qk+2+qk+1+qk), x T_{k}(x)=T_{k}(x-1)+2 x\left(P_{k}(x-1)+q_{k}\right)-\left(q_{k+2}+q_{k+1}+q_{k}\right),

where the polynomials $T_{k} \in \mathbb{Z}[x]$ are defined by $T_{k}(x)=\left(x^{2}+x\right) P_{k}(x)-P_{k+1}(x)-P_{k+2}(x)-q_{k} x$. Thus

xTk(x)Tk(x1)+qk+2+qk+1+qk2,k=1,2, x T_{k}(x) \equiv T_{k}(x-1)+q_{k+2}+q_{k+1}+q_{k} \bmod 2, \quad k=1,2, \ldots

Comparing the degrees, we easily see that this is only possible if $T_{k}$ is the zero polynomial modulo 2 , and

qk+2qk+1+qk2 for k=1,2, q_{k+2} \equiv q_{k+1}+q_{k} \bmod 2 \quad \text { for } k=1,2, \ldots

Since $q_{1}=-1$ and $q_{2}=0$, these congruences finish the proof.

Solution 2. Part $A$ and $B$. Let $k$ be a positive integer, and suppose there is a sequence $a_{0}, a_{1}, \ldots$ as required. We prove: There exists a polynomial $P \in \mathbb{Z}[x]$, i. e., with integer coefficients, such that $a_{n}=P(n), n=0,1, \ldots$, and $\quad x P(x)=x^{k}+P(x-1)$. To prove this, we write $\quad P(x)=b_{k-1} x^{k-1}+\cdots+b_{1} x+b_{0} \quad$ and determine the coefficients $b_{k-1}, b_{k-2}, \ldots, b_{0}$ successively such that

xP(x)xkP(x1)=q, x P(x)-x^{k}-P(x-1)=q,

where $q=q_{k}$ is an integer. Comparing the coefficients of $x^{m}$ results in an expression of $b_{m-1}$ as an integer linear combination of $b_{k-1}, \ldots, b_{m}$. Defining $c_{n}=a_{n}-P(n)$, we get

P(n)+cn=P(n1)+cn1+nkn, i.e., q+ncn=cn1, \begin{aligned} P(n)+c_{n} & =\frac{P(n-1)+c_{n-1}+n^{k}}{n}, \quad \text { i.e., } \\ q+n c_{n} & =c_{n-1}, \end{aligned}

hence

cn=c0n!q0!+1!++(n1)!n! c_{n}=\frac{c_{0}}{n!}-q \cdot \frac{0!+1!+\cdots+(n-1)!}{n!}

We conclude $\lim {n \rightarrow \infty} c{n}=0$, which, using $c_{n} \in \mathbb{Z}$, implies $c_{n}=0$ for sufficiently large $n$. Therefore, we get $q=0$ and $c_{n}=0, n=0,1, \ldots$. Part C. Suppose that $q=q_{k}=0$, i. e. $x P(x)=x^{k}+P(x-1)$. To consider this identity for arguments $x \in \mathbb{F}{4}$, we write $\mathbb{F}{4}={0,1, \alpha, \alpha+1}$. Then we get

αPk(α)=αk+Pk(α+1) and (α+1)Pk(α+1)=(α+1)k+Pk(α), \begin{aligned} \alpha P_{k}(\alpha) & =\alpha^{k}+P_{k}(\alpha+1) \quad \text { and } \\ (\alpha+1) P_{k}(\alpha+1) & =(\alpha+1)^{k}+P_{k}(\alpha), \end{aligned}

hence

Pk(α)=1Pk(α)=(α+1)αPk(α)=(α+1)Pk(α+1)+(α+1)αk=Pk(α)+(α+1)k+(α+1)αk. \begin{aligned} P_{k}(\alpha) & =1 \cdot P_{k}(\alpha)=(\alpha+1) \alpha P_{k}(\alpha) \\ & =(\alpha+1) P_{k}(\alpha+1)+(\alpha+1) \alpha^{k} \\ & =P_{k}(\alpha)+(\alpha+1)^{k}+(\alpha+1) \alpha^{k} . \end{aligned}

Now, $(\alpha+1)^{k-1}=\alpha^{k}$ implies $k \equiv 2 \bmod 3$.

Comment 1. For $k=2$, the sequence given by $a_{n}=n+1, n=0,1, \ldots$, satisfies the conditions of the problem.

Comment 2. The first few polynomials $P_{k}$ and integers $q_{k}$ are

P1(x)=1,q1=1,P2(x)=x+1,q2=0,P3(x)=x2+x1,q3=1,P4(x)=x3+x22x1,q4=1,P5(x)=x4+x33x2+5,q5=2,P6(x)=x5+x44x3+2x2+10x5,q6=9,q7=9,q8=50,q9=267,q10=413,q11=2180. \begin{aligned} & P_{1}(x)=1, \quad q_{1}=-1, \\ & P_{2}(x)=x+1, \quad q_{2}=0, \\ & P_{3}(x)=x^{2}+x-1, \quad q_{3}=1, \\ & P_{4}(x)=x^{3}+x^{2}-2 x-1, \quad q_{4}=-1, \\ & P_{5}(x)=x^{4}+x^{3}-3 x^{2}+5, \quad q_{5}=-2, \\ & P_{6}(x)=x^{5}+x^{4}-4 x^{3}+2 x^{2}+10 x-5, \quad q_{6}=9, \\ & q_{7}=-9, \quad q_{8}=-50, \quad q_{9}=267, \quad q_{10}=-413, \quad q_{11}=-2180 . \end{aligned}

A lookup in the On-Line Encyclopedia of Integer Sequences (A000587) reveals that the sequence $q_{1},-q_{2}, q_{3},-q_{4}, q_{5}, \ldots$ is known as Uppuluri-CARPENTER numbers. The result that $q_{k}=0$ implies $k \equiv 2 \bmod 3$ is contained in Murty, Summer: On the $p$-adic series $\sum_{n=0}^{\infty} n^{k} \cdot n$ !. CRM Proc. and Lecture Notes 36, 2004. As shown by Alexander (Non-Vanishing of Uppuluri-Carpenter Numbers, Preprint 2006), Uppuluri-Carpenter numbers are zero at most twice.

Comment 3. The numbers $q_{k}$ can be written in terms of the Stirling numbers of the second kind. To show this, we fix the notation such that

xk=Sk1,k1x(x1)(xk+1)+Sk1,k2x(x1)(xk+2)++Sk1,0x \begin{aligned} x^{k}= & S_{k-1, k-1} x(x-1) \cdots(x-k+1) \\ & +S_{k-1, k-2} x(x-1) \cdots(x-k+2) \\ & +\cdots+S_{k-1,0} x \end{aligned}

e.g., $S_{2,2}=1, S_{2,1}=3, S_{2,0}=1$, and we define

Ωk=Sk1,k1Sk1,k2+ \Omega_{k}=S_{k-1, k-1}-S_{k-1, k-2}+-\cdots

Replacing $x$ by $-x$ in (*) results in

xk=Sk1,k1x(x+1)(x+k1)Sk1,k2x(x+1)(x+k2)+±Sk1,0x \begin{aligned} x^{k}= & S_{k-1, k-1} x(x+1) \cdots(x+k-1) \\ & -S_{k-1, k-2} x(x+1) \cdots(x+k-2) \\ & +-\cdots \pm S_{k-1,0} x \end{aligned}

Defining

P(x)=Sk1,k1(x+1)(x+k1)+(Sk1,k1Sk1,k2)(x+1)(x+k2)+(Sk1,k1Sk1,k2+Sk1,k3)(x+1)(x+k3)++Ωk \begin{aligned} P(x)= & S_{k-1, k-1}(x+1) \cdots(x+k-1) \\ & +\left(S_{k-1, k-1}-S_{k-1, k-2}\right)(x+1) \cdots(x+k-2) \\ & +\left(S_{k-1, k-1}-S_{k-1, k-2}+S_{k-1, k-3}\right)(x+1) \cdots(x+k-3) \\ & +\cdots+\Omega_{k} \end{aligned}

we obtain

xP(x)P(x1)=Sk1,k1x(x+1)(x+k1)Sk1,k2x(x+1)(x+k2)+±Sk1,0xΩk=xkΩk \begin{aligned} x P(x)-P(x-1)= & S_{k-1, k-1} x(x+1) \cdots(x+k-1) \\ & -S_{k-1, k-2} x(x+1) \cdots(x+k-2) \\ & +-\cdots \pm S_{k-1,0} x-\Omega_{k} \\ = & x^{k}-\Omega_{k} \end{aligned}

hence $q_{k}=-\Omega_{k}$.

N7 MNG (Mongolia)

Let $a$ and $b$ be distinct integers greater than 1 . Prove that there exists a positive integer $n$ such that $\left(a^{n}-1\right)\left(b^{n}-1\right)$ is not a perfect square.

Solution 1. At first we notice that

(1α)12(1β)12=(112α18α2)(112β18β2)=k,0ck,αkβ for all α,β(0,1) \begin{aligned} (1-\alpha)^{\frac{1}{2}}(1-\beta)^{\frac{1}{2}} & =\left(1-\frac{1}{2} \cdot \alpha-\frac{1}{8} \cdot \alpha^{2}-\cdots\right)\left(1-\frac{1}{2} \cdot \beta-\frac{1}{8} \cdot \beta^{2}-\cdots\right) \\ & =\sum_{k, \ell \geq 0} c_{k, \ell} \cdot \alpha^{k} \beta^{\ell} \quad \text { for all } \alpha, \beta \in(0,1) \end{aligned}

where $c_{0,0}=1$ and $c_{k, \ell}$ are certain coefficients. For an indirect proof, we suppose that $x_{n}=\sqrt{\left(a^{n}-1\right)\left(b^{n}-1\right)} \in \mathbb{Z}$ for all positive integers $n$. Replacing $a$ by $a^{2}$ and $b$ by $b^{2}$ if necessary, we may assume that $a$ and $b$ are perfect squares, hence $\sqrt{a b}$ is an integer. At first we shall assume that $a^{\mu} \neq b^{\nu}$ for all positive integers $\mu, \nu$. We have

xn=(ab)n(11an)12(11bn)12=k,0ck,(abakb)n. x_{n}=(\sqrt{a b})^{n}\left(1-\frac{1}{a^{n}}\right)^{\frac{1}{2}}\left(1-\frac{1}{b^{n}}\right)^{\frac{1}{2}}=\sum_{k, \ell \geq 0} c_{k, \ell}\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n} .

Choosing $k_{0}$ and $\ell_{0}$ such that $a^{k_{0}}>\sqrt{a b}, b^{\ell_{0}}>\sqrt{a b}$, we define the polynomial

P(x)=k=0,=0k01,01(akbxab)=:i=0k00dixi P(x)=\prod_{k=0, \ell=0}^{k_{0}-1, \ell_{0}-1}\left(a^{k} b^{\ell} x-\sqrt{a b}\right)=: \sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x^{i}

with integer coefficients $d_{i}$. By our assumption, the zeros

abakb,k=0,,k01,=0,,01 \frac{\sqrt{a b}}{a^{k} b^{\ell}}, \quad k=0, \ldots, k_{0}-1, \quad \ell=0, \ldots, \ell_{0}-1

of $P$ are pairwise distinct. Furthermore, we consider the integer sequence

yn=i=0k00dixn+i,n=1,2, y_{n}=\sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x_{n+i}, \quad n=1,2, \ldots

By the theory of linear recursions, we obtain

yn=k,0kk0 or 0ek,(abakb)n,n=1,2, y_{n}=\sum_{\substack{k, \ell \geq 0 \\ k \geq k_{0} \text { or } \ell \geq \ell_{0}}} e_{k, \ell}\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n}, \quad n=1,2, \ldots

with real numbers $e_{k, \ell}$. We have

ynk,0kk0 or 0ek,(abakb)n=:Mn. \left|y_{n}\right| \leq \sum_{\substack{k, \ell \geq 0 \\ k \geq k_{0} \text { or } \ell \geq \ell_{0}}}\left|e_{k, \ell}\right|\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n}=: M_{n} .

Because the series in (4) is obtained by a finite linear combination of the absolutely convergent series (1), we conclude that in particular $M_{1}<\infty$. Since

abakbλ:=max{abak0,abb0} for all k,0 such that kk0 or 0 \frac{\sqrt{a b}}{a^{k} b^{\ell}} \leq \lambda:=\max \left\{\frac{\sqrt{a b}}{a^{k_{0}}}, \frac{\sqrt{a b}}{b^{\ell_{0}}}\right\} \quad \text { for all } k, \ell \geq 0 \text { such that } k \geq k_{0} \text { or } \ell \geq \ell_{0}

we get the estimates $M_{n+1} \leq \lambda M_{n}, n=1,2, \ldots$ Our choice of $k_{0}$ and $\ell_{0}$ ensures $\lambda<1$, which implies $M_{n} \rightarrow 0$ and consequently $y_{n} \rightarrow 0$ as $n \rightarrow \infty$. It follows that $y_{n}=0$ for all sufficiently large $n$. So, equation (3) reduces to $\sum_{i=0}^{k_{0} \cdot \ell_{0}} d_{i} x_{n+i}=0$. Using the theory of linear recursions again, for sufficiently large $n$ we have

xn=k=0,=0k01,01fk,(abakb)n x_{n}=\sum_{k=0, \ell=0}^{k_{0}-1, \ell_{0}-1} f_{k, \ell}\left(\frac{\sqrt{a b}}{a^{k} b^{\ell}}\right)^{n}

for certain real numbers $f_{k, \ell}$. Comparing with (2), we see that $f_{k, \ell}=c_{k, \ell}$ for all $k, \ell \geq 0$ with $k<k_{0}, \ell<\ell_{0}$, and $c_{k, \ell}=0$ if $k \geq k_{0}$ or $\ell \geq \ell_{0}$, since we assumed that $a^{\mu} \neq b^{\nu}$ for all positive integers $\mu, \nu$. In view of (1), this means

(1α)12(1β)12=k=0,=0k01,01ck,αkβ (1-\alpha)^{\frac{1}{2}}(1-\beta)^{\frac{1}{2}}=\sum_{k=0, \ell=0}^{k_{0}-1, \ell_{0}-1} c_{k, \ell} \cdot \alpha^{k} \beta^{\ell}

for all real numbers $\alpha, \beta \in(0,1)$. We choose $k^{}<k_{0}$ maximal such that there is some $i$ with $c_{k^{}, i} \neq 0$. Squaring (5) and comparing coefficients of $\alpha^{2 k^{}} \beta^{2 i^{}}$, where $i^{}$ is maximal with $c_{k^{}, i^{}} \neq 0$, we see that $k^{}=0$. This means that the right hand side of (5) is independent of $\alpha$, which is clearly impossible. We are left with the case that $a^{\mu}=b^{\nu}$ for some positive integers $\mu$ and $\nu$. We may assume that $\mu$ and $\nu$ are relatively prime. Then there is some positive integer $c$ such that $a=c^{\nu}$ and $b=c^{\mu}$. Now starting with the expansion (2), i. e.,

xn=j0gj(cμ+νcj)n x_{n}=\sum_{j \geq 0} g_{j}\left(\frac{\sqrt{c^{\mu+\nu}}}{c^{j}}\right)^{n}

for certain coefficients $g_{j}$, and repeating the arguments above, we see that $g_{j}=0$ for sufficiently large $j$, say $j>j_{0}$. But this means that

(1xμ)12(1xν)12=j=0j0gjxj \left(1-x^{\mu}\right)^{\frac{1}{2}}\left(1-x^{\nu}\right)^{\frac{1}{2}}=\sum_{j=0}^{j_{0}} g_{j} x^{j}

for all real numbers $x \in(0,1)$. Squaring, we see that

(1xμ)(1xν) \left(1-x^{\mu}\right)\left(1-x^{\nu}\right)

is the square of a polynomial in $x$. In particular, all its zeros are of order at least 2 , which implies $\mu=\nu$ by looking at roots of unity. So we obtain $\mu=\nu=1$, i. e., $a=b$, a contradiction.

Solution 2. We set $a^{2}=A, b^{2}=B$, and $z_{n}=\sqrt{\left(A^{n}-1\right)\left(B^{n}-1\right)}$. Let us assume that $z_{n}$ is an integer for $n=1,2, \ldots$. Without loss of generality, we may suppose that $b<a$. We determine an integer $k \geq 2$ such that $b^{k-1} \leq a<b^{k}$, and define a sequence $\gamma_{1}, \gamma_{2}, \ldots$ of rational numbers such that

2γ1=1 and 2γn+1=i=1nγiγni for n=1,2, 2 \gamma_{1}=1 \quad \text { and } \quad 2 \gamma_{n+1}=\sum_{i=1}^{n} \gamma_{i} \gamma_{n-i} \text { for } n=1,2, \ldots

It could easily be shown that $\gamma_{n}=\frac{1 \cdot 1 \cdot 3 . .(2 n-3)}{2 \cdot 4 \cdot 6 \cdot \ldots 2 n}$, for instance by reading VANDERMONDEs convolution as an equation between polynomials, but we shall have no use for this fact. Using Landaus $O$-Notation in the usual way, we have

{(ab)nγ1(ab)nγ2(ab3)nγk(ab2k1)n+O(ba)n}2=AnBn2γ1Ani=2k(2γij=1i1γjγij)(ABi1)n+O(ABk)n+O(Bn)=AnBnAn+O(Bn) \begin{aligned} & \left\{(a b)^{n}-\gamma_{1}\left(\frac{a}{b}\right)^{n}-\gamma_{2}\left(\frac{a}{b^{3}}\right)^{n}-\cdots-\gamma_{k}\left(\frac{a}{b^{2 k-1}}\right)^{n}+O\left(\frac{b}{a}\right)^{n}\right\}^{2} \\ & =A^{n} B^{n}-2 \gamma_{1} A^{n}-\sum_{i=2}^{k}\left(2 \gamma_{i}-\sum_{j=1}^{i-1} \gamma_{j} \gamma_{i-j}\right)\left(\frac{A}{B^{i-1}}\right)^{n}+O\left(\frac{A}{B^{k}}\right)^{n}+O\left(B^{n}\right) \\ & =A^{n} B^{n}-A^{n}+O\left(B^{n}\right) \end{aligned}

whence

zn=(ab)nγ1(ab)nγ2(ab3)nγk(ab2k1)n+O(ba)n z_{n}=(a b)^{n}-\gamma_{1}\left(\frac{a}{b}\right)^{n}-\gamma_{2}\left(\frac{a}{b^{3}}\right)^{n}-\cdots-\gamma_{k}\left(\frac{a}{b^{2 k-1}}\right)^{n}+O\left(\frac{b}{a}\right)^{n}

Now choose rational numbers $r_{1}, r_{2}, \ldots, r_{k+1}$ such that

(xab)(xab)(xab2k1)=xk+1r1xk+±rk+1 (x-a b) \cdot\left(x-\frac{a}{b}\right) \ldots\left(x-\frac{a}{b^{2 k-1}}\right)=x^{k+1}-r_{1} x^{k}+-\cdots \pm r_{k+1}

and then a natural number $M$ for which $M r_{1}, M r_{2}, \ldots M r_{k+1}$ are integers. For known reasons,

M(zn+k+1r1zn+k+±rk+1zn)=O(ba)n M\left(z_{n+k+1}-r_{1} z_{n+k}+-\cdots \pm r_{k+1} z_{n}\right)=O\left(\frac{b}{a}\right)^{n}

for all $n \in \mathbb{N}$ and thus there is a natural number $N$ which is so large, that

zn+k+1=r1zn+kr2zn+k1+rk+1zn z_{n+k+1}=r_{1} z_{n+k}-r_{2} z_{n+k-1}+-\cdots \mp r_{k+1} z_{n}

holds for all $n \geqslant N$. Now the theory of linear recursions reveals that there are some rational numbers $\delta_{0}, \delta_{1}, \delta_{2}, \ldots, \delta_{k}$ such that

zn=δ0(ab)nδ1(ab)nδ2(ab3)nδk(ab2k1)n z_{n}=\delta_{0}(a b)^{n}-\delta_{1}\left(\frac{a}{b}\right)^{n}-\delta_{2}\left(\frac{a}{b^{3}}\right)^{n}-\cdots-\delta_{k}\left(\frac{a}{b^{2 k-1}}\right)^{n}

for sufficiently large $n$, where $\delta_{0}>0$ as $z_{n}>0$. As before, one obtains

AnBnAnBn+1=zn2={δ0(ab)nδ1(ab)nδ2(ab3)nδk(ab2k1)n}2=δ02AnBn2δ0δ1Ani=2i=k(2δ0δij=1j=i1δjδij)(ABi1)n+O(ABk)n \begin{aligned} & A^{n} B^{n}-A^{n}-B^{n}+1=z_{n}^{2} \\ & =\left\{\delta_{0}(a b)^{n}-\delta_{1}\left(\frac{a}{b}\right)^{n}-\delta_{2}\left(\frac{a}{b^{3}}\right)^{n}-\cdots-\delta_{k}\left(\frac{a}{b^{2 k-1}}\right)^{n}\right\}^{2} \\ & =\delta_{0}^{2} A^{n} B^{n}-2 \delta_{0} \delta_{1} A^{n}-\sum_{i=2}^{i=k}\left(2 \delta_{0} \delta_{i}-\sum_{j=1}^{j=i-1} \delta_{j} \delta_{i-j}\right)\left(\frac{A}{B^{i-1}}\right)^{n}+O\left(\frac{A}{B^{k}}\right)^{n} \end{aligned}

Easy asymptotic calculations yield $\delta_{0}=1, \delta_{1}=\frac{1}{2}, \delta_{i}=\frac{1}{2} \sum_{j=1}^{j=i-1} \delta_{j} \delta_{i-j}$ for $i=2,3, \ldots, k-2$, and then $a=b^{k-1}$. It follows that $k>2$ and there is some $P \in \mathbb{Q}[X]$ for which $(X-1)\left(X^{k-1}-1\right)=$ $P(X)^{2}$. But this cannot occur, for instance as $X^{k-1}-1$ has no double zeros. Thus our assumption that $z_{n}$ was an integer for $n=1,2, \ldots$ turned out to be wrong, which solves the problem.

Original formulation of the problem. $a, b$ are positive integers such that $a \cdot b$ is not a square of an integer. Prove that there exists a (infinitely many) positive integer $n$ such that ( $\left.a^{n}-1\right)\left(b^{n}-1\right)$ is not a square of an integer.

Solution. Lemma. Let $c$ be a positive integer, which is not a perfect square. Then there exists an odd prime $p$ such that $c$ is not a quadratic residue modulo $p$. Proof. Denoting the square-free part of $c$ by $c^{\prime}$, we have the equality $\left(\frac{c^{\prime}}{p}\right)=\left(\frac{c}{p}\right)$ of the corresponding LegEndre symbols. Suppose that $c^{\prime}=q_{1} \cdots q_{m}$, where $q_{1}<\cdots<q_{m}$ are primes. Then we have

(cp)=(q1p)(qmp) \left(\frac{c^{\prime}}{p}\right)=\left(\frac{q_{1}}{p}\right) \cdots\left(\frac{q_{m}}{p}\right)

Case 1. Let $q_{1}$ be odd. We choose a quadratic nonresidue $r_{1}$ modulo $q_{1}$ and quadratic residues $r_{i}$ modulo $q_{i}$ for $i=2, \ldots, m$. By the Chinese remainder theorem and the Dirichlet theorem, there exists a (infinitely many) prime $p$ such that

pr1q1pr2q2prmqmp14 \begin{aligned} & p \equiv r_{1} \bmod q_{1} \\ & p \equiv r_{2} \bmod q_{2} \\ & \vdots \\ & \quad \vdots \\ & p \equiv r_{m} \bmod q_{m} \\ & p \equiv 1 \bmod 4 \end{aligned}

By our choice of the residues, we obtain

(pqi)=(riqi)={1,i=11,i=2,,m \left(\frac{p}{q_{i}}\right)=\left(\frac{r_{i}}{q_{i}}\right)= \begin{cases}-1, & i=1 \\ 1, & i=2, \ldots, m\end{cases}

The congruence $p \equiv 1 \bmod 4$ implies that $\left(\frac{q_{i}}{p}\right)=\left(\frac{p}{q_{i}}\right), i=1, \ldots, m$, by the law of quadratic reciprocity. Thus

(cp)=(q1p)(qmp)=1 \left(\frac{c^{\prime}}{p}\right)=\left(\frac{q_{1}}{p}\right) \cdots\left(\frac{q_{m}}{p}\right)=-1

Case 2. Suppose $q_{1}=2$. We choose quadratic residues $r_{i}$ modulo $q_{i}$ for $i=2, \ldots, m$. Again, by the Chinese remainder theorem and the Dirichlet theorem, there exists a prime $p$ such that

pr2q2prmqmp58 \begin{aligned} & p \equiv r_{2} \bmod q_{2} \\ & \vdots \\ & \quad \vdots \\ & p \equiv r_{m} \bmod q_{m} \\ & p \equiv 5 \bmod 8 \end{aligned}

By the choice of the residues, we obtain $\left(\frac{p}{q_{i}}\right)=\left(\frac{r_{i}}{q_{i}}\right)=1$ for $i=2, \ldots, m$. Since $p \equiv 1 \bmod 4$ we have $\left(\frac{q_{i}}{p}\right)=\left(\frac{p}{q_{i}}\right), i=2, \ldots, m$, by the law of quadratic reciprocity. The congruence $p \equiv 5 \bmod 8$ implies that $\left(\frac{2}{p}\right)=-1$. Thus

(cp)=(2p)(q2p)(qmp)=1 \left(\frac{c^{\prime}}{p}\right)=\left(\frac{2}{p}\right)\left(\frac{q_{2}}{p}\right) \cdots\left(\frac{q_{m}}{p}\right)=-1

and the lemma is proved. Applying the lemma for $c=a \cdot b$, we find an odd prime $p$ such that

(abp)=(ap)(bp)=1. \left(\frac{a b}{p}\right)=\left(\frac{a}{p}\right) \cdot\left(\frac{b}{p}\right)=-1 .

This implies either

ap121p,bp121p, or ap121p,bp121p a^{\frac{p-1}{2}} \equiv 1 \bmod p, \quad b^{\frac{p-1}{2}} \equiv-1 \bmod p, \quad \text { or } \quad a^{\frac{p-1}{2}} \equiv-1 \bmod p, \quad b^{\frac{p-1}{2}} \equiv 1 \bmod p

Without loss of generality, suppose that $a^{\frac{p-1}{2}} \equiv 1 \bmod p$ and $b^{\frac{p-1}{2}} \equiv-1 \bmod p$. The second congruence implies that $b^{\frac{p-1}{2}}-1$ is not divisible by $p$. Hence, if the exponent $\nu_{p}\left(a^{\frac{p-1}{2}}-1\right)$ of $p$ in the prime decomposition of $\left(a^{\frac{p-1}{2}}-1\right)$ is odd, then $\left(a^{\frac{p-1}{2}}-1\right)\left(b^{\frac{p-1}{2}}-1\right)$ is not a perfect square. If $\nu_{p}\left(a^{\frac{p-1}{2}}-1\right)$ is even, then $\nu_{p}\left(a^{\frac{p-1}{2} p}-1\right)$ is odd by the well-known power lifting property

νp(ap12p1)=νp(ap121)+1. \nu_{p}\left(a^{\frac{p-1}{2} p}-1\right)=\nu_{p}\left(a^{\frac{p-1}{2}}-1\right)+1 .

In this case, $\left(a^{\frac{p-1}{2} p}-1\right)\left(b^{\frac{p-1}{2} p}-1\right)$ is not a perfect square.

Comment 1. In 1998, the following problem appeared in Crux Mathematicorum: Problem 2344. Find all positive integers $N$ that are quadratic residues modulo all primes greater than $N$. The published solution (Crux Mathematicorum, 25(1999)4) is the same as the proof of the lemma given above, see also http://www.mathlinks.ro/viewtopic.php?t=150495.

Comment 2. There is also an elementary proof of the lemma. We cite Theorem 3 of Chapter 5 and its proof from the book Ireland, Rosen: A Classical Introduction to Modern Number Theory, Springer 1982. Theorem. Let $a$ be a nonsquare integer. Then there are infinitely many primes $p$ for which $a$ is a quadratic nonresidue. Proof. It is easily seen that we may assume that $a$ is square-free. Let $a=2^{e} q_{1} q_{2} \cdots q_{n}$, where $q_{i}$ are distinct odd primes and $e=0$ or 1 . The case $a=2$ has to be dealt with separately. We shall assume to begin with that $n \geq 1$, i. e., that $a$ is divisible by an odd prime.

Let $\ell_{1}, \ell_{2}, \ldots, \ell_{k}$ be a finite set of odd primes not including any $q_{i}$. Let $s$ be any quadratic nonresidue $\bmod q_{n}$, and find a simultaneous solution to the congruences

x1i,i=1,,k,x18,x1qi,i=1,,n1,xsqn. \begin{aligned} & x \equiv 1 \bmod \ell_{i}, \quad i=1, \ldots, k, \\ & x \equiv 1 \bmod 8, \\ & x \equiv 1 \bmod q_{i}, \quad i=1, \ldots, n-1, \\ & x \equiv s \bmod q_{n} . \end{aligned}

Call the solution $b . b$ is odd. Suppose that $b=p_{1} p_{2} \cdots p_{m}$ is its prime decomposition. Since $b \equiv 1 \bmod 8$ we have $\left(\frac{2}{b}\right)=1$ and $\left(\frac{q_{i}}{b}\right)=\left(\frac{b}{q_{i}}\right)$ by a result on JACOBI symbols. Thus

(ab)=(2b)e(q1b)(qn1b)(qnb)=(bq1)(bqn1)(bqn)=(1q1)(1qn1)(sqn)=1 \left(\frac{a}{b}\right)=\left(\frac{2}{b}\right)^{e}\left(\frac{q_{1}}{b}\right) \cdots\left(\frac{q_{n-1}}{b}\right)\left(\frac{q_{n}}{b}\right)=\left(\frac{b}{q_{1}}\right) \cdots\left(\frac{b}{q_{n-1}}\right)\left(\frac{b}{q_{n}}\right)=\left(\frac{1}{q_{1}}\right) \cdots\left(\frac{1}{q_{n-1}}\right)\left(\frac{s}{q_{n}}\right)=-1

On the other hand, by the definition of $\left(\frac{a}{b}\right)$, we have $\left(\frac{a}{b}\right)=\left(\frac{a}{p_{1}}\right)\left(\frac{a}{p_{2}}\right) \cdots\left(\frac{a}{p_{m}}\right)$. It follows that $\left(\frac{a}{p_{i}}\right)=-1$ for some $i$. Notice that $\ell_{j}$ does not divide $b$. Thus $p_{i} \notin\left{\ell_{1}, \ell_{2}, \ldots, \ell_{k}\right}$. To summarize, if $a$ is a nonsquare, divisible by an odd prime, we have found a prime $p$, outside of a given finite set of primes $\left{2, \ell_{1}, \ell_{2}, \ldots, \ell_{k}\right}$, such that $\left(\frac{a}{p}\right)=-1$. This proves the theorem in this case.

It remains to consider the case $a=2$. Let $\ell_{1}, \ell_{2}, \ldots, \ell_{k}$ be a finite set of primes, excluding 3 , for which $\left(\frac{2}{\ell_{i}}\right)=-1$. Let $b=8 \ell_{1} \ell_{2} \cdots \ell_{k}+3 . b$ is not divisible by 3 or any $\ell_{i}$. Since $b \equiv 3 \bmod 8$ we have $\left(\frac{2}{b}\right)=(-1)^{\frac{b^{2}-1}{8}}=-1$. Suppose that $b=p_{1} p_{2} \cdots p_{m}$ is the prime decomposition of b. Then, as before, we see that $\left(\frac{2}{p_{i}}\right)=-1$ for some $i . p_{i} \notin\left{3, \ell_{1}, \ell_{2}, \ldots, \ell_{k}\right}$. This proves the theorem for $a=2$. This proof has also been posted to mathlinks, see http://www.mathlinks.ro/viewtopic. php?t=150495 again.

The IMO 2009 is organised by §Bildung