# MEMO Mathematical Olympiad ## Solutions ## to Individual Competition Problems ## Problem I-1 Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $$ f(x f(y)+2 y)=f(x y)+x f(y)+f(f(y)) $$ holds for all real numbers $x$ and $y$. (proposed by Patrik Bak, Slovakia) Answer. The functional equation has two solutions, $f(x) \equiv 0$ and $f(x) \equiv 2 x$. Solution. Setting $x=0$ and $y=0$ in the functional equation yields $f(f(0))=0$. So there is at least one zero point of $f$. Let $a$ be any of them. Setting $y=a$ gives us $f(2 a)=f(a x)+f(0)$. If $a \neq 0$, then $f$ is a constant function and we know that $f(a)=0$, so it is a zero function, which is indeed a solution. It remains to investigate the case where 0 is the only zero point of $f$, i.e. $f(a)=0$ if and only if $a=0$. Furthermore, taking $x=0$ in the functional equation we obtain $$ f(2 y)=f(f(y)) $$ If we prove an injectivity of $f$, the previous identity yields $f(y)=2 y$, what is the second solution, as we can easily check. Now we prove the injectivity of $f$. Firstly, let us examine the set of the fixed points of $f$. This set is non-empty because 0 is one of its points. Assume that $p$ is any of the fixed points, i.e. $f(p)=p$. Setting $x=-1, y=p$ in the functional equation gives $$ p=f(-f(p)+2 p)=f(-p)-f(p)+f(f(p))=f(-p) $$ Now we set $x=1, y=-p$ in the functional equation and we obtain using proved $f(-p)=p$ $$ p=f(f(-p)-2 p)=f(-p)+f(-p)+f(f(-p))=3 p $$ This yields that $p=0$ is the only fixed point of $f$. Secondly, we choose $x$ so that $x f(y)+2 y=x y$, which yields $x=2 y /(y-f(y))$. This can be done for each $y \neq 0$, since 0 is the only fixed point of $f$. This substitution gives us $$ f(f(y))=\frac{2 y f(y)}{f(y)-y}=\frac{2 f^{2}(y)}{f(y)-y}-2 f(y) $$ In order to finish the proof of injectivity let us assume that non-zero real numbers $a, b$ satisfy $f(a)=f(b)$. We have already proved that $f(a)=f(b) \neq 0$. The previous identity yields $$ \frac{2 f^{2}(a)}{f(a)-a}-2 f(a)=f(f(a))=f(f(b))=\frac{2 f^{2}(b)}{f(b)-b}-2 f(b) $$ and it follows that $a=b$. The proof of the injectivity is thereby finished. Remark. We present an alternative way of proving that $f(p)=p$ implies $p=0$. Assume that $f(p)=p$. Then $y=p$ in (1) means $f(2 p)=p$ and afterwards $y=2 p$ means $f(4 p)=p$. Taking $x=2$ and $y=p$ in the original equation then gives us $p=0$, which works. Therefore the only fixed point of $f$ is 0 . Solution by Jozef Fülöp awarded by prize of the dean of the FMF, Charles Univerzity, Prague. We set $x=1, y=0$ in the original equation and we obtain $$ f(f(0))=f(0)+f(0)+f(f(0)) $$ which implies $f(0)=0$. This identity yields after setting $x=0$ in the original equation $$ f(2 y)=f(f(y)) $$ Let us assume that there exists $t_{0} \neq 0$ such that $f\left(t_{0}\right)=0$. For every real number $t$ we obtain by substitution $x=t / t_{0}, y=t_{0}$ in the original equation $$ f\left(2 t_{0}\right)=f(t)+\frac{t}{t_{0}} \cdot f\left(t_{0}\right)+f(f(y))=f(t)+f\left(f\left(t_{0}\right)\right) $$ This equation with (2) gives us $f(t)=0$ for each real number $t$, which is one of the solutions, as we can easily check. Now we can assume that $f(y) \neq 0$ for every real number $y \neq 0$. For each real number $t$ and $y \neq 0$ we obtain by putting $x=2 t / f(y)$ in the original equation $$ f(2 t+2 y)=f\left(\frac{2 t y}{f(y)}\right)+2 t+f(f(y)) $$ We prove that the function $f$ is injective. If $a, b$ are numbers from $\mathbb{R} \backslash\{0\}$ such that $f(a)=$ $f(b)(\neq 0)$ then the substitutions $t=a, y=b$ or $t=b, y=a$ in the previous equation gives $$ \begin{aligned} f(2 a+2 b) & =f\left(\frac{2 a b}{f(b)}\right)+2 a+f(f(b)) \\ f(2 b+2 a) & =f\left(\frac{2 b a}{f(a)}\right)+2 b+f(f(a)) \end{aligned} $$ This two equations directly yields to $a=b$, which proves the injectivity. The injectivity of the function $f$ together with (2) lead to $f(y)=2 y$ what is the second solution, as we can check. ## Problem I-2 Let $n \geq 3$ be an integer. We say that a vertex $A_{i}(1 \leq i \leq n)$ of a convex polygon $A_{1} A_{2} \ldots A_{n}$ is Bohemian if its reflection with respect to the midpoint of the segment $A_{i-1} A_{i+1}$ (with $A_{0}=A_{n}$ and $A_{n+1}=A_{1}$ ) lies inside or on the boundary of the polygon $A_{1} A_{2} \ldots A_{n}$. Determine the smallest possible number of Bohemian vertices a convex $n$-gon can have (depending on $n$ ). (A convex polygon $A_{1} A_{2} \ldots A_{n}$ has $n$ vertices with all inner angles smaller than $180^{\circ}$.) (proposed by Dominik Burek, Poland) Answer. $n-3$. In the following we write for short 'reflection of $A$ in $P$ ' instead of 'reflection of the vertex $A$ with respect to the midpoint of the segment connecting the two neigbouring vertices of $A$ in the polygon $P$ ? ## Solution. Lemma. If $A B C D$ is a convex quadrilateral with $\angle B A D+\angle C B A \geq \pi$ and $\angle B A D+\angle A D C \geq$ $\pi$ then $A$ is a Bohemian vertex of $A B C D$. Proof. Let $E$ be the reflection of $A$ in $A B C D$. It is clearly seen that $E$ belongs to the halfplanes containing $C$ determined by lines $A B$ and $A D$. Since $\angle B A D+\angle C B A \geq \pi$ and $\angle B A D+$ $\angle E B A=\pi$, point $E$ belongs to the (closed) halfplane containing points $A, D$ determined by the line $B C$. Analogously, using the assumption $\angle B A D+\angle A D C$ we infer that $E$ belongs to the closed halfplane containing points $A, B$ determined by the line $C D$. ![](https://cdn.mathpix.com/cropped/2024_06_05_7e99b1556acc0291915eg-3.jpg?height=499&width=713&top_left_y=2189&top_left_x=680) Therefore $E$ lies inside or on the boundary of $A B C D$. Thus $A$ is Bohemian. Consider a convex $n$-gon $A_{1} A_{2} \ldots A_{n}$. Choose any four vertices $A_{i}, A_{j}, A_{k}, A_{l}$ with $i0$ and the second coordinates of all the remaining vertices are positive. If all the remaining vertices $A_{2}, \ldots, A_{n}$ have their first coordinates between 0 and $a$ (see picture below), it is easy to see that the only vertices that could be non-Bohemian are $A_{1}, A_{2}$, and the point with the strictly largest second coordinate (if such a vertex exists). So, in this case, there exist at least $n-3$ Bohemian vertices. ![](https://cdn.mathpix.com/cropped/2024_06_05_7e99b1556acc0291915eg-5.jpg?height=472&width=1196&top_left_y=318&top_left_x=427) Observation 2. An affine transformation does not change anything, so the statement is proved for all polygons that lie between two parallel lines that go through two adjacent vertices, i.e., whenever there are two adjacent vertices with sum of their angles at most $180^{\circ}$. Consider now any polygon $P=A_{1} A_{2}, \ldots A_{n}$. Observation 3. If there are two (non-adjacent) vertices $A_{i}, A_{j}$ and two parallel lines $p_{i}, p_{j}$ with $A_{i} \in p_{i}, A_{j} \in p_{j}$ such that the whole polygon lies between $p_{i}$ and $p_{j}$, then the diagonal $A_{i} A_{j}$ splits $P$ into two polygons of the type considered in Observation 2. By Observations 1 and 2, these two polygons have at most 4 non-Bohemian points together, $A_{i}, A_{j}$, and two more. Observation 4. For any vertex $A_{i}$ there exist a vertex $A_{j}$ and two parallel lines $p_{i}$ and $p_{j}$ with $A_{i} \in p_{i}, A_{j} \in p_{j}$ such that the whole polygon lies between them. In fact, take a line $p_{i}$ such that $p_{i} \cap P=\left\{A_{i}\right\}$, then $A_{j}$ is the vertex with maximal distance from $p_{i}$, if there are two such vertices, change the direction of $p_{i}$ slightly to obtain a unique $A_{j}$. Let $n=4$. Then there exist two adjacent vertices with sum of their angles not larger than $180^{\circ}$, so, by Observation 2, any quadrilateral has at most 3 non-Bohemian vertices. Let $n \geq 5$. By Observations 3 and 4 , there exist at most 4 non-Bohemian vertices. So, at least one vertex is Bohemian, denote it by $A_{i}$. Then, by Observations 3 and 4 , all the nonBohemian vertices are contained in the quadruple $A_{i}, A_{j}$ and some other two vertices. Since $A_{i}$ is Bohemian, there are at most three non-Bohemian vertices and the proof is complete. Solution 3. We prove by induction that every $n$-gon has at least $n-3$ Bohemian vertices. Step $1, n=4$. We show that every quadrilateral $A B C D$ has at least one Bohemian vertex. We consider a triangle $A B C$. Then $D$ has to be in one of the areas $P_{1}, P_{2}, P_{3}, P_{4}$ (see picture below), otherwise, $A B C D$ would not be a convex quadrilateral. If $D$ were in $P_{2}$, then $B$ would be Bohemian. If $D$ were in $P_{3}$, it would be Bohemian. If $D$ were in $P_{1}$, then $A$ would be Bohemian and similarly if $D$ were in $P_{4}$, then $C$ would be Bohemian (the last two cases are not immediate but easy to prove). ![](https://cdn.mathpix.com/cropped/2024_06_05_7e99b1556acc0291915eg-6.jpg?height=477&width=714&top_left_y=201&top_left_x=662) Induction step. Consider an $n$-gon $P=A_{1} A_{2} \ldots A_{n}$ with $n \geq 5$. Let $P^{\prime}$ be an $(n-1)$-gon obtained from $P$ by omitting one vertex different from $A_{1}$. Let $A_{1}^{\prime}$ be the reflexion of $A_{1}$ in $P$ and $A_{1}^{\prime \prime}$ the reflexion of $A_{1}$ in $P^{\prime}$. We show the following statement $$ \text { if } A_{1} \text { is non-Bohemian in } P \text {, then it is non-Bohemian also in } P^{\prime} \text {. } $$ This statment is obvious if the omitted vertex is not adjacent to $A_{1}$ (since in this case $A_{1}^{\prime}=A_{1}^{\prime \prime}$ and $P^{\prime} \subset P$ ). So, let the omitted vertex be $A_{n}$ (the other neighbour $A_{2}$ can be done in the same way) and let us assume for contradiction that $A_{1}^{\prime} \notin P$ and $A_{1}^{\prime \prime} \in P^{\prime}$. Let us observe that vectors $A_{n} A_{n-1}$ and $A_{1}^{\prime} A_{1}^{\prime \prime}$ are equal. Let us discuss the possible position of $A_{n-1}$. If $A_{n-1} \in Q_{3} \cup Q_{4}$ (as in the picture below) then $A_{1}^{\prime \prime}$ lies below the line $A_{n} A_{n-1}$ while the whole polygon $P$ lies above this line, contradiction with $A_{1}^{\prime \prime} \in P^{\prime} \subset P$. If $A_{n-1} \in Q_{2}$, then $A_{1}^{\prime} \in \triangle A_{2} A_{n} A_{n-1} \subset P$, contradiction. If $A_{n-1} \in Q_{1}$, then the new reflexion $A_{1}^{\prime \prime} \in Q_{2}$ and $A_{1}^{\prime} \in \triangle A_{2} A_{n} A_{1}^{\prime \prime}$ and $\triangle A_{2} A_{n} A_{1}^{\prime \prime} \subset P^{\prime}$ since $A_{1}^{\prime \prime} \in P^{\prime}$. Therefore $A_{1}^{\prime} \in P^{\prime} \subset P$, contradiction. Statement (S) is proved. ![](https://cdn.mathpix.com/cropped/2024_06_05_7e99b1556acc0291915eg-6.jpg?height=506&width=1268&top_left_y=1506&top_left_x=405) Since (by the induction hypothesis) there are at most 3 non-Bohemian vertices in $P^{\prime}$, there are at most 4 non-Bohemian vertices in $P$ (the three and the omitted one). Since $n \geq 5$ there is at least one Bohemian vertex in $P$. Assume now that $P^{\prime}$ is obtained form $P$ by omitting a Bohemian vertex. Since there are at most 3 non-Bohemian vertices in $P^{\prime}$, there are at most 3 non-Bohemian vertices in $P$ and the proof is complete. ## Problem I-3 Let $A B C$ be an acute-angled triangle with $A C>B C$ and circumcircle $\omega$. Suppose that $P$ is a point on $\omega$ such that $A P=A C$ and that $P$ is an interior point of the shorter arc $B C$ of $\omega$. Let $Q$ be the point of intersection of the lines $A P$ and $B C$. Furthermore, suppose that $R$ is a point on $\omega$ such that $Q A=Q R$ and that $R$ is an interior point of the shorter arc $A C$ of $\omega$. Finally, let $S$ be the point of intersection of the line $B C$ with the perpendicular bisector of the side $A B$. Prove that the points $P, Q, R$, and $S$ are concyclic. (proposed by Patrik Bak, Slovakia) Solution. Let ud denote $O$ the center of the circle $\omega$ and $\varphi=\angle P A R$. Since the triangle $Q A R$ is isosceles, we have $\angle A R Q=\varphi$ and $\angle P Q R=2 \varphi$. The central angle theorem (applying to the chord $P R$ ) also yields $\angle P O R=2 \varphi$. Thus the points $P, Q, O$ and $R$ are concyclic. ![](https://cdn.mathpix.com/cropped/2024_06_05_7e99b1556acc0291915eg-7.jpg?height=808&width=654&top_left_y=795&top_left_x=701) Further, let us denote $\beta=\angle A B C$. Since $A P=A C$, we have $\angle A C P=\angle A P C=\beta$ and thus (by the central angle theorem) $\angle A O P=2 \beta$, which gives $$ \angle P A O=\angle A P O=90^{\circ}-\beta=\angle O P Q $$ Since $\angle A B S=\beta$, we furthermore have $\angle O S B=\angle O S Q=90^{\circ}-\beta$, which concludes $\angle O P Q=$ $\angle O S B$ and therefore also the points $P, Q, O$ and $S$ are concyclic. From both paragraphs above it immediately follows the requested claim, i.e. the points $P, Q$, $R, S$ are concyclic, and the proof is done. ## Problem I-4 Determine the smallest positive integer $n$ for which the following statement holds true: From any $n$ consecutive integers one can select a non-empty set of consecutive integers such that their sum is divisible by 2019 . ## (proposed by Kartal Nagy, Hungary) Answer. $n=340$. Solution The prime factorization of 2019 is $3 \cdot 673$. Let $p=673$. For each integer $k$, color the three numbers $k p-1, k p, k p+1$ red, and and the six numbers $k p+\frac{p-5}{2}, k p+\frac{p-3}{2}, k p+\frac{p-1}{2}, k p+\frac{p+1}{2}, k p+\frac{p+3}{2}, k p+\frac{p+5}{2}$ blue. Now the integers are colored periodically. In a period of length $p=673$, there are 3 red integers, then 332 uncolored integers, then 6 blue integers and finally 332 uncolored integers. The sum of the integers in a red interval is $3 k p=2019 \cdot k$, and the sum of the integers in a blue interval is $6\left(k p+\frac{p}{2}\right)=2019 \cdot(2 k+1)$. So if there is a colored interval (we mean a maximal one throughout) in the given $n$ consecutive integers, one can choose it. It is easy to see, that among any $340=332+(6-1)+(3-1)+1$ consecutive integers, there must be a colored interval. Thus the smallest $n$ (that we look for) satisfies $n \leq 340$. Now we will show that it is not possible to choose consecutive integers in the desired way from the set $A=\{335,336, \ldots, 673\} . \quad(|A|=339$ and thus $n \geq 340$.) Assume that there exists $\{a, a+1, \ldots b\} \subseteq A$ such that $$ 2019 \left\lvert\, a+(a+1)+\cdots+b=\frac{(b-a+1)(a+b)}{2}\right. $$ That means either $673 \mid b-a+1$, or $673 \mid a+b$. Since $$ 0<1 \leq b-a+1 \leq 339<673 $$ 673 must divide $a+b$. Taking into account that $$ 671=335+336 \leq a+b \leq 673+673=2 \cdot 673 $$ we conclude that $a+b$ must be 673 or $2 \cdot 673$. It means either $a=335$ and $b=338$, or $a=336$ and $b=337$, or $a=b=673$. But $2019 \nmid 335+336+337+338=1346,2019 \nmid 336+337=673$ and $2019 \nmid 673$, a contradiction. Comment. The same proof works for every odd number $m=p \cdot q$, where $p$ is a 'big' prime divisor of $m$. We need that $p>\sqrt{3 m}$. Then the answer is $n=\frac{p+3 q}{2}-1$.