Find all the functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that  $$ f(a)^{2}+f(b)^{2}+f(c)^{2}=2 f(a) f(b)+2 f(b) f(c)+2 f(c) f(a) $$  for all integers $a, b, c$ satisfying $a+b+c=0$.

Solution: The substitution $a=b=c=0$ gives $3 f(0)^{2}=6 f(0)^{2}$, hence  $$ f(0)=0 \text {. } $$  The substitution $b=-a$ and $c=0$ gives $\left((f(a)-f(-a))^{2}=0\right.$. Hence $f$ is an even function:  $$ f(a)=f(-a) \quad \text { for all } a \in \mathbb{Z} $$  Now set $b=a$ and $c=-2 a$ to obtain $2 f(a)^{2}+f(2 a)^{2}=2 f(a)^{2}+4 f(a) f(2 a)$. Hence  $$ f(2 a)=0 \text { or } f(2 a)=4 f(a) \text { for all } a \in \mathbb{Z} $$  If $f(r)=0$ for some $r \geq 1$ then the substitution $b=r$ and $c=-a-r$ gives $(f(a+r)-f(a))^{2}=0$. So $f$ is periodic with period $r$, i. e.  $$ f(a+r)=f(a) \text { for all } a \in \mathbb{Z} $$  In particular, if $f(1)=0$ then $f$ is constant, thus $f(a)=0$ for all $a \in \mathbb{Z}$. This function clearly satisfies the functional equation. For the rest of the analysis, we assume $f(1)=k \neq 0$.  By (3) we have $f(2)=0$ or $f(2)=4 k$. If $f(2)=0$ then $f$ is periodic of period 2 , thus $f($ even $)=0$ and $f($ odd $)=k$. This function is a solution for every $k$. We postpone the verification; for the sequel assume $f(2)=4 k \neq 0$.  By (3) again, we have $f(4)=0$ or $f(4)=16 k$. In the first case $f$ is periodic of period 4 , and $f(3)=f(-1)=f(1)=k$, so we have $f(4 n)=0, f(4 n+1)=f(4 n+3)=k$, and $f(4 n+2)=4 k$ for all $n \in \mathbb{Z}$. This function is a solution too, which we justify later. For the rest of the analysis, we assume $f(4)=16 k \neq 0$.  We show now that $f(3)=9 k$. In order to do so, we need two substitutions:  $$ \begin{gathered} a=1, b=2, c=-3 \Longrightarrow f(3)^{2}-10 k f(3)+9 k^{2}=0 \Longrightarrow f(3) \in\{k, 9 k\}, \\ a=1, b=3, c=-4 \Longrightarrow f(3)^{2}-34 k f(3)+225 k^{2}=0 \Longrightarrow f(3) \in\{9 k, 25 k\} . \end{gathered} $$  Therefore $f(3)=9 k$, as claimed. Now we prove inductively that the only remaining function is $f(x)=k x^{2}, x \in \mathbb{Z}$. We proved this for $x=0,1,2,3,4$. Assume that $n \geq 4$ and that $f(x)=k x^{2}$ holds for all integers $x \in[0, n]$. Then the substitutions $a=n, b=1, c=-n-1$ and $a=n-1$, $b=2, c=-n-1$ lead respectively to  $$ f(n+1) \in\left\{k(n+1)^{2}, k(n-1)^{2}\right\} \quad \text { and } \quad f(n+1) \in\left\{k(n+1)^{2}, k(n-3)^{2}\right\} \text {. } $$  Since $k(n-1)^{2} \neq k(n-3)^{2}$ for $n \neq 2$, the only possibility is $f(n+1)=k(n+1)^{2}$. This completes the induction, so $f(x)=k x^{2}$ for all $x \geq 0$. The same expression is valid for negative values of $x$ since $f$ is even. To verify that $f(x)=k x^{2}$ is actually a solution, we need to check the identity $a^{4}+b^{4}+(a+b)^{4}=2 a^{2} b^{2}+2 a^{2}(a+b)^{2}+2 b^{2}(a+b)^{2}$, which follows directly by expanding both sides.  Therefore the only possible solutions of the functional equation are the constant function $f_{1}(x)=0$ and the following functions:  $$ f_{2}(x)=k x^{2} \quad f_{3}(x)=\left\{\begin{array}{cc} 0 & x \text { even } \\ k & x \text { odd } \end{array} \quad f_{4}(x)=\left\{\begin{array}{ccc} 0 & x \equiv 0 & (\bmod 4) \\ k & x \equiv 1 & (\bmod 2) \\ 4 k & x \equiv 2 & (\bmod 4) \end{array}\right.\right. $$  for any non-zero integer $k$. The verification that they are indeed solutions was done for the first two. For $f_{3}$ note that if $a+b+c=0$ then either $a, b, c$ are all even, in which case $f(a)=f(b)=f(c)=0$, or one of them is even and the other two are odd, so both sides of the equation equal $2 k^{2}$. For $f_{4}$ we use similar parity considerations and the symmetry of the equation, which reduces the verification to the triples $(0, k, k),(4 k, k, k),(0,0,0),(0,4 k, 4 k)$. They all satisfy the equation.  Comment. We used several times the same fact: For any $a, b \in \mathbb{Z}$ the functional equation is a quadratic equation in $f(a+b)$ whose coefficients depend on $f(a)$ and $f(b)$ :  $$ f(a+b)^{2}-2(f(a)+f(b)) f(a+b)+(f(a)-f(b))^{2}=0 $$  Its discriminant is $16 f(a) f(b)$. Since this value has to be non-negative for any $a, b \in \mathbb{Z}$, we conclude that either $f$ or $-f$ is always non-negative. Also, if $f$ is a solution of the functional equation, then $-f$ is also a solution. Therefore we can assume $f(x) \geq 0$ for all $x \in \mathbb{Z}$. Now, the two solutions of the quadratic equation are  $$ f(a+b) \in\left\{(\sqrt{f(a)}+\sqrt{f(b)})^{2},(\sqrt{f(a)}-\sqrt{f(b)})^{2}\right\} \quad \text { for all } a, b \in \mathbb{Z} $$  The computation of $f(3)$ from $f(1), f(2)$ and $f(4)$ that we did above follows immediately by setting $(a, b)=(1,2)$ and $(a, b)=(1,-4)$. The inductive step, where $f(n+1)$ is derived from $f(n), f(n-1)$, $f(2)$ and $f(1)$, follows immediately using $(a, b)=(n, 1)$ and $(a, b)=(n-1,2)$.


Let $\mathbb{Z}$ and $\mathbb{Q}$ be the sets of integers and rationals respectively.  a) Does there exist a partition of $\mathbb{Z}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint?  b) Does there exist a partition of $\mathbb{Q}$ into three non-empty subsets $A, B, C$ such that the sets $A+B, B+C, C+A$ are disjoint?  Here $X+Y$ denotes the set $\{x+y \mid x \in X, y \in Y\}$, for $X, Y \subseteq \mathbb{Z}$ and $X, Y \subseteq \mathbb{Q}$.

Solution: a) The residue classes modulo 3 yield such a partition:  $$ A=\{3 k \mid k \in \mathbb{Z}\}, \quad B=\{3 k+1 \mid k \in \mathbb{Z}\}, \quad C=\{3 k+2 \mid k \in \mathbb{Z}\} $$  b) The answer is no. Suppose that $\mathbb{Q}$ can be partitioned into non-empty subsets $A, B, C$ as stated. Note that for all $a \in A, b \in B, c \in C$ one has  $$ a+b-c \in C, \quad b+c-a \in A, \quad c+a-b \in B $$  Indeed $a+b-c \notin A$ as $(A+B) \cap(A+C)=\emptyset$, and similarly $a+b-c \notin B$, hence $a+b-c \in C$. The other two relations follow by symmetry. Hence $A+B \subset C+C, B+C \subset A+A, C+A \subset B+B$.  The opposite inclusions also hold. Let $a, a^{\prime} \in A$ and $b \in B, c \in C$ be arbitrary. By (1) $a^{\prime}+c-b \in B$, and since $a \in A, c \in C$, we use (1) again to obtain  $$ a+a^{\prime}-b=a+\left(a^{\prime}+c-b\right)-c \in C . $$  So $A+A \subset B+C$ and likewise $B+B \subset C+A, C+C \subset A+B$. In summary  $$ B+C=A+A, \quad C+A=B+B, \quad A+B=C+C . $$  Furthermore suppose that $0 \in A$ without loss of generality. Then $B=\{0\}+B \subset A+B$ and $C=\{0\}+C \subset A+C$. So, since $B+C$ is disjoint with $A+B$ and $A+C$, it is also disjoint with $B$ and $C$. Hence $B+C$ is contained in $\mathbb{Z} \backslash(B \cup C)=A$. Because $B+C=A+A$, we obtain $A+A \subset A$. On the other hand $A=\{0\}+A \subset A+A$, implying $A=A+A=B+C$.  Therefore $A+B+C=A+A+A=A$, and now $B+B=C+A$ and $C+C=A+B$ yield $B+B+B=A+B+C=A, C+C+C=A+B+C=A$. In particular if $r \in \mathbb{Q}=A \cup B \cup C$ is arbitrary then $3 r \in A$.  However such a conclusion is impossible. Take any $b \in B(B \neq \emptyset)$ and let $r=b / 3 \in \mathbb{Q}$. Then $b=3 r \in A$ which is a contradiction.


Solution: We prove that the example for $\mathbb{Z}$ from the first solution is unique, and then use this fact to solve part b).  Let $\mathbb{Z}=A \cup B \cup C$ be a partition of $\mathbb{Z}$ with $A, B, C \neq \emptyset$ and $A+B, B+C, C+A$ disjoint. We need the relations (1) which clearly hold for $\mathbb{Z}$. Fix two consecutive integers from different sets, say $b \in B$ and $c=b+1 \in C$. For every $a \in A$ we have, in view of (1), $a-1=a+b-c \in C$ and $a+1=a+c-b \in B$. So every $a \in A$ is preceded by a number from $C$ and followed by a number from $B$.  In particular there are pairs of the form $c, c+1$ with $c \in C, c+1 \in A$. For such a pair and any $b \in B$ analogous reasoning shows that each $b \in B$ is preceded by a number from $A$ and followed by a number from $C$. There are also pairs $b, b-1$ with $b \in B, b-1 \in A$. We use them in a similar way to prove that each $c \in C$ is preceded by a number from $B$ and followed by a number from $A$.  By putting the observations together we infer that $A, B, C$ are the three congruence classes modulo 3. Observe that all multiples of 3 are in the set of the partition that contains 0 .  Now we turn to part b). Suppose that there is a partition of $\mathbb{Q}$ with the given properties. Choose three rationals $r_{i}=p_{i} / q_{i}$ from the three sets $A, B, C, i=1,2,3$, and set $N=3 q_{1} q_{2} q_{3}$.  Let $S \subset \mathbb{Q}$ be the set of fractions with denominators $N$ (irreducible or not). It is obtained through multiplication of every integer by the constant $1 / N$, hence closed under sums and differences. Moreover, if we identify each $k \in \mathbb{Z}$ with $k / N \in S$ then $S$ is essentially the set $\mathbb{Z}$ with respect to addition. The numbers $r_{i}$ belong to $S$ because  $$ r_{1}=\frac{3 p_{1} q_{2} q_{3}}{N}, \quad r_{2}=\frac{3 p_{2} q_{3} q_{1}}{N}, \quad r_{3}=\frac{3 p_{3} q_{1} q_{2}}{N} $$  The partition $\mathbb{Q}=A \cup B \cup C$ of $\mathbb{Q}$ induces a partition $S=A^{\prime} \cup B^{\prime} \cup C^{\prime}$ of $S$, with $A^{\prime}=A \cap S$, $B^{\prime}=B \cap S, C^{\prime}=C \cap S$. Clearly $A^{\prime}+B^{\prime}, B^{\prime}+C^{\prime}, C^{\prime}+A^{\prime}$ are disjoint, so this partition has the properties we consider.  By the uniqueness of the example for $\mathbb{Z}$ the sets $A^{\prime}, B^{\prime}, C^{\prime}$ are the congruence classes modulo 3 , multiplied by $1 / N$. Also all multiples of $3 / N$ are in the same set, $A^{\prime}, B^{\prime}$ or $C^{\prime}$. This holds for $r_{1}, r_{2}, r_{3}$ in particular as they are all multiples of $3 / N$. However $r_{1}, r_{2}, r_{3}$ are in different sets $A^{\prime}, B^{\prime}, C^{\prime}$ since they were chosen from different sets $A, B, C$. The contradiction ends the proof.  Comment. The uniqueness of the example for $\mathbb{Z}$ can also be deduced from the argument in the first solution.


Let $a_{2}, \ldots, a_{n}$ be $n-1$ positive real numbers, where $n \geq 3$, such that $a_{2} a_{3} \cdots a_{n}=1$. Prove that  $$ \left(1+a_{2}\right)^{2}\left(1+a_{3}\right)^{3} \cdots\left(1+a_{n}\right)^{n}>n^{n} . $$

Solution: The substitution $a_{2}=\frac{x_{2}}{x_{1}}, a_{3}=\frac{x_{3}}{x_{2}}, \ldots, a_{n}=\frac{x_{1}}{x_{n-1}}$ transforms the original problem into the inequality  $$ \left(x_{1}+x_{2}\right)^{2}\left(x_{2}+x_{3}\right)^{3} \cdots\left(x_{n-1}+x_{1}\right)^{n}>n^{n} x_{1}^{2} x_{2}^{3} \cdots x_{n-1}^{n} $$  for all $x_{1}, \ldots, x_{n-1}>0$. To prove this, we use the AM-GM inequality for each factor of the left-hand side as follows:  $$ \begin{array}{rlcl} \left(x_{1}+x_{2}\right)^{2} & & & \geq 2^{2} x_{1} x_{2} \\ \left(x_{2}+x_{3}\right)^{3} & = & \left(2\left(\frac{x_{2}}{2}\right)+x_{3}\right)^{3} & \geq 3^{3}\left(\frac{x_{2}}{2}\right)^{2} x_{3} \\ \left(x_{3}+x_{4}\right)^{4} & = & \left(3\left(\frac{x_{3}}{3}\right)+x_{4}\right)^{4} & \geq 4^{4}\left(\frac{x_{3}}{3}\right)^{3} x_{4} \\ & \vdots & \vdots & \vdots \end{array} $$  Multiplying these inequalities together gives $\left({ }^{*}\right)$, with inequality sign $\geq$ instead of $>$. However for the equality to occur it is necessary that $x_{1}=x_{2}, x_{2}=2 x_{3}, \ldots, x_{n-1}=(n-1) x_{1}$, implying $x_{1}=(n-1) ! x_{1}$. This is impossible since $x_{1}>0$ and $n \geq 3$. Therefore the inequality is strict.  Comment. One can avoid the substitution $a_{i}=x_{i} / x_{i-1}$. Apply the weighted AM-GM inequality to each factor $\left(1+a_{k}\right)^{k}$, with the same weights like above, to obtain  $$ \left(1+a_{k}\right)^{k}=\left((k-1) \frac{1}{k-1}+a_{k}\right)^{k} \geq \frac{k^{k}}{(k-1)^{k-1}} a_{k} $$  Multiplying all these inequalities together gives  $$ \left(1+a_{2}\right)^{2}\left(1+a_{3}\right)^{3} \cdots\left(1+a_{n}\right)^{n} \geq n^{n} a_{2} a_{3} \cdots a_{n}=n^{n} . $$  The same argument as in the proof above shows that the equality cannot be attained.


