Let $a_0$ be an arbitrary positive integer. Consider the infinite sequence $(a_n)_{n\geq 1}$, defined inductively as follows: given $a_0, a_1, ..., a_{n-1}$ define the term $a_n$ as the smallest positive integer such that $a_0+a_1+...+a_n$ is divisible by $n$. Prove that there exist a positive integer a positive integer $M$ such that $a_{n+1}=a_n$ for all $n\geq M$.
2019 Balkan MO Shortlist
Algebra
Find all functions $f: \mathbb{R} \to \mathbb{R}$ such that \[ f(xy) = yf(x) + x + f(f(y) - f(x)) \]for all $x,y \in \mathbb{R}$.
Let $a,b,c$ be real numbers such that $0 \leq a \leq b \leq c$ and $a+b+c=ab+bc+ca >0.$ Prove that $\sqrt{bc}(a+1) \geq 2$ and determine the equality cases. (Edit: Proposed by sir Leonard Giugiuc, Romania)
Let $a_{ij}, i = 1, 2, \dots, m$ and $j = 1, 2, \dots, n$ be positive real numbers. Prove that \[ \sum_{i = 1}^m \left( \sum_{j = 1}^n \frac{1}{a_{ij}} \right)^{-1} \le \left( \sum_{j = 1}^n \left( \sum_{i = 1}^m a_{ij} \right)^{-1} \right)^{-1} \]
Let $a,b,c$ be positive real numbers, such that $(ab)^2 + (bc)^2 + (ca)^2 = 3$. Prove that \[ (a^2 - a + 1)(b^2 - b + 1)(c^2 - c + 1) \ge 1. \] Proposed by Florin Stanescu (wer), România
Combinatorics
100 couples are invited to a traditional Modolvan dance. The $200$ people stand in a line, and then in a $\textit{step}$, (not necessarily adjacent) many swap positions. Find the least $C$ such that whatever the initial order, they can arrive at an ordering where everyone is dancing next to their partner in at most $C$ steps.
Determine the largest natural number $ N $ having the following property: every $ 5\times 5 $ array consisting of pairwise distinct natural numbers from $ 1 $ to $ 25 $ contains a $ 2\times 2 $ subarray of numbers whose sum is, at least, $ N. $ Demetres Christofides and Silouan Brazitikos
A grid consists of all points of the form $(m, n)$ where $m$ and $n$ are integers with $|m|\le 2019,|n| \le 2019$ and $|m| +|n| < 4038$. We call the points $(m,n)$ of the grid with either $|m| = 2019$ or $|n| = 2019$ the boundary points. The four lines $x = \pm 2019$ and $y= \pm 2019$ are called boundary lines. Two points in the grid are called neighbours if the distance between them is equal to $1$. Anna and Bob play a game on this grid. Anna starts with a token at the point $(0,0)$. They take turns, with Bob playing first. 1) On each of his turns. Bob deletes at most two boundary points on each boundary line. 2) On each of her turns. Anna makes exactly three steps , where a step consists of moving her token from its current point to any neighbouring point, which has not been deleted. As soon as Anna places her token on some boundary point which has not been deleted, the game is over and Anna wins. Does Anna have a winning strategy? Proposed by Demetres Christofides, Cyprus
A town-planner has built an isolated city whose road network consists of $2N$ roundabouts, each connecting exactly three roads. A series of tunnels and bridges ensure that all roads in the town meet only at roundabouts. All roads are two-way, and each roundabout is oriented clockwise. Vlad has recently passed his driving test, and is nervous about roundabouts. He starts driving from his house, and always takes the first edit at each roundabout he encounters. It turns out his journey incluldes every road in the town in both directions before he arrives back at the starting point in the starting direction. For what values of $N$ is this possible?
Geometry
Let $ABCD$ be a square of center $O$ and let $M$ be the symmetric of the point $B$ with respect to point $A$. Let $E$ be the intersection of $CM$ and $BD$, and let $S$ be the intersection of $MO$ and $AE$. Show that $SO$ is the angle bisector of $\angle ESB$.
Let be a triangle $\triangle ABC$ with $m(\angle ABC) = 75^{\circ}$ and $m(\angle ACB) = 45^{\circ}$. The angle bisector of $\angle CAB$ intersects $CB$ at point $D$. We consider the point $E \in (AB)$, such that $DE = DC$. Let $P$ be the intersection of lines $AD$ and $CE$. Prove that $P$ is the midpoint of segment $AD$.
Let $ABC$ be a scalene and acute triangle with circumcenter $O$. Let $\omega$ be the circle with center $A$, tangent to $BC$ at $D$. Suppose there are two points $F$ and $G$ on $\omega$ such that $FG \perp AO$, $\angle BFD = \angle DGC$ and the couples of points $(B,F)$ and $(C,G)$ are in different halfplanes with respect to the line $AD$. Show that the tangents to $\omega$ at $F$ and $G$ meet on the circumcircle of $ABC$.
Given an acute triangle $ABC$, let $M$ be the midpoint of $BC$ and $H$ the orthocentre. Let $\Gamma$ be the circle with diameter $HM$, and let $X,Y$ be distinct points on $\Gamma$ such that $AX,AY$ are tangent to $\Gamma$. Prove that $BXYC$ is cyclic.
Let $ABC$ ($BC > AC$) be an acute triangle with circumcircle $k$ centered at $O$. The tangent to $k$ at $C$ intersects the line $AB$ at the point $D$. The circumcircles of triangles $BCD, OCD$ and $AOB$ intersect the ray $CA$ (beyond $A$) at the points $Q, P$ and $K$, respectively, such that $P \in (AK)$ and $K \in (PQ)$. The line $PD$ intersects the circumcircle of triangle $BKQ$ at the point $T$, so that $P$ and $T$ are in different halfplanes with respect to $BQ$. Prove that $TB = TQ$.
Let $ABC$ be an acute scalene triangle. Let $X$ and $Y$ be two distinct interior points of the segment $BC$ such that $\angle{CAX} = \angle{YAB}$. Suppose that: $1)$ $K$ and $S$ are the feet of the perpendiculars from from $B$ to the lines $AX$ and $AY$ respectively. $2)$ $T$ and $L$ are the feet of the perpendiculars from $C$ to the lines $AX$ and $AY$ respectively. Prove that $KL$ and $ST$ intersect on the line $BC$.
Let $AD, BE$, and $CF$ denote the altitudes of triangle $\vartriangle ABC$. Points $E'$ and $F'$ are the reflections of $E$ and $F$ over $AD$, respectively. The lines $BF'$ and $CE'$ intersect at $X$, while the lines $BE'$ and $CF'$ intersect at the point $Y$. Prove that if $H$ is the orthocenter of $\vartriangle ABC$, then the lines $AX, YH$, and $BC$ are concurrent.
Given an acute triangle $ABC$, $(c)$ its circumcircle with center $O$ and $H$ the orthocenter of the triangle $ABC$. The line $AO$ intersects $(c)$ at the point $D$. Let $D_1, D_2$ and $H_2, H_3$ be the symmetrical points of the points $D$ and $H$ with respect to the lines $AB, AC$ respectively. Let $(c_1)$ be the circumcircle of the triangle $AD_1D_2$. Suppose that the line $AH$ intersects again $(c_1)$ at the point $U$, the line $H_2H_3$ intersects the segment $D_1D_2$ at the point $K_1$ and the line $DH_3$ intersects the segment $UD_2$ at the point $L_1$. Prove that one of the intersection points of the circumcircles of the triangles $D_1K_1H_2$ and $UDL_1$ lies on the line $K_1L_1$.
Given semicircle $(c)$ with diameter $AB$ and center $O$. On the $(c)$ we take point $C$ such that the tangent at the $C$ intersects the line $AB$ at the point $E$. The perpendicular line from $C$ to $AB$ intersects the diameter $AB$ at the point $D$. On the $(c)$ we get the points $H,Z$ such that $CD = CH = CZ$. The line $HZ$ intersects the lines $CO,CD,AB$ at the points $S, I, K$ respectively and the parallel line from $I$ to the line $AB$ intersects the lines $CO,CK$ at the points $L,M$ respectively. We consider the circumcircle $(k)$ of the triangle $LMD$, which intersects again the lines $AB, CK$ at the points $P, U$ respectively. Let $(e_1), (e_2), (e_3)$ be the tangents of the $(k)$ at the points $L, M, P$ respectively and $R = (e_1) \cap (e_2)$, $X = (e_2) \cap (e_3)$, $T = (e_1) \cap (e_3)$. Prove that if $Q$ is the center of $(k)$, then the lines $RD, TU, XS$ pass through the same point, which lies in the line $IQ$.
Number Theory
Let $\mathbb{P}$ be the set of all prime numbers. Find all functions $f:\mathbb{P}\rightarrow\mathbb{P}$ such that: $$f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$$holds for all $p,q\in\mathbb{P}$. Proposed by Dorlir Ahmeti, Albania
Let $S \subset \{ 1, \dots, n \}$ be a nonempty set, where $n$ is a positive integer. We denote by $s$ the greatest common divisor of the elements of the set $S$. We assume that $s \not= 1$ and let $d$ be its smallest divisor greater than $1$. Let $T \subset \{ 1, \dots, n \}$ be a set such that $S \subset T$ and $|T| \ge 1 + \left[ \frac{n}{d} \right]$. Prove that the greatest common divisor of the elements in $T$ is $1$. [Second Version] Let $n(n \ge 1)$ be a positive integer and $U = \{ 1, \dots, n \}$. Let $S$ be a nonempty subset of $U$ and let $d (d \not= 1)$ be the smallest common divisor of all elements of the set $S$. Find the smallest positive integer $k$ such that for any subset $T$ of $U$, consisting of $k$ elements, with $S \subset T$, the greatest common divisor of all elements of $T$ is equal to $1$.