![](https://cdn.mathpix.com/cropped/2024_06_05_a922c8a7251a83b3b676g-01.jpg?height=334&width=376&top_left_y=284&top_left_x=246) # $10^{\mathrm{TH}}$ EUropean Mathematical CUP $11^{\text {th }}$ December 2021 - $19^{\text {th }}$ December 2021 Junior Category ## Problems and Solutions Problem 1. We say that a quadruple of nonnegative real numbers $(a, b, c, d)$ is balanced if $$ a+b+c+d=a^{2}+b^{2}+c^{2}+d^{2} $$ Find all positive real numbers $x$ such that $$ (x-a)(x-b)(x-c)(x-d) \geqslant 0 $$ for every balanced quadruple $(a, b, c, d)$. (Ivan Novak) First Solution. We'll call any $x \in\langle 0, \infty\rangle$ satisfying the problem's condition great. Let $(a, b, c, d)$ be a balanced quadruple. Without loss of generality let $a \geqslant b \geqslant c \geqslant d$. We can rewrite the equation $a^{2}+b^{2}+c^{2}+d^{2}=a+b+c+d$ as $$ \left(a-\frac{1}{2}\right)^{2}+\left(b-\frac{1}{2}\right)^{2}+\left(c-\frac{1}{2}\right)^{2}+\left(d-\frac{1}{2}\right)^{2}=1 $$ which implies $\left(a-\frac{1}{2}\right)^{2} \leqslant 1$, meaning that $a \leqslant \frac{3}{2}$. 6 points. If we take $x \geqslant \frac{3}{2}$, the values of $x-a, x-b, x-c$ and $x-d$ are all nonnegative. Thus, any $x \geqslant \frac{3}{2}$ is great. 1 point. If we take $(a, b, c, d)=\left(\frac{3}{2}, \frac{1}{2}, \frac{1}{2}, \frac{1}{2}\right)$, then for any $x \in\left\langle\frac{1}{2}, \frac{3}{2}\right\rangle$ we have $(x-a)(x-b)(x-c)(x-d)<0$. Thus, no $x \in\left\langle\frac{1}{2}, \frac{3}{2}\right\rangle$ is great. 2 points. If we take $(a, b, c, d)=(1,0,0,0)$, then for any $x \in\langle 0,1\rangle$ we have $(x-a)(x-b)(x-c)(x-d)<0$. Thus, no $x \in\langle 0,1\rangle$ is great. 1 point. We conclude that a number $x$ is great if and only if $x \geqslant \frac{3}{2}$. Second Solution. Here we present another way to conclude that all $x \geqslant \frac{3}{2}$ satisfy the condition. As in the first solution, we call any $x \in\langle 0, \infty\rangle$ which satisfies the problem's condition great, and without loss of generality let $(a, b, c, d)$ be a balanced quadruple satisfying $a \geqslant b \geqslant c \geqslant d$. We notice that for all $y \in \mathbb{R}$ we have $$ \left(y-\frac{1}{2}\right)^{2} \geqslant 0 \Longrightarrow y^{2} \geqslant y-\frac{1}{4} $$ Applying this inequality to $b, c$ and $d$ separately and summing the inequalities we get the following: $$ \left\{\begin{array}{l} b^{2} \geqslant b-\frac{1}{4} \\ c^{2} \geqslant c-\frac{1}{4} \\ d^{2} \geqslant d-\frac{1}{4} \end{array} \quad \Longrightarrow b^{2}+c^{2}+d^{2} \geqslant b+c+d-\frac{3}{4}\right. $$ Using the equality $b^{2}+c^{2}+d^{2}=a+b+c+d-a^{2}$ transforms the inequality above into $$ a \geqslant a^{2}-\frac{3}{4} \Longrightarrow 1 \geqslant\left(a-\frac{1}{2}\right)^{2} $$ which implies $a \leqslant \frac{3}{2}$, 3 points. meaning that all $x \geqslant \frac{3}{2}$ are great. 1 point. The rest of the solution is the same as the previous solution. Problem 2. Let $A B C$ be an acute-angled triangle such that $|A B|<|A C|$. Let $X$ and $Y$ be points on the minor arc $B C$ of the circumcircle of $A B C$ such that $|B X|=|X Y|=|Y C|$. Suppose that there exists a point $N$ on the segment $\overline{A Y}$ such that $|A B|=|A N|=|N C|$. Prove that the line $N C$ passes through the midpoint of the segment $\overline{A X}$. (Ivan Novak) ![](https://cdn.mathpix.com/cropped/2024_06_05_a922c8a7251a83b3b676g-03.jpg?height=1003&width=1033&top_left_y=515&top_left_x=520) First Solution. Let the line $C N$ intersect the circumcircle of $A B C$ at $T \neq C$. Since $|B X|=|X Y|=|Y C|$, we have $\varangle B A X=\varangle X A Y=\varangle Y A C$. Denote that angle by $\varphi$. Furthermore, since $|A N|=|N C|$, we have $\varangle N A C=\varangle N C A=\varphi$, which means that $|A T|=|C Y|$. 1 point. Furthermore, from $|A B|=|A N|$ and $\varangle B A X=\varangle X A Y$ it follows that $A X$ is the perpendicular bisector of $\overline{B N}$, so $|X N|=|B X|$. Since $|B X|=|C Y|=|A T|$, we have $|X N|=|A T|$. 3 points. Now $A T B X$ is an isosceles trapezoid because $|A T|=|B X|$ and because it's cyclic, which means that $|A B|=|T X|$, which, combined with the fact that $|A B|=|A N|$, yields $|T X|=|A N|$. 3 points. Therefore, from $|T X|=|A N|$ and $|X N|=|A T|$ we have that triangles $A T X$ and $A N X$ are congruent, as well as triangles $A T N$ and $X T N$. Therefore, $\varangle A T X=\varangle A N X$ and $\varangle T A N=\varangle T X N$, which means that $A T X N$ is a parallelogram. Now, as $N T$ and $A X$ are diagonals of a parallelogram, $N T$ passes through the midpoint of $\overline{A X}$, which proves the claim. 3 points. Second Solution. Let $l$ be the line parallel to $A B$ through $C$, and let $P$ be the intersection of $l$ and $A Y$. Let $\alpha$ denote the angle $\angle B A C$. From $|A N|=|N C|$ it follows that $\angle A B X=\angle X A N=\angle N A C=\angle N C A=\frac{\alpha}{3}$. Then it's easy to see that $\angle C N P=$ $\angle N A C+\angle N C A=\frac{2 \alpha}{3}$. 1 point. Similarly, $\angle N P C=\angle P A B=\frac{2 \alpha}{3}$ by definition of $P$. 2 points. Thus, the triangle $C N P$ is isosceles. Therefore, we conclude that $|C N|=|P C|$. 1 point. However, $|C N|=|A N|=|A B|$, which implies $|A B|=|P C|$. Since $A B$ and $P C$ are parallel, this means that $A B P C$ is a parallelogram. 2 points. This implies that $A Y$ is the $A$-median of triangle $A B C$. Since $A X$ is isogonal to $A Y$ with respect to $\varangle B A C$, we conclude that $A X$ is the $A$-symmedian in the triangle $A B C$. 1 point. From a well-known lemma, it now follows that $C B$ is the $C$-symmedian in the triangle $A X C$. Note that $$ \angle B C X=\angle B A X=\angle N A C=\angle N C A $$ We now see that $C N$ and $C B$ are isogonal with respect to $\angle A C X$. Hence, $C N$ is the $C$-median of triangle $A C X$ and we are done. 3 points. Third Solution. Denote the angles of $A B C$ by $\alpha, \beta$ and $\gamma$ in a standard way, so that $\alpha=\angle B A C, \beta=\angle C B A$ and $\gamma=\angle A C B$ Note that $\angle B C X=\frac{\alpha}{3}$ and $\angle W C A=\angle N C A=\angle N A C=\frac{\alpha}{3}$ since $N C A$ is isosceles. Thus, $\angle W C X=\angle B C A=\gamma$. Also, note that $\angle W A C=\frac{2 \alpha}{3}$. From sine law in triangle $A N C$, we have $\frac{|A N|}{\sin \frac{\alpha}{3}}=\frac{|A C|}{\sin \frac{2 \alpha}{3}}$. Using the fact that $\frac{|A B|}{|A C|}=\frac{\sin \gamma}{\sin \beta}$ and $|A B|=|A N|$, we get the equality $$ \sin \gamma \sin \frac{2 \alpha}{3}=\sin \beta \sin \frac{\alpha}{3} $$ 3 points. Let $W$ denote the intersection of $A X$ and $N C$. From sine law in triangle $A W C$, we have $$ \frac{|A W|}{|W C|}=\frac{\sin \frac{\alpha}{3}}{\sin \frac{2 \alpha}{3}} $$ 1 point. From sine law in $W X C$, we have $$ \frac{|W X|}{|W C|}=\frac{\sin \gamma}{\sin \beta} $$ 1 point. From these two equalities we get $$ \frac{|A W|}{|W X|}=\frac{\sin \beta \sin \frac{\alpha}{3}}{\sin \gamma \sin \frac{2 \alpha}{3}} $$ which equals 1 by (1). Thus, $|A W|=|W X|$. 5 points. ## Notes on marking: - In the second solution, proving that it suffices to prove that $A Y$ is the $A$-median of $A B C$ (last 4 points) is worth at most 2 points if a student doesn't prove the parts before that. Problem 3. Let $\ell$ be a positive integer. We say that a positive integer $k$ is nice if $k!+\ell$ is a square of an integer. Prove that for every positive integer $n \geqslant \ell$, the set $\left\{1,2, \ldots, n^{2}\right\}$ contains at most $n^{2}-n+\ell$ nice integers. (Theo Lenoir) Solution. We claim that for every $k \geqslant \ell+1$, at most one number among $k^{2}-1$ and $k^{2}$ is nice. 1 point. Suppose for the sake of contradiction that both $k^{2}-1$ and $k^{2}$ are nice for some $k \geqslant \ell+1$. Let $u=\sqrt{\left(k^{2}-1\right)!+\ell}$ and $v=\sqrt{\left(k^{2}\right)!+\ell}$. Then $$ v^{2}-\ell=\left(k^{2}\right)!=k^{2}\left(u^{2}-\ell\right) $$ which can be rearranged into $$ (k u)^{2}-v^{2}=\left(k^{2}-1\right) \ell $$ 2 points. Note that this implies $k u>v$ and, furthermore, $$ (k u)^{2}-v^{2}=(k u-v)(k u+v) \geqslant k u+v>k u>k \sqrt{\left(k^{2}-1\right)!}=\sqrt{\left(k^{2}\right)!} $$ Furthermore, we have the following bounds: $$ \left(k^{2}\right)!\geqslant k^{2}\left(k^{2}-1\right)\left(k^{2}-2\right)>k^{2}\left(k^{2}-1\right)(k-1)^{2}>\left(k^{2}-1\right)^{2}(k-1)^{2} \geqslant\left(k^{2}-1\right)^{2} \ell^{2} $$ where we used the fact that $k^{2}-2>(k-1)^{2}=k^{2}-2 k+1$ for $k \geqslant 2$ and the assumption $\ell \leqslant k-1$. But this implies that the left hand side in (1) is greater than the right hand side, which is a contradiction. 7 points. Thus, there is at least one integer which is not good among $\left\{k^{2}-1, k^{2}\right\}$ for every $k \in\{\ell+1, \ldots, n\}$, which means there are at least $n-\ell$ integers which aren't good. Thus, the claim is proven. Partial solution. This is a sketch of a partial solution using analytic number theory. This is not a solution to the original problem, but it provides a better asymptotic bound on the number of nice integers. This solution is worth $\mathbf{5}$ points in total. We first solve the case where $\ell$ is not a perfect square. Let $p$ be a prime such that $\nu_{p}(\ell)$ is odd. Then for every $k \geqslant 2 p$, we have $\nu_{p}(k!+\ell)=\nu_{p}(\ell)$, which is odd. Hence, every $k \geqslant 2 p$ is not nice, so there are at most $2 \ell$ nice numbers and $2 \ell \leqslant n^{2}-n+\ell$ for $\ell \geqslant 2$. 1 point. Now consider the case when $\ell$ is a square. Then $\ell+1$ is not a perfect square. Note that $(p-2)!\equiv 1(\bmod p)$ for every prime number $p$, and thus $(p-2)!+\ell \equiv \ell+1(\bmod p)$. If we pick $p$ to be a prime such that $\ell+1$ is not a quadratic residue modulo $p$, we conclude that $(p-2)!+\ell$ is not a square. 1 point. Note that, by quadratic reciprocity, $\ell+1$ being a quadratic residue modulo $p$ for $p>\ell+1$ depends only on the remainder of $p$ modulo $8(\ell+1)$, and since $\ell+1$ is not a square, there must exist a class of residues modulo $8(\ell+1)$ such that $\ell+1$ is not a quadratic residue modulo primes from that class. 1 point. By Dirichlet's theorem on arithmetic progressions, the number of primes less than some $N$ which are from a given class of residues modulo $8(\ell+1)$ is asymptotically $$ \frac{1}{\varphi(8(\ell+1))} \pi(N) $$ where $\pi(N)$ is the number of primes less than $N$ and $\varphi$ is the Euler's Totient function. By Prime number theorem, $\pi(N)$ is asymptotically $N / \log (N)$. Hence, for large $n$, the number of integers less than $n^{2}$ which are not nice is at least $$ c \cdot \frac{n^{2}}{\log \left(n^{2}\right)} $$ where $c>0$ is some constant. For $n$ large enough, this is obviously bigger than $n-\ell$. 2 points. ## Notes on marking: - In the second solution, if a contestant isn't rigorous enough with the bounds in the end, they shouldn't get more than 1 point for the last part. - Points from the second solution are not additive with the points from the first solution. Problem 4. Let $n$ be a positive integer. Morgane has coloured the integers $1,2, \ldots, n$. Each of them is coloured in exactly one colour. It turned out that for all positive integers $a$ and $b$ such that $ay$ or not. - If $x>y$, consider the integer $r=x-y=(x+1)-(y+1)$. Since $x \in B$ and $y \in C, r \in B \cup C$. Since $x+1 \in B$ and $y+1 \in A, r \in B \cup A$. Hence, $r \in B$. Similarly, consider $r+1=(x+1)-y=x-(y-1)$. Since $x+1 \in B$ and $y \in C, r+1 \in B \cup C$. Since $x \in B$ and $y-1 \in A, r+1 \in A \cup B$. Hence, $r+1 \in B$. - If $xy$ in the first solution, because one can prove this part without stating Lemma 2. Proving this part in the context of Lemma 2 is worth 3 points, and without the context of Lemma 2 it's worth 2 points. ![](https://cdn.mathpix.com/cropped/2024_06_05_a922c8a7251a83b3b676g-08.jpg?height=337&width=376&top_left_y=280&top_left_x=246) ## $10^{\mathrm{TH}}$ EURopean Mathematical CUP$11^{\text {th }}$ December 2021 - $19^{\text {th }}$ December 2021 Senior Category ## Problems and Solutions Problem 1. Alice drew a regular 2021-gon in the plane. Bob then labelled each vertex of the 2021-gon with a real number, in such a way that the labels of consecutive vertices differ by at most 1. Then, for every pair of non-consecutive vertices whose labels differ by at most 1, Alice drew a diagonal connecting them. Let $d$ be the number of diagonals Alice drew. Find the least possible value that $d$ can obtain. (Ivan Novak) First Solution. Consider the following labelling of the vertices, where the $i$-th number of the 2021-tuple below is the label of the $i$-th vertex: $$ (0.5,1.5,2.5, \ldots, 1009.5,1010.5,1010,1009,1008, \ldots, 2,1) $$ It's easy to see that in this case, Alice will draw 2018 diagonals, those connecting the vertices whose pairs of labels are $\{1.5,1\},\{2.5,2\}, \ldots,\{1009.5,1009\}$ and $\{1.5,2\},\{2.5,3\}, \ldots,\{1009.5,1010\}$. 3 points. We now prove that 2018 is the minimum amount of diagonals Alice could have drawn. Call any labelling of a convex $n$-gon which satisfies the condition that consecutive vertices have labels which differ by at most 1 a sweet labelling, and also call the corresponding $n$-gon sweet. We will prove by mathematical induction that for every $n \geqslant 3$, in any sweet labelling of an $n$-gon, there are at least $n-3$ pairs of nonconsecutive vertices whose labels differ by at most 1. The claim is obvious for $n=3$. Suppose that the claim is true for some positive integer $n$. Consider a sweet labelling of some $n+1$-gon $P$. Consider a vertex $v$ with the maximum label, $L$. Then both of its neighbouring vertices have labels in the set $[L-1, L]$, which means that their labels differ by at most 1 . 1 point. Then the $n$-gon $P^{\prime}$ obtained from $P$ by erasing $v$ and connecting its neighbouring vertices is also sweet. 2 points. Applying the inductive hypothesis on it, there are at least $n-3$ pairs of nonconsecutive vertices of $P^{\prime}$ whose labels differ by at most 1. Adding the pair of neighbours of $v$, we conclude that $P$ has at most $n-2$ pairs of such vertices. This completes the step of the induction. 4 points. Second Solution. The example which achieves the desired bound is the same as in the previous solution. 3 points. Let the labels of the vertices of the 2021-gon be $v_{1}, \ldots, v_{2021}$, where we assume the labels to be ordered so that $v_{1} \leqslant \ldots \leqslant v_{2021}$. Note that this is not necessarily the order in which the values appear on the 2021-gon. We claim that $\left|v_{i}-v_{i+2}\right| \leqslant 1$, for all $i=1,2, \ldots, 2019$. Assume for the sake of contradiction that there exists an $i \in\{1,2, \ldots, 2019\}$ for which $v_{i+2}-v_{i}>1$. Start a circular walk around the 2021-gon, going from the vertex which has the value $v_{1}$, visiting all of the vertices one by one, and returning back to the starting vertex. Doing so visits the values $v_{1}, \ldots, v_{2021}$ in a certain permuted order, starting and ending on $v_{1}$. We look at the first time during the walk when we step on a value whose index is greater than or equal to $i+2$. Let this index be $j \geqslant i+2$. Let's say that on the previous step, we were on value $v_{b}$, where $b \leqslant i+1$. Note that if $b \leqslant i$, then $v_{j}-v_{b} \geqslant v_{i+2}-v_{i}>1$, so it must be the case that $b=i+1$. Next, we look at the first time we return to an index which is smaller than or equal to $i$. Such an index must exist since we eventually return back to $v_{1}$, and we'll denote it by $k$. A similar argument as for $v_{j}$ shows that in the step before reaching $v_{k}$, we must have been on index $b$. This is a contradiction as no vertex can be visited more than once, except for the one we started with. 5 points. We now have $\left|v_{i}-v_{j}\right| \leqslant 1$, for all $i=3, \ldots, 2019$ and $j \in\{i-1, i-2, i+1, i+2\},\left|v_{1}-v_{i}\right| \leqslant 1$ for $j \in\{2,3\}$ and $\left|v_{j}-v_{2021}\right| \leqslant 1$ for $j \in\{2019,2020\}$, which gives at least $\frac{1}{2}(2+3+4 \cdot 2017+3+2)-2021=2018$ diagonals. 2 points. Third Solution. The example which achieves the desired bound is the same as in the previous solution. 3 points. Note that We label the vertices $v_{1}, v_{2}, \ldots, v_{2021}$, and, respectively, their labels $x_{1}, x_{2}, \ldots, x_{2021}$ and view the indices modulo 2021 . We'll say vertices $\left(v_{i}, v_{j}\right)$ are a nigh pair if their labels differ by at most 1 . Without loss of generality, let 1 and $g$ be the indices among $\{1,2, \ldots, 2021\}$ of the vertices with the smallest and greatest label, respectively. Without loss of generality we can also assume $g \leqslant 1011$ since we can otherwise mirror the 2021-gon. Additionally, we will assume that $g \geqslant 4$, and the cases $g=3$ and $g=2$ are dealt with separately. We make use of the following lemmas. Lemma 1. For every $14039$ nigh pairs, making this case suboptimal as well. 0 points. ## Notes on marking: - Points from different solutions are not additive. Student's score should be the maximum of points scored over all solutions. - Miscounting the number $d$ in the optimal example or making a similar minor mistake in that part should be awarded 2 points out of possible $\mathbf{3}$ for that part of the solution. - In the first solution, just stating the idea of induction is worth no points on its own. - In the third solution, dealing with the case $g \leqslant 3$ is worth no points on its own. However, a contestant who doesn't comment these cases can get at most 9 points for their solution. Problem 2. Let $A B C$ be a triangle and let $D, E$ and $F$ be the midpoints of sides $\overline{B C}, \overline{C A}$ and $\overline{A B}$, respectively. Let $X \neq A$ be the intersection of $A D$ with the circumcircle of $A B C$. Let $\Omega$ be the circle through $D$ and $X$, tangent to the circumcircle of $A B C$. Let $Y$ and $Z$ be the intersections of the tangent to $\Omega$ at $D$ with the perpendicular bisectors of segments $\overline{D E}$ and $\overline{D F}$, respectively. Let $P$ be the intersection of $Y E$ and $Z F$ and let $G$ be the centroid of $A B C$. Show that the tangents at $B$ and $C$ to the circumcircle of $A B C$ and the line $P G$ are concurrent. (Jakob Jurij Snoj) ![](https://cdn.mathpix.com/cropped/2024_06_05_a922c8a7251a83b3b676g-10.jpg?height=868&width=1234&top_left_y=594&top_left_x=411) First Solution. Due to the collinearity of $A, X$ and $D$, there is a homothety at $X$ sending the circumcircle of $A B C$ to $\Omega$. This homothety also sends the tangent at $A$ to the circumcircle of $A B C$ to the tangent at $D$ of $\Omega$. 1 point. The homothety in $G$ with ratio $-\frac{1}{2}$ sends the circumcircle of $A B C$ to its nine-point circle and the tangent at $A$ to the circumcircle to the tangent at $D$ to the nine-point circle. These tangents are therefore parallel. It follows that $\Omega$ and the nine-point circle of $A B C$ share a tangent at $D$. 2 points. As $Y$ and $Z$ lie on the perpendicular bisectors of $D E$ and $D F$, respectively, it follows that $|Y D|=|Y E|$ and $Y E$ is also tangent to the nine-point circle of $A B C$ - similarly, $Z F$ is also tangent to this circle. We conclude that the nine-point circle of $A B C$ is the incircle of $P Y Z$. 3 points. Finally, the homothety at $G$ sending the circumcircle of $A B C$ to its nine-point circle sends the tangents through $A, B$ and $C$ to the circumcircle of $A B C$ respectively to the tangents at $D, E$ and $F$ to the nine-point circle of $A B C$. It, therefore, sends the intersection of tangents at $B$ and $C$ to the circumcircle of $A B C$ to the point $P$, thus proving the desired collinearity. 4 points. ![](https://cdn.mathpix.com/cropped/2024_06_05_a922c8a7251a83b3b676g-11.jpg?height=1043&width=1242&top_left_y=181&top_left_x=407) Second Solution. As in the previous solution, we prove that the tangent at $D$ to $\Omega$ is parallel to the tangent at $A$ to the circumcircle of $A B C$. 1 point. Let $\varangle B A C=\alpha, \varangle A B C=\beta, \varangle A C B=\gamma$. Let $Q$ be the intersection of the tangents at $B$ and $C$ to the circumcircle of $A B C$. It now suffices to prove that $G$ lies on $P Q$. 0 points. Let $T$ be the point on $B C$ such that the line $T A$ is tangent to the circumcircle of $A B C$ at $A$. By the tangent-chord theorem, we have $\varangle T A B=\gamma$, which implies $\varangle A T B=\beta-\gamma$. Since $Z Y \| T A$ and $\varangle Y D C=\varangle A T B=\beta-\gamma$. 1 point. By definion of $Y$, we have $|E Y|=|D Y|$. Since $D E$ is a midline of $A B C$, we have $\varangle E D C=\varangle A B C=\beta$. Thus $$ \varangle D E Y=\varangle E D Y=\varangle E D C-\varangle Y D C=\beta-(\beta-\gamma)=\gamma $$ 2 points. Furthermore, note that $\varangle B E D+\varangle D B E=\varangle E D C=\beta$, and $\varangle Q B C=\alpha$, by the tangent-chord theorem. This implies $$ \varangle Q B E+\varangle B E Y=(\varangle Q B C+\varangle D B E)+(\varangle B E D+\varangle D E Y)=\alpha+\beta+\gamma=180^{\circ} $$ so $Q B \| P E$. By analogous reasoning we conclude that $Q C \| P F$. 2 points. Since $E F$ is a midline of $A B C$, we have that the sides $E P, P F, E F$ of triangle $P E F$ are parallel to the sides $Q B, Q C$, $B C$ of triangle $Q B C$, respectively. Those triangles are not congruent because $E F=\frac{B C}{2}$, so there exists a homothety which maps $P E F$ to $Q B C$. The centre of the homothety is the intersection of $B E, C F$, and $P Q$, which implies that $G$ lies on $P Q$ and we are done. 4 points. ## Notes on marking: - In the second solution, once we obtain $\varangle D E Y=\varangle E D Y=\gamma$, we can conclude that $Y E$ is tangent to the circumcircle of $D E F$ and finish as in the first solution. - The final 4 points in either solution can only be awarded if the student correctly proves the other steps of the problem. Otherwise, a contestant can only obtain up to 2 points for this part of the solution. - No points are deducted if the student fails to argue that $\triangle P Y Z$ and the triangle formed by the tangents through $A, B$ and $C$ to the circumcircle of $A B C$ are not congruent. - Analytic approaches are only awarded points if their results are correctly interpreted by geometric means. Problem 3. Let $\mathbb{N}$ denote the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that $$ x^{2}-y^{2}+2 y(f(x)+f(y)) $$ is a square of an integer for all positive integers $x$ and $y$. (Ivan Novak) First Solution. Throughout the solution, let $P(a, b)$ denote the assertion " $a^{2}-b^{2}+2 b(f(a)+f(b))$ is a perfect square". Let $p$ be a prime. Then $P(p, p)$ implies $4 p f(p)$ is a perfect square, which implies $p \mid f(p)$. 1 point. Let $y$ be any positive integer, and let $p$ be any prime. $P(p, y)$ implies $p^{2}+2 y f(p)+2 y f(y)-y^{2}$ is a perfect square. Taking the assertion modulo $p$, it follows that $2 y f(y)-y^{2}$ is a quadratic residue modulo $p$. It is a well known fact that if a positive integer is a quadratic residue modulo all primes, it must be a perfect square. We conclude that $2 y f(y)-y^{2}$ is a perfect square for all $y \in \mathbb{N}$. 3 points. Define $g(y)$ to be $\sqrt{2 y f(y)-y^{2}}$. $P(1, y)$ implies $1-y^{2}+2 y f(1)+2 y f(y)=g(y)^{2}+2 y f(1)+1$ is a perfect square, and since $$ g(y)^{2}+2 y f(1)+1>g(y)^{2} $$ we have a following chain of inequalities: $$ \begin{aligned} & g(y)^{2}+2 y f(1)+1 \geqslant(g(y)+1)^{2} \Longrightarrow 2 y f(1)+1 \geqslant 2 g(y)+1 \Longrightarrow \\ & y f(1) \geqslant g(y) \Longrightarrow y^{2} f(1)^{2} \geqslant 2 y f(y)-y^{2} \Longrightarrow \frac{f(1)^{2}+1}{2} y \geqslant f(y) \end{aligned} $$ 1 point. Since $p \mid f(p)$ and $\frac{f(p)}{p} \leqslant \frac{f(1)^{2}+1}{2}$ for any prime $p$, it follows from Pigeonhole principle that there exists a positive integer $a$ such that $f(p)=a p$ for infinitely many primes $p$. 2 points. Let $p$ be any prime such that $f(p)=a p$ and let $n$ be any positive integer. $P(p, n)$ implies $$ p^{2}-n^{2}+2 n a p+2 n f(n)=(p+n a)^{2}-n^{2} a^{2}-n^{2}+2 n f(n) $$ is a perfect square. However, this means that $2 n f(n)-n^{2}-n^{2} a^{2}$ can be written as a difference of squares in infinitely many ways, which is only possible if it equals 0 . Thus, $2 n f(n)=n^{2} a^{2}+n^{2}$, or, equivalently, $f(n)=\frac{n\left(a^{2}+1\right)}{2}$ for all $n \in \mathbb{N}$. This also implies $\frac{a^{2}+1}{2}=a$, which gives us $a=1$. Therefore, $f(n)=n$ for all $n \in \mathbb{N}$. It can be easily checked that the identity function is indeed a solution. 3 points. Second Solution. Similarly as in the first solution, we conclude that $p \mid f(p)$. Also, from $P(4 p, 4 p)$, we also conclude that $p \mid f(4 p)$ for every odd prime $p$. 1 point. Fix an odd prime number $p$, and let $A=\frac{f(p)}{p}$ and $B=\frac{f(4 p)}{p}$. Now, from $P(4 p, p)$, we have that $15 p^{2}+2 p^{2}(A+B)$ is a square, which means $15+2(A+B)$ is also a square. Multiplying by 4 yields the fact that $60+8(A+B)$ is a square. From $P(p, 4 p)$, we have that $-15 p^{2}+8 p^{2}(A+B)$ is a square, which means $-15+8(A+B)$ is a square. We then have $$ 75=60+8(A+B)-(-15+8(A+B)) $$ Since there are finitely many ways to write 75 as a difference of two squares, we conclude that $A+B$ can take only finitely many different values as $p$ ranges over all primes. The same is true for $A$. 4 points. Therefore, by Pigeonhole principle, there exists a positive integer $a$ such that $f(p)=a p$ for infinitely many primes $p$. 2 points. The problem can now be finished the same way as in the first solution. ## Notes on marking: - Both solutions follow a similar structure. In the first part, a constant $a$ is found such that $f(p)=a p$ for infinitely many primes $p$, and in the second part the problem is completed using the first fact. The points from different solutions are not additive. - In the first solution, it is not expected from the students to prove the key lemma about quadratic residues that is used; it suffices to state it. On the other hand, merely stating the lemma is not worth any points on its own. - If a student solves the problem under the assumption that $f(p)=a p$ for infinitely many $p$, but they don't prove this fact, they can get at most 1 point out of the last $\mathbf{3}$ points. - In the second solution, if a student discusses $P(1,4)$ and $P(4,1)$ similarly to how $P(p, 4 p)$ and $P(4 p, p)$ are discussed, and concludes that $f(1)$ and $f(4)$ can take on finitely many different values, they should get 1 point out of 4 for that part of the solution. Problem 4. Find all positive integers $d$ for which there exist polynomials $P(x)$ and $Q(x)$ with real coefficients such that degree of $P$ equals $d$ and $$ P(x)^{2}+1=\left(x^{2}+1\right) Q(x)^{2} $$ (Ivan Novak) ## First Solution. $$ P(x)^{2}+1=\left(x^{2}+1\right) Q(x)^{2} $$ Let $P$ and $Q$ be polynomials satisfying the conditions. Note that the degree of the left hand side in (1) the equality is $2 d$, and the degree of the right hand side is $2+2 \operatorname{deg} Q$, which implies $\operatorname{deg} Q=d-1$. Suppose that $r$ is a real root of $Q$. Then $P(r)^{2}+1=0$, which is clearly impossible. We conclude that $Q$ has no real roots. Since $Q$ has real coefficients, we conclude that $Q$ has even degree since its roots must come in conjugate pairs. Thus, $d$ must be odd. 1 point. Now we prove that for any odd $d$, there exist polynomials satisfying the conditions. Let $\mathbb{R}\left[x, \sqrt{x^{2}+1}\right]$ be the set of all functions of the form $A+B \sqrt{x^{2}+1}$, where $A$ and $B$ are polynomials with real coefficients. Note that each element of $\mathbb{R}\left[x, x^{2}+1\right]$ can be uniquely associated with a pair of polynomials $(A, B)$. Consider a function $n: \mathbb{R}\left[x, \sqrt{x^{2}+1}\right] \rightarrow \mathbb{R}$ defined by $$ n\left(A+B \sqrt{x^{2}+1}\right)=A^{2}-\left(x^{2}+1\right) B^{2} $$ for all real polynomials $A$ and $B$. Note that the equality (1) is equivalent to the equality $$ n\left(P+\sqrt{x^{2}+1} Q\right)=-1 $$ 1 point. Note that $n\left(\left(A+\sqrt{x^{2}+1} B\right)\left(C+\sqrt{x^{2}+1} D\right)\right)=n\left(A C+\left(x^{2}+1\right) B D+\sqrt{x^{2}+1}(A D+B C)\right)=\left(A C+\left(x^{2}+1\right) B D\right)^{2}-\left(x^{2}+1\right)(A D+B C)^{2}$. On the other hand, $$ n\left(A+\sqrt{x^{2}+1} B\right) n\left(C+\sqrt{x^{2}+1} D\right)=\left(A^{2}-\left(x^{2}+1\right) B^{2}\right)\left(C^{2}-\left(x^{2}+1\right) D^{2}\right) $$ It can easily be checked that the two expressions are equal. Hence, the function $n$ is multiplicative. 1 point. Note that $n\left(x+\sqrt{x^{2}+1}\right)=-1$. 1 point. Then, using the multiplicative property, $n\left(\left(x+\sqrt{x^{2}+1}\right)^{d}\right)=-1$ as well. Let $\left(x+\sqrt{x^{2}+1}\right)^{d}=P+\sqrt{x^{2}+1} Q$ for some polynomials $P$ and $Q$. By binomial theorem, we have $$ P+\sqrt{x^{2}+1} Q=\left(x+\sqrt{x^{2}+1}\right)^{d}=\sum_{j \text { odd }}\binom{d}{j} x^{d-j}\left(x^{2}+1\right)^{\frac{d-j}{2}}+\sum_{j \text { even }}\binom{d}{j} x^{j}\left(x^{2}+1\right)^{\frac{d-1-j}{2}} \sqrt{x^{2}+1} $$ It's now easy to see that $P$ has degree $d$, since it is a sum of polynomials which have degree $d$ and positive leading coefficients, and $P$ and $Q$ satisfy the starting equality. Thus, all odd positive integers are solutions. 6 points. ## Second Solution. $$ P(x)^{2}+1=\left(x^{2}+1\right) Q(x)^{2} $$ Similarly as in the first solution, we conclude that $d$ needs to be odd. 1 point. Let us now prove that for every odd $d$ such polynomials $P(x)$ and $Q(x)$ exist. Fix an odd positive integer $d$. Observing the roots of polynomials $P(x)$ and $Q(x)$, we can easily see from (2) that $P(x)$ and $Q(x)$ don't have a common root. Differentiating (2), we get : $$ P^{\prime}(x) P(x)=x \cdot Q(x)^{2}+\left(x^{2}+1\right) \cdot Q^{\prime}(x) Q(x)=Q(x)\left(x \cdot Q(x)+\left(x^{2}+1\right) \cdot Q^{\prime}(x)\right) $$ Since $P(x)$ and $Q(x)$ don't have common roots, from (3) we conclude that $Q(x)$ must divide $P^{\prime}(x)$. Since they have the same degree, there must exist a real number $u$ such that $u P^{\prime}(x)=Q(x)$. 1 point. Comparing coefficients in (2), we get that $u$ must be $\frac{1}{d}$ or $-\frac{1}{d}$. We'll take $u=\frac{1}{d}$. Plugging in $Q(x)=P^{\prime}(x) / d$ in (3), we get $$ P(x)=\frac{1}{d}\left(\frac{1}{d} x \cdot P^{\prime}(x)+\frac{1}{d}\left(x^{2}+1\right) P^{\prime \prime}(x)\right) $$ We will now find all polynomials $P$ of degree $d$ which satisfy (4). Note that, by multiplying both sides with $P^{\prime}(x)$ and integrating, each of these polynomials satisfies the equation $P(x)^{2}+C=\left(x^{2}+1\right) \frac{\left(P^{\prime}(x)\right)^{2}}{d^{2}}$ for some $C \in \mathbb{R}$. Denote $P(x)=\sum_{i=0}^{d} a_{i} x^{i}$. Then $P^{\prime}(x)=\sum_{i=1}^{d} i a_{i} x^{i-1}$ and $P^{\prime \prime}(x)=\sum_{i=2}^{d} i(i-1) a_{i} x^{i-2}$. Writing out the coefficients in (4), we get $$ \sum_{i=0}^{d} a_{i} x^{i}=\frac{1}{d^{2}}\left(\sum_{i=1}^{d} i^{2} a_{i} x^{i}+\sum_{i=2}^{d} i(i-1) a_{i} x^{i-2}\right) $$ Comparing the coefficients of $x^{k}$ for all $k$ on the left hand side and the right hand side of the above equation for $k \geqslant 0$, we get: $$ a_{d-1}=\frac{1}{d^{2}}\left((d-1)^{2} a_{d-1}\right) \quad \text { which implies } \quad a_{d-1}=0 $$ and also $$ \begin{gathered} a_{k}=\frac{1}{d^{2}}\left(k^{2} a_{k}+(k+2)(k+1) a_{k+2}\right) \quad \text { which can be rewritten as } \\ a_{k+2}=\frac{d^{2}-k^{2}}{(k+2)(k+1)} \cdot a_{k} \quad \text { for all } \quad 0 \leqslant k \leqslant d-2 \end{gathered} $$ 1 point. From here, we now have that $a_{k}=0$ for all even $0 \leqslant k \leqslant d-2$ and that for all odd $0 \leqslant k \leqslant d-2$, we have $a_{k}=q_{k} a_{1}$ for some nonzero real coefficient $q_{k}$ which is uniquely determined by the above recursion. 1 point. It's easy to see that any such choice of coefficients $\left(a_{k}\right)_{k}$ with $a_{1} \neq 0$ gives a solution to (4) which has degree $d$. As we've already said, any solution to (4) is a solution to $P(x)^{2}+C=\left(x^{2}+1\right) \frac{\left(P^{\prime}(x)\right)^{2}}{d^{2}}$ for some $C \in \mathbb{R}$. Considering the coefficient alongside $x^{0}$ in both sides and noting $a_{0}=0$, we get $C=a_{1}^{2} / d^{2}$. Thus, taking a solution with $a_{1}=d$, we get the solution to $P(x)^{2}+1=\left(x^{2}+1\right) \frac{\left(P^{\prime}(x)\right)^{2}}{d^{2}}$, which proves that every odd $d$ is a solution to the problem. 5 points. ## Third Solution. $$ P(x)^{2}+1=\left(x^{2}+1\right) Q(x)^{2} $$ Similarly as in the first solution, we conclude that $d$ needs to be odd. 1 point. Note that $d=1$ is a solution, taking $P(x)=x$ and $Q(x)=1$. Henceforth assume $d \geqslant 3$. From $x^{2}+1 \mid P(x)^{2}+1$ we get $x^{2}+1\left|P(x)^{2}-x^{2} \Longrightarrow x^{2}+1\right|(P(x)-x)(P(x)+x)$. It is not hard to see that the irreducible polynomial $x^{2}+1$ divides exactly one of the two factors. We can replace $P$ by $-P$, so without loss of generality it is safe to assume that $P(x)=A(x)\left(x^{2}+1\right)+x$ for some real polynomial $A$. If we put this in (5), we obtain $$ (A(x) \cdot x+1)^{2}+A(x)^{2}=Q(x)^{2} $$ We will find real polynomials $\alpha$ and $\beta$ such that $A(x)=2 \alpha(x) \beta(x), Q(x)=\alpha(x)^{2}+\beta(x)^{2}, x A(x)+1=\alpha(x)^{2}-\beta(x)^{2}$ and $\operatorname{deg} \alpha+\operatorname{deg} \beta=d-2$. Note that then $A(x)$ and $Q(x)$ satisfy the conditions due to the identities for Pythagorean triples. 2 points. We thus need to find solutions to the equation $$ 2 x \alpha(x) \beta(x)+1=\alpha(x)^{2}-\beta(x)^{2} $$ where $\alpha, \beta \in \mathbb{R}[x]$ are polynomials with real coefficients. Notice that $(\alpha, \beta)=(1,-2 x)$ is a pair of solutions. 1 point. If we look at (6) as a quadratic equation in $\alpha$ we have $$ \alpha^{2}-\alpha \cdot 2 x \beta+1-\beta^{2}=0 $$ Roots $\alpha_{1}, \alpha_{2}$ must then satisfy $\alpha_{1}+\alpha_{2}=2 x \beta$. It is now easily verified that if $(\alpha, \beta)$ is a pair of polynomials which satisfy $(6)$, then $(\beta, 2 x \beta-\alpha)$ is another such pair. 1 point. Thus starting with solution $\left(\alpha_{0}, \beta_{0}\right)=(1,-2 x)$, we can recursively generate a sequence of solutions $$ \left(\alpha_{i+1}, \beta_{i+1}\right)=\left(\beta_{i}, 2 x \beta_{i}-\alpha_{i}\right) $$ The degrees of $\left(\alpha_{i}, \beta_{i}\right)_{i \geqslant 0}$ now follow the pattern $$ (0,1),(1,2),(2,3),(3,4) \ldots $$ More precisely, deg $\alpha_{i}=i$, $\operatorname{deg} \beta_{i}=i+1$ for all $i \geqslant 0$. But then, if $d=2 i+1$ for some $i \geqslant 0$, the pair $\left(\alpha_{i}, \beta_{i}\right)$ gives a pair $(A, Q)=\left(2 \alpha \beta, \alpha^{2}+\beta^{2}\right)$ such that $(x A(x)+1)^{2}+A(x)^{2}=$ $Q(x)^{2}$ and $\operatorname{deg} A=i+(i-1)=d-2$. Then, taking $P(x)=\left(x^{2}+1\right) A(x)+x$ yields a pair $(P, Q)$ satisfying the original equation such that $\operatorname{deg} P=d$. We conclude that every odd $d$ is a solution. 5 points. ## Notes on marking: - Points from different marking schemes are not additive.