Let $f$ and $g$ be two nonzero polynomials with integer coefficients and $\operatorname{deg} f>\operatorname{deg} g$. Suppose that for infinitely many primes $p$ the polynomial $p f+g$ has a rational root. Prove that $f$ has a rational root.

Solution: Since $\operatorname{deg} f>\operatorname{deg} g$, we have $|g(x) / f(x)|<1$ for sufficiently large $x$; more precisely, there is a real number $R$ such that $|g(x) / f(x)|<1$ for all $x$ with $|x|>R$. Then for all such $x$ and all primes $p$ we have  $$ |p f(x)+g(x)| \geq|f(x)|\left(p-\frac{|g(x)|}{|f(x)|}\right)>0 $$  Hence all real roots of the polynomials $p f+g$ lie in the interval $[-R, R]$.  Let $f(x)=a_{n} x^{n}+a_{n-1} x^{n-1}+\cdots+a_{0}$ and $g(x)=b_{m} x^{m}+b_{m-1} x^{m-1}+\cdots+b_{0}$ where $n>m, a_{n} \neq 0$ and $b_{m} \neq 0$. Upon replacing $f(x)$ and $g(x)$ by $a_{n}^{n-1} f\left(x / a_{n}\right)$ and $a_{n}^{n-1} g\left(x / a_{n}\right)$ respectively, we reduce the problem to the case $a_{n}=1$. In other words one can assume that $f$ is monic. Then the leading coefficient of $p f+g$ is $p$, and if $r=u / v$ is a rational root of $p f+g$ with $(u, v)=1$ and $v>0$, then either $v=1$ or $v=p$.  First consider the case when $v=1$ infinitely many times. If $v=1$ then $|u| \leq R$, so there are only finitely many possibilities for the integer $u$. Therefore there exist distinct primes $p$ and $q$ for which we have the same value of $u$. Then the polynomials $p f+g$ and $q f+g$ share this root, implying $f(u)=g(u)=0$. So in this case $f$ and $g$ have an integer root in common.  Now suppose that $v=p$ infinitely many times. By comparing the exponent of $p$ in the denominators of $p f(u / p)$ and $g(u / p)$ we get $m=n-1$ and $p f(u / p)+g(u / p)=0$ reduces to an equation of the form  $$ \left(u^{n}+a_{n-1} p u^{n-1}+\ldots+a_{0} p^{n}\right)+\left(b_{n-1} u^{n-1}+b_{n-2} p u^{n-2}+\ldots+b_{0} p^{n-1}\right)=0 . $$  The equation above implies that $u^{n}+b_{n-1} u^{n-1}$ is divisible by $p$ and hence, since $(u, p)=1$, we have $u+b_{n-1}=p k$ with some integer $k$. On the other hand all roots of $p f+g$ lie in the interval $[-R, R]$, so that  $$ \begin{gathered} \frac{\left|p k-b_{n-1}\right|}{p}=\frac{|u|}{p}<R, \\ |k|<R+\frac{\left|b_{n-1}\right|}{p}<R+\left|b_{n-1}\right| . \end{gathered} $$  Therefore the integer $k$ can attain only finitely many values. Hence there exists an integer $k$ such that the number $\frac{p k-b_{n-1}}{p}=k-\frac{b_{n-1}}{p}$ is a root of $p f+g$ for infinitely many primes $p$. For these primes we have  $$ f\left(k-b_{n-1} \frac{1}{p}\right)+\frac{1}{p} g\left(k-b_{n-1} \frac{1}{p}\right)=0 . $$  So the equation  $$ f\left(k-b_{n-1} x\right)+x g\left(k-b_{n-1} x\right)=0 $$  has infinitely many solutions of the form $x=1 / p$. Since the left-hand side is a polynomial, this implies that (1) is a polynomial identity, so it holds for all real $x$. In particular, by substituting $x=0$ in (1) we get $f(k)=0$. Thus the integer $k$ is a root of $f$.  In summary the monic polynomial $f$ obtained after the initial reduction always has an integer root. Therefore the original polynomial $f$ has a rational root.


Solution: Analogously to the first solution, there exists a real number $R$ such that the complex roots of all polynomials of the form $p f+g$ lie in the disk $|z| \leq R$.  For each prime $p$ such that $p f+g$ has a rational root, by GAUSs' lemma $p f+g$ is the product of two integer polynomials, one with degree 1 and the other with degree $\operatorname{deg} f-1$. Since $p$ is a prime, the leading coefficient of one of these factors divides the leading coefficient of $f$. Denote that factor by $h_{p}$.  By narrowing the set of the primes used we can assume that all polynomials $h_{p}$ have the same degree and the same leading coefficient. Their complex roots lie in the disk $|z| \leq R$, hence VIETA's formulae imply that all coefficients of all polynomials $h_{p}$ form a bounded set. Since these coefficients are integers, there are only finitely many possible polynomials $h_{p}$. Hence there is a polynomial $h$ such that $h_{p}=h$ for infinitely many primes $p$.  Finally, if $p$ and $q$ are distinct primes with $h_{p}=h_{q}=h$ then $h$ divides $(p-q) f$. Since $\operatorname{deg} h=1$ or $\operatorname{deg} h=\operatorname{deg} f-1$, in both cases $f$ has a rational root.  Comment. Clearly the polynomial $h$ is a common factor of $f$ and $g$. If $\operatorname{deg} h=1$ then $f$ and $g$ share a rational root. Otherwise $\operatorname{deg} h=\operatorname{deg} f-1$ forces $\operatorname{deg} g=\operatorname{deg} f-1$ and $g$ divides $f$ over the rationals.


Solution: Like in the first solution, there is a real number $R$ such that the real roots of all polynomials of the form $p f+g$ lie in the interval $[-R, R]$.  Let $p_{1}<p_{2}<\cdots$ be an infinite sequence of primes so that for every index $k$ the polynomial $p_{k} f+g$ has a rational root $r_{k}$. The sequence $r_{1}, r_{2}, \ldots$ is bounded, so it has a convergent subsequence $r_{k_{1}}, r_{k_{2}}, \ldots$ Now replace the sequences $\left(p_{1}, p_{2}, \ldots\right)$ and $\left(r_{1}, r_{2}, \ldots\right)$ by $\left(p_{k_{1}}, p_{k_{2}}, \ldots\right)$ and $\left(r_{k_{1}}, r_{k_{2}}, \ldots\right)$; after this we can assume that the sequence $r_{1}, r_{2}, \ldots$ is convergent. Let $\alpha=\lim _{k \rightarrow \infty} r_{k}$. We show that $\alpha$ is a rational root of $f$.  Over the interval $[-R, R]$, the polynomial $g$ is bounded, $|g(x)| \leq M$ with some fixed $M$. Therefore  $$ \left|f\left(r_{k}\right)\right|=\left|f\left(r_{k}\right)-\frac{p_{k} f\left(r_{k}\right)+g\left(r_{k}\right)}{p_{k}}\right|=\frac{\left|g\left(r_{k}\right)\right|}{p_{k}} \leq \frac{M}{p_{k}} \rightarrow 0, $$  and  $$ f(\alpha)=f\left(\lim _{k \rightarrow \infty} r_{k}\right)=\lim _{k \rightarrow \infty} f\left(r_{k}\right)=0 $$  So $\alpha$ is a root of $f$ indeed.  Now let $u_{k}, v_{k}$ be relative prime integers for which $r_{k}=\frac{u_{k}}{v_{k}}$. Let $a$ be the leading coefficient of $f$, let $b=f(0)$ and $c=g(0)$ be the constant terms of $f$ and $g$, respectively. The leading coefficient of the polynomial $p_{k} f+g$ is $p_{k} a$, its constant term is $p_{k} b+c$. So $v_{k}$ divides $p_{k} a$ and $u_{k}$ divides $p_{k} b+c$. Let $p_{k} b+c=u_{k} e_{k}$ (if $p_{k} b+c=u_{k}=0$ then let $e_{k}=1$ ).  We prove that $\alpha$ is rational by using the following fact. Let $\left(p_{n}\right)$ and $\left(q_{n}\right)$ be sequences of integers such that the sequence $\left(p_{n} / q_{n}\right)$ converges. If $\left(p_{n}\right)$ or $\left(q_{n}\right)$ is bounded then $\lim \left(p_{n} / q_{n}\right)$ is rational.  Case 1: There is an infinite subsequence $\left(k_{n}\right)$ of indices such that $v_{k_{n}}$ divides $a$. Then $\left(v_{k_{n}}\right)$ is bounded, so $\alpha=\lim _{n \rightarrow \infty}\left(u_{k_{n}} / v_{k_{n}}\right)$ is rational.  Case 2: There is an infinite subsequence $\left(k_{n}\right)$ of indices such that $v_{k_{n}}$ does not divide $a$. For such indices we have $v_{k_{n}}=p_{k_{n}} d_{k_{n}}$ where $d_{k_{n}}$ is a divisor of $a$. Then  $$ \alpha=\lim _{n \rightarrow \infty} \frac{u_{k_{n}}}{v_{k_{n}}}=\lim _{n \rightarrow \infty} \frac{p_{k_{n}} b+c}{p_{k_{n}} d_{k_{n}} e_{k_{n}}}=\lim _{n \rightarrow \infty} \frac{b}{d_{k_{n}} e_{k_{n}}}+\lim _{n \rightarrow \infty} \frac{c}{p_{k_{n}} d_{k_{n}} e_{k_{n}}}=\lim _{n \rightarrow \infty} \frac{b}{d_{k_{n}} e_{k_{n}}} . $$  Because the numerator $b$ in the last limit is bounded, $\alpha$ is rational.


Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ that satisfy the conditions  $$ f(1+x y)-f(x+y)=f(x) f(y) \quad \text { for all } x, y \in \mathbb{R} $$  and $f(-1) \neq 0$.

Solution: The only solution is the function $f(x)=x-1, x \in \mathbb{R}$.  We set $g(x)=f(x)+1$ and show that $g(x)=x$ for all real $x$. The conditions take the form  $$ g(1+x y)-g(x+y)=(g(x)-1)(g(y)-1) \quad \text { for all } x, y \in \mathbb{R} \text { and } g(-1) \neq 1 $$  Denote $C=g(-1)-1 \neq 0$. Setting $y=-1$ in (1) gives  $$ g(1-x)-g(x-1)=C(g(x)-1) . $$  Set $x=1$ in (2) to obtain $C(g(1)-1)=0$. Hence $g(1)=1$ as $C \neq 0$. Now plugging in $x=0$ and $x=2$ yields $g(0)=0$ and $g(2)=2$ respectively.  We pass on to the key observations  $$ \begin{array}{ll} g(x)+g(2-x)=2 & \text { for all } x \in \mathbb{R} \\ g(x+2)-g(x)=2 & \text { for all } x \in \mathbb{R} \end{array} $$  Replace $x$ by $1-x$ in (2), then change $x$ to $-x$ in the resulting equation. We obtain the relations $g(x)-g(-x)=C(g(1-x)-1), g(-x)-g(x)=C(g(1+x)-1)$. Then adding them up leads to $C(g(1-x)+g(1+x)-2)=0$. Thus $C \neq 0$ implies (3).  Let $u, v$ be such that $u+v=1$. Apply (1) to the pairs $(u, v)$ and $(2-u, 2-v)$ :  $$ g(1+u v)-g(1)=(g(u)-1)(g(v)-1), \quad g(3+u v)-g(3)=(g(2-u)-1)(g(2-v)-1) . $$  Observe that the last two equations have equal right-hand sides by (3). Hence $u+v=1$ implies  $$ g(u v+3)-g(u v+1)=g(3)-g(1) . $$  Each $x \leq 5 / 4$ is expressible in the form $x=u v+1$ with $u+v=1$ (the quadratic function $t^{2}-t+(x-1)$ has real roots for $\left.x \leq 5 / 4\right)$. Hence $g(x+2)-g(x)=g(3)-g(1)$ whenever $x \leq 5 / 4$. Because $g(x)=x$ holds for $x=0,1,2$, setting $x=0$ yields $g(3)=3$. This proves (4) for $x \leq 5 / 4$. If $x>5 / 4$ then $-x<5 / 4$ and so $g(2-x)-g(-x)=2$ by the above. On the other hand (3) gives $g(x)=2-g(2-x), g(x+2)=2-g(-x)$, so that $g(x+2)-g(x)=g(2-x)-g(-x)=2$. Thus (4) is true for all $x \in \mathbb{R}$.  Now replace $x$ by $-x$ in (3) to obtain $g(-x)+g(2+x)=2$. In view of (4) this leads to $g(x)+g(-x)=0$, i. e. $g(-x)=-g(x)$ for all $x$. Taking this into account, we apply (1) to the pairs $(-x, y)$ and $(x,-y)$ :  $g(1-x y)-g(-x+y)=(g(x)+1)(1-g(y)), \quad g(1-x y)-g(x-y)=(1-g(x))(g(y)+1)$.  Adding up yields $g(1-x y)=1-g(x) g(y)$. Then $g(1+x y)=1+g(x) g(y)$ by (3). Now the original equation (1) takes the form $g(x+y)=g(x)+g(y)$. Hence $g$ is additive.  By additvity $g(1+x y)=g(1)+g(x y)=1+g(x y)$; since $g(1+x y)=1+g(x) g(y)$ was shown above, we also have $g(x y)=g(x) g(y)$ ( $g$ is multiplicative). In particular $y=x$ gives $g\left(x^{2}\right)=g(x)^{2} \geq 0$ for all $x$, meaning that $g(x) \geq 0$ for $x \geq 0$. Since $g$ is additive and bounded from below on $[0,+\infty)$, it is linear; more exactly $g(x)=g(1) x=x$ for all $x \in \mathbb{R}$.  In summary $f(x)=x-1, x \in \mathbb{R}$. It is straightforward that this function satisfies the requirements.  Comment. There are functions that satisfy the given equation but vanish at -1 , for instance the constant function 0 and $f(x)=x^{2}-1, x \in \mathbb{R}$.


Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be a function, and let $f^{m}$ be $f$ applied $m$ times. Suppose that for every $n \in \mathbb{N}$ there exists a $k \in \mathbb{N}$ such that $f^{2 k}(n)=n+k$, and let $k_{n}$ be the smallest such $k$. Prove that the sequence $k_{1}, k_{2}, \ldots$ is unbounded.

Solution: We restrict attention to the set  $$ S=\left\{1, f(1), f^{2}(1), \ldots\right\} $$  Observe that $S$ is unbounded because for every number $n$ in $S$ there exists a $k>0$ such that $f^{2 k}(n)=n+k$ is in $S$. Clearly $f$ maps $S$ into itself; moreover $f$ is injective on $S$. Indeed if $f^{i}(1)=f^{j}(1)$ with $i \neq j$ then the values $f^{m}(1)$ start repeating periodically from some point on, and $S$ would be finite.  Define $g: S \rightarrow S$ by $g(n)=f^{2 k_{n}}(n)=n+k_{n}$. We prove that $g$ is injective too. Suppose that $g(a)=g(b)$ with $a<b$. Then $a+k_{a}=f^{2 k_{a}}(a)=f^{2 k_{b}}(b)=b+k_{b}$ implies $k_{a}>k_{b}$. So, since $f$ is injective on $S$, we obtain  $$ f^{2\left(k_{a}-k_{b}\right)}(a)=b=a+\left(k_{a}-k_{b}\right) . $$  However this contradicts the minimality of $k_{a}$ as $0<k_{a}-k_{b}<k_{a}$.  Let $T$ be the set of elements of $S$ that are not of the form $g(n)$ with $n \in S$. Note that $1 \in T$ by $g(n)>n$ for $n \in S$, so $T$ is non-empty. For each $t \in T$ denote $C_{t}=\left\{t, g(t), g^{2}(t), \ldots\right\}$; call $C_{t}$ the chain starting at $t$. Observe that distinct chains are disjoint because $g$ is injective. Each $n \in S \backslash T$ has the form $n=g\left(n^{\prime}\right)$ with $n^{\prime}<n, n^{\prime} \in S$. Repeated applications of the same observation show that $n \in C_{t}$ for some $t \in T$, i. e. $S$ is the disjoint union of the chains $C_{t}$.  If $f^{n}(1)$ is in the chain $C_{t}$ starting at $t=f^{n_{t}}(1)$ then $n=n_{t}+2 a_{1}+\cdots+2 a_{j}$ with  $$ f^{n}(1)=g^{j}\left(f^{n_{t}}(1)\right)=f^{2 a_{j}}\left(f^{2 a_{j-1}}\left(\cdots f^{2 a_{1}}\left(f^{n_{t}}(1)\right)\right)\right)=f^{n_{t}}(1)+a_{1}+\cdots+a_{j} . $$  Hence  $$ f^{n}(1)=f^{n_{t}}(1)+\frac{n-n_{t}}{2}=t+\frac{n-n_{t}}{2} . $$  Now we show that $T$ is infinite. We argue by contradiction. Suppose that there are only finitely many chains $C_{t_{1}}, \ldots, C_{t_{r}}$, starting at $t_{1}<\cdots<t_{r}$. Fix $N$. If $f^{n}(1)$ with $1 \leq n \leq N$ is in $C_{t}$ then $f^{n}(1)=t+\frac{n-n_{t}}{2} \leq t_{r}+\frac{N}{2}$ by (1). But then the $N+1$ distinct natural numbers $1, f(1), \ldots, f^{N}(1)$ are all less than $t_{r}+\frac{N}{2}$ and hence $N+1 \leq t_{r}+\frac{N}{2}$. This is a contradiction if $N$ is sufficiently large, and hence $T$ is infinite.  To complete the argument, choose any $k$ in $\mathbb{N}$ and consider the $k+1$ chains starting at the first $k+1$ numbers in $T$. Let $t$ be the greatest one among these numbers. Then each of the chains in question contains a number not exceeding $t$, and at least one of them does not contain any number among $t+1, \ldots, t+k$. So there is a number $n$ in this chain such that $g(n)-n>k$, i. e. $k_{n}>k$. In conclusion $k_{1}, k_{2}, \ldots$ is unbounded.


We say that a function $f: \mathbb{R}^{k} \rightarrow \mathbb{R}$ is a metapolynomial if, for some positive integers $m$ and $n$, it can be represented in the form  $$ f\left(x_{1}, \ldots, x_{k}\right)=\max _{i=1, \ldots, m} \min _{j=1, \ldots, n} P_{i, j}\left(x_{1}, \ldots, x_{k}\right) $$  where $P_{i, j}$ are multivariate polynomials. Prove that the product of two metapolynomials is also a metapolynomial.

Solution: We use the notation $f(x)=f\left(x_{1}, \ldots, x_{k}\right)$ for $x=\left(x_{1}, \ldots, x_{k}\right)$ and $[m]=\{1,2, \ldots, m\}$. Observe that if a metapolynomial $f(x)$ admits a representation like the one in the statement for certain positive integers $m$ and $n$, then they can be replaced by any $m^{\prime} \geq m$ and $n^{\prime} \geq n$. For instance, if we want to replace $m$ by $m+1$ then it is enough to define $P_{m+1, j}(x)=P_{m, j}(x)$ and note that repeating elements of a set do not change its maximum nor its minimum. So one can assume that any two metapolynomials are defined with the same $m$ and $n$. We reserve letters $P$ and $Q$ for polynomials, so every function called $P, P_{i, j}, Q, Q_{i, j}, \ldots$ is a polynomial function.  We start with a lemma that is useful to change expressions of the form $\min \max f_{i, j}$ to ones of the form $\max \min g_{i, j}$.  Lemma. Let $\left\{a_{i, j}\right\}$ be real numbers, for all $i \in[m]$ and $j \in[n]$. Then  $$ \min _{i \in[m]} \max _{j \in[n]} a_{i, j}=\max _{j_{1}, \ldots, j_{m} \in[n]} \min _{i \in[m]} a_{i, j_{i}} $$  where the max in the right-hand side is over all vectors $\left(j_{1}, \ldots, j_{m}\right)$ with $j_{1}, \ldots, j_{m} \in[n]$.  Proof. We can assume for all $i$ that $a_{i, n}=\max \left\{a_{i, 1}, \ldots, a_{i, n}\right\}$ and $a_{m, n}=\min \left\{a_{1, n}, \ldots, a_{m, n}\right\}$. The left-hand side is $=a_{m, n}$ and hence we need to prove the same for the right-hand side. If $\left(j_{1}, j_{2}, \ldots, j_{m}\right)=(n, n, \ldots, n)$ then $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\}=\min \left\{a_{1, n}, \ldots, a_{m, n}\right\}=a_{m, n}$ which implies that the right-hand side is $\geq a_{m, n}$. It remains to prove the opposite inequality and this is equivalent to $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\} \leq a_{m, n}$ for all possible $\left(j_{1}, j_{2}, \ldots, j_{m}\right)$. This is true because $\min \left\{a_{1, j_{1}}, \ldots, a_{m, j_{m}}\right\} \leq a_{m, j_{m}} \leq a_{m, n}$.  We need to show that the family $\mathcal{M}$ of metapolynomials is closed under multiplication, but it turns out easier to prove more: that it is also closed under addition, maxima and minima.  First we prove the assertions about the maxima and the minima. If $f_{1}, \ldots, f_{r}$ are metapolynomials, assume them defined with the same $m$ and $n$. Then  $$ f=\max \left\{f_{1}, \ldots, f_{r}\right\}=\max \left\{\max _{i \in[m]} \min _{j \in[n]} P_{i, j}^{1}, \ldots, \max _{i \in[m]} \min _{j \in[n]} P_{i, j}^{r}\right\}=\max _{s \in[r], i \in[m]} \min _{j \in[n]} P_{i, j}^{s} $$  It follows that $f=\max \left\{f_{1}, \ldots, f_{r}\right\}$ is a metapolynomial. The same argument works for the minima, but first we have to replace $\min \max$ by $\max \min$, and this is done via the lemma.  Another property we need is that if $f=\max \min P_{i, j}$ is a metapolynomial then so is $-f$. Indeed, $-f=\min \left(-\min P_{i, j}\right)=\min \max P_{i, j}$.  To prove $\mathcal{M}$ is closed under addition let $f=\max \min P_{i, j}$ and $g=\max \min Q_{i, j}$. Then  $$ \begin{gathered} f(x)+g(x)=\max _{i \in[m]} \min _{j \in[n]} P_{i, j}(x)+\max _{i \in[m]} \min _{j \in[n]} Q_{i, j}(x) \\ =\max _{i_{1}, i_{2} \in[m]}\left(\min _{j \in[n]} P_{i_{1}, j}(x)+\min _{j \in[n]} Q_{i_{2}, j}(x)\right)=\max _{i_{1}, i_{2} \in[m]} \min _{j_{1}, j_{2} \in[n]}\left(P_{i_{1}, j_{1}}(x)+Q_{i_{2}, j_{2}}(x)\right), \end{gathered} $$  and hence $f(x)+g(x)$ is a metapolynomial.  We proved that $\mathcal{M}$ is closed under sums, maxima and minima, in particular any function that can be expressed by sums, max, min, polynomials or even metapolynomials is in $\mathcal{M}$.  We would like to proceed with multiplication along the same lines like with addition, but there is an essential difference. In general the product of the maxima of two sets is not equal to the maximum of the product of the sets. We need to deal with the fact that $a<b$ and $c<d$ do not imply $a c<b d$. However this is true for $a, b, c, d \geq 0$.  In view of this we decompose each function $f(x)$ into its positive part $f^{+}(x)=\max \{f(x), 0\}$ and its negative part $f^{-}(x)=\max \{0,-f(x)\}$. Note that $f=f^{+}-f^{-}$and $f^{+}, f^{-} \in \mathcal{M}$ if $f \in \mathcal{M}$. The whole problem reduces to the claim that if $f$ and $g$ are metapolynomials with $f, g \geq 0$ then $f g$ it is also a metapolynomial.  Assuming this claim, consider arbitrary $f, g \in \mathcal{M}$. We have  $$ f g=\left(f^{+}-f^{-}\right)\left(g^{+}-g^{-}\right)=f^{+} g^{+}-f^{+} g^{-}-f^{-} g^{+}+f^{-} g^{-}, $$  and hence $f g \in \mathcal{M}$. Indeed, $\mathcal{M}$ is closed under addition, also $f^{+} g^{+}, f^{+} g^{-}, f^{-} g^{+}, f^{-} g^{-} \in \mathcal{M}$ because $f^{+}, f^{-}, g^{+}, g^{-} \geq 0$.  It remains to prove the claim. In this case $f, g \geq 0$, and one can try to repeat the argument for the sum. More precisely, let $f=\max \min P_{i j} \geq 0$ and $g=\max \min Q_{i j} \geq 0$. Then  $$ f g=\max \min P_{i, j} \cdot \max \min Q_{i, j}=\max \min P_{i, j}^{+} \cdot \max \min Q_{i, j}^{+}=\max \min P_{i_{1}, j_{1}}^{+} \cdot Q_{i_{2}, j_{2}}^{+} . $$  Hence it suffices to check that $P^{+} Q^{+} \in \mathcal{M}$ for any pair of polynomials $P$ and $Q$. This reduces to the identity  $$ u^{+} v^{+}=\max \left\{0, \min \{u v, u, v\}, \min \left\{u v, u v^{2}, u^{2} v\right\}, \min \left\{u v, u, u^{2} v\right\}, \min \left\{u v, u v^{2}, v\right\}\right\} $$  with $u$ replaced by $P(x)$ and $v$ replaced by $Q(x)$. The formula is proved by a case-by-case analysis. If $u \leq 0$ or $v \leq 0$ then both sides equal 0 . In case $u, v \geq 0$, the right-hand side is clearly $\leq u v$. To prove the opposite inequality we use that $u v$ equals  $$ \begin{array}{ll} \min \{u v, u, v\} & \text { if } 0 \leq u, v \leq 1, \\ \min \left\{u v, u v^{2}, u^{2} v\right\} & \text { if } 1 \leq u, v, \\ \min \left\{u v, u, u^{2} v\right\} & \text { if } 0 \leq v \leq 1 \leq u, \\ \min \left\{u v, u v^{2}, v\right\} & \text { if } 0 \leq u \leq 1 \leq v . \end{array} $$  Comment. The case $k=1$ is simpler and can be solved by proving that a function $f: \mathbb{R} \rightarrow \mathbb{R}$ is a metapolynomial if and only if it is a piecewise polinomial (and continuos) function.  It is enough to prove that all such functions are metapolynomials, and this easily reduces to the following case. Given a polynomial $P(x)$ with $P(0)=0$, the function $f$ defined by $f(x)=P(x)$ for $x \geq 0$ and 0 otherwise is a metapolynomial. For this last claim, it suffices to prove that $\left(x^{+}\right)^{n}$ is a metapolynomial, and this follows from the formula $\left(x^{+}\right)^{n}=\max \left\{0, \min \left\{x^{n-1}, x^{n}\right\}, \min \left\{x^{n}, x^{n+1}\right\}\right\}$.


Several positive integers are written in a row. Iteratively, Alice chooses two adjacent numbers $x$ and $y$ such that $x>y$ and $x$ is to the left of $y$, and replaces the pair $(x, y)$ by either $(y+1, x)$ or $(x-1, x)$. Prove that she can perform only finitely many such iterations.

Solution: Note first that the allowed operation does not change the maximum $M$ of the initial sequence. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the numbers obtained at some point of the process. Consider the sum  $$ S=a_{1}+2 a_{2}+\cdots+n a_{n} $$  We claim that $S$ increases by a positive integer amount with every operation. Let the operation replace the pair ( $\left.a_{i}, a_{i+1}\right)$ by a pair $\left(c, a_{i}\right)$, where $a_{i}>a_{i+1}$ and $c=a_{i+1}+1$ or $c=a_{i}-1$. Then the new and the old value of $S$ differ by $d=\left(i c+(i+1) a_{i}\right)-\left(i a_{i}+(i+1) a_{i+1}\right)=a_{i}-a_{i+1}+i\left(c-a_{i+1}\right)$. The integer $d$ is positive since $a_{i}-a_{i+1} \geq 1$ and $c-a_{i+1} \geq 0$.  On the other hand $S \leq(1+2+\cdots+n) M$ as $a_{i} \leq M$ for all $i=1, \ldots, n$. Since $S$ increases by at least 1 at each step and never exceeds the constant $(1+2+\cdots+n) M$, the process stops after a finite number of iterations.


Solution: Like in the first solution note that the operations do not change the maximum $M$ of the initial sequence. Now consider the reverse lexicographical order for $n$-tuples of integers. We say that $\left(x_{1}, \ldots, x_{n}\right)<\left(y_{1}, \ldots, y_{n}\right)$ if $x_{n}<y_{n}$, or if $x_{n}=y_{n}$ and $x_{n-1}<y_{n-1}$, or if $x_{n}=y_{n}$, $x_{n-1}=y_{n-1}$ and $x_{n-2}<y_{n-2}$, etc. Each iteration creates a sequence that is greater than the previous one with respect to this order, and no sequence occurs twice during the process. On the other hand there are finitely many possible sequences because their terms are always positive integers not exceeding $M$. Hence the process cannot continue forever.


Solution: Let the current numbers be $a_{1}, a_{2}, \ldots, a_{n}$. Define the score $s_{i}$ of $a_{i}$ as the number of $a_{j}$ 's that are less than $a_{i}$. Call the sequence $s_{1}, s_{2}, \ldots, s_{n}$ the score sequence of $a_{1}, a_{2}, \ldots, a_{n}$.  Let us say that a sequence $x_{1}, \ldots, x_{n}$ dominates a sequence $y_{1}, \ldots, y_{n}$ if the first index $i$ with $x_{i} \neq y_{i}$ is such that $x_{i}<y_{i}$. We show that after each operation the new score sequence dominates the old one. Score sequences do not repeat, and there are finitely many possibilities for them, no more than $(n-1)^{n}$. Hence the process will terminate.  Consider an operation that replaces $(x, y)$ by $(a, x)$, with $a=y+1$ or $a=x-1$. Suppose that $x$ was originally at position $i$. For each $j<i$ the score $s_{j}$ does not increase with the change because $y \leq a$ and $x \leq x$. If $s_{j}$ decreases for some $j<i$ then the new score sequence dominates the old one. Assume that $s_{j}$ stays the same for all $j<i$ and consider $s_{i}$. Since $x>y$ and $y \leq a \leq x$, we see that $s_{i}$ decreases by at least 1 . This concludes the proof.  Comment. All three proofs work if $x$ and $y$ are not necessarily adjacent, and if the pair $(x, y)$ is replaced by any pair $(a, x)$, with $a$ an integer satisfying $y \leq a \leq x$. There is nothing special about the "weights" $1,2, \ldots, n$ in the definition of $S=\sum_{i=1}^{n} i a_{i}$ from the first solution. For any sequence $w_{1}<w_{2}<\cdots<w_{n}$ of positive integers, the sum $\sum_{i=1}^{n} w_{i} a_{i}$ increases by at least 1 with each operation.  Consider the same problem, but letting Alice replace the pair $(x, y)$ by $(a, x)$, where $a$ is any positive integer less than $x$. The same conclusion holds in this version, i. e. the process stops eventually. The solution using the reverse lexicographical order works without any change. The first solution would require a special set of weights like $w_{i}=M^{i}$ for $i=1, \ldots, n$.  Comment. The first and the second solutions provide upper bounds for the number of possible operations, respectively of order $M n^{2}$ and $M^{n}$ where $M$ is the maximum of the original sequence. The upper bound $(n-1)^{n}$ in the third solution does not depend on $M$.


Let $n \geq 1$ be an integer. What is the maximum number of disjoint pairs of elements of the set $\{1,2, \ldots, n\}$ such that the sums of the different pairs are different integers not exceeding $n$ ?

Solution: Consider $x$ such pairs in $\{1,2, \ldots, n\}$. The sum $S$ of the $2 x$ numbers in them is at least $1+2+\cdots+2 x$ since the pairs are disjoint. On the other hand $S \leq n+(n-1)+\cdots+(n-x+1)$ because the sums of the pairs are different and do not exceed $n$. This gives the inequality  $$ \frac{2 x(2 x+1)}{2} \leq n x-\frac{x(x-1)}{2}, $$  which leads to $x \leq \frac{2 n-1}{5}$. Hence there are at most $\left\lfloor\frac{2 n-1}{5}\right\rfloor$ pairs with the given properties.  We show a construction with exactly $\left\lfloor\frac{2 n-1}{5}\right\rfloor$ pairs. First consider the case $n=5 k+3$ with $k \geq 0$, where $\left\lfloor\frac{2 n-1}{5}\right\rfloor=2 k+1$. The pairs are displayed in the following table.  | Pairs | $3 k+1$ | $3 k$ | $\cdots$ | $2 k+2$ | $4 k+2$ | $4 k+1$ | $\cdots$ | $3 k+3$ | $3 k+2$ | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | |  | 2 | 4 | $\cdots$ | $2 k$ | 1 | 3 | $\cdots$ | $2 k-1$ | $2 k+1$ | | Sums | $3 k+3$ | $3 k+4$ | $\cdots$ | $4 k+2$ | $4 k+3$ | $4 k+4$ | $\cdots$ | $5 k+2$ | $5 k+3$ |  The $2 k+1$ pairs involve all numbers from 1 to $4 k+2$; their sums are all numbers from $3 k+3$ to $5 k+3$. The same construction works for $n=5 k+4$ and $n=5 k+5$ with $k \geq 0$. In these cases the required number $\left\lfloor\frac{2 n-1}{5}\right\rfloor$ of pairs equals $2 k+1$ again, and the numbers in the table do not exceed $5 k+3$. In the case $n=5 k+2$ with $k \geq 0$ one needs only $2 k$ pairs. They can be obtained by ignoring the last column of the table (thus removing $5 k+3$ ). Finally, $2 k$ pairs are also needed for the case $n=5 k+1$ with $k \geq 0$. Now it suffices to ignore the last column of the table and then subtract 1 from each number in the first row.  Comment. The construction above is not unique. For instance, the following table shows another set of $2 k+1$ pairs for the cases $n=5 k+3, n=5 k+4$, and $n=5 k+5$.  | Pairs | 1 | 2 | $\cdots$ | $k$ | $k+1$ | $k+2$ | $\cdots$ | $2 k+1$ | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | |  | $4 k+1$ | $4 k-1$ | $\cdots$ | $2 k+3$ | $4 k+2$ | $4 k$ | $\cdots$ | $2 k+2$ | | Sums | $4 k+2$ | $4 k+1$ | $\cdots$ | $3 k+3$ | $5 k+3$ | $5 k+2$ | $\cdots$ | $4 k+3$ |  The table for the case $n=5 k+2$ would be the same, with the pair $(k+1,4 k+2)$ removed. For the case $n=5 k+1$ remove the last column and subtract 2 from each number in the second row.


In a $999 \times 999$ square table some cells are white and the remaining ones are red. Let $T$ be the number of triples $\left(C_{1}, C_{2}, C_{3}\right)$ of cells, the first two in the same row and the last two in the same column, with $C_{1}$ and $C_{3}$ white and $C_{2}$ red. Find the maximum value $T$ can attain.

Solution: We prove that in an $n \times n$ square table there are at most $\frac{4 n^{4}}{27}$ such triples.  Let row $i$ and column $j$ contain $a_{i}$ and $b_{j}$ white cells respectively, and let $R$ be the set of red cells. For every red cell $(i, j)$ there are $a_{i} b_{j}$ admissible triples $\left(C_{1}, C_{2}, C_{3}\right)$ with $C_{2}=(i, j)$, therefore  $$ T=\sum_{(i, j) \in R} a_{i} b_{j} $$  We use the inequality $2 a b \leq a^{2}+b^{2}$ to obtain  $$ T \leq \frac{1}{2} \sum_{(i, j) \in R}\left(a_{i}^{2}+b_{j}^{2}\right)=\frac{1}{2} \sum_{i=1}^{n}\left(n-a_{i}\right) a_{i}^{2}+\frac{1}{2} \sum_{j=1}^{n}\left(n-b_{j}\right) b_{j}^{2} $$  This is because there are $n-a_{i}$ red cells in row $i$ and $n-b_{j}$ red cells in column $j$. Now we maximize the right-hand side.  By the AM-GM inequality we have  $$ (n-x) x^{2}=\frac{1}{2}(2 n-2 x) \cdot x \cdot x \leq \frac{1}{2}\left(\frac{2 n}{3}\right)^{3}=\frac{4 n^{3}}{27} $$  with equality if and only if $x=\frac{2 n}{3}$. By putting everything together, we get  $$ T \leq \frac{n}{2} \frac{4 n^{3}}{27}+\frac{n}{2} \frac{4 n^{3}}{27}=\frac{4 n^{4}}{27} $$  If $n=999$ then any coloring of the square table with $x=\frac{2 n}{3}=666$ white cells in each row and column attains the maximum as all inequalities in the previous argument become equalities. For example color a cell $(i, j)$ white if $i-j \equiv 1,2, \ldots, 666(\bmod 999)$, and red otherwise.  Therefore the maximum value $T$ can attain is $T=\frac{4 \cdot 999^{4}}{27}$.  Comment. One can obtain a better preliminary estimate with the CAUCHY-SCHWARZ inequality:  $$ T=\sum_{(i, j) \in R} a_{i} b_{j} \leq\left(\sum_{(i, j) \in R} a_{i}^{2}\right)^{\frac{1}{2}} \cdot\left(\sum_{(i, j) \in R} b_{j}^{2}\right)^{\frac{1}{2}}=\left(\sum_{i=1}^{n}\left(n-a_{i}\right) a_{i}^{2}\right)^{\frac{1}{2}} \cdot\left(\sum_{j=1}^{n}\left(n-b_{j}\right) b_{j}^{2}\right)^{\frac{1}{2}} $$  It can be used to reach the same conclusion.


Players $A$ and $B$ play a game with $N \geq 2012$ coins and 2012 boxes arranged around a circle. Initially $A$ distributes the coins among the boxes so that there is at least 1 coin in each box. Then the two of them make moves in the order $B, A, B, A, \ldots$ by the following rules:  - On every move of his $B$ passes 1 coin from every box to an adjacent box. - On every move of hers $A$ chooses several coins that were not involved in $B$ 's previous move and are in different boxes. She passes every chosen coin to an adjacent box.  Player $A$ 's goal is to ensure at least 1 coin in each box after every move of hers, regardless of how $B$ plays and how many moves are made. Find the least $N$ that enables her to succeed.

Solution: We argue for a general $n \geq 7$ instead of 2012 and prove that the required minimum $N$ is $2 n-2$. For $n=2012$ this gives $N_{\min }=4022$.  a) If $N=2 n-2$ player $A$ can achieve her goal. Let her start the game with a regular distribution: $n-2$ boxes with 2 coins and 2 boxes with 1 coin. Call the boxes of the two kinds red and white respectively. We claim that on her first move $A$ can achieve a regular distribution again, regardless of $B$ 's first move $M$. She acts according as the following situation $S$ occurs after $M$ or not: The initial distribution contains a red box $R$ with 2 white neighbors, and $R$ receives no coins from them on move $M$.  Suppose that $S$ does not occur. Exactly one of the coins $c_{1}$ and $c_{2}$ in a given red box $X$ is involved in $M$, say $c_{1}$. If $M$ passes $c_{1}$ to the right neighbor of $X$, let $A$ pass $c_{2}$ to its left neighbor, and vice versa. By doing so with all red boxes $A$ performs a legal move $M^{\prime}$. Thus $M$ and $M^{\prime}$ combined move the 2 coins of every red box in opposite directions. Hence after $M$ and $M^{\prime}$ are complete each neighbor of a red box $X$ contains exactly 1 coin that was initially in $X$. So each box with a red neighbor is non-empty after $M^{\prime}$. If initially there is a box $X$ with 2 white neighbors ( $X$ is red and unique) then $X$ receives a coin from at least one of them on move $M$ since $S$ does not occur. Such a coin is not involved in $M^{\prime}$, so $X$ is also non-empty after $M^{\prime}$. Furthermore each box $Y$ has given away its initial content after $M$ and $M^{\prime}$. A red neighbor of $Y$ adds 1 coin to it; a white neighbor adds at most 1 coin because it is not involved in $M^{\prime}$. Hence each box contains 1 or 2 coins after $M^{\prime}$. Because $N=2 n-2$, such a distribution is regular.  Now let $S$ occur after move $M$. Then $A$ leaves untouched the exceptional red box $R$. With all remaining red boxes she proceeds like in the previous case, thus making a legal move $M^{\prime \prime}$. Box $R$ receives no coins from its neighbors on either move, so there is 1 coin in it after $M^{\prime \prime}$. Like above $M$ and $M^{\prime \prime}$ combined pass exactly 1 coin from every red box different from $R$ to each of its neighbors. Every box except $R$ has a red neighbor different from $R$, hence all boxes are non-empty after $M^{\prime \prime}$. Next, each box $Y$ except $R$ loses its initial content after $M$ and $M^{\prime \prime}$. A red neighbor of $Y$ adds at most 1 coin to it; a white neighbor also adds at most 1 coin as it does not participate in $M^{\prime \prime}$. Thus each box has 1 or 2 coins after $M^{\prime \prime}$, and the obtained distribution is regular.  Player $A$ can apply the described strategy indefinitely, so $N=2 n-2$ enables her to succeed.  b) For $N \leq 2 n-3$ player $B$ can achieve an empty box after some move of $A$. Let $\alpha$ be a set of $\ell$ consecutive boxes containing a total of $N(\alpha)$ coins. We call $\alpha$ an arc if $\ell \leq n-2$ and $N(\alpha) \leq 2 \ell-3$. Note that $\ell \geq 2$ by the last condition. Moreover if both extremes of $\alpha$ are non-empty boxes then $N(\alpha) \geq 2$, so that $N(\alpha) \leq 2 \ell-3$ implies $\ell \geq 3$. Observe also that if an extreme $X$ of $\alpha$ has more than 1 coin then ignoring $X$ yields a shorter arc. It follows that every arc contains an arc whose extremes have at most 1 coin each.  Given a clockwise labeling $1,2, \ldots, n$ of the boxes, suppose that boxes $1,2, \ldots, \ell$ form an arc $\alpha$, with $\ell \leq n-2$ and $N(\alpha) \leq 2 \ell-3$. Suppose also that all $n \geq 7$ boxes are non-empty. Then $B$ can move so that an arc $\alpha^{\prime}$ with $N\left(\alpha^{\prime}\right)<N(\alpha)$ will appear after any response of $A$.  One may assume exactly 1 coin in boxes 1 and $\ell$ by a previous remark. Let $B$ pass 1 coin in counterclockwise direction from box 1 and box $n$, and in clockwise direction from each remaining box. This leaves $N(\alpha)-2$ coins in the boxes of $\alpha$. In addition, due to $3 \leq \ell \leq n-2$, box $\ell$ has exactly 1 coin $c$, the one received from box $\ell-1$.  Let player $A$ 's next move $M$ pass $k \leq 2$ coins to boxes $1,2, \ldots, \ell$ from the remaining ones. Only boxes 1 and $\ell$ can receive such coins, at most 1 each. If $k<2$ then after move $M$ boxes $1,2, \ldots, \ell$ form an arc $\alpha^{\prime}$ with $N\left(\alpha^{\prime}\right)<N(\alpha)$. If $k=2$ then $M$ adds a coin to box $\ell$. Also $M$ does not move coin $c$ from $\ell$ because $c$ is involved in the previous move of $B$. In summary boxes $1,2, \ldots, \ell$ contain $N(\alpha)$ coins like before, so they form an arc. However there are 2 coins now in the extreme $\ell$ of the arc. Ignore $\ell$ to obtain a shorter arc $\alpha^{\prime}$ with $N\left(\alpha^{\prime}\right)<N(\alpha)$.  Consider any initial distribution without empty boxes. Since $N \leq 2 n-3$, there are at least 3 boxes in it with exactly 1 coin. It follows from $n \geq 7$ that some 2 of them are the extremes of an $\operatorname{arc} \alpha$. Hence $B$ can make the move described above, which leads to an arc $\alpha^{\prime}$ with $N\left(\alpha^{\prime}\right)<N(\alpha)$ after $A^{\prime}$ 's response. If all boxes in the new distribution are non-empty he can repeat the same, and so on. Because $N(\alpha)$ cannot decrease indefinitely, an empty box will occur after some move of $A$.


The columns and the rows of a $3 n \times 3 n$ square board are numbered $1,2, \ldots, 3 n$. Every square $(x, y)$ with $1 \leq x, y \leq 3 n$ is colored asparagus, byzantium or citrine according as the modulo 3 remainder of $x+y$ is 0,1 or 2 respectively. One token colored asparagus, byzantium or citrine is placed on each square, so that there are $3 n^{2}$ tokens of each color.  Suppose that one can permute the tokens so that each token is moved to a distance of at most $d$ from its original position, each asparagus token replaces a byzantium token, each byzantium token replaces a citrine token, and each citrine token replaces an asparagus token. Prove that it is possible to permute the tokens so that each token is moved to a distance of at most $d+2$ from its original position, and each square contains a token with the same color as the square.

Solution: Without loss of generality it suffices to prove that the A-tokens can be moved to distinct $\mathrm{A}$-squares in such a way that each $\mathrm{A}$-token is moved to a distance at most $d+2$ from its original place. This means we need a perfect matching between the $3 n^{2} \mathrm{~A}$-squares and the $3 n^{2}$ A-tokens such that the distance in each pair of the matching is at most $d+2$.  To find the matching, we construct a bipartite graph. The A-squares will be the vertices in one class of the graph; the vertices in the other class will be the A-tokens.  Split the board into $3 \times 1$ horizontal triminos; then each trimino contains exactly one Asquare. Take a permutation $\pi$ of the tokens which moves A-tokens to B-tokens, B-tokens to C-tokens, and C-tokens to A-tokens, in each case to a distance at most $d$. For each A-square $S$, and for each A-token $T$, connect $S$ and $T$ by an edge if $T, \pi(T)$ or $\pi^{-1}(T)$ is on the trimino containing $S$. We allow multiple edges; it is even possible that the same square and the same token are connected with three edges. Obviously the lengths of the edges in the graph do not exceed $d+2$. By length of an edge we mean the distance between the A-square and the A-token it connects.  Each A-token $T$ is connected with the three A-squares whose triminos contain $T, \pi(T)$ and $\pi^{-1}(T)$. Therefore in the graph all tokens are of degree 3. We show that the same is true for the A-squares. Let $S$ be an arbitrary A-square, and let $T_{1}, T_{2}, T_{3}$ be the three tokens on the trimino containing $S$. For $i=1,2,3$, if $T_{i}$ is an A-token, then $S$ is connected with $T_{i}$; if $T_{i}$ is a B-token then $S$ is connected with $\pi^{-1}\left(T_{i}\right)$; finally, if $T_{i}$ is a C-token then $S$ is connected with $\pi\left(T_{i}\right)$. Hence in the graph the A-squares also are of degree 3.  Since the A-squares are of degree 3 , from every set $\mathcal{S}$ of A-squares exactly $3|\mathcal{S}|$ edges start. These edges end in at least $|\mathcal{S}|$ tokens because the A-tokens also are of degree 3. Hence every set $\mathcal{S}$ of A-squares has at least $|\mathcal{S}|$ neighbors among the A-tokens.  Therefore, by HALL's marriage theorem, the graph contains a perfect matching between the two vertex classes. So there is a perfect matching between the A-squares and A-tokens with edges no longer than $d+2$. It follows that the tokens can be permuted as specified in the problem statement.  Comment 1. In the original problem proposal the board was infinite and there were only two colors. Having $n$ colors for some positive integer $n$ was an option; we chose $n=3$. Moreover, we changed the board to a finite one to avoid dealing with infinite graphs (although Hall's theorem works in the infinite case as well).  With only two colors Hall's theorem is not needed. In this case we split the board into $2 \times 1$ dominos, and in the resulting graph all vertices are of degree 2. The graph consists of disjoint cycles with even length and infinite paths, so the existence of the matching is trivial.  Having more than three colors would make the problem statement more complicated, because we need a matching between every two color classes of tokens. However, this would not mean a significant increase in difficulty.  Comment 2. According to Wikipedia, the color asparagus (hexadecimal code \#87A96B) is a tone of green that is named after the vegetable. Crayola created this color in 1993 as one of the 16 to be named in the Name The Color Contest. Byzantium (\#702963) is a dark tone of purple. Its first recorded use as a color name in English was in 1926. Citrine (\#E4D00A) is variously described as yellow, greenish-yellow, brownish-yellow or orange. The first known use of citrine as a color name in English was in the 14th century.


Let $k$ and $n$ be fixed positive integers. In the liar's guessing game, Amy chooses integers $x$ and $N$ with $1 \leq x \leq N$. She tells Ben what $N$ is, but not what $x$ is. Ben may then repeatedly ask Amy whether $x \in S$ for arbitrary sets $S$ of integers. Amy will always answer with yes or no, but she might lie. The only restriction is that she can lie at most $k$ times in a row. After he has asked as many questions as he wants, Ben must specify a set of at most $n$ positive integers. If $x$ is in this set he wins; otherwise, he loses. Prove that:  a) If $n \geq 2^{k}$ then Ben can always win.  b) For sufficiently large $k$ there exist $n \geq 1.99^{k}$ such that Ben cannot guarantee a win.

Solution: Consider an answer $A \in\{y e s, n o\}$ to a question of the kind "Is $x$ in the set $S$ ?" We say that $A$ is inconsistent with a number $i$ if $A=y e s$ and $i \notin S$, or if $A=n o$ and $i \in S$. Observe that an answer inconsistent with the target number $x$ is a lie.  a) Suppose that Ben has determined a set $T$ of size $m$ that contains $x$. This is true initially with $m=N$ and $T=\{1,2, \ldots, N\}$. For $m>2^{k}$ we show how Ben can find a number $y \in T$ that is different from $x$. By performing this step repeatedly he can reduce $T$ to be of size $2^{k} \leq n$ and thus win.  Since only the size $m>2^{k}$ of $T$ is relevant, assume that $T=\left\{0,1, \ldots, 2^{k}, \ldots, m-1\right\}$. Ben begins by asking repeatedly whether $x$ is $2^{k}$. If Amy answers no $k+1$ times in a row, one of these answers is truthful, and so $x \neq 2^{k}$. Otherwise Ben stops asking about $2^{k}$ at the first answer yes. He then asks, for each $i=1, \ldots, k$, if the binary representation of $x$ has a 0 in the $i$ th digit. Regardless of what the $k$ answers are, they are all inconsistent with a certain number $y \in\left\{0,1, \ldots, 2^{k}-1\right\}$. The preceding answer yes about $2^{k}$ is also inconsistent with $y$. Hence $y \neq x$. Otherwise the last $k+1$ answers are not truthful, which is impossible.  Either way, Ben finds a number in $T$ that is different from $x$, and the claim is proven.  b) We prove that if $1<\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$ then Ben cannot guarantee a win. To complete the proof, then it suffices to take $\lambda$ such that $1.99<\lambda<2$ and $k$ large enough so that  $$ n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1 \geq 1.99^{k} $$  Consider the following strategy for Amy. First she chooses $N=n+1$ and $x \in\{1,2, \ldots, n+1\}$ arbitrarily. After every answer of hers Amy determines, for each $i=1,2, \ldots, n+1$, the number $m_{i}$ of consecutive answers she has given by that point that are inconsistent with $i$. To decide on her next answer, she then uses the quantity  $$ \phi=\sum_{i=1}^{n+1} \lambda^{m_{i}} $$  No matter what Ben's next question is, Amy chooses the answer which minimizes $\phi$.  We claim that with this strategy $\phi$ will always stay less than $\lambda^{k+1}$. Consequently no exponent $m_{i}$ in $\phi$ will ever exceed $k$, hence Amy will never give more than $k$ consecutive answers inconsistent with some $i$. In particular this applies to the target number $x$, so she will never lie more than $k$ times in a row. Thus, given the claim, Amy's strategy is legal. Since the strategy does not depend on $x$ in any way, Ben can make no deductions about $x$, and therefore he cannot guarantee a win.  It remains to show that $\phi<\lambda^{k+1}$ at all times. Initially each $m_{i}$ is 0 , so this condition holds in the beginning due to $1<\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$. Suppose that $\phi<\lambda^{k+1}$ at some point, and Ben has just asked if $x \in S$ for some set $S$. According as Amy answers yes or no, the new value of $\phi$ becomes  $$ \phi_{1}=\sum_{i \in S} 1+\sum_{i \notin S} \lambda^{m_{i}+1} \quad \text { or } \quad \phi_{2}=\sum_{i \in S} \lambda^{m_{i}+1}+\sum_{i \notin S} 1 $$  Since Amy chooses the option minimizing $\phi$, the new $\phi$ will equal $\min \left(\phi_{1}, \phi_{2}\right)$. Now we have  $$ \min \left(\phi_{1}, \phi_{2}\right) \leq \frac{1}{2}\left(\phi_{1}+\phi_{2}\right)=\frac{1}{2}\left(\sum_{i \in S}\left(1+\lambda^{m_{i}+1}\right)+\sum_{i \notin S}\left(\lambda^{m_{i}+1}+1\right)\right)=\frac{1}{2}(\lambda \phi+n+1) $$  Because $\phi<\lambda^{k+1}$, the assumptions $\lambda<2$ and $n=\left\lfloor(2-\lambda) \lambda^{k+1}\right\rfloor-1$ lead to  $$ \min \left(\phi_{1}, \phi_{2}\right)<\frac{1}{2}\left(\lambda^{k+2}+(2-\lambda) \lambda^{k+1}\right)=\lambda^{k+1} $$  The claim follows, which completes the solution.  Comment. Given a fixed $k$, let $f(k)$ denote the minimum value of $n$ for which Ben can guarantee a victory. The problem asks for a proof that for large $k$  $$ 1.99^{k} \leq f(k) \leq 2^{k} $$  A computer search shows that $f(k)=2,3,4,7,11,17$ for $k=1,2,3,4,5,6$.


There are given $2^{500}$ points on a circle labeled $1,2, \ldots, 2^{500}$ in some order. Prove that one can choose 100 pairwise disjoint chords joining some of these points so that the 100 sums of the pairs of numbers at the endpoints of the chosen chords are equal.

Solution: The proof is based on the following general fact.  Lemma. In a graph $G$ each vertex $v$ has degree $d_{v}$. Then $G$ contains an independent set $S$ of vertices such that $|S| \geq f(G)$ where  $$ f(G)=\sum_{v \in G} \frac{1}{d_{v}+1} $$  Proof. Induction on $n=|G|$. The base $n=1$ is clear. For the inductive step choose a vertex $v_{0}$ in $G$ of minimum degree $d$. Delete $v_{0}$ and all of its neighbors $v_{1}, \ldots, v_{d}$ and also all edges with endpoints $v_{0}, v_{1}, \ldots, v_{d}$. This gives a new graph $G^{\prime}$. By the inductive assumption $G^{\prime}$ contains an independent set $S^{\prime}$ of vertices such that $\left|S^{\prime}\right| \geq f\left(G^{\prime}\right)$. Since no vertex in $S^{\prime}$ is a neighbor of $v_{0}$ in $G$, the set $S=S^{\prime} \cup\left\{v_{0}\right\}$ is independent in $G$.  Let $d_{v}^{\prime}$ be the degree of a vertex $v$ in $G^{\prime}$. Clearly $d_{v}^{\prime} \leq d_{v}$ for every such vertex $v$, and also $d_{v_{i}} \geq d$ for all $i=0,1, \ldots, d$ by the minimal choice of $v_{0}$. Therefore  $$ f\left(G^{\prime}\right)=\sum_{v \in G^{\prime}} \frac{1}{d_{v}^{\prime}+1} \geq \sum_{v \in G^{\prime}} \frac{1}{d_{v}+1}=f(G)-\sum_{i=0}^{d} \frac{1}{d_{v_{i}}+1} \geq f(G)-\frac{d+1}{d+1}=f(G)-1 . $$  Hence $|S|=\left|S^{\prime}\right|+1 \geq f\left(G^{\prime}\right)+1 \geq f(G)$, and the induction is complete.  We pass on to our problem. For clarity denote $n=2^{499}$ and draw all chords determined by the given $2 n$ points. Color each chord with one of the colors $3,4, \ldots, 4 n-1$ according to the sum of the numbers at its endpoints. Chords with a common endpoint have different colors. For each color $c$ consider the following graph $G_{c}$. Its vertices are the chords of color $c$, and two chords are neighbors in $G_{c}$ if they intersect. Let $f\left(G_{c}\right)$ have the same meaning as in the lemma for all graphs $G_{c}$.  Every chord $\ell$ divides the circle into two arcs, and one of them contains $m(\ell) \leq n-1$ given points. (In particular $m(\ell)=0$ if $\ell$ joins two consecutive points.) For each $i=0,1, \ldots, n-2$ there are $2 n$ chords $\ell$ with $m(\ell)=i$. Such a chord has degree at most $i$ in the respective graph. Indeed let $A_{1}, \ldots, A_{i}$ be all points on either arc determined by a chord $\ell$ with $m(\ell)=i$ and color $c$. Every $A_{j}$ is an endpoint of at most 1 chord colored $c, j=1, \ldots, i$. Hence at most $i$ chords of color $c$ intersect $\ell$.  It follows that for each $i=0,1, \ldots, n-2$ the $2 n$ chords $\ell$ with $m(\ell)=i$ contribute at least $\frac{2 n}{i+1}$ to the sum $\sum_{c} f\left(G_{c}\right)$. Summation over $i=0,1, \ldots, n-2$ gives  $$ \sum_{c} f\left(G_{c}\right) \geq 2 n \sum_{i=1}^{n-1} \frac{1}{i} $$  Because there are $4 n-3$ colors in all, averaging yields a color $c$ such that  $$ f\left(G_{c}\right) \geq \frac{2 n}{4 n-3} \sum_{i=1}^{n-1} \frac{1}{i}>\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i} $$  By the lemma there are at least $\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i}$ pairwise disjoint chords of color $c$, i. e. with the same sum $c$ of the pairs of numbers at their endpoints. It remains to show that $\frac{1}{2} \sum_{i=1}^{n-1} \frac{1}{i} \geq 100$ for $n=2^{499}$. Indeed we have  $$ \sum_{i=1}^{n-1} \frac{1}{i}>\sum_{i=1}^{2^{400}} \frac{1}{i}=1+\sum_{k=1}^{400} \sum_{i=2^{k-1+1}}^{2^{k}} \frac{1}{i}>1+\sum_{k=1}^{400} \frac{2^{k-1}}{2^{k}}=201>200 $$  This completes the solution.


In the triangle $A B C$ the point $J$ is the center of the excircle opposite to $A$. This excircle is tangent to the side $B C$ at $M$, and to the lines $A B$ and $A C$ at $K$ and $L$ respectively. The lines $L M$ and $B J$ meet at $F$, and the lines $K M$ and $C J$ meet at $G$. Let $S$ be the point of intersection of the lines $A F$ and $B C$, and let $T$ be the point of intersection of the lines $A G$ and $B C$. Prove that $M$ is the midpoint of $S T$.

Solution: Let $\alpha=\angle C A B, \beta=\angle A B C$ and $\gamma=\angle B C A$. The line $A J$ is the bisector of $\angle C A B$, so $\angle J A K=\angle J A L=\frac{\alpha}{2}$. By $\angle A K J=\angle A L J=90^{\circ}$ the points $K$ and $L$ lie on the circle $\omega$ with diameter $A J$.  The triangle $K B M$ is isosceles as $B K$ and $B M$ are tangents to the excircle. Since $B J$ is the bisector of $\angle K B M$, we have $\angle M B J=90^{\circ}-\frac{\beta}{2}$ and $\angle B M K=\frac{\beta}{2}$. Likewise $\angle M C J=90^{\circ}-\frac{\gamma}{2}$ and $\angle C M L=\frac{\gamma}{2}$. Also $\angle B M F=\angle C M L$, therefore  $$ \angle L F J=\angle M B J-\angle B M F=\left(90^{\circ}-\frac{\beta}{2}\right)-\frac{\gamma}{2}=\frac{\alpha}{2}=\angle L A J . $$  Hence $F$ lies on the circle $\omega$. (By the angle computation, $F$ and $A$ are on the same side of $B C$.) Analogously, $G$ also lies on $\omega$. Since $A J$ is a diameter of $\omega$, we obtain $\angle A F J=\angle A G J=90^{\circ}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-29.jpg?height=703&width=1242&top_left_y=1276&top_left_x=407)  The lines $A B$ and $B C$ are symmetric with respect to the external bisector $B F$. Because $A F \perp B F$ and $K M \perp B F$, the segments $S M$ and $A K$ are symmetric with respect to $B F$, hence $S M=A K$. By symmetry $T M=A L$. Since $A K$ and $A L$ are equal as tangents to the excircle, it follows that $S M=T M$, and the proof is complete.  Comment. After discovering the circle $A F K J L G$, there are many other ways to complete the solution. For instance, from the cyclic quadrilaterals $J M F S$ and $J M G T$ one can find $\angle T S J=\angle S T J=\frac{\alpha}{2}$. Another possibility is to use the fact that the lines $A S$ and $G M$ are parallel (both are perpendicular to the external angle bisector $B J$ ), so $\frac{M S}{M T}=\frac{A G}{G T}=1$.


Let $A B C D$ be a cyclic quadrilateral whose diagonals $A C$ and $B D$ meet at $E$. The extensions of the sides $A D$ and $B C$ beyond $A$ and $B$ meet at $F$. Let $G$ be the point such that $E C G D$ is a parallelogram, and let $H$ be the image of $E$ under reflection in $A D$. Prove that $D, H, F, G$ are concyclic.

Solution: We show first that the triangles $F D G$ and $F B E$ are similar. Since $A B C D$ is cyclic, the triangles $E A B$ and $E D C$ are similar, as well as $F A B$ and $F C D$. The parallelogram $E C G D$ yields $G D=E C$ and $\angle C D G=\angle D C E$; also $\angle D C E=\angle D C A=\angle D B A$ by inscribed angles. Therefore  $$ \begin{gathered} \angle F D G=\angle F D C+\angle C D G=\angle F B A+\angle A B D=\angle F B E, \\ \frac{G D}{E B}=\frac{C E}{E B}=\frac{C D}{A B}=\frac{F D}{F B} . \end{gathered} $$  It follows that $F D G$ and $F B E$ are similar, and so $\angle F G D=\angle F E B$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-30.jpg?height=954&width=974&top_left_y=948&top_left_x=538)  Since $H$ is the reflection of $E$ with respect to $F D$, we conclude that  $$ \angle F H D=\angle F E D=180^{\circ}-\angle F E B=180^{\circ}-\angle F G D . $$  This proves that $D, H, F, G$ are concyclic.  Comment. Points $E$ and $G$ are always in the half-plane determined by the line $F D$ that contains $B$ and $C$, but $H$ is always in the other half-plane. In particular, $D H F G$ is cyclic if and only if $\angle F H D+\angle F G D=180^{\circ}$.


In an acute triangle $A B C$ the points $D, E$ and $F$ are the feet of the altitudes through $A$, $B$ and $C$ respectively. The incenters of the triangles $A E F$ and $B D F$ are $I_{1}$ and $I_{2}$ respectively; the circumcenters of the triangles $A C I_{1}$ and $B C I_{2}$ are $O_{1}$ and $O_{2}$ respectively. Prove that $I_{1} I_{2}$ and $O_{1} O_{2}$ are parallel.

Solution: Let $\angle C A B=\alpha, \angle A B C=\beta, \angle B C A=\gamma$. We start by showing that $A, B, I_{1}$ and $I_{2}$ are concyclic. Since $A I_{1}$ and $B I_{2}$ bisect $\angle C A B$ and $\angle A B C$, their extensions beyond $I_{1}$ and $I_{2}$ meet at the incenter $I$ of the triangle. The points $E$ and $F$ are on the circle with diameter $B C$, so $\angle A E F=\angle A B C$ and $\angle A F E=\angle A C B$. Hence the triangles $A E F$ and $A B C$ are similar with ratio of similitude $\frac{A E}{A B}=\cos \alpha$. Because $I_{1}$ and $I$ are their incenters, we obtain $I_{1} A=I A \cos \alpha$ and $I I_{1}=I A-I_{1} A=2 I A \sin ^{2} \frac{\alpha}{2}$. By symmetry $I I_{2}=2 I B \sin ^{2} \frac{\beta}{2}$. The law of sines in the triangle $A B I$ gives $I A \sin \frac{\alpha}{2}=I B \sin \frac{\beta}{2}$. Hence  $$ I I_{1} \cdot I A=2\left(I A \sin \frac{\alpha}{2}\right)^{2}=2\left(I B \sin \frac{\beta}{2}\right)^{2}=I I_{2} \cdot I B $$  Therefore $A, B, I_{1}$ and $I_{2}$ are concyclic, as claimed.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-31.jpg?height=848&width=1466&top_left_y=998&top_left_x=295)  In addition $I I_{1} \cdot I A=I I_{2} \cdot I B$ implies that $I$ has the same power with respect to the circles $\left(A C I_{1}\right),\left(B C I_{2}\right)$ and $\left(A B I_{1} I_{2}\right)$. Then $C I$ is the radical axis of $\left(A C I_{1}\right)$ and $\left(B C I_{2}\right)$; in particular $C I$ is perpendicular to the line of centers $O_{1} O_{2}$.  Now it suffices to prove that $C I \perp I_{1} I_{2}$. Let $C I$ meet $I_{1} I_{2}$ at $Q$, then it is enough to check that $\angle I I_{1} Q+\angle I_{1} I Q=90^{\circ}$. Since $\angle I_{1} I Q$ is external for the triangle $A C I$, we have  $$ \angle I I_{1} Q+\angle I_{1} I Q=\angle I I_{1} Q+(\angle A C I+\angle C A I)=\angle I I_{1} I_{2}+\angle A C I+\angle C A I . $$  It remains to note that $\angle I I_{1} I_{2}=\frac{\beta}{2}$ from the cyclic quadrilateral $A B I_{1} I_{2}$, and $\angle A C I=\frac{\gamma}{2}$, $\angle C A I=\frac{\alpha}{2}$. Therefore $\angle I I_{1} Q+\angle I_{1} I Q=\frac{\alpha}{2}+\frac{\beta}{2}+\frac{\gamma}{2}=90^{\circ}$, completing the proof.  Comment. It follows from the first part of the solution that the common point $I_{3} \neq C$ of the circles $\left(A C I_{1}\right)$ and $\left(B C I_{2}\right)$ is the incenter of the triangle $C D E$.


Let $A B C$ be a triangle with $A B \neq A C$ and circumcenter $O$. The bisector of $\angle B A C$ intersects $B C$ at $D$. Let $E$ be the reflection of $D$ with respect to the midpoint of $B C$. The lines through $D$ and $E$ perpendicular to $B C$ intersect the lines $A O$ and $A D$ at $X$ and $Y$ respectively. Prove that the quadrilateral $B X C Y$ is cyclic.

Solution: The bisector of $\angle B A C$ and the perpendicular bisector of $B C$ meet at $P$, the midpoint of the minor arc $\widehat{B C}$ (they are different lines as $A B \neq A C$ ). In particular $O P$ is perpendicular to $B C$ and intersects it at $M$, the midpoint of $B C$.  Denote by $Y^{\prime}$ the reflexion of $Y$ with respect to $O P$. Since $\angle B Y C=\angle B Y^{\prime} C$, it suffices to prove that $B X C Y^{\prime}$ is cyclic.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-32.jpg?height=1039&width=826&top_left_y=720&top_left_x=615)  We have  $$ \angle X A P=\angle O P A=\angle E Y P \text {. } $$  The first equality holds because $O A=O P$, and the second one because $E Y$ and $O P$ are both perpendicular to $B C$ and hence parallel. But $\left\{Y, Y^{\prime}\right\}$ and $\{E, D\}$ are pairs of symmetric points with respect to $O P$, it follows that $\angle E Y P=\angle D Y^{\prime} P$ and hence  $$ \angle X A P=\angle D Y^{\prime} P=\angle X Y^{\prime} P . $$  The last equation implies that $X A Y^{\prime} P$ is cyclic. By the powers of $D$ with respect to the circles $\left(X A Y^{\prime} P\right)$ and $(A B P C)$ we obtain  $$ X D \cdot D Y^{\prime}=A D \cdot D P=B D \cdot D C $$  It follows that $B X C Y^{\prime}$ is cyclic, as desired.


Let $A B C$ be a triangle with $\angle B C A=90^{\circ}$, and let $C_{0}$ be the foot of the altitude from $C$. Choose a point $X$ in the interior of the segment $C C_{0}$, and let $K, L$ be the points on the segments $A X, B X$ for which $B K=B C$ and $A L=A C$ respectively. Denote by $M$ the intersection of $A L$ and $B K$. Show that $M K=M L$.

Solution: Let $C^{\prime}$ be the reflection of $C$ in the line $A B$, and let $\omega_{1}$ and $\omega_{2}$ be the circles with centers $A$ and $B$, passing through $L$ and $K$ respectively. Since $A C^{\prime}=A C=A L$ and $B C^{\prime}=B C=B K$, both $\omega_{1}$ and $\omega_{2}$ pass through $C$ and $C^{\prime}$. By $\angle B C A=90^{\circ}, A C$ is tangent to $\omega_{2}$ at $C$, and $B C$ is tangent to $\omega_{1}$ at $C$. Let $K_{1} \neq K$ be the second intersection of $A X$ and $\omega_{2}$, and let $L_{1} \neq L$ be the second intersection of $B X$ and $\omega_{1}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-33.jpg?height=1051&width=1016&top_left_y=688&top_left_x=520)  By the powers of $X$ with respect to $\omega_{2}$ and $\omega_{1}$,  $$ X K \cdot X K_{1}=X C \cdot X C^{\prime}=X L \cdot X L_{1}, $$  so the points $K_{1}, L, K, L_{1}$ lie on a circle $\omega_{3}$.  The power of $A$ with respect to $\omega_{2}$ gives  $$ A L^{2}=A C^{2}=A K \cdot A K_{1}, $$  indicating that $A L$ is tangent to $\omega_{3}$ at $L$. Analogously, $B K$ is tangent to $\omega_{3}$ at $K$. Hence $M K$ and $M L$ are the two tangents from $M$ to $\omega_{3}$ and therefore $M K=M L$.


Let $A B C$ be a triangle with circumcenter $O$ and incenter $I$. The points $D, E$ and $F$ on the sides $B C, C A$ and $A B$ respectively are such that $B D+B F=C A$ and $C D+C E=A B$. The circumcircles of the triangles $B F D$ and $C D E$ intersect at $P \neq D$. Prove that $O P=O I$.

