1$ implies $f(a+2)=2 a+3$. Setting $b=a+2$ gives $f(a+2)+2 a-1 \mid 2(2 a+1)$. If $f(a+2)=1$, then $a \mid 2 a+1$. This implies $a=1$, which was excluded. Therefore, the odd number $f(a+2)$ is greater than 2 , so $f(a+2)+2 a-1$ is a divisor of $2(2 a+1)$ that is greater than $2 a+1$ (half of $2(2 a+1)$ ). Thus $f(a+2)+2 a-1$ must be equal to $2(2 a+1)$, which gives $f(a+2)=2 a+3$ as desired. Therefore, $f(2)=3$ implies $f(4)=7$. Now, setting $a=3$ and $b=4$ gives $f(3)+7 \mid 12$, which implies $f(3)=5$. Since we now know that $f(a)=2 a-1$ holds for $1,2,3,4$ and we can use induction in steps of two, we get $f(a)=2 a-1$ for all $a$, which is clearly a solution. The two solutions are $f(a)=1$ for all $a$ and $f(a)=2 a-1$ for all $a$. Solution. 3. We have $f(1)=1$ and $f(a) \mid(2 a-1)$ as in the previous solution. If $f(2)=1$, then $f(a)=1$ for all $a$ as in the previous solution. Therefore, we only have to consider $f(2)=3$. We easily check that $f(a)=2 a-1$ for all $a$ is a solution. Choose $k$ maximally such that $f(a)=2 a-1$ holds for all $1 \leqslant a \leqslant k$. Then setting $a=k$ and $b=k+1$ yields $$ 2 k-1+f(k+1)=f(k)+f(k+1) \mid 4 k $$ which by maximality of $k$ implies that $f(k+1)=1$. Setting $a=k-1$ and $b=k+1$ yields $$ 2 k-2=f(k-1)+f(k+1) \mid 2(k-1+k+1-1)=4 k-2 $$ which also implies $2 k-2 \mid((4 k-2)-2(2 k-2))=2$ and thus $k=2$. We conclude that $f(3)=1$ and $f(4) \mid 7$. If $f(4)=1$, then $$ 4=f(2)+f(4) \mid 10 $$ a contradiction. Thus $f(4)=7$. This leads to the contradiction $$ 8=f(3)+f(4) \mid 12 $$ Thus there are only the constant solution and the solution $f(a)=2 a-1$ for all $a$. Solution 4. We have $f(1)=1$ and $f(a) \mid(2 a-1)$ as in the previous solutions. If $f(2)=1$, then $f(a)=1$ for all $a$ as in the previous solutions. Therefore, we only have to consider $f(2)=3$. Let $p$ be a prime with $p \equiv-1(\bmod 4)$. Since we already know that $f(a) \mid 2 a-1$, we get $\left.f\left(\frac{p+1}{2}\right) \right\rvert\, p$ which implies that $f\left(\frac{p+1}{2}\right)$ is either 1 or $p$. If $f\left(\frac{p+1}{2}\right)=1$ then we choose $a=2$ and $b=\frac{p+1}{2}$ in the original equation and get $4 \mid p+3$ which is impossible. Therefore, $f\left(\frac{p+1}{2}\right)=p$ for all such primes $p$. Now we choose $b=\frac{p+1}{2}$ in the original equation and get $$ f(a)+p|2 a-1+p \Longrightarrow f(a)+p| 2 a-1-f(a) \text {. } $$ Since there exist arbitrarily large primes $p$ with $p \equiv-1(\bmod 4)$, the right-hand side has to be 0 , so $f(a)=2 a-1$ which is indeed a solution. ## T-1 A Determine all triples $(a, b, c)$ of real numbers satisfying the system of equations $$ \begin{aligned} & a^{2}+a b+c=0 \\ & b^{2}+b c+a=0 \\ & c^{2}+c a+b=0 \end{aligned} $$ Answer. The solutions are $$ (a, b, c) \in\left\{(0,0,0),\left(-\frac{1}{2},-\frac{1}{2},-\frac{1}{2}\right)\right\} $$ Solution. If one of the numbers $a, b$ and $c$ is equal to zero, it is easy to see that the other two numbers also have to be equal to zero, which gives us the solution $(0,0,0)$. Now assume that $a, b, c \neq 0$. If all three numbers are positive, then the left-hand side of each equation is positive, while the right-hand sides are equal to zero, which is impossible. Let us assume that only one of the numbers is positive, and without loss of generality let it be $a$. Since $b, c<0$, it follows that $b^{2}+b c+a>0$, which is a contradiction. It remains to consider the two following cases: (a) All three numbers are negative. We substitute $a=-x, b=-y$ and $c=-z$, where $x, y, z>0$. The original system transforms into $$ \begin{aligned} & x^{2}+x y=z \\ & y^{2}+y z=x \\ & z^{2}+z x=y \end{aligned} $$ The system is cyclic, so we can assume that $x \leqslant y$ and $x \leqslant z$. Now we have $$ \begin{aligned} & x^{2}+x y=z \geqslant x \Longrightarrow x+y \geqslant 1 \\ & y^{2}+y z=x \leqslant y \Longrightarrow y+z \leqslant 1 \end{aligned} $$ From the previous two inequalities we conclude that $$ x+y \geqslant 1 \geqslant y+z, \quad \text { i.e. } \quad x \geqslant z $$ On the other hand $x \leqslant z$, so we get $x=z$. Now, from equation (1) it follows that $x+y=1$, while from equation (2) it follows that $$ x=y^{2}+y z=y^{2}+y x=y(y+x)=y $$ Thus $x=y=z$ and from $x+y=1$ we see that $x=y=z=1 / 2$. We easily verify that $(a, b, c)=\left(-\frac{1}{2},-\frac{1}{2},-\frac{1}{2}\right)$ is indeed a solution. (b) Exactly one of the numbers is negative. Without loss of generality we can assume that $c$ is negative, while $a$ and $b$ are positive. From the second equation we conclude that $b(b+c)=-a<0$, thus $b+c<0$. The third equation yields $c(a+c)=-b<0$, thus $a+c>0$. Adding $a+b$ to the first equation and cyclic permutation yields $$ a+b+c=(1-a)(a+b)=(1-b)(b+c)=(1-c)(c+a) $$ The last product is positive. This implies that $1-a>0$ and $1-b<0$ by our above considerations. Therefore $00$ (note that $S=0$ would imply $x=y=z=0$ and hence $a=b=c=0$, which has already been excluded), we can split it into the inequalities $3 \geqslant S$ and $S \geqslant 3$, so we have equality and actually all the inequalities are equalities. The case of equality for the triangle equality is when all nonzero $x, y, z$ have the same sign and, in view of equations 6, the only possibility is that $x, y, z$ are all negative. Moreover, in the last inequality, we have equality exactly when $x^{2}=y^{2}=z^{2}$ and, because they have the same sign, it means $x=y=z$. Finally, in view of $x y z=-1$, the only possibility is $x=y=z=-1$. By definition of $x, y, z$ the values of $a, b, c$ are then $$ (a, b, c)=\left(\frac{-1}{2}, \frac{-1}{2}, \frac{-1}{2}\right) $$ and this is indeed a solution. ## T-2 A Let $\mathbb{R}$ denote the set of real numbers. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $$ f(x) f(y)=x f(f(y-x))+x f(2 x)+f\left(x^{2}\right) $$ holds for all real numbers $x$ and $y$. Answer. There are two solutions: $$ f: \mathbb{R} \rightarrow \mathbb{R}: x \mapsto 0, \quad g: \mathbb{R} \rightarrow \mathbb{R}: x \mapsto 3 x $$ Solution. We set $x=0$ and get $f(0) f(y)=f(0)$, so $f(0)=0$ or $f(y)=1$ for all $y$. The latter leads to a contradiction. We set $y=x+z$ and get $$ f(x) f(x+z)=x f(f(z))+x f(2 x)+f\left(x^{2}\right) $$ for all $x$ and $z$. Setting $z=0$ yields $$ f(x)^{2}=x f(2 x)+f\left(x^{2}\right) $$ We set $C=f(1)$. For $x=1$ and $x=2$, we get $f(2)=C(C-1)$ and $f(4)=C^{2}(C-1)^{2} / 3$, respectively. If $C=0$, so (1) with $x=1$ yields $f(f(z))=f(2)=0$, so (1) reads $f(x) f(x+z)=x f(2 x)+f\left(x^{2}\right)$ for all $z$, which implies that $f(x)=0$ for all $x$. Setting $x=1$ and $x=2$ in (1) leads to $$ \begin{aligned} C f(z+1) & =f(f(z))+C^{2} \\ C(C-1) f(z+2) & =2 f(f(z))+C^{2}(C-1)^{2} \end{aligned} $$ Eliminating $f(f(z))$ and division by $C \neq 0$ leads to $$ (C-1) f(z+2)-2 f(z+1)=C\left(C^{2}-2 C-1\right) $$ for all $z$. Setting $z=-1$ leads to $C(C-1)=C\left(C^{2}-2 C-1\right)$. In view of $C \neq 0$, this implies $C=3$. Inserting this in (3), dividing by 2 and shifting $z$ leads to $$ f(z+1)-f(z)=3 $$ for all $z$. We set $z=1$ in (1) and get $$ f(x)(f(x)+3)=9 x+x f(2 x)+f\left(x^{2}\right) $$ Together with (2), we get $3 f(x)=9 x$, i.e., $f(x)=3 x$ for all $x$. Both $f(x)=3 x$ and $f(x)=0$ are solutions. Alternative Solution. Setting $x=0$ in the original equation gives $f(0) f(y)=f(0)$. If $f(0) \neq 0$ then $f(x)=1, x \in \mathbb{R}$, but this function does not satisfy the original equation. Hence, $f(0)=0$. Setting $y=0$ and $y=x$ in the original equation we get $$ 0=x f(f(-x))+x f(2 x)+f\left(x^{2}\right), \quad f(x)^{2}=x f(2 x)+f\left(x^{2}\right) $$ In combination this gives $$ -x f(f(-x))=f(x)^{2} \quad \text { and } \quad x f(f(x))=f(-x)^{2}, x \in \mathbb{R} $$ Multiplying the original equation by $y-x$ gives $(y-x) f(x) f(y)=x(y-x) f(f(y-x))+(y-x)\left(x f(2 x)+f\left(x^{2}\right)\right)=x f(x-y)^{2}+(y-x) f(x)^{2}$, which gives $$ x f(x-y)^{2}=(y-x) f(x)(f(y)-f(x)) $$ Now setting $x=2 y \neq 0$ in (5) we get $$ 2 y f(y)^{2}=-y f(2 y)(f(y)-f(2 y)) $$ and consequently $$ 0=f(2 y)^{2}-f(y) f(2 y)-2 f(y)^{2}=(f(2 y)+f(y))(f(2 y)-2 f(y)) $$ Thus, for any $y \neq 0$ (and for $y=0$ as well) we have $f(2 y)=-f(y)$ or $f(2 y)=2 f(y)$. Setting $y=2 x \neq 0$ in (5) we get $$ x f(-x)^{2}=x f(x)(f(2 x)-f(x)) $$ and consequently $$ f(-x)^{2}+f(x)^{2}=f(x) f(2 x) $$ If $f(2 x)=-f(x)$ holds for some $x \in \mathbb{R}$, then $f(-x)^{2}+2 f(x)^{2}=0$ implies $f(-x)=f(x)=0=$ $f(2 x)$. Hence, the equality $f(2 x)=2 f(x)$ holds for all $x \in \mathbb{R}$. Replacing $y$ by $y+x$ in the original equation and using (4) gives $$ f(x) f(x+y)=x f(f(y))+x f(2 x)+f\left(x^{2}\right)=x f(f(y))+f(x)^{2} $$ Now setting $y=x$ gives $2 f(x)^{2}=x f(f(x))+f(x)^{2}$, which means $f(x)^{2}=x f(f(x))$. Multiplying (6) by $y$ yields $$ y f(x) f(x+y)=x f(y)^{2}+y f(x)^{2} $$ Here we can deduce that $f(x)=0$ implies $x=0$, unless $f$ is identically 0 . Now we can interchange $x$ and $y$ and achieve $y f(x) f(x+y)=x f(y) f(x+y)$. Setting $y=1$ now gives $f(x)=x f(1)$ for all $x \neq-1$. However, we also have $$ f(-1)=\frac{1}{2} f(-2)=\frac{1}{2} \cdot(-2) f(1)=-f(1) $$ so $f(x)=x f(1)$ is valid for all $x$. Plugging in $f(x)=c x$ easily gives $c=0$ or $c=3$. Hence these are the two solutions. ## T-3 C A tract of land in the shape of an $8 \times 8$ square, whose sides are oriented north-south and east-west, consists of 64 smaller $1 \times 1$ square plots. There can be at most one house on each of the individual plots. A house can only occupy a single $1 \times 1$ square plot. A house is said to be blocked from sunlight if there are three houses on the plots immediately to its east, west and south. What is the maximum number of houses that can simultaneously exist, such that none of them is blocked from sunlight? Remark: By definition, houses on the east, west and south borders are never blocked from sunlight. Answer. The maximal number of houses is 50 . Solution. Let us represent the tract as an $8 \times 8$-chessboard, with cells colored black if the corresponding parcel is occupied, and white otherwise. We denote by $(i, j)$ the cell in the $i-$ th row and $j$-th column (with the first row being the northernmost and the first column being the westernmost). We start by showing that an optimal configuration can be obtained by coloring all the cells along the east, south, and west borders. Assume that there is an optimal configuration in which one of those cells, for example $(i, 1)$, is left white. Since we have an optimal configuration, this cell cannot be colored black. This means that by coloring $(i, 1)$, we would block the cell $(i, 2)$. In other words, we know that the cells $(i, 2),(i, 3)$ and $(i+1,2)$ are all colored black in this optimal configuration. However, we now see that we can color $(i, 1)$ instead of $(i, 2)$, keeping the same number of black cells and coloring $(i, 1)$, without disturbing any of the other cells. We can apply the same reasoning to any of the cells $(1,1)-(8,1),(8,1)-(8,8)$ and, similarly, to $(8,8)-(1,8)$, thus showing that there is an optimal configuration in which all the cells along the E, S, W borders are colored black. Those cells being colored, we are left with a $7 \times 6$ area of the board. We can now show that no more than 28 cells in this area can be colored black. In order to obtain 28 , the average number of black cells per row has to be 4 . However, if any row contains six black cells, the next row down cannot contain any black cells, since such a black cell would block the cell immediately north of it. Similarly, if a row were to contain 5 black cells, the next row down would be able to contain at most 3 black cells (namely in the cell immediately below the single white one and the two next to it). This shows that the average number of black cells per row in our $7 \times 6$ area cannot be greater than 4 .  (a)  (b) Figure 1: Alternative Solution This gives us an upper bound on the total number of black cells: the 22 border cells plus 28 cells in the remaining $7 \times 6$ area, i.e., 50 cells in total. An example to show that 50 can indeed be achieved is the following. We color the columns $1,2,4,5,7,8$ and row 8 black, leaving the other cells white. This coloring clearly satisfies the conditions and contains exactly 50 black cells, completing the proof. Alternative Solution. By building a house on each dark grey plot in Figure 1(a), we see that 50 houses can be built accordingly. We will prove that no more than 50 houses can be built, or, equivalently, that at least 14 plots remain empty. Consider the $144 \times 1$ rectangles in Figure 1(b) marked by their thick boundary. We will uniquely assign one empty plot to each of these 14 rectangles as follows: - if the rectangle contains at least one empty plot, assign to it the easternmost such plot; - if the rectangle contains no empty plots, assign to it the westernmost empty plot in the rectangle directly to the south of it. In order to see that this assignment is feasible, note that if some rectangle contains no empty plots, then its two central houses are blocked from sunlight from the east and west. Therefore, the two central plots of the rectangle directly to the south of it must be empty, showing that we can indeed assign its westernmost empty plot to the original rectangle while leaving its easternmost empty plot unassigned. The above assignment is thus feasible and shows that there are at least 14 empty plots, concluding the proof. ## T-4 C A class of high school students wrote a test. Every question was graded as either 1 point for a correct answer or 0 points otherwise. It is known that each question was answered correctly by at least one student and the students did not all achieve the same total score. Prove that there was a question on the test with the following property: The students who answered the question correctly got a higher average test score than those who did not. Solution. Let $n$ be the number of the students in the class and $a$ their average score. Denote by $P$ and $S$ the set of all problems, and the set of all students resp., and let $S(p)$ be the non-empty set of students who solved problem $p \in P$. For any student $s$, let $\operatorname{sc}(s)$ be the score of $s$. For any proposition $A$, let $[A]=1$ if $A$ is true and 0 if $A$ is false. We will prove the assertion by contradiction. Assume that on all questions the average test score of solvers was at most the general average $a$, that is $$ a \geqslant \frac{1}{|S(p)|} \sum_{s \in S(p)} \operatorname{sc}(s) \Leftrightarrow a|S(p)| \geqslant \sum_{s \in S(p)} \operatorname{sc}(s) $$ We now sum these inequalities over all problems $p \in P$ to get $$ \begin{aligned} & a \sum_{p \in P}|S(p)| \geqslant \sum_{p \in P} \sum_{s \in S(p)} \operatorname{sc}(s) \\ & \Leftrightarrow \quad a \sum_{p \in P} \sum_{s \in S}[s \text { solved } p] \geqslant \sum_{p \in P} \sum_{s \in S}[s \text { solved } p] \sum_{q \in P}[s \text { solved } q] \\ & \Leftrightarrow \quad a \sum_{s \in S} \operatorname{sc}(s) \geqslant \sum_{s \in S}\left(\sum_{p \in P}[s \text { solved } p]\right) \cdot\left(\sum_{q \in P}[s \text { solved } q]\right) \\ & \Leftrightarrow \quad \frac{1}{n}\left(\sum_{s \in S} \operatorname{sc}(s)\right)^{2} \geqslant \sum_{s \in S} \operatorname{sc}(s)^{2} \end{aligned} $$ However, this is the reverse of the inequality between the arithmetic and the quadratic mean. Since the case of equality, namely that $\operatorname{sc}(s)$ is the same for all $s \in S$, is excluded by the problem statement, we arrive at the desired contradiction. ## T-5 G Let $A B C$ be an acute-angled triangle with $A B \neq A C$, and let $O$ be its circumcentre. The line $A O$ intersects the circumcircle $\omega$ of $A B C$ a second time in point $D$, and the line $B C$ in point $E$. The circumcircle of $C D E$ intersects the line $C A$ a second time in point $P$. The line $P E$ intersects the line $A B$ in point $Q$. The line through $O$ parallel to $P E$ intersects the altitude of the triangle $A B C$ that passes through $A$ in point $F$. Prove that $F P=F Q$.  Solution 1. Let us denote $\Varangle A B C$ by $\beta$ and $\Varangle B C A$ by $\gamma$. Without loss of generality, $A B>$ $A C$, or equivalently $\beta<\gamma$, as in the figure. Segment $A D$ is a diameter of $\omega$, so by Thales' theorem we have $\Varangle D C A=90^{\circ}$. Since the quadrilateral $C E D P$ is cyclic, we get $\Varangle P E D=90^{\circ}$, which immediately gives $\Varangle A E Q=90^{\circ}$. Since $\Varangle E A Q=\Varangle O A B=90^{\circ}-\gamma$, we also get $\Varangle A Q P=\Varangle A Q E=\gamma$. Since $C E D P$ is cyclic, we get $\Varangle A D P=\Varangle E D P=180^{\circ}-\Varangle P C E=\Varangle A C B=\gamma$. This means that the quadrilateral $A Q D P$ is cyclic. Let us denote the circumcentre of $A Q D P$ by $F^{\prime}$. We show that $F=F^{\prime}$. We have $\Varangle A P Q=180^{\circ}-\Varangle C A B-\Varangle A Q P=\beta$. Hence $\Varangle F^{\prime} A Q=90^{\circ}-\beta$, which implies that $F^{\prime}$ lies on the altitude of $A B C$ that passes through $A$. Moreover, by definition $F^{\prime}$ must lie on the perpendicular bisector of $A D$, which is the line through $O$ parallel to $P E$. So we get $F^{\prime}=F$, and consequently $F P=F Q$.  Solution 2. Let $\alpha, \beta$ and $\gamma$ denote the angles of $A B C$ in the natural way. Point $F$ is defined as the intersection point of the perpendicular bisector of diameter $A D$ with the altitude of triangle $A B C$ through $A$. We define points $P^{\prime}$ and $Q^{\prime}$ as the intersection points of the circle with center $F$ passing through $A$ (and therefore also through $D$ ) with sides $A C$ and $A B$, respectively. First we show $P=P^{\prime}$. We calculate $$ \begin{gathered} \Varangle E D P^{\prime}=\Varangle A D P^{\prime}=\Varangle A Q^{\prime} P^{\prime}=\Varangle A Q^{\prime} F+\Varangle F Q^{\prime} P^{\prime}= \\ \Varangle A Q^{\prime} F+\frac{180^{\circ}-\Varangle Q^{\prime} F P^{\prime}}{2}=90^{\circ}-\beta+90^{\circ}-\alpha=\gamma=180^{\circ}-\Varangle E C P^{\prime} . \end{gathered} $$ So we have that $P^{\prime}$ is the intersection of the circumcircle of triangle $E D C$ with $A C$ and therefore we have $P=P^{\prime}$. Now we prove $Q=Q^{\prime}$. We have $$ \Varangle A B C=\Varangle A D C=\Varangle E D C=\Varangle E P C=\Varangle Q^{\prime} P A=\Varangle Q^{\prime} D A=\beta $$ and therefore quadrilateral $B D E Q^{\prime}$ is cyclic. Since $\Varangle D B Q^{\prime}=90^{\circ}$ we get $Q^{\prime} E \perp A D$. Together with $\Varangle D E P^{\prime}=\Varangle D E P=90^{\circ}$ we have that $Q^{\prime}$ lies on the line $P E$ and thus $Q^{\prime}=Q$. Therefore we have proven $F P=F Q$. Solution 3. Let us denote $\angle A B C$ by $\beta$ and $\angle B C A$ by $\gamma$ and the foot of the altitude from $A$ by $G$. Without loss of generality let $A B>A C$, or equivalently $\beta<\gamma$, as in the figure.  Let $\omega_{1}$ be the reflection of $\omega$ about the angle bisector of $\angle B A C$. Since $\angle E A B=\angle O A B=$ $\angle C A G=90^{\circ}-\gamma$, the center $O_{1}$ of $\omega_{1}$ lies on the altitude from $A$ and $A O=A O_{1}$. The circle $\omega_{1}$ intersects $A B$ for the second time at $C_{1}$ with $A C=A C_{1}$ and $A C$ for the second time at $B_{1}$ with $A B=A B_{1}$. Now, if we can prove $$ A C_{1}: A Q=A B_{1}: A P=A O_{1}: A F $$ then there is a homothety with center $A$ which maps $C_{1} \rightarrow Q, B_{1} \rightarrow P$ and $O_{1} \rightarrow F$. Hence $P$ and $Q$ lie on a circle $\omega_{2}$ with center $F$ and and the problem is solved. Therefore it remains to prove $A C_{1}: A Q=A B_{1}: A P=A O_{1}: A F$. The triangles $A O F$ and $A G E$ are similar, so we have $A F=\frac{A O \cdot A E}{A G}$. Due to segment $A D$ being a diameter of $\omega$, we have $\angle D C A=90^{\circ}$ by Thales' theorem. Since the quadrilateral $C E D P$ is cyclic, we get $\angle P E D=90^{\circ}$, which immediately gives $\angle A E Q=90^{\circ}$. Since $\angle E A Q=\angle O A Q=$ $90^{\circ}-\gamma$, we have $A Q=\frac{A E}{\sin \gamma}$ and with $A C=\frac{A G}{\sin \gamma}$, we get $$ A C_{1}: A Q=A C: A Q=\frac{A G}{\sin \gamma}: \frac{A E}{\sin \gamma}=A G: A E=A O: \frac{A O \cdot A E}{A G}=A O_{1}: A F $$ Similarly we can prove $A B_{1}: A P=A O_{1}: A F$ and we are ready. ## T-6 G Let $A B C$ be a triangle with $A B \neq A C$. The points $K, L, M$ are the midpoints of the sides $B C, C A, A B$, respectively. The inscribed circle of $A B C$ with centre $I$ touches the side $B C$ at point $D$. The line $g$, which passes through the midpoint of segment $I D$ and is perpendicular to $I K$, intersects the line $L M$ at point $P$. Prove that $\Varangle P I A=90^{\circ}$. Solution 1. Let $(X Y Z)$ denote the circumcircle of a triangle $X Y Z$. We use the following well-known lemma: Lemma. The centre of the circle $(B I C)$ is the midpoint of arc $B C$ of circle $(A B C)$ and therefore lies on the angle bisector of $\Varangle B A C$.  Now assume without loss of generality that $A B1$, there are $9 \cdot 10^{k-1}$ numbers with $k$ digits, which is an even number. Thus we need to end after a segment of odd length of numbers with an odd number of digits, i.e., we end on an even number, so a Mozartian number is indeed even. (b) The numbers $n=\underbrace{2 \ldots 2}_{2 \ell} 0$ are Mozartian numbers for all natural numbers $\ell$ : There are an even number of least significant digits $0,1, \ldots, 9$; and all other digits at higher positions except for those in $n$ are repeated 10 times in a row which does not change the parities of occurrences. The leading $2 \ell$ digits 2 of $n$ do not change parities, either. ## Solution 2. (a) Let $k$ be any integer $\geqslant 0$. In the pairing $(2,3),(4,5), \ldots,(2 k, 2 k+1)$, the members of each pair need the same number of digits, so each pair needs an even number of digits together, so alltogether the numbers from 1 to $2 k+1$ need an odd number of digits. Therefore, any Mozartian number has to be even because the total number of digits used up to a Mozartian number has to be even. (b) We will show that $10^{2 k}+22$ are Mozartian numbers for all natural numbers $k$. We first note that by the proof of the first part, we know that we need an odd number of digits up to $10^{2 k}+21$, and therefore an even number of digits up to $10^{2 k}+22$. So it is sufficient to check that the digits $1,2, \ldots, 9$ occur an even number of times because the condition for 0 will be automatically satisfied. Now, we will consider the numbers from 0 to $10^{2 k}-1$ as numbers with $2 k+1$ digits with leading zeros where necessary. Clearly, each digit must occur equally often. Since the number of all digits in this list is divisible by 100 , this quantity is still divisible by 10 , therefore even. This proves that nonzero digits occur an even number of times in this interval. It remains to consider the numbers $10^{2 k}, 10^{2 k}+1, \ldots, 10^{2 k}+22$. Clearly, the leading ones occur an odd number of times. Since the list $1,2, \ldots, 22$ contains an odd number of ones and an even number of the other digits, the proof is finished. ## Solution 3. (only Part (b)) We will first show that for any $k \geqslant 1$ the numbers from 0 to $20 k-1$ together contain an even number of each digit from 0 to 9 . The units digits clearly run from 0 to 9 an even number of times, so they contribute an even number to each digit count. For any possible fixed choice of all digits except the units digits, there are 10 numbers that satisfy this condition, so again, they contribute an even number to each digit count which proves the assertion. Consider now the numbers from 1 to $M=20 k$ where $M$ has a decimal representation that contains an odd number of zeros and an even number of each digit from 1 to 9 . Since the odd number of zeros compensates for the missing zero that was counted in the above assertion, we find that $M$ is a Mozartian number. There are clearly infinitely many such numbers, for example all numbers of the form $22 \ldots 20$ that contain an even number of $2 \mathrm{~s}$. Comment. The argument of Solution 3 shows that Mozartian numbers that are multiples of 20 are exactly those multiples that contain an odd number of 0 s and an even number of all other digits. By an analogous argument, one can now find all Mozartian numbers. The following table lists the parity restrictions on the digit counts for each possible even residue modulo 20 where e stands for even and o stands for odd. The rows list the different possible residues and the columns lists the digits from 0 to 9. For example, 10198 is a Mozartian number because it has residue 18 modulo 20 and the digits that occur an odd number of times are 0,8 and 9 . These conditions are the only restrictions on Mozartian numbers. | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | 0 | o | e | e | e | e | e | e | e | e | e | | 2 | e | o | e | e | e | e | e | e | e | e | | 4 | e | o | o | o | e | e | e | e | e | e | | 6 | e | o | o | o | o | o | e | e | e | e | | 8 | e | o | o | o | o | o | o | o | e | e | | 10 | e | o | o | o | o | o | o | o | o | o | | 12 | o | e | o | o | o | o | o | o | o | o | | 14 | o | e | e | e | o | o | o | o | o | o | | 16 | o | e | e | e | e | e | o | o | o | o | | 18 | o | e | e | e | e | e | e | e | o | o | ## T-8 N We consider the equation $a^{2}+b^{2}+c^{2}+n=a b c$, where $a, b, c$ are positive integers. Prove: (a) There are no solutions $(a, b, c)$ for $n=2017$. (b) For $n=2016, a$ must be divisible by 3 for every solution $(a, b, c)$. (c) The equation has infinitely many solutions $(a, b, c)$ for $n=2016$. ## Solution 1. (a) We distinguish cases depending on the parity of $a, b, c$ : - If all three are odd, we have $a^{2}+b^{2}+c^{2}+2017 \equiv 0(\bmod 2)$ and $a b c \equiv 1(\bmod 2)$. - If exactly one of them is even, we have $a^{2}+b^{2}+c^{2}+2017 \equiv 1(\bmod 2)$ and $a b c \equiv 0$ $(\bmod 2)$. - If exactly two of them are even, we have $a^{2}+b^{2}+c^{2}+2017 \equiv 2(\bmod 4)($ recalling that squares are either congruent to 0 or 1 modulo 4$)$ and $a b c \equiv 0(\bmod 4)$. - If all three are even, we have $a^{2}+b^{2}+c^{2}+2017 \equiv 1(\bmod 2)$ and $a b c \equiv 0(\bmod 2)$. In each of the four cases, we see that the two sides of the equation cannot be equal. (b) Note that $m^{2} \equiv 0(\bmod 3)$ if $m$ is divisible by 3 and $m^{2} \equiv 1(\bmod 3)$ otherwise, and note also that 2016 is divisible by 3 . We consider two cases: - If none of the three numbers $a, b, c$ is divisible by 3 , then neither is $a b c$, while on the other hand $a^{2}+b^{2}+c^{2}+2016 \equiv 1+1+1+0 \equiv 0(\bmod 3)$. Hence we get a contradiction. - Otherwise, $a b c$ is divisible by 3 , so $a^{2}+b^{2}+c^{2}$ must be divisible by 3 as well. If exactly one of the three variables is divisible by 3 , we have $a^{2}+b^{2}+c^{2} \equiv 2(\bmod 3)$, and if exactly two of them are divisible by 3 , we have $a^{2}+b^{2}+c^{2} \equiv 1(\bmod 3)$. In both cases, we see that there cannot be a solution. This leaves us with the only possibility that $a, b, c$ are all divisible by 3 . (c) We know from the previous part that we must have $a=3 x, b=3 y, c=3 z$ for certain positive integers $x, y, z$. We plug these into the given equation and divide by 9 to obtain $$ x^{2}+y^{2}+z^{2}+224=3 x y z $$ Note that $225=15^{2}$ is a perfect square, so we try to find solutions with $x=1$ : $$ y^{2}+z^{2}+225=3 y z $$ Indeed, $y=z=15$ is a solution, and we find further solutions by means of "Vieta jumping". Suppose that $\left(y_{0}, z_{0}\right)$ is a solution, i.e., $$ y_{0}^{2}+z_{0}^{2}+225=3 y_{0} z_{0} $$ where $y_{0} \geqslant z_{0}$. The second solution to the quadratic equation $$ z^{2}-3 y_{0} z+\left(225+y_{0}^{2}\right)=0 $$ is $z_{1}=3 y_{0}-z_{0} \geqslant 2 y_{0}>y_{0}$, giving us a new solution pair $\left(z_{1}, y_{0}\right)$ that has a greater first component than the previous one. Repeating the procedure, we obtain infinitely many solutions. Solution 2. The third part can also be solved by means of the theory of Pellian equations. Let us return to the equation $$ y^{2}+z^{2}+225=3 y z $$ We multiply by 4 and complete the square: $$ 4 y^{2}-12 y z+4 z^{2}+900=(2 y-3 z)^{2}-5 z^{2}+900=0 $$ For odd $k$, we have $$ (2+\sqrt{5})^{k} \cdot(2-\sqrt{5})^{k}=-1 $$ We can write $(2+\sqrt{5})^{k}$ as $u+v \sqrt{5}$ for certain positive integers $u$ and $v$, so that $(2-\sqrt{5})^{k}=$ $u-v \sqrt{5}$ and thus $$ u^{2}-5 v^{2}=-1 $$ Now simply set $z=30 v$ and $y=15 u+45 v$ (so that $2 y-3 z=30 u$ ) to obtain $$ (2 y-3 z)^{2}-5 z^{2}+900=0 $$ as desired. Since we obtain a solution for every odd $k$ in this way, there must be infinitely many.