Every positive integer is marked with a number from the set $\{ 0,1,2\}$, according to the following rule: $$\text{if a positive integer }k\text{ is marked with }j,\text{ then the integer }k+j\text{ is marked with }0.$$Let $S$ denote the sum of marks of the first $2019$ positive integers. Determine the maximum possible value of $S$. Proposed by Ivan Novak
2019 European Mathematical Cup
Junior Division
Let $(x_n)_{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}{2x_1x_2-1}+\frac{x_2^2}{2x_2x_3-1}+\dotsc +\frac{x_{2018}^2}{2x_{2018}x_{2019}-1}+\frac{x_{2019}^2}{2x_{2019}x_{2020}-1}>\frac{2019^2}{x_{2019}^2+\frac{1}{x_{2019}^2}}.$$ Proposed by Ivan Novak
Let $ABC$ 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 \parallel 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 $BC$ as $A$. Let $DA$ intersect $l_C$ at $F$ and let $EA$ intersect $l_B$ at $G$. If $O$, $O_1$ and $O_2$ are circumcenters of the triangles $ABC$, $ADG$ and $AEF$, respectively, and $P$ is the circumcenter of the triangle $OO_1O_2$, prove that $l_B \parallel OP \parallel l_C$. Proposed by Stefan Lozanovski, Macedonia
Let $u$ be a positive rational number and $m$ be a positive integer. Define a sequence $q_1,q_2,q_3,\dotsc$ 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+mb}{b+1}.$$Determine all positive integers $m$ such that the sequence $q_1,q_2,q_3,\dotsc$ is eventually periodic for any positive rational number $u$. Remark: A sequence $x_1,x_2,x_3,\dotsc $ is eventually periodic if there are positive integers $c$ and $t$ such that $x_n=x_{n+t}$ for all $n\geqslant c$. Proposed by Petar NiziƩ-Nikolac
Senior Division
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,mn)>1.$$ Proposed by Ivan Novak
Let $n$ be a positive integer. An $n\times n$ board consisting of $n^2$ cells, each being a unit square colored either black or white, is called convex if for every black colored cell, both the cell directly to the left of it and the cell directly above it are also colored 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. Proposed by Ivan Novak
In an acute triangle $ABC$ with $|AB| \not= |AC|$, let $I$ be the incenter and $O$ the circumcenter. The incircle is tangent to $\overline{BC}, \overline{CA}$ and $\overline{AB}$ in $D,E$ and $F$ respectively. Prove that if the line parallel to $EF$ passing through $I$, the line parallel to $AO$ passing through $D$ and the altitude from $A$ are concurrent, then the point of concurrence is the orthocenter of the triangle $ABC$. Proposed by Petar NiziƩ-Nikolac
Find all functions $f:\mathbb{R}\to \mathbb{R}$ such that $$f(x)+f(yf(x)+f(y))=f(x+2f(y))+xy$$for all $x,y\in \mathbb{R}$. Proposed by Adrian Beker