Solution: By Miquel's theorem the circles $(A E F)=\omega_{A},(B F D)=\omega_{B}$ and $(C D E)=\omega_{C}$ have a common point, for arbitrary points $D, E$ and $F$ on $B C, C A$ and $A B$. So $\omega_{A}$ passes through the common point $P \neq D$ of $\omega_{B}$ and $\omega_{C}$.  Let $\omega_{A}, \omega_{B}$ and $\omega_{C}$ meet the bisectors $A I, B I$ and $C I$ at $A \neq A^{\prime}, B \neq B^{\prime}$ and $C \neq C^{\prime}$ respectively. The key observation is that $A^{\prime}, B^{\prime}$ and $C^{\prime}$ do not depend on the particular choice of $D, E$ and $F$, provided that $B D+B F=C A, C D+C E=A B$ and $A E+A F=B C$ hold true (the last equality follows from the other two). For a proof we need the following fact.  Lemma. Given is an angle with vertex $A$ and measure $\alpha$. A circle $\omega$ through $A$ intersects the angle bisector at $L$ and sides of the angle at $X$ and $Y$. Then $A X+A Y=2 A L \cos \frac{\alpha}{2}$.  Proof. Note that $L$ is the midpoint of $\operatorname{arc} \widehat{X L Y}$ in $\omega$ and set $X L=Y L=u, X Y=v$. By PtOLEMY's theorem $A X \cdot Y L+A Y \cdot X L=A L \cdot X Y$, which rewrites as $(A X+A Y) u=A L \cdot v$. Since $\angle L X Y=\frac{\alpha}{2}$ and $\angle X L Y=180^{\circ}-\alpha$, we have $v=2 \cos \frac{\alpha}{2} u$ by the law of sines, and the claim follows.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-34.jpg?height=551&width=671&top_left_y=1118&top_left_x=698)  Apply the lemma to $\angle B A C=\alpha$ and the circle $\omega=\omega_{A}$, which intersects $A I$ at $A^{\prime}$. This gives $2 A A^{\prime} \cos \frac{\alpha}{2}=A E+A F=B C$; by symmetry analogous relations hold for $B B^{\prime}$ and $C C^{\prime}$. It follows that $A^{\prime}, B^{\prime}$ and $C^{\prime}$ are independent of the choice of $D, E$ and $F$, as stated.  We use the lemma two more times with $\angle B A C=\alpha$. Let $\omega$ be the circle with diameter $A I$. Then $X$ and $Y$ are the tangency points of the incircle of $A B C$ with $A B$ and $A C$, and hence $A X=A Y=\frac{1}{2}(A B+A C-B C)$. So the lemma yields $2 A I \cos \frac{\alpha}{2}=A B+A C-B C$. Next, if $\omega$ is the circumcircle of $A B C$ and $A I$ intersects $\omega$ at $M \neq A$ then $\{X, Y\}=\{B, C\}$, and so $2 A M \cos \frac{\alpha}{2}=A B+A C$ by the lemma. To summarize,  $$ 2 A A^{\prime} \cos \frac{\alpha}{2}=B C, \quad 2 A I \cos \frac{\alpha}{2}=A B+A C-B C, \quad 2 A M \cos \frac{\alpha}{2}=A B+A C $$  These equalities imply $A A^{\prime}+A I=A M$, hence the segments $A M$ and $I A^{\prime}$ have a common midpoint. It follows that $I$ and $A^{\prime}$ are equidistant from the circumcenter $O$. By symmetry $O I=O A^{\prime}=O B^{\prime}=O C^{\prime}$, so $I, A^{\prime}, B^{\prime}, C^{\prime}$ are on a circle centered at $O$.  To prove $O P=O I$, now it suffices to show that $I, A^{\prime}, B^{\prime}, C^{\prime}$ and $P$ are concyclic. Clearly one can assume $P \neq I, A^{\prime}, B^{\prime}, C^{\prime}$.  We use oriented angles to avoid heavy case distinction. The oriented angle between the lines $l$ and $m$ is denoted by $\angle(l, m)$. We have $\angle(l, m)=-\angle(m, l)$ and $\angle(l, m)+\angle(m, n)=\angle(l, n)$ for arbitrary lines $l, m$ and $n$. Four distinct non-collinear points $U, V, X, Y$ are concyclic if and only if $\angle(U X, V X)=\angle(U Y, V Y)$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-35.jpg?height=1048&width=1059&top_left_y=184&top_left_x=493)  Suppose for the moment that $A^{\prime}, B^{\prime}, P, I$ are distinct and noncollinear; then it is enough to check the equality $\angle\left(A^{\prime} P, B^{\prime} P\right)=\angle\left(A^{\prime} I, B^{\prime} I\right)$. Because $A, F, P, A^{\prime}$ are on the circle $\omega_{A}$, we have $\angle\left(A^{\prime} P, F P\right)=\angle\left(A^{\prime} A, F A\right)=\angle\left(A^{\prime} I, A B\right)$. Likewise $\angle\left(B^{\prime} P, F P\right)=\angle\left(B^{\prime} I, A B\right)$. Therefore  $$ \angle\left(A^{\prime} P, B^{\prime} P\right)=\angle\left(A^{\prime} P, F P\right)+\angle\left(F P, B^{\prime} P\right)=\angle\left(A^{\prime} I, A B\right)-\angle\left(B^{\prime} I, A B\right)=\angle\left(A^{\prime} I, B^{\prime} I\right) \text {. } $$  Here we assumed that $P \neq F$. If $P=F$ then $P \neq D, E$ and the conclusion follows similarly (use $\angle\left(A^{\prime} F, B^{\prime} F\right)=\angle\left(A^{\prime} F, E F\right)+\angle(E F, D F)+\angle\left(D F, B^{\prime} F\right)$ and inscribed angles in $\left.\omega_{A}, \omega_{B}, \omega_{C}\right)$.  There is no loss of generality in assuming $A^{\prime}, B^{\prime}, P, I$ distinct and noncollinear. If $A B C$ is an equilateral triangle then the equalities $\left(^{*}\right)$ imply that $A^{\prime}, B^{\prime}, C^{\prime}, I, O$ and $P$ coincide, so $O P=O I$. Otherwise at most one of $A^{\prime}, B^{\prime}, C^{\prime}$ coincides with $I$. If say $C^{\prime}=I$ then $O I \perp C I$ by the previous reasoning. It follows that $A^{\prime}, B^{\prime} \neq I$ and hence $A^{\prime} \neq B^{\prime}$. Finally $A^{\prime}, B^{\prime}$ and $I$ are noncollinear because $I, A^{\prime}, B^{\prime}, C^{\prime}$ are concyclic.  Comment. The proposer remarks that the locus $\gamma$ of the points $P$ is an arc of the circle $\left(A^{\prime} B^{\prime} C^{\prime} I\right)$. The reflection $I^{\prime}$ of $I$ in $O$ belongs to $\gamma$; it is obtained by choosing $D, E$ and $F$ to be the tangency points of the three excircles with their respective sides. The rest of the circle $\left(A^{\prime} B^{\prime} C^{\prime} I\right)$, except $I$, can be included in $\gamma$ by letting $D, E$ and $F$ vary on the extensions of the sides and assuming signed lengths. For instance if $B$ is between $C$ and $D$ then the length $B D$ must be taken with a negative sign. The incenter $I$ corresponds to the limit case where $D$ tends to infinity.


Let $A B C D$ be a convex quadrilateral with non-parallel sides $B C$ and $A D$. Assume that there is a point $E$ on the side $B C$ such that the quadrilaterals $A B E D$ and $A E C D$ are circumscribed. Prove that there is a point $F$ on the side $A D$ such that the quadrilaterals $A B C F$ and $B C D F$ are circumscribed if and only if $A B$ is parallel to $C D$.

Solution: Let $\omega_{1}$ and $\omega_{2}$ be the incircles and $O_{1}$ and $O_{2}$ the incenters of the quadrilaterals $A B E D$ and $A E C D$ respectively. A point $F$ with the stated property exists only if $\omega_{1}$ and $\omega_{2}$ are also the incircles of the quadrilaterals $A B C F$ and $B C D F$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-36.jpg?height=494&width=868&top_left_y=593&top_left_x=591)  Let the tangents from $B$ to $\omega_{2}$ and from $C$ to $\omega_{1}$ (other than $B C$ ) meet $A D$ at $F_{1}$ and $F_{2}$ respectively. We need to prove that $F_{1}=F_{2}$ if and only if $A B \| C D$.  Lemma. The circles $\omega_{1}$ and $\omega_{2}$ with centers $O_{1}$ and $O_{2}$ are inscribed in an angle with vertex $O$. The points $P, S$ on one side of the angle and $Q, R$ on the other side are such that $\omega_{1}$ is the incircle of the triangle $P Q O$, and $\omega_{2}$ is the excircle of the triangle $R S O$ opposite to $O$. Denote $p=O O_{1} \cdot O O_{2}$. Then exactly one of the following relations holds:  $$ O P \cdot O R<p<O Q \cdot O S, \quad O P \cdot O R>p>O Q \cdot O S, \quad O P \cdot O R=p=O Q \cdot O S $$  Proof. Denote $\angle O P O_{1}=u, \angle O Q O_{1}=v, \angle O O_{2} R=x, \angle O O_{2} S=y, \angle P O Q=2 \varphi$. Because $P O_{1}, Q O_{1}, R O_{2}, S O_{2}$ are internal or external bisectors in the triangles $P Q O$ and $R S O$, we have  $$ u+v=x+y\left(=90^{\circ}-\varphi\right) . $$  By the law of sines  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-36.jpg?height=417&width=880&top_left_y=1756&top_left_x=588)  $$ \frac{O P}{O O_{1}}=\frac{\sin (u+\varphi)}{\sin u} \quad \text { and } \quad \frac{O O_{2}}{O R}=\frac{\sin (x+\varphi)}{\sin x} $$  Therefore, since $x, u$ and $\varphi$ are acute,  $O P \cdot O R \geq p \Leftrightarrow \frac{O P}{O O_{1}} \geq \frac{O O_{2}}{O R} \Leftrightarrow \sin x \sin (u+\varphi) \geq \sin u \sin (x+\varphi) \Leftrightarrow \sin (x-u) \geq 0 \Leftrightarrow x \geq u$.  Thus $O P \cdot O R \geq p$ is equivalent to $x \geq u$, with $O P \cdot O R=p$ if and only if $x=u$.  Analogously, $p \geq O Q \cdot O S$ is equivalent to $v \geq y$, with $p=O Q \cdot O S$ if and only if $v=y$. On the other hand $x \geq u$ and $v \geq y$ are equivalent by (1), with $x=u$ if and only if $v=y$. The conclusion of the lemma follows from here.  Going back to the problem, apply the lemma to the quadruples $\left\{B, E, D, F_{1}\right\},\{A, B, C, D\}$ and $\left\{A, E, C, F_{2}\right\}$. Assuming $O E \cdot O F_{1}>p$, we obtain  $$ O E \cdot O F_{1}>p \Rightarrow O B \cdot O D<p \Rightarrow O A \cdot O C>p \Rightarrow O E \cdot O F_{2}<p . $$  In other words, $O E \cdot O F_{1}>p$ implies  $$ O B \cdot O D<p<O A \cdot O C \text { and } O E \cdot O F_{1}>p>O E \cdot O F_{2} \text {. } $$  Similarly, $O E \cdot O F_{1}<p$ implies  $$ O B \cdot O D>p>O A \cdot O C \text { and } O E \cdot O F_{1}<p<O E \cdot O F_{2} \text {. } $$  In these cases $F_{1} \neq F_{2}$ and $O B \cdot O D \neq O A \cdot O C$, so the lines $A B$ and $C D$ are not parallel.  There remains the case $O E \cdot O F_{1}=p$. Here the lemma leads to $O B \cdot O D=p=O A \cdot O C$ and $O E \cdot O F_{1}=p=O E \cdot O F_{2}$. Therefore $F_{1}=F_{2}$ and $A B \| C D$.  Comment. The conclusion is also true if $B C$ and $A D$ are parallel. One can prove a limit case of the lemma for the configuration shown in the figure below, where $r_{1}$ and $r_{2}$ are parallel rays starting at $O^{\prime}$ and $O^{\prime \prime}$, with $O^{\prime} O^{\prime \prime} \perp r_{1}, r_{2}$ and $O$ the midpoint of $O^{\prime} O^{\prime \prime}$. Two circles with centers $O_{1}$ and $O_{2}$ are inscribed in the strip between $r_{1}$ and $r_{2}$. The lines $P Q$ and $R S$ are tangent to the circles, with $P, S$ on $r_{1}$, and $Q, R$ on $r_{2}$, so that $O, O_{1}$ are on the same side of $P Q$ and $O, O_{2}$ are on different sides of $R S$. Denote $s=O O_{1}+O O_{2}$. Then exactly one of the following relations holds:  $$ O^{\prime} P+O^{\prime \prime} R<s<O^{\prime \prime} Q+O^{\prime} S, \quad O^{\prime} P+O^{\prime \prime} R>s>O^{\prime \prime} Q+O^{\prime} S, \quad O^{\prime} P+O^{\prime \prime} R=s=O^{\prime \prime} Q+O^{\prime} S . $$  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-37.jpg?height=300&width=780&top_left_y=1403&top_left_x=638)  Once this is established, the proof of the original statement for $B C \| A D$ is analogous to the one in the intersecting case. One replaces products by sums of relevant segments.


Let $A B C$ be a triangle with circumcircle $\omega$ and $\ell$ a line without common points with $\omega$. Denote by $P$ the foot of the perpendicular from the center of $\omega$ to $\ell$. The side-lines $B C, C A, A B$ intersect $\ell$ at the points $X, Y, Z$ different from $P$. Prove that the circumcircles of the triangles $A X P, B Y P$ and $C Z P$ have a common point different from $P$ or are mutually tangent at $P$.

Solution: Let $\omega_{A}, \omega_{B}, \omega_{C}$ and $\omega$ be the circumcircles of triangles $A X P, B Y P, C Z P$ and $A B C$ respectively. The strategy of the proof is to construct a point $Q$ with the same power with respect to the four circles. Then each of $P$ and $Q$ has the same power with respect to $\omega_{A}, \omega_{B}, \omega_{C}$ and hence the three circles are coaxial. In other words they have another common point $P^{\prime}$ or the three of them are tangent at $P$.  We first give a description of the point $Q$. Let $A^{\prime} \neq A$ be the second intersection of $\omega$ and $\omega_{A}$; define $B^{\prime}$ and $C^{\prime}$ analogously. We claim that $A A^{\prime}, B B^{\prime}$ and $C C^{\prime}$ have a common point. Once this claim is established, the point just constructed will be on the radical axes of the three pairs of circles $\left\{\omega, \omega_{A}\right\},\left\{\omega, \omega_{B}\right\},\left\{\omega, \omega_{C}\right\}$. Hence it will have the same power with respect to $\omega, \omega_{A}, \omega_{B}, \omega_{C}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-38.jpg?height=783&width=1242&top_left_y=965&top_left_x=407)  We proceed to prove that $A A^{\prime}, B B^{\prime}$ and $C C^{\prime}$ intersect at one point. Let $r$ be the circumradius of triangle $A B C$. Define the points $X^{\prime}, Y^{\prime}, Z^{\prime}$ as the intersections of $A A^{\prime}, B B^{\prime}, C C^{\prime}$ with $\ell$. Observe that $X^{\prime}, Y^{\prime}, Z^{\prime}$ do exist. If $A A^{\prime}$ is parallel to $\ell$ then $\omega_{A}$ is tangent to $\ell$; hence $X=P$ which is a contradiction. Similarly, $B B^{\prime}$ and $C C^{\prime}$ are not parallel to $\ell$.  From the powers of the point $X^{\prime}$ with respect to the circles $\omega_{A}$ and $\omega$ we get  $$ X^{\prime} P \cdot\left(X^{\prime} P+P X\right)=X^{\prime} P \cdot X^{\prime} X=X^{\prime} A^{\prime} \cdot X^{\prime} A=X^{\prime} O^{2}-r^{2} $$  hence  $$ X^{\prime} P \cdot P X=X^{\prime} O^{2}-r^{2}-X^{\prime} P^{2}=O P^{2}-r^{2} . $$  We argue analogously for the points $Y^{\prime}$ and $Z^{\prime}$, obtaining  $$ X^{\prime} P \cdot P X=Y^{\prime} P \cdot P Y=Z^{\prime} P \cdot P Z=O P^{2}-r^{2}=k^{2} $$  In these computations all segments are regarded as directed segments. We keep the same convention for the sequel.  We prove that the lines $A A^{\prime}, B B^{\prime}, C C^{\prime}$ intersect at one point by CEVA's theorem. To avoid distracting remarks we interpret everything projectively, i. e. whenever two lines are parallel they meet at a point on the line at infinity.  Let $U, V, W$ be the intersections of $A A^{\prime}, B B^{\prime}, C C^{\prime}$ with $B C, C A, A B$ respectively. The idea is that although it is difficult to calculate the ratio $\frac{B U}{C U}$, it is easier to deal with the cross-ratio $\frac{B U}{C U} / \frac{B X}{C X}$ because we can send it to the line $\ell$. With this in mind we apply MEnELaus' theorem to the triangle $A B C$ and obtain $\frac{B X}{C X} \cdot \frac{C Y}{A Y} \cdot \frac{A Z}{B Z}=1$. Hence Ceva's ratio can be expressed as  $$ \frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=\frac{B U}{C U} / \frac{B X}{C X} \cdot \frac{C V}{A V} / \frac{C Y}{A Y} \cdot \frac{A W}{B W} / \frac{A Z}{B Z} $$  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-39.jpg?height=594&width=1145&top_left_y=565&top_left_x=453)  Project the line $B C$ to $\ell$ from $A$. The cross-ratio between $B C$ and $U X$ equals the cross-ratio between $Z Y$ and $X^{\prime} X$. Repeating the same argument with the lines $C A$ and $A B$ gives  $$ \frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=\frac{Z X^{\prime}}{Y X^{\prime}} / \frac{Z X}{Y X} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} / \frac{X Y}{Z Y} \cdot \frac{Y Z^{\prime}}{X Z^{\prime}} / \frac{Y Z}{X Z} $$  and hence  $$ \frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=(-1) \cdot \frac{Z X^{\prime}}{Y X^{\prime}} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} \cdot \frac{Y Z^{\prime}}{X Z^{\prime}} $$  The equations (1) reduce the problem to a straightforward computation on the line $\ell$. For instance, the transformation $t \mapsto-k^{2} / t$ preserves cross-ratio and interchanges the points $X, Y, Z$ with the points $X^{\prime}, Y^{\prime}, Z^{\prime}$. Then  $$ \frac{B U}{C U} \cdot \frac{C V}{A V} \cdot \frac{A W}{B W}=(-1) \cdot \frac{Z X^{\prime}}{Y X^{\prime}} / \frac{Z Z^{\prime}}{Y Z^{\prime}} \cdot \frac{X Y^{\prime}}{Z Y^{\prime}} / \frac{X Z^{\prime}}{Z Z^{\prime}}=-1 $$  We proved that CEvA's ratio equals -1 , so $A A^{\prime}, B B^{\prime}, C C^{\prime}$ intersect at one point $Q$.  Comment 1. There is a nice projective argument to prove that $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$ intersect at one point. Suppose that $\ell$ and $\omega$ intersect at a pair of complex conjugate points $D$ and $E$. Consider a projective transformation that takes $D$ and $E$ to $[i ; 1,0]$ and $[-i, 1,0]$. Then $\ell$ is the line at infinity, and $\omega$ is a conic through the special points $[i ; 1,0]$ and $[-i, 1,0]$, hence it is a circle. So one can assume that $A X, B Y, C Z$ are parallel to $B C, C A, A B$. The involution on $\ell$ taking $X, Y, Z$ to $X^{\prime}, Y^{\prime}, Z^{\prime}$ and leaving $D, E$ fixed is the involution changing each direction to its perpendicular one. Hence $A X, B Y, C Z$ are also perpendicular to $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$.  It follows from the above that $A X^{\prime}, B Y^{\prime}, C Z^{\prime}$ intersect at the orthocenter of triangle $A B C$.  Comment 2. The restriction that the line $\ell$ does not intersect the circumcricle $\omega$ is unnecessary. The proof above works in general. In case $\ell$ intersects $\omega$ at $D$ and $E$ point $P$ is the midpoint of $D E$, and some equations can be interpreted differently. For instance  $$ X^{\prime} P \cdot X^{\prime} X=X^{\prime} A^{\prime} \cdot X^{\prime} A=X^{\prime} D \cdot X^{\prime} E $$  and hence the pairs $X^{\prime} X$ and $D E$ are harmonic conjugates. This means that $X^{\prime}, Y^{\prime}, Z^{\prime}$ are the harmonic conjugates of $X, Y, Z$ with respect to the segment $D E$.


