![](https://cdn.mathpix.com/cropped/2024_06_05_3c9a4bb6a404b95ac7e4g-01.jpg?height=331&width=1630&top_left_y=283&top_left_x=247) # Problems and Solutions Problem 1. Every positive integer is marked with a number from the set $\{0,1,2\}$, according to the following rule: if a positive integer $k$ is marked with $j$, then the integer $k+j$ is marked with 0 . Let $S$ denote the sum of marks of the first 2019 positive integers. Determine the maximum possible value of $S$. (Ivan Novak) First Solution. Consider an arbitrary marking scheme which follows the given rule. Let $a$ denote the number of positive integers from the set $\{1, \ldots, 2019\}$ which are marked with a $2, b$ the number of those marked with a 1 , and $c$ the number of those marked with a 0 . 1 point. We have $S=2 a+b$. 1 point. For every positive integer $j \in\{1, \ldots, 2017\}$ which is marked with a 2 , the number $j+2$ is marked with a 0 . This implies that the number of positive integers less than 2017 marked with 2 is less than or equal to $c$. 1 point. Hence, this implies $a \leqslant c+2$. We then have $$ S=2 a+b \leqslant a+b+c+2=2019+2=2021 . $$ 3 points. Consider the following marking scheme: $$ 210|210| 210|\underbrace{2200|2200| 2200 \ldots 2200}_{502 \text { blocks of } 2200}| 22 \mid 0000 \ldots $$ Here the $i$-th digit in the sequence denotes the mark of positive integer $i$. For this marking, $S=2021$, and therefore 2021 is the maximum possible value of $S$. 4 points. Second Solution. The marking scheme for which $S=2021$ is the same as in the first solution. Let $S_{n}$ denote the sum of marks of first $n$ positive integers, and let $a_{k}$ denote the mark of $k$. Without loss of generality we may assume $a_{j}=0$ for all integers $j \leqslant 0$. We'll prove the following claim by strong mathematical induction: for every positive integer $n, S_{n} \leqslant n+2$ and if equality holds, then $a_{n}=2$. 1 point. The base cases for $n \in\{1,2\}$ trivially hold. Suppose the claim is true for all $k \leqslant n$ for some $n \geqslant 2$. Suppose there exists a marking scheme for which $S_{n+1} \geqslant n+4$. Then if $a_{n+1}<2$, we have $S_{n} \geqslant n+3$, which is a contradiction. Hence, $a_{n+1}=2$. 1 point. This implies that $a_{n} \in\{0,2\}$. If $a_{n}=0$, then $S_{n-1} \geqslant n+2$, which is a contradiction. So, $a_{n}=2$. 1 point. Now $a_{n-1}=0$ because both $a_{n}$ and $a_{n+1}$ are nonzero. We now have $S_{n-2} \geqslant n$, and by the induction hypothesis, it must hold that $S_{n-2}=n$ and $a_{n-2}=2$. However, this is in contradiction with $a_{n}$ being nonzero. Hence, $S_{n+1} \leqslant n+3$. 1 point. Suppose $S_{n+1}=n+3$ and $a_{n+1} \neq 2$. If $a_{n+1}=0$, then $S_{n} \geqslant n+3$, which is a contradiction. Thus, $a_{n+1}=1$. 1 point. Then $S_{n}=n+2$, which implies $a_{n}=2$. Then we must have $a_{n-1}=0$, and then $S_{n-2}=n$, which implies $a_{n-2}=2$, but $a_{n}$ is nonzero, which is a contradiction. Therefore, the claim is true for $n+1$, which implies it is true for all positive integers. In particular, $S_{2019} \leqslant 2021$, which combined with the construction implies that the maximum value of $S$ is 2021 . 1 point. ## Notes on marking: - If a student forgets to write additional zeros beyond the first 2019 digits in his construction, but the construction is otherwise valid, he should be awarded all 4 points for this part. - There are many different optimal marking schemes. For example, $2200|210| 210|\ldots| 210|22| 000 \ldots$, where the block $|210|$ repeats 671 times. - In the Second Solution, if the student writes only the first part of the induction hypothesis without the assumption that $a_{n}=2$ in the case of equality: he should be awarded $\mathbf{0}$ points, unless he reaches additional conclusions which lead to the solution. - In the Second Solution, if the student doesn't comment on the base case/cases at all, he should be deducted 1 point. - If the student proves any nontrivial lemma useful for any of the solutions, but the lemma itself isn't worth any points and the student wouldn't otherwise get any of the 6 points given for proving the bound, he should get 1 point for this part. Problem 2. Let $\left(x_{n}\right)_{n \in \mathbb{N}}$ be a sequence defined recursively such that $x_{1}=\sqrt{2}$ and $$ x_{n+1}=x_{n}+\frac{1}{x_{n}} \text { for } n \in \mathbb{N} $$ Prove that the following inequality holds: $$ \frac{x_{1}^{2}}{2 x_{1} x_{2}-1}+\frac{x_{2}^{2}}{2 x_{2} x_{3}-1}+\ldots+\frac{x_{2018}^{2}}{2 x_{2018} x_{2019}-1}+\frac{x_{2019}^{2}}{2 x_{2019} x_{2020}-1}>\frac{2019^{2}}{x_{2019}^{2}+\frac{1}{x_{2019}^{2}}} $$ (Ivan Novak) First Solution. Notice that by squaring the assertion $x_{n+1}=x_{n}+\frac{1}{x_{n}}$ we obtain the equality $x_{n+1}^{2}=x_{n}^{2}+\frac{1}{x_{n}^{2}}+2 \Longrightarrow$ $x_{n}^{2}+\frac{1}{x_{n}^{2}}=x_{n+1}^{2}-2$, which implies that the right hand side equals $\frac{2019^{2}}{x_{2020}^{2}-2}$. 1 point. On the other hand, we have $$ 2 x_{n} x_{n+1}-1=2 x_{n}\left(x_{n}+\frac{1}{x_{n}}\right)-1=2 x_{n}^{2}+1 $$ 1 point. This implies that the sum on the left hand side can be written as $$ \frac{1}{2+\frac{1}{x_{1}^{2}}}+\frac{1}{2+\frac{1}{x_{2}^{2}}}+\ldots+\frac{1}{2+\frac{1}{x_{2019}^{2}}} $$ 1 point. By squaring the given assertion, we get the equality $2+\frac{1}{x_{n}^{2}}=x_{n+1}^{2}-x_{n}^{2}$. This implies that the left hand side equals $$ \frac{1}{x_{2}^{2}-x_{1}^{2}}+\frac{1}{x_{3}^{2}-x_{2}^{2}}+\ldots+\frac{1}{x_{2019}^{2}-x_{2018}^{2}}+\frac{1}{x_{2020}^{2}-x_{2019}^{2}} $$ 1 point. Using the inequality between arithmetic and harmonic mean, we find that the left hand side is greater than or equal to $$ \frac{2019^{2}}{\left(x_{2}^{2}-x_{1}^{2}\right)+\left(x_{3}^{2}-x_{2}^{2}\right)+\ldots+\left(x_{2020}^{2}-x_{2019}^{2}\right)} $$ 4 points. We now notice that the denominator is a telescoping sum and it equals $x_{2020}^{2}-x_{1}^{2}$, which implies the right hand side equals $$ \frac{2019^{2}}{x_{2020}^{2}-x_{1}^{2}}=\frac{2019^{2}}{x_{2020}^{2}-2} $$ which is exactly equal to the right hand side. 1 point. The equality cannot hold because $x_{2}^{2}-x_{1}^{2} \neq x_{3}^{2}-x_{2}^{2}$. 1 point. Second Solution. As in the first solution, we obtain that the left hand side equals $$ \frac{1}{2+\frac{1}{x_{1}^{2}}}+\frac{1}{2+\frac{1}{x_{2}^{2}}}+\ldots+\frac{1}{2+\frac{1}{x_{2018}^{2}}}+\frac{1}{2+\frac{1}{x_{2019}^{2}}} $$ Using the inequality between arithmetic and harmonic mean, we get that the left hand side is greater than or equal to $$ \frac{2019^{2}}{2 \cdot 2019+\frac{1}{x_{1}^{2}}+\frac{1}{x_{2}^{2}}+\ldots+\frac{1}{x_{2019}^{2}}} $$ 4 points. We now prove by mathematical induction that $$ 2 \cdot n+\frac{1}{x_{1}^{2}}+\frac{1}{x_{2}^{2}}+\ldots+\frac{1}{x_{n-1}^{2}}=x_{n}^{2} $$ holds for every $n \in \mathbb{N}$. 1 point. For $n=1$, we have $2 \cdot 1=\sqrt{2}^{2}$. Suppose the claim is true for some $n \in \mathbb{N}$. Then $$ x_{n+1}^{2}=2+x_{n}^{2}+\frac{1}{x_{n}^{2}}=2+2 n+\frac{1}{x_{1}^{2}}+\frac{1}{x_{2}^{2}}+\ldots+\frac{1}{x_{n-1}^{2}}+\frac{1}{x_{n}^{2}} $$ where we used the induction hypothesis for the last equality. This proves the claim. 2 points. In particular, for $n=2019$, we have that $$ \frac{2019^{2}}{2 \cdot 2019+\frac{1}{x_{1}^{2}}+\frac{1}{x_{2}^{2}}+\ldots+\frac{1}{x_{2019}^{2}}}=\frac{2019^{2}}{x_{2019}^{2}+\frac{1}{x_{2019}^{2}}} $$ which proves the inequality. The equality cannot hold because $\frac{1}{x_{1}^{2}}+2 \neq \frac{1}{x_{2}^{2}}+2$. 1 point. Third Solution. We prove by mathematical induction that for every $n \geqslant 2$ the following inequality holds: $$ \frac{x_{1}^{2}}{2 x_{1} x_{2}-1}+\frac{x_{2}^{2}}{2 x_{2} x_{3}-1}+\ldots+\frac{x_{n}^{2}}{2 x_{n} x_{n+1}-1}>\frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}} $$ For $n=2$, the left hand side equals $\frac{2}{5}+\frac{4.5}{10}=\frac{17}{20}$, and the right hand side equals $\frac{4}{\frac{9}{2}+\frac{2}{9}}=\frac{72}{85}<\frac{17}{20}$, which proves the base case. Suppose the claim was true for some $n \in \mathbb{N}$. Then by the induction hypothesis, we know that $$ \frac{x_{1}^{2}}{2 x_{1} x_{2}-1}+\frac{x_{2}^{2}}{2 x_{2} x_{3}-1}+\ldots+\frac{x_{n}^{2}}{2 x_{n} x_{n+1}-1}+\frac{x_{n+1}^{2}}{2 x_{n+1} x_{n+2}-1}>\frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}}+\frac{x_{n+1}^{2}}{2 x_{n+1} x_{n+2}-1} $$ It suffices to prove that $$ \frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}}+\frac{x_{n+1}^{2}}{2 x_{n+1} x_{n+2}-1} \geqslant \frac{(n+1)^{2}}{x_{n+1}^{2}+\frac{1}{x_{n+1}^{2}}} $$ 1 point. We now prove that $2 x_{n+1} x_{n+2}-1=2 x_{n+1}^{2}+1$ as in the first solution. 1 point. We then have $$ \frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}}+\frac{x_{n+1}^{2}}{2 x_{n+1} x_{n+2}-1}=\frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}}+\frac{x_{n+1}^{2}}{2 x_{n+1}^{2}+1}=\frac{n^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}}+\frac{1}{2+\frac{1}{x_{n+1}^{2}}} $$ 1 point. By the inequality of arithmetic and harmonic mean, this is greater than or equal to $$ \frac{(n+1)^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}+2+\frac{1}{x_{n+1}^{2}}} $$ 5 points. Notice that squaring the assertion $x_{n+1}=x_{n}+\frac{1}{x_{n}}$, we obtain $$ x_{n}^{2}+\frac{1}{x_{n}^{2}}+2=x_{n+1}^{2} $$ 1 point. This implies that $$ \frac{(n+1)^{2}}{x_{n}^{2}+\frac{1}{x_{n}^{2}}+2+\frac{1}{x_{n+1}^{2}}}=\frac{(n+1)^{2}}{x_{n+1}^{2}+\frac{1}{x_{n+1}^{2}}} $$ which is exactly equal to the right hand side. Therefore, the claim is proven by the principle of mathematical induction. In particular, the claim is true for $n=2019$, which proves the inequality. 1 point. ## Notes on marking: - Points from separate solutions can not be added. The student should be awarded the maximum of the points scored in the 3 presented solutions, or an appropriate number of points on an alternative solution. - The third solution gives 5 points for the use of AM-HM inequality as opposed to 4 points in the first solution because in the third solution it is not necessary to comment the equality case. However, if a student has $n=1$ as a basis of induction and doesn't comment the equality case, he should be deducted 1 point out of possible 5 . - The point for proving that the equality cannot be achieved is only awarded if the student has proved the non-strict version of inequality. Problem 3. Let $A B C$ be a triangle with circumcircle $\omega$. Let $l_{B}$ and $l_{C}$ be two lines through the points $B$ and $C$, respectively, such that $l_{B} \| l_{C}$. The second intersections of $l_{B}$ and $l_{C}$ with $\omega$ are $D$ and $E$, respectively. Assume that $D$ and $E$ are on the same side of $B C$ as $A$. Let $D A$ intersect $l_{C}$ at $F$ and let $E A$ intersect $l_{B}$ at $G$. If $O, O_{1}$ and $O_{2}$ are circumcenters of the triangles $A B C, A D G$ and $A E F$, respectively, and $P$ is the circumcenter of the triangle $O O_{1} O_{2}$, prove that $l_{B}\|O P\| l_{C}$. (Stefan Lozanovski) Sketch. ![](https://cdn.mathpix.com/cropped/2024_06_05_3c9a4bb6a404b95ac7e4g-06.jpg?height=1373&width=1334&top_left_y=564&top_left_x=361) Solution. Let us write $\angle B A C=\alpha, \angle A B C=\beta, \angle A C B=\gamma$. Lemma. Triangles $A G D$ and $A E F$ are similar to the triangle $A B C$. Proof. As $D B C A E$ is a cylic pentagon we have $$ \angle G D A=\angle B C A=\gamma $$ Now from $l_{B} \| l_{C}$ we get that $$ \angle D B A=\angle D B C-\beta=180^{\circ}-\angle B C E-\beta=\alpha+\gamma-\angle B C E=\alpha-\angle A C E $$ so from the cyclicity $$ \angle B C D=\angle B A D=180^{\circ}-\angle D B A-\angle A D B=180^{\circ}-(\alpha-\angle A C E)-\left(180^{\circ}-\gamma\right)=\gamma-\alpha+\angle A C E $$ 1 point. Hence $$ \angle D A G=\angle D C E=\angle B C A-\angle B C D+\angle A C E=\alpha $$ Now as $G, A$ and $E$ are collinear and $F, A$ and $D$ are collinear, using Lemma we get that $O, O_{1}$ and $O_{2}$ are collinear. 1 point. As $O_{1}$ is the circumcenter of the triangle $A D G$ and $O_{1} D$ is the bisector of the chord $\overline{A D}$ we get that $$ \angle A O_{1} O=\frac{1}{2} \angle A O_{1} D=\angle A G D=\beta $$ and similarly $\angle A O_{1} O=\gamma$, so the triangle $O O_{1} O_{2}$ is similar to the triangle $A B C$. 2 points. Now as $P$ is the circumcenter of the triangle $\mathrm{OO}_{1} \mathrm{O}_{2}$ from the previous similarity we get that $$ \angle O_{1} O P=\angle B A O $$ 1 point. Hence $$ \angle D O P=\angle D O O_{1}+\angle O_{1} O P=\angle D B A+\angle B A O=\angle D B A+\angle A B O=\angle D B O=\angle O D B $$ so $l_{B}\|O P\| l_{C}$. 2 points. ## Notes on marking: - If a student has a partial solution with analytic methods, only points for proving facts that can be expressed in geometric ways and lead to a compete solution can be awarded. Problem 4. Let $u$ be a positive rational number and $m$ be a positive integer. Define a sequence $q_{1}, q_{2}, q_{3}, \ldots$ such that $q_{1}=u$ and for $n \geqslant 2$ : $$ \text { if } q_{n-1}=\frac{a}{b} \text { for some relatively prime positive integers } a \text { and } b \text {, then } q_{n}=\frac{a+m b}{b+1} $$ Determine all positive integers $m$ such that the sequence $q_{1}, q_{2}, q_{3}, \ldots$ is eventually periodic for any positive rational number $u$. Remark: A sequence $x_{1}, x_{2}, x_{3}, \ldots$ is eventually periodic if there are positive integers $c$ and $t$ such that $x_{n}=x_{n+t}$ for all $n \geqslant c$. (Petar Nizić-Nikolac) Solution. We will prove that the sequence is eventually periodic if and only if $m$ is odd. Let $a_{1}, a_{2}, a_{3}, \ldots$ and $b_{1}, b_{2}, b_{3}, \ldots$ be sequences of numerators and denumerators of $q_{1}, q_{2}, q_{3}, \ldots$ respectively when written in the irreducible form, i.e. for $n \in \mathbb{N}$ : $$ q_{n}=\frac{a_{n}}{b_{n}} \quad \operatorname{gcd}\left(a_{n}, b_{n}\right)=1 $$ Say that there was reduction in the $n^{\text {th }}$ step if $\operatorname{gcd}\left(a_{n}+m b_{n}, b_{n}+1\right)>1$. Case 1. $m$ is even Set $u=\frac{1}{1}$. Assume for the sake of contradiction that $q_{1}, q_{2}, q_{3}, \ldots$ is eventually periodic. Then $\left(b_{n}\right)_{n \in \mathbb{N}}$ is bounded so there is $r>1$ (pick the smallest one) such that there was reduction in the $r^{\text {th }}$ step. Easy to see that $$ q_{1}=\frac{1}{1}, q_{2}=\frac{m+1}{2}, q_{3}=\frac{3 m+1}{3}, q_{4}=\frac{6 m+1}{4}, q_{5}=\frac{10 m+1}{5}, \ldots, q_{r}=\frac{\binom{r}{2} m+1}{r} $$ 2 points. Now as $m$ is even we have $\operatorname{gcd}\left(a_{r}+m b_{r}, b_{r}+1\right)=\operatorname{gcd}\left(\binom{r}{2} m+1+m r, r+1\right)=\operatorname{gcd}\left(\binom{r+1}{2} m+1, r+1\right)=\operatorname{gcd}\left((r+1) r \frac{m}{2}+1, r+1\right)=1$ so this is a contradiction, and hence it is not eventually periodic for any positive rational number $u$. 1 point. Case 2. $m$ is odd Assume that there is $r \in \mathbb{N}$ such that there was no reduction in the steps $r, r+1, r+2$ and $r+3$. Then for $i \in\{1,2\}$ : $$ \left(a_{r+i+2}, b_{r+i+2}\right) \equiv\left(a_{r+i}+m b_{r+i}+m b_{r+i+1}, b_{r+i}+1+1\right) \equiv\left(a_{r+i}+2 m b_{r+i}+m, b_{r+i}+2\right) \equiv\left(a_{r+i}+1, b_{r+i}\right)(\bmod 2) $$ so at least one of the following pairs: $\left(a_{r+1}, b_{r+1}\right),\left(a_{r+2}, b_{r+2}\right),\left(a_{r+3}, b_{r+3}\right),\left(a_{r+4}, b_{r+4}\right)$ has both even entries which is impossible (as they are coprime). Hence there was at least one reduction in the steps $r, r+1, r+2$ and $r+3$. 2 points. Therefore for all $n \geqslant 1$ : $$ \max \left\{b_{n+1}, b_{n+2}, b_{n+3}, b_{n+4}\right\} \leqslant \min \left\{b_{n+1}, b_{n+2}, b_{n+3}, b_{n+4}\right\}+3 \leqslant \frac{1}{2} \max \left\{b_{n}, b_{n+1}, b_{n+2}, b_{n+3}\right\}+3 $$ so there exists $C \geqslant 1$ such that $b_{n} \leqslant 6$ for all $n \geqslant C$. 2 points. Similarly for all $n \geqslant C$ : $$ \max \left\{a_{n+1}, a_{n+2}, a_{n+3}, a_{n+4}\right\} \leqslant \min \left\{a_{n+1}, a_{n+2}, a_{n+3}, a_{n+4}\right\}+3 \cdot 6 m \leqslant \frac{1}{2} \max \left\{a_{n}, a_{n+1}, a_{n+2}, a_{n+3}\right\}+18 m $$ so there exists $D \geqslant C$ such that $a_{n} \leqslant 36 m$ for all $n \geqslant D$. 2 points. We conclude that for all $n \geqslant D$ there are finitely many pairs $(6 \cdot 36 m=216 m)$ that $\left(a_{n}, b_{n}\right)$ attains so it becomes eventually periodic for any positive rational number $u$. 1 point. Notes on marking: - Case 1 and Case 2 are always worth 3 points and 7 points respectively. ![](https://cdn.mathpix.com/cropped/2024_06_05_3c9a4bb6a404b95ac7e4g-09.jpg?height=326&width=1625&top_left_y=288&top_left_x=250) ## Problems and Solutions Problem 1. For positive integers $a$ and $b$, let $M(a, b)$ denote their greatest common divisor. Determine all pairs of positive integers $(m, n)$ such that for any two positive integers $x$ and $y$ such that $x \mid m$ and $y \mid n$, $$ M(x+y, m n)>1 $$ (Ivan Novak) First Solution. We will prove that there are no solutions. Let $m$ and $n$ be any positive integers. Let $P$ denote the product of all primes which divide $n$ and don't divide $m$. Then $m$ is a divisor of $m$ and $P$ is a divisor of $n$, but we'll prove that $m+P$ and $m n$ are relatively prime. 4 points. Let $p$ be any prime divisor of $m n$. If $p$ divides $m$, then $p$ doesn't divide $P$ and therefore $p$ doesn't divide $m+P$. 3 points. If $p$ doesn't divide $m$, then $p$ divides $n$, and then $p$ divides $P$ by definition of $P$, which implies that $p$ doesn't divide $m+P$. 3 points. Hence, $m+P$ and $m n$ have no common prime factors, which implies they are relatively prime. Hence, there are no solutions. Second Solution. We will prove that there are no solutions. Assume for the sake of contradiction that ( $m, n$ ) was a solution. We will recursively construct an infinite unbounded sequence of pairs of positive integers $\left(x_{k}, y_{k}\right)_{k \in \mathbb{N}}$ such that $x_{k}\left|m, y_{k}\right| n$ and $M\left(x_{k}, y_{k}\right)=1$. 1 point. Then either $\left(x_{k}\right)_{k \in \mathbb{N}}$ or $\left(y_{k}\right)_{k \in \mathbb{N}}$ will be unbounded, but $x_{k} \leqslant m$ and $y_{k} \leqslant n$ for all $k \in \mathbb{N}$, which will yield a contradiction. 1 point. Let $\left(x_{1}, y_{1}\right)=(1,1)$. Let $k \in \mathbb{N}$. Suppose we have constructed $\left(x_{k}, y_{k}\right)$ satisfying all of the above conditions. Then since $(m, n)$ is a solution, there exists a prime divisor $p$ of both $m n$ and $x_{k}+y_{k}$. 1 point. If $p$ divides $m$, then let $\left(x_{k+1}, y_{k+1}\right)=\left(p x_{k}, y_{k}\right)$. 2 points. If $p$ divides $n$ and doesn't divide $m$, let $\left(x_{k+1}, y_{k+1}\right)=\left(x_{k}, p y_{k}\right)$. 2 points. In both cases $x_{k+1}$ divides $m$ and $y_{k+1}$ divides $n$. 1 point. Also, $M\left(x_{k+1}, y_{k+1}\right)=1$ because $p$ does not divide neither $x_{k}$ nor $y_{k}$ (as $x_{k}$ and $y_{k}$ are relatively prime and $p$ divides $\left.x_{k}+y_{k}\right)$. Hence, the construction is valid. 2 points. ## Notes on marking: - In the First solution, there are different choices for pairs of divisors whose sum is relatively prime with $m n$. For example, one can take $\left(\operatorname{rad}(m), \frac{\operatorname{rad}(m n)}{\operatorname{rad}(m)}\right)$, where $\operatorname{rad}(x)$ denotes the product of all prime divisors of $x$. If a student finds such a pair and claims that it is a solution without proving that their sum is relatively prime with $m n$, and if the proof is as straightforward as in the official solution, he should still get 4 points from the first part of the solution. Problem 2. Let $n$ be a positive integer. An $n \times n$ board consisting of $n^{2}$ cells, each being a unit square coloured either black or white, is called convex if for every black coloured cell, both the cell directly to the left of it and the cell directly above it are also coloured black. We define the beauty of a board as the number of pairs of its cells $(u, v)$ such that $u$ is black, $v$ is white and $u$ and $v$ are in the same row or column. Determine the maximum possible beauty of a convex $n \times n$ board. (Ivan Novak) First Solution. We colour the board so that in the $i$-th row, the leftmost $n+1-i$ cells are black. We'll call this board the Unicorn. 1 point. The beauty of this board equals $$ 2 \sum_{k=1}^{n-1} k(n-k)=2\left(\sum_{k=1}^{n-1} n k-\sum_{k=1}^{n-1} k^{2}\right)=2\left(\frac{n^{2}(n-1)}{2}-\frac{n(n-1)(2 n-1)}{6}\right)=\frac{n^{3}-n}{3} $$ 1 point. We'll call any pair $(u, v)$ such that $u$ is white, $v$ is black and $u$ and $v$ are in the same row or column a pretty pair. Now we will prove that the beauty of every convex board is less than or equal to the beauty of the Unicorn. We will do this by performing an algorithm which turns an arbitrary board into the Unicorn in finitely many steps. Consider an arbitrary convex board. Let $a_{i}$ be the number of black coloured cells in the $i$-th row. We perform the following algorithm: If the board is equal to the Unicorn, we are done. Otherwise, find the first row in which $a_{i} \neq n+1-i$. Then, we consider two cases: 1. $a_{i}n+1-i$. Let $j \geqslant i$ be the biggest index such that $a_{j}=a_{i}$. We colour the $a_{i}$-th cell of the $j$-th column white. 1 point. We claim that the beauty of the board didn't decrease. As in the first case, we count the number of black/white cells which are in the same row or column as the cell we colored and which are distinct from it. The number of white cells in the same row equals $n-a_{j}$, and the number of white cells in the same column equals $n-j$. On the other hand, the number of black cells in the same row equals $a_{j}-1$, and the number of black cells in the same column equals $j-1$. 1 point. Therefore, the difference of beauties of the board before and after coloring the $a_{j}$-th cell of $j$-th row white is $\left(n-a_{j}\right)+(n-j)-\left(a_{j}-1\right)-(j-1)=2\left(n+1-j-a_{j}\right) \leqslant 2\left(n+1-i-a_{i}\right)<0$, which implies that the new board's beauty is bigger. 1 point. The algorithm terminates because after each step, the number of positions where the board differs from the Unicorn decreases by 1. Therefore, the maximum beauty is achieved for the Unicorn. Second Solution. Consider an arbitrary convex board. Let $a_{i}$ denote the number of black cells in the $i$-th row. Furthermore, we define $a_{0}=n$ and $a_{n+1}=0$. Then the number of pretty pairs $(u, v)$ such that $u$ and $v$ are in the same row equals $$ \sum_{i=1}^{n} a_{i}\left(n-a_{i}\right) $$ 1 point. The number of columns with at least $i$ black cells equals $a_{i}$. 1 point. This implies that the number of columns with exactly $i$ black cells equals the difference between the number of columns with at least $i$ black cells and the number of columns with at least $i+1$ black cells. Therefore, the number of columns with exactly $i$ black cells equals $a_{i}-a_{i+1}$. 2 points. This implies that the number of pretty pairs $(u, v)$ such that $u$ and $v$ are in the same column equals $$ \sum_{i=1}^{n}\left(a_{i}-a_{i+1}\right) i(n-i) $$ 1 point. Therefore, the beauty of the board equals $$ \sum_{i=1}^{n} a_{i}\left(n-a_{i}\right)+\left(a_{i}-a_{i+1}\right) i(n-i)=\sum_{i=1}^{n} a_{i}\left(n-a_{i}+i(n-i)-(i-1)(n+1-i)\right)=\sum_{i=1}^{n} a_{i}\left(2 n+1-2 i-a_{i}\right) $$ 1 point. For a fixed $i \in\{1, \ldots, n\}, a_{i}\left(2 n+1-2 i-a_{i}\right)$ is a quadratic function of $a_{i}$, which is increasing for $a_{i} \in\left[0, n-i+\frac{1}{2}\right]$ and decreasing for $a_{i} \in\left[n-i+\frac{1}{2}, n\right]$, and the maximum among all integer $a_{i}$ is then achieved if $a_{i} \in\{n-i, n-i+1\}$. 1 point. Therefore, the whole sum is maximised if $a_{i} \in\{n-i, n-i+1\}$ for all $i \in\{1, \ldots, n\}$. 1 point. Any board with $a_{i} \in\{n-i, n-i+1\}$ is convex since then $a_{i} \geqslant a_{i+1}$ for any of the possible choices. 1 point. In this case, the sum equals $$ \sum_{i=1}^{n}(n-i)(n-i+1)=\sum_{i=1}^{n} i(i-1)=\sum_{i=1}^{n} i^{2}-i=\frac{n(n+1)(2 n+1)-3 n(n+1)}{6}=\frac{n^{3}-n}{6} $$ 1 point. ## Notes on marking: - A student is awarded the maximum of the two scores he gets by following either of the two marking schemes. Points from different solutions are not additive. - If the student produces an optimal board, writes down its beauty, but does not simplify the expression to a closed form, then: a) if the student does not prove the optimality of the board (a " $0+$ " solution), he is awarded 0 points for this part; b) if the student proves the optimality of the board (a "10-" solution), he is awarded 1 point for this part. - In the First Solution, the last 2 points are only awarded if he gives a correct algorithm. - In the First Solution, if the student has a correct algorithm, but fails to prove that it terminates, he should be deducted 1 point. - In the Second Solution, the "other direction" is implicit in the last part of the solution. This is because the Unicorn configuration is covered by the given equality cases. If the student gives an optimal board as in the other solutions, and then shows that his optimal board is contained in the equality case, his solution is complete. However, if the student does not in any way show that his lower and upper bounds match, he should be deducted 1 point. Problem 3. In an acute triangle $A B C$ with $|A B| \neq|A C|$, let $I$ be the incenter and $O$ the circumcenter. The incircle is tangent to $\overline{B C}, \overline{C A}$ and $\overline{A B}$ in $D, E$ and $F$ respectively. Prove that if the line parallel to $E F$ passing through $I$, the line parallel to $A O$ passing through $D$ and the altitude from $A$ are concurrent, then the point of concurrence is the orthocenter of the triangle $A B C$. (Petar Nizić-Nikolac) Sketch. ![](https://cdn.mathpix.com/cropped/2024_06_05_3c9a4bb6a404b95ac7e4g-13.jpg?height=876&width=1173&top_left_y=470&top_left_x=447) Solution. Let $H$ be that concurrence point. We shall prove that $H$ is the orthocenter of the triangle $A B C$. Firstly we observe that $A F I E$ is a deltoid (because $|A E|=|A F|$ and $|I E|=|I F|$ ), so $A I \perp E F \| H I$. 1 point. Using the fact that $A I$ is the bisector of $\angle O A H$ and $A H \| I D$ we conclude that $$ \angle D I H=\angle A I D-90^{\circ}=180^{\circ}-\angle I A H-90^{\circ}=90^{\circ}-\frac{\angle O A H}{2}=90^{\circ}-\frac{\angle H D I}{2} $$ so triangle $I H D$ is an isoscales one. 1 point. Denote by $T$ the second intersection of the line $D I$ and the incircle and $S$ as the point such that $S H D I$ is a rhombus. It follows that $S$ lies on $A H$, but also that triangle $I S H$ is an isoscales one, so $$ \angle S I A=90^{\circ}-\angle S I H=90^{\circ}-\angle S H I=90^{\circ}-\angle H I D=\angle A I T=\angle I A S \text {. } $$ Hence $|A S|=|S I|=|I D|=|I T|$ (we used that $I$ is the midpoint of $\overline{T D}$ ), so ASIT is a rhombus. 3 points. Lemma. $A, T, O$ and $D_{1}$ are collinear, where $D_{1}$ is the point where $A$-excircle is tangent to $B C$. Proof. Firstly, $A, T$ and $O$ are collinear as $A T\|S I\| H D \| A O$. 1 point. Secondly, $A, T$ and $D_{1}$ are collinear as there is homothety from $A$ sending incircle to $A$-excircle, so the "highest" points (w.r.t. $\overline{B C}$ ) of these circles ( $T$ and $D_{1}$ ) and the center of homothety $(A)$ are collinear. Therefore, $A, T, O$ and $D_{1}$ are collinear. 1 point. Denote by $M$ the midpoint of $\overline{B C}$. We know that $|B D|=\frac{|A B|+|B C|-|A C|}{2}=\left|C D_{1}\right|$, so $M$ is the midpoint of $\overline{D D_{1}}$. 1 point. As $T D D_{1}$ is a right triangle and $\angle O M D_{1}=90^{\circ}$ we conclude that $\overline{O M}$ is a $D_{1}$-midline in the triangle $T D D_{1}$, hence $$ 2|O M|=|T D|=|T I|+|I D|=|A S|+|S H|=|A H| $$ 1 point. Now we can conclude in various ways (for example, using the Euler line argument) that $H$ is the orthocenter of the triangle $A B C$. 1 point. ## Notes on marking: - Essentially, 5 points are awarded for proving that $A H D T$ is a parallelogram with longer side being twice the size of the shorter side, next 4 points are awarded for proving that $2|O M|=|A H|$ is true, and 1 point is awarded for deduction that $H$ is indeed an orthocenter. - If a student states that $A, T, D_{1}$ are collinear in a general triangle without using it to prove the problem (for example, by introducing the point $O$ and stating that it should be on the line), it should be awarded $\mathbf{0}$ points. On the other hand, if a student uses this fact to prove the problem, it does not have to prove this fact and it is enough to state it. In that case it is awarded 1 point. - If a student states that $2|O M|=|A H|$ in a general triangle without using it to prove the problem (for example, by noting that $|O M|=|I D|)$, it should be awarded 0 points. On the other hand, if a student uses this fact to prove the problem, it does not have to prove this fact and it is enough to state it. In that case it is awarded 1 point. - If a student has a partial solution with analytic methods, only points for proving facts that can be expressed in geometric ways and lead to a compete solution can be awarded. Problem 4. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $$ f(x)+f(y f(x)+f(y))=f(x+2 f(y))+x y $$ for all $x, y \in \mathbb{R}$. (Adrian Beker) Solution. It is easily checked that $f(x)=x+1$ is a valid solution. We will prove that it is the only solution. Let $P(x, y)$ denote the assertion $$ f(x)+f(y f(x)+f(y))=f(x+2 f(y))+x y $$ and let $a=f(0)$. We will first prove the following claim: Claim. $f$ is injective Proof: Suppose that $f(x)=f(y)=t$ for some $x, y \in \mathbb{R}$. We have: $$ \begin{aligned} & P(x, x) \Longrightarrow t+f(x t+t)=f(x+2 t)+x^{2} \\ & P(x, y) \Longrightarrow t+f(y t+t)=f(x+2 t)+x y \end{aligned} $$ Subtracting the last two equations yields $f(x t+t)-f(y t+t)=x(x-y)$. Similarily, we have $f(y t+t)-f(x t+t)=y(y-x)$ which implies $(x-y)^{2}=0 \Longrightarrow x=y$, hence $f$ is injective. 4 points. We have: $$ P(x, 0) \Longrightarrow f(x)+f(a)=f(x+2 a) $$ Setting $x=-a$ yields $f(-a)=0$. Now we have: $$ P(x,-a) \Longrightarrow f(-a f(x))=-a x $$ Again, setting $x=-a$ yields $a=a^{2}$, hence $a \in\{0,1\}$. 1 point. Case 1. $a=0$ $$ P(0, y) \Longrightarrow f(f(y))=f(2 f(y)) $$ Since $f$ is injective, we have $f(y)=2 f(y) \Longrightarrow f(y)=0$ for all $y \in \mathbb{R}$, which is clearly impossible. 1 point. Case 2. $a=1$ Now (2) implies $f(-f(x))=-x$ for all $x \in \mathbb{R}$ This means that $f$ is bijective. On the other hand, (1) implies that $f(x)+f(1)=f(x+2)$ for all $x \in \mathbb{R}$. $$ \begin{gathered} P(x+2, y) \Longrightarrow f(x+2)+f(y f(x+2)+f(y))=f(x+2+2 f(y))+(x+2) y \\ f(x)+f(y)+f(y f(x)+f(y)+y f(1))=f(x+2 f(y))+f(1)+x y+2 y \end{gathered} $$ 1 point. By subtracting the initial equation from this one, we obtain: $$ f(y f(x)+f(y)+y f(1))=f(y f(x)+f(y))+2 y $$ If $y \neq 0$, we can choose $x \in \mathbb{R}$ such that $f(x)=-\frac{f(y)}{y}$ because $f$ is surjective, hence the last equation yields: $$ f(y f(1))=2 y+1 $$ 2 points. for all $y \neq 0$, but it is also true for $y=0$. In particular, setting $y=-\frac{1}{2}$ yields $f\left(-\frac{f(1)}{2}\right)=0$. Since $f$ is injective and $f(-1)=0$, it follows that $f(1)=2 \Longrightarrow f(2 y)=2 y+1$ for all $y \in \mathbb{R}$. Finally, we deduce that $f(x)=x+1$ for all $x \in \mathbb{R}$, as desired. 1 point. ## Notes on marking: - The case $a=1$ can be finished without injectivity. If a student deduces that $f$ is linear and checks that the only option for $f$ is $f(x)=x+1$, he should get 1 point. - If a student manages to prove that $f$ is injective in the case $a=0$, he should get 4 points from the first part of the solution since in the case $a=1$ the proof can be finished without injectivity. - If a student doesn't check that $f(x)=x+1$ is indeed a solution or at least mention that it can be easily checked, he should lose 1 point.