Solution: First we prove that there is an inversion in space that takes $\ell$ and $\omega$ to parallel circles on a sphere. Let $Q R$ be the diameter of $\omega$ whose extension beyond $Q$ passes through $P$. Let $\Pi$ be the plane carrying our objects. In space, choose a point $O$ such that the line $Q O$ is perpendicular to $\Pi$ and $\angle P O R=90^{\circ}$, and apply an inversion with pole $O$ (the radius of the inversion does not matter). For any object $\mathcal{T}$ denote by $\mathcal{T}^{\prime}$ the image of $\mathcal{T}$ under this inversion.  The inversion takes the plane $\Pi$ to a sphere $\Pi^{\prime}$. The lines in $\Pi$ are taken to circles through $O$, and the circles in $\Pi$ also are taken to circles on $\Pi^{\prime}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-40.jpg?height=491&width=1288&top_left_y=560&top_left_x=384)  Since the line $\ell$ and the circle $\omega$ are perpendicular to the plane $O P Q$, the circles $\ell^{\prime}$ and $\omega^{\prime}$ also are perpendicular to this plane. Hence, the planes of the circles $\ell^{\prime}$ and $\omega^{\prime}$ are parallel.  Now consider the circles $A^{\prime} X^{\prime} P^{\prime}, B^{\prime} Y^{\prime} P^{\prime}$ and $C^{\prime} Z^{\prime} P^{\prime}$. We want to prove that either they have a common point (on $\Pi^{\prime}$ ), different from $P^{\prime}$, or they are tangent to each other.  ![](https://cdn.mathpix.com/cropped/2024_04_17_93f7104904c3717a5058g-40.jpg?height=819&width=870&top_left_y=1321&top_left_x=593)  The point $X^{\prime}$ is the second intersection of the circles $B^{\prime} C^{\prime} O$ and $\ell^{\prime}$, other than $O$. Hence, the lines $O X^{\prime}$ and $B^{\prime} C^{\prime}$ are coplanar. Moreover, they lie in the parallel planes of $\ell^{\prime}$ and $\omega^{\prime}$. Therefore, $O X^{\prime}$ and $B^{\prime} C^{\prime}$ are parallel. Analogously, $O Y^{\prime}$ and $O Z^{\prime}$ are parallel to $A^{\prime} C^{\prime}$ and $A^{\prime} B^{\prime}$.  Let $A_{1}$ be the second intersection of the circles $A^{\prime} X^{\prime} P^{\prime}$ and $\omega^{\prime}$, other than $A^{\prime}$. The segments $A^{\prime} A_{1}$ and $P^{\prime} X^{\prime}$ are coplanar, and therefore parallel. Now we know that $B^{\prime} C^{\prime}$ and $A^{\prime} A_{1}$ are parallel to $O X^{\prime}$ and $X^{\prime} P^{\prime}$ respectively, but these two segments are perpendicular because $O P^{\prime}$ is a diameter in $\ell^{\prime}$. We found that $A^{\prime} A_{1}$ and $B^{\prime} C^{\prime}$ are perpendicular, hence $A^{\prime} A_{1}$ is the altitude in the triangle $A^{\prime} B^{\prime} C^{\prime}$, starting from $A$.  Analogously, let $B_{1}$ and $C_{1}$ be the second intersections of $\omega^{\prime}$ with the circles $B^{\prime} P^{\prime} Y^{\prime}$ and $C^{\prime} P^{\prime} Z^{\prime}$, other than $B^{\prime}$ and $C^{\prime}$ respectively. Then $B^{\prime} B_{1}$ and $C^{\prime} C_{1}$ are the other two altitudes in the triangle $A^{\prime} B^{\prime} C^{\prime}$.  Let $H$ be the orthocenter of the triangle $A^{\prime} B^{\prime} C^{\prime}$. Let $W$ be the second intersection of the line $P^{\prime} H$ with the sphere $\Pi^{\prime}$, other than $P^{\prime}$. The point $W$ lies on the sphere $\Pi^{\prime}$, in the plane of the circle $A^{\prime} P^{\prime} X^{\prime}$, so $W$ lies on the circle $A^{\prime} P^{\prime} X^{\prime}$. Similarly, $W$ lies on the circles $B^{\prime} P^{\prime} Y^{\prime}$ and $C^{\prime} P^{\prime} Z^{\prime}$ as well; indeed $W$ is the second common point of the three circles.  If the line $P^{\prime} H$ is tangent to the sphere then $W$ coincides with $P^{\prime}$, and $P^{\prime} H$ is the common tangent of the three circles.


Call admissible a set $A$ of integers that has the following property:  $$ \text { If } x, y \in A \text { (possibly } x=y \text { ) then } x^{2}+k x y+y^{2} \in A \text { for every integer } k \text {. } $$  Determine all pairs $m, n$ of nonzero integers such that the only admissible set containing both $m$ and $n$ is the set of all integers.

Solution: A pair of integers $m, n$ fulfills the condition if and only if $\operatorname{gcd}(m, n)=1$. Suppose that $\operatorname{gcd}(m, n)=d>1$. The set  $$ A=\{\ldots,-2 d,-d, 0, d, 2 d, \ldots\} $$  is admissible, because if $d$ divides $x$ and $y$ then it divides $x^{2}+k x y+y^{2}$ for every integer $k$. Also $m, n \in A$ and $A \neq \mathbb{Z}$.  Now let $\operatorname{gcd}(m, n)=1$, and let $A$ be an admissible set containing $m$ and $n$. We use the following observations to prove that $A=\mathbb{Z}$ :  (i) $k x^{2} \in A$ for every $x \in A$ and every integer $k$.  (ii) $(x+y)^{2} \in A$ for all $x, y \in A$.  To justify (i) let $y=x$ in the definition of an admissible set; to justify (ii) let $k=2$.  Since $\operatorname{gcd}(m, n)=1$, we also have $\operatorname{gcd}\left(m^{2}, n^{2}\right)=1$. Hence one can find integers $a, b$ such that $a m^{2}+b n^{2}=1$. It follows from (i) that $a m^{2} \in A$ and $b n^{2} \in A$. Now we deduce from (ii) that $1=\left(a m^{2}+b n^{2}\right)^{2} \in A$. But if $1 \in A$ then (i) implies $k \in A$ for every integer $k$.


Find all triples $(x, y, z)$ of positive integers such that $x \leq y \leq z$ and  $$ x^{3}\left(y^{3}+z^{3}\right)=2012(x y z+2) \text {. } $$

Solution: First note that $x$ divides $2012 \cdot 2=2^{3} \cdot 503$. If $503 \mid x$ then the right-hand side of the equation is divisible by $503^{3}$, and it follows that $503^{2} \mid x y z+2$. This is false as $503 \mid x$. Hence $x=2^{m}$ with $m \in\{0,1,2,3\}$. If $m \geq 2$ then $2^{6} \mid 2012(x y z+2)$. However the highest powers of 2 dividing 2012 and $x y z+2=2^{m} y z+2$ are $2^{2}$ and $2^{1}$ respectively. So $x=1$ or $x=2$, yielding the two equations  $$ y^{3}+z^{3}=2012(y z+2), \quad \text { and } \quad y^{3}+z^{3}=503(y z+1) \text {. } $$  In both cases the prime $503=3 \cdot 167+2$ divides $y^{3}+z^{3}$. We claim that $503 \mid y+z$. This is clear if $503 \mid y$, so let $503 \nmid y$ and $503 \nmid z$. Then $y^{502} \equiv z^{502}(\bmod 503)$ by FeRmat's little theorem. On the other hand $y^{3} \equiv-z^{3}(\bmod 503)$ implies $y^{3 \cdot 167} \equiv-z^{3 \cdot 167}(\bmod 503)$, i. e. $y^{501} \equiv-z^{501}(\bmod 503)$. It follows that $y \equiv-z(\bmod 503)$ as claimed.  Therefore $y+z=503 k$ with $k \geq 1$. In view of $y^{3}+z^{3}=(y+z)\left((y-z)^{2}+y z\right)$ the two equations take the form  $$ \begin{aligned} & k(y-z)^{2}+(k-4) y z=8 \\ & k(y-z)^{2}+(k-1) y z=1 . \end{aligned} $$  In (1) we have $(k-4) y z \leq 8$, which implies $k \leq 4$. Indeed if $k>4$ then $1 \leq(k-4) y z \leq 8$, so that $y \leq 8$ and $z \leq 8$. This is impossible as $y+z=503 k \geq 503$. Note next that $y^{3}+z^{3}$ is even in the first equation. Hence $y+z=503 k$ is even too, meaning that $k$ is even. Thus $k=2$ or $k=4$. Clearly (1) has no integer solutions for $k=4$. If $k=2$ then (1) takes the form $(y+z)^{2}-5 y z=4$. Since $y+z=503 k=503 \cdot 2$, this leads to $5 y z=503^{2} \cdot 2^{2}-4$. However $503^{2} \cdot 2^{2}-4$ is not a multiple of 5 . Therefore (1) has no integer solutions.  Equation (2) implies $0 \leq(k-1) y z \leq 1$, so that $k=1$ or $k=2$. Also $0 \leq k(y-z)^{2} \leq 1$, hence $k=2$ only if $y=z$. However then $y=z=1$, which is false in view of $y+z \geq 503$. Therefore $k=1$ and (2) takes the form $(y-z)^{2}=1$, yielding $z-y=|y-z|=1$. Combined with $k=1$ and $y+z=503 k$, this leads to $y=251, z=252$.  In summary the triple $(2,251,252)$ is the only solution.


Determine all integers $m \geq 2$ such that every $n$ with $\frac{m}{3} \leq n \leq \frac{m}{2}$ divides the binomial coefficient $\left(\begin{array}{c}n \\ m-2 n\end{array}\right)$.

Solution: The integers in question are all prime numbers.  First we check that all primes satisfy the condition, and even a stronger one. Namely, if $p$ is a prime then every $n$ with $1 \leq n \leq \frac{p}{2}$ divides $\left(\begin{array}{c}n \\ p-2 n\end{array}\right)$. This is true for $p=2$ where $n=1$ is the only possibility. For an odd prime $p$ take $n \in\left[1, \frac{p}{2}\right]$ and consider the following identity of binomial coefficients:  $$ (p-2 n) \cdot\left(\begin{array}{c} n \\ p-2 n \end{array}\right)=n \cdot\left(\begin{array}{c} n-1 \\ p-2 n-1 \end{array}\right) $$  Since $p \geq 2 n$ and $p$ is odd, all factors are non-zero. If $d=\operatorname{gcd}(p-2 n, n)$ then $d$ divides $p$, but $d \leq n<p$ and hence $d=1$. It follows that $p-2 n$ and $n$ are relatively prime, and so the factor $n$ in the right-hand side divides the binomial coefficient $\left(\begin{array}{c}n \\ p-2 n\end{array}\right)$.  Next we show that no composite number $m$ has the stated property. Consider two cases.  - If $m=2 k$ with $k>1$, pick $n=k$. Then $\frac{m}{3} \leq n \leq \frac{m}{2}$ but $\left(\begin{array}{c}n \\ m-2 n\end{array}\right)=\left(\begin{array}{l}k \\ 0\end{array}\right)=1$ is not divisible by $k>1$. - If $m$ is odd then there exist an odd prime $p$ and an integer $k \geq 1$ with $m=p(2 k+1)$. Pick $n=p k$, then $\frac{m}{3} \leq n \leq \frac{m}{2}$ by $k \geq 1$. However  $$ \frac{1}{n}\left(\begin{array}{c} n \\ m-2 n \end{array}\right)=\frac{1}{p k}\left(\begin{array}{c} p k \\ p \end{array}\right)=\frac{(p k-1)(p k-2) \cdots(p k-(p-1))}{p !} $$  is not an integer, because $p$ divides the denominator but not the numerator.