year
stringdate
1961-01-01 00:00:00
2025-01-01 00:00:00
tier
stringclasses
5 values
problem_label
stringclasses
119 values
problem_type
stringclasses
13 values
exam
stringclasses
28 values
problem
stringlengths
87
2.77k
solution
stringlengths
834
13k
metadata
dict
problem_tokens
int64
50
903
solution_tokens
int64
500
3.93k
2020
T1
3
null
APMO
Determine all positive integers $k$ for which there exist a positive integer $m$ and a set $S$ of positive integers such that any integer $n>m$ can be written as a sum of distinct elements of $S$ in exactly $k$ ways.
. We give an alternative proof of the first half of the lemma in the Solution 1 above. Let $s_{1}<s_{2}<\cdots$ be the elements of $S$. For any positive integer $r$, define $A_{r}(x)=\prod_{n=1}^{r}\left(1+x^{s_{n}}\right)$. For each $n$ such that $m \leq n<s_{r+1}$, all $k$ ways of writing $n$ as a sum of elements of $S$ must only use $s_{1}, \ldots, s_{r}$, so the coefficient of $x^{n}$ in $A_{r}(x)$ is $k$. Similarly the number of ways of writing $s_{r+1}$ as a sum of elements of $S$ without using $s_{r+1}$ is exactly $k-1$. Hence the coefficient of $x^{s_{r+1}}$ in $A_{r}(x)$ is $k-1$. Fix a $t$ such that $s_{t}>2(m+1)$. Write $$ A_{t-1}(x)=u(x)+k\left(x^{m+1}+\cdots+x^{s_{t}-1}\right)+x^{s_{t}} v(x) $$ for some $u(x), v(x)$ where $u(x)$ is of degree at most $m$. Note that $$ A_{t+1}(x)=A_{t-1}(x)+x^{s_{t}} A_{t-1}(x)+x^{s_{t+1}} A_{t-1}(x)+x^{s_{t}+s_{t+1}} A_{t-1}(x) $$ If $s_{t+1}+m+1<2 s_{t}$, we can find the term $x^{s_{t+1}+m+1}$ in $x^{s_{t}} A_{t-1}(x)$ and in $x^{s_{t+1}} A_{t-1}(x)$. Hence the coefficient of $x^{s_{t+1}+m+1}$ in $A_{t+1}(x)$ is at least $2 k$, which is impossible. So $s_{t+1} \geq 2 s_{t}-(m+1)>$ $s_{t}+m+1$. Now $$ A_{t}(x)=A_{t-1}(x)+x^{s_{t}} u(x)+k\left(x^{s_{t}+m+1}+\cdots x^{2 s_{t}-1}\right)+x^{2 s_{t}} v(x) $$ Recall that the coefficent of $x^{s_{t+1}}$ in $A_{t}(x)$ is $k-1$. But if $s_{t}+m+1<s_{t+1}<s_{2 t}$, then the coefficient of $x^{s_{t+1}}$ in $A_{t}(x)$ is at least $k$, which is a contradiction. Therefore $s_{t+1} \geq 2 s_{t}$.
{ "problem_match": "\nProblem 3.", "resource_path": "APMO/segmented/en-apmo2020_sol.jsonl", "solution_match": "\nSolution 2" }
55
707
2020
T1
4
null
APMO
Let $\mathbb{Z}$ denote the set of all integers. Find all polynomials $P(x)$ with integer coefficients that satisfy the following property: For any infinite sequence $a_{1}, a_{2}, \ldots$ of integers in which each integer in $\mathbb{Z}$ appears exactly once, there exist indices $i<j$ and an integer $k$ such that $a_{i}+a_{i+1}+\cdots+a_{j}=P(k)$.
Part 1: All polynomials with $\operatorname{deg} P=1$ satisfy the given property. Suppose $P(x)=c x+d$, and assume without loss of generality that $c>d \geq 0$. Denote $s_{i}=a_{1}+a_{2}+$ $\cdots+a_{i}(\bmod c)$. It suffices to show that there exist indices $i$ and $j$ such that $j-i \geq 2$ and $s_{j}-s_{i} \equiv d$ $(\bmod c)$. Consider $c+1$ indices $e_{1}, e_{2}, \ldots, e_{c+1}>1$ such that $a_{e_{l}} \equiv d(\bmod c)$. By the pigeonhole principle, among the $n+1$ pairs $\left(s_{e_{1}-1}, s_{e_{1}}\right),\left(s_{e_{2}-1}, s_{e_{2}}\right), \ldots,\left(s_{e_{n+1}-1}, s_{e_{n+1}}\right)$, some two are equal, say $\left(s_{m-1}, s_{m}\right)$ and $\left(s_{n-1}, s_{n}\right)$. We can then take $i=m-1$ and $j=n$. Part 2: All polynomials with $\operatorname{deg} P \neq 1$ do not satisfy the given property. Lemma: If $\operatorname{deg} P \neq 1$, then for any positive integers $A, B$, and $C$, there exists an integer $y$ with $|y|>C$ such that no value in the range of $P$ falls within the interval $[y-A, y+B]$. Proof of Lemma: The claim is immediate when $P$ is constant or when $\operatorname{deg} P$ is even since $P$ is bounded from below. Let $P(x)=a_{n} x^{n}+\cdots+a_{1} x+a_{0}$ be of odd degree greater than 1 , and assume without loss of generality that $a_{n}>0$. Since $P(x+1)-P(x)=a_{n} n x^{n-1}+\ldots$, and $n-1>0$, the gap between $P(x)$ and $P(x+1)$ grows arbitrarily for large $x$. The claim follows. Suppose $\operatorname{deg} P \neq 1$. We will inductively construct a sequence $\left\{a_{i}\right\}$ such that for any indices $i<j$ and any integer $k$ it holds that $a_{i}+a_{i+1}+\cdots+a_{j} \neq P(k)$. Suppose that we have constructed the sequence up to $a_{i}$, and $m$ is an integer with smallest magnitude yet to appear in the sequence. We will add two more terms to the sequence. Take $a_{i+2}=m$. Consider all the new sums of at least two consecutive terms; each of them contains $a_{i+1}$. Hence all such sums are in the interval $\left[a_{i+1}-A, a_{i+1}+B\right]$ for fixed constants $A, B$. The lemma allows us to choose $a_{i+1}$ so that all such sums avoid the range of $P$. Alternate Solution for Part 1: Again, suppose $P(x)=c x+d$, and assume without loss of generality that $c>d \geq 0$. Let $S_{i}=\left\{a_{j}+a_{j+1}+\cdots+a_{i}(\bmod c) \mid j=1,2, \ldots, i\right\}$. Then $S_{i+1}=\left\{s_{i}+a_{i+1}\right.$ $\left.(\bmod c) \mid s_{i} \in S_{i}\right\} \cup\left\{a_{i+1}(\bmod c)\right\}$. Hence $\left|S_{i+1}\right|=\left|S_{i}\right|$ or $S_{i+1}=\left|S_{i}\right|+1$, with the former occuring exactly when $0 \in S_{i}$. Since $\left|S_{i}\right| \leq c$, the latter can only occur finitely many times, so there exists $I$ such that $0 \in S_{i}$ for all $i \geq I$. Let $t>I$ be an index with $a_{t} \equiv d(\bmod c)$. Then we can find a sum of at least two consecutive terms ending at $a_{t}$ and congruent to $d(\bmod c)$. Alternate Construction when $P(x)$ is constant or of even degree If $P(x)$ is of even degree, then $P$ is bounded from below or from above. In case of $P$ is constant or bounded from above, then there exists a positive integer $c$ such that $P(x)<c$. Let $\left\{a_{i}\right\}$ be the sequence $$ 0,1,-1,2,3,-2,4,5,-3, \cdots $$ which is given by $a_{3 n+1}=2 n, a_{3 n+2}=2 n+1, a_{3 n+3}=-(n+1)$ for all $n \geq 0$. Notice that for any $i<j$ we have $a_{i}+\cdots+a_{j} \geq 0$. Then for the sequence $\left\{b_{n}\right\}$ defined by $b_{n}=a_{n}+c$, clearly $b_{i}+\cdots+b_{j} \geq\left(a_{i}+\cdots+a_{j}\right)+2 c>c$ which is out side the range of $P(x)$. Now if $P$ is bounded from below, there exist a positive integer $c$ such that $P(x)>-c$. In this case, take $b_{n}$ to be $b_{n}=-a_{n}-c$. Then for all $i<j$ we have $b_{i}+\cdots+b_{j} \leq-\left(a_{1}+\cdots a_{n}\right)-2 c<-c$ which is again out side the range of $P(x)$.
{ "problem_match": "\nProblem 4.", "resource_path": "APMO/segmented/en-apmo2020_sol.jsonl", "solution_match": "# Solution:" }
103
1,448
2020
T1
5
null
APMO
Let $n \geq 3$ be a fixed integer. The number 1 is written $n$ times on a blackboard. Below the blackboard, there are two buckets that are initially empty. A move consists of erasing two of the numbers $a$ and $b$, replacing them with the numbers 1 and $a+b$, then adding one stone to the first bucket and $\operatorname{gcd}(a, b)$ stones to the second bucket. After some finite number of moves, there are $s$ stones in the first bucket and $t$ stones in the second bucket, where $s$ and $t$ are positive integers. Find all possible values of the ratio $\frac{t}{s}$.
The answer is the set of all rational numbers in the interval $[1, n-1)$. First, we show that no other numbers are possible. Clearly the ratio is at least 1, since for every move, at least one stone is added to the second bucket. Note that the number $s$ of stones in the first bucket is always equal to $p-n$, where $p$ is the sum of the numbers on the blackboard. We will assume that the numbers are written in a row, and whenever two numbers $a$ and $b$ are erased, $a+b$ is written in the place of the number on the right. Let $a_{1}, a_{2}, \ldots, a_{n}$ be the numbers on the blackboard from left to right, and let $$ q=0 \cdot a_{1}+1 \cdot a_{2}+\cdots+(n-1) a_{n} $$ Since each number $a_{i}$ is at least 1 , we always have $$ q \leq(n-1) p-(1+\cdots+(n-1))=(n-1) p-\frac{n(n-1)}{2}=(n-1) s+\frac{n(n-1)}{2} $$ Also, if a move changes $a_{i}$ and $a_{j}$ with $i<j$, then $t$ changes by $\operatorname{gcd}\left(a_{i}, a_{j}\right) \leq a_{i}$ and $q$ increases by $$ (j-1) a_{i}-(i-1)\left(a_{i}-1\right) \geq i a_{i}-(i-1)\left(a_{i}-1\right) \geq a_{i} $$ Hence $q-t$ never decreases. We may assume without loss of generality that the first move involves the rightmost 1. Then immediately after this move, $q=0+1+\cdots+(n-2)+(n-1) \cdot 2=\frac{(n+2)(n-1)}{2}$ and $t=1$. So after that move, we always have $$ \begin{aligned} t & \leq q+1-\frac{(n+2)(n-1)}{2} \\ & \leq(n-1) s+\frac{n(n-1)}{2}-\frac{(n+2)(n-1)}{2}+1 \\ & =(n-1) s-(n-2)<(n-1) s \end{aligned} $$ Hence, $\frac{t}{s}<n-1$. So $\frac{t}{s}$ must be a rational number in $[1, n-1)$. After a single move, we have $\frac{t}{s}=1$, so it remains to prove that $\frac{t}{s}$ can be any rational number in $(1, n-1)$. We will now show by induction on $n$ that for any positive integer $a$, it is possible to reach a situation where there are $n-1$ occurrences of 1 on the board and the number $a^{n-1}$, with $t$ and $s$ equal to $a^{n-2}(a-1)(n-1)$ and $a^{n-1}-1$, respectively. For $n=2$, this is clear as there is only one possible move at each step, so after $a-1$ moves $s$ and $t$ will both be equal to $a-1$. Now assume that the claim is true for $n-1$, where $n>2$. Call the algorithm which creates this situation using $n-1$ numbers algorithm $A$. Then to reach the situation for size $n$, we apply algorithm $A$, to create the number $a^{n-2}$. Next, apply algorithm $A$ again and then add the two large numbers, repeat until we get the number $a^{n-1}$. Then algorithm $A$ was applied $a$ times and the two larger numbers were added $a-1$ times. Each time the two larger numbers are added, $t$ increases by $a^{n-2}$ and each time algorithm $A$ is applied, $t$ increases by $a^{n-3}(a-1)(n-2)$. Hence, the final value of $t$ is $$ t=(a-1) a^{n-2}+a \cdot a^{n-3}(a-1)(n-2)=a^{n-2}(a-1)(n-1) $$ This completes the induction. Now we can choose 1 and the large number $b$ times for any positive integer $b$, and this will add $b$ stones to each bucket. At this point we have $$ \frac{t}{s}=\frac{a^{n-2}(a-1)(n-1)+b}{a^{n-1}-1+b} $$ So we just need to show that for any rational number $\frac{p}{q} \in(1, n-1)$, there exist positive integers $a$ and $b$ such that $$ \frac{p}{q}=\frac{a^{n-2}(a-1)(n-1)+b}{a^{n-1}-1+b} $$ Rearranging, we see that this happens if and only if $$ b=\frac{q a^{n-2}(a-1)(n-1)-p\left(a^{n-1}-1\right)}{p-q} . $$ If we choose $a \equiv 1(\bmod p-q)$, then this will be an integer, so we just need to check that the numerator is positive for sufficiently large $a$. $$ \begin{aligned} q a^{n-2}(a-1)(n-1)-p\left(a^{n-1}-1\right) & >q a^{n-2}(a-1)(n-1)-p a^{n-1} \\ & =a^{n-2}(a(q(n-1)-p)-(n-1)) \end{aligned} $$ which is positive for sufficiently large $a$ since $q(n-1)-p>0$. Alternative solution for the upper bound. Rather than starting with $n$ occurrences of 1 , we may start with infinitely many 1 s , but we are restricted to having at most $n-1$ numbers which are not equal to 1 on the board at any time. It is easy to see that this does not change the problem. Note also that we can ignore the 1 we write on the board each move, so the allowed move is to rub off two numbers and write their sum. We define the width and score of a number on the board as follows. Colour that number red, then reverse every move up to that point all the way back to the situation when the numbers are all 1 s . Whenever a red number is split, colour the two replacement numbers red. The width of the original number is equal to the maximum number of red integers greater than 1 which appear on the board at the same time. The score of the number is the number of stones which were removed from the second bucket during these splits. Then clearly the width of any number is at most $n-1$. Also, $t$ is equal to the sum of the scores of the final numbers. We claim that if a number $p>1$ has a width of at most $w$, then its score is at most $(p-1) w$. We will prove this by strong induction on $p$. If $p=1$, then clearly $p$ has a score of 0 , so the claim is true. If $p>1$, then $p$ was formed by adding two smaller numbers $a$ and $b$. Clearly $a$ and $b$ both have widths of at most $w$. Moreover, if $a$ has a width of $w$, then at some point in the reversed process there will be $w$ numbers in the set $\{2,3,4, \ldots\}$ that have split from $a$, and hence there can be no such numbers at this point which have split from $b$. Between this point and the final situation, there must always be at least one number in the set $\{2,3,4, \ldots\}$ that split from $a$, so the width of $b$ is at most $w-1$. Therefore, $a$ and $b$ cannot both have widths of $w$, so without loss of generality, $a$ has width at most $w$ and $b$ has width at most $w-1$. Then by the inductive hypothesis, $a$ has score at most $(a-1) w$ and $b$ has score at most $(b-1)(w-1)$. Hence, the score of $p$ is at most $$ \begin{aligned} (a-1) w+(b-1)(w-1)+\operatorname{gcd}(a, b) & \leq(a-1) w+(b-1)(w-1)+b \\ & =(p-1) w+1-w \\ & \leq(p-1) w . \end{aligned} $$ This completes the induction. Now, since each number $p$ in the final configuration has width at most $(n-1)$, it has score less than $(n-1)(p-1)$. Hence the number $t$ of stones in the second bucket is less than the sum over the values of $(n-1)(p-1)$, and $s$ is equal to the sum of the the values of $(p-1)$. Therefore, $\frac{t}{s}<n-1$.
{ "problem_match": "\nProblem 5.", "resource_path": "APMO/segmented/en-apmo2020_sol.jsonl", "solution_match": "# Solution:" }
151
2,136
2021
T1
2
null
APMO
For a polynomial $P$ and a positive integer $n$, define $P_{n}$ as the number of positive integer pairs $(a, b)$ such that $a<b \leq n$ and $|P(a)|-|P(b)|$ is divisible by $n$. Determine all polynomial $P$ with integer coefficients such that for all positive integers $n, P_{n} \leq 2021$.
There are two possible families of solutions: - $P(x)=x+d$, for some integer $d \geq-2022$. - $P(x)=-x+d$, for some integer $d \leq 2022$. Suppose $P$ satisfies the problem conditions. Clearly $P$ cannot be a constant polynomial. Notice that a polynomial $P$ satifies the conditions if and only if $-P$ also satisfies them. Hence, we may assume the leading coefficient of $P$ is positive. Then, there exists positive integer $M$ such that $P(x)>0$ for $x \geq M$. Lemma 1. For any positive integer $n$, the integers $P(1), P(2), \ldots, P(n)$ leave pairwise distinct remainders upon division by $n$. Proof. Assume for contradiction that this is not the case. Then, for some $1 \leq y<z \leq n$, there exists $0 \leq r \leq n-1$ such that $P(y) \equiv P(z) \equiv r(\bmod n)$. Since $P(a n+b) \equiv P(b)(\bmod n)$ for all $a, b$ integers, we have $P(a n+y) \equiv P(a n+z) \equiv r(\bmod n)$ for any integer $a$. Let $A$ be a positive integer such that $A n \geq M$, and let $k$ be a positive integer such that $k>2 A+2021$. Each of the $2(k-A)$ integers $P(A n+y), P(A n+z), P((A+1) n+y), P((A+1) n+z), \ldots, P((k-1) n+y), P((k-1) n+z)$ leaves one of the $k$ remainders $$ r, n+r, 2 n+r, \ldots,(k-1) n+r $$ upon division by $k n$. This implies that at least $2(k-A)-k=k-2 A$ (possibly overlapping) pairs leave the same remainder upon division by $k n$. Since $k-2 A>2021$ and all of the $2(k-A)$ integers are positive, we find more than 2021 pairs $a, b$ with $a<b \leq k n$ for which $|P(b)|-|P(a)|$ is divisible by $k n$-hence, $P_{k n}>2021$, a contradiction. Next, we show that $P$ is linear. Assume that this is not the case, i.e., $\operatorname{deg} P \geq 2$. Then we can find a positive integer $k$ such that $P(k)-P(1) \geq k$. This means that among the integers $P(1), P(2), \ldots, P(P(k)-P(1))$, two of them, namely $P(k)$ and $P(1)$, leave the same remainder upon division by $P(k)-P(1)$ - contradicting the lemma (by taking $n=P(k)-P(1)$ ). Hence, $P$ must be linear. We can now write $P(x)=c x+d$ with $c>0$. We prove that $c=1$ by two ways.
{ "problem_match": "\nProblem 2.", "resource_path": "APMO/segmented/en-apmo2021_sol.jsonl", "solution_match": "\nSolution " }
92
737
2021
T1
3
null
APMO
Let $A B C D$ be a cyclic convex quadrilateral and $\Gamma$ be its circumcircle. Let $E$ be the intersection of the diagonals $A C$ and $B D$, let $L$ be the center of the circle tangent to sides $A B, B C$, and $C D$, and let $M$ be the midpoint of the arc $B C$ of $\Gamma$ not containing $A$ and $D$. Prove that the excenter of triangle $B C E$ opposite $E$ lies on the line $L M$.
Let $L$ be the intersection of the bisectors of $\angle A B C$ and $\angle B C D$. Let $N$ be the $E$-excenter of $\triangle B C E$. Let $\angle B A C=\angle B D C=\alpha, \angle D B C=\beta$ and $\angle A C B=\gamma$. We have the following: $$ \begin{array}{r} \angle C B L=\frac{1}{2} \angle A B C=90^{\circ}-\frac{1}{2} \alpha-\frac{1}{2} \gamma \text { and } \angle B C L=90^{\circ}-\frac{1}{2} \alpha-\frac{1}{2} \beta, \\ \angle C B N=90^{\circ}-\frac{1}{2} \beta \text { and } \angle B C N=90^{\circ}-\frac{1}{2} \gamma, \\ \angle M B L=\angle M B C+\angle C B L=90^{\circ}-\frac{1}{2} \gamma \text { and } \angle M C L=90^{\circ}-\frac{1}{2} \beta, \\ \angle L C N=\angle L B N=180^{\circ}-\frac{1}{2}(\alpha+\beta+\gamma) . \end{array} $$ Applying the sine rule to $\triangle M B L$ and $\triangle M C L$ we obtain $$ \frac{M B}{M L}=\frac{M C}{M L}=\frac{\sin \angle B L M}{\sin \angle M B L}=\frac{\sin \angle C L M}{\sin \angle M C L} $$ It follows that $$ \frac{\sin \angle B L M}{\sin \angle C L M}=\frac{\sin \angle M B L}{\sin \angle M C L}=\frac{\cos (\gamma / 2)}{\cos (\beta / 2)} $$ Now $$ \frac{\sin \angle B L M}{\sin \angle M L C} \cdot \frac{\sin \angle L C N}{\sin \angle N C B} \cdot \frac{\sin \angle N B C}{\sin \angle N B L}=\frac{\cos (\gamma / 2)}{\cos (\beta / 2)} \cdot \frac{\sin \left(90^{\circ}-\frac{1}{2} \beta\right)}{\sin \left(90^{\circ}-\frac{1}{2} \gamma\right)}=1 $$ Hence $L M, B N, C N$ are concurrent and therefore $L, M, N$ are collinear. ## Alternative proof We proceed similarly as above until the equation (1). We use the following lemma. Lemma: If $\pi>\alpha, \beta, \gamma, \delta>0, \alpha+\beta=\gamma+\delta<\pi$, and $\frac{\sin \alpha}{\sin \beta}=\frac{\sin \gamma}{\sin \delta}$, then $\alpha=\gamma$ and $\beta=\delta$. Proof of Lemma: Let $\theta=\alpha+\beta=\gamma+\delta$. Then $\frac{\sin (\theta-\beta)}{\sin \beta}=\frac{\sin (\theta-\delta)}{\sin \delta}$. $$ \begin{gathered} \Longleftrightarrow \sin (\theta-\beta) \sin \delta=\sin (\theta-\delta) \sin \beta \\ \Longleftrightarrow(\sin \theta \cos \beta-\sin \beta \cos \theta) \sin \delta=(\sin \theta \cos \delta-\sin \delta \cos \theta) \sin \beta \\ \Longleftrightarrow \sin \theta \cos \beta \sin \delta=\sin \theta \cos \delta \sin \beta \\ \Longleftrightarrow \sin \theta \sin (\beta-\delta)=0 \end{gathered} $$ Since $0<\theta<\pi$, then $\sin \theta \neq 0$. Therefore, $\sin (\beta-\delta)=0$, and we must have $\beta=\delta$. Applying the sine rule to $\triangle N B L$ and $\triangle N C L$ we obtain $$ \begin{aligned} & \frac{N B}{N L}=\frac{\sin \angle B L N}{\sin \angle L B N} \\ & \frac{N C}{N L}=\frac{\sin \angle C L N}{\sin \angle L C N} \end{aligned} $$ Since $\angle L B N=\angle L C N$, it follows that $$ \frac{\sin \angle B L N}{\sin \angle C L N}=\frac{N B}{N C}=\frac{\sin \angle B C N}{\sin \angle C B N}=\frac{\cos (\gamma / 2)}{\cos (\beta / 2)}=\frac{\sin \angle B L M}{\sin \angle C L M} $$ By the lemma, it is concluded that $\angle B L M=\angle B L N$ and $\angle C L M=\angle C L N$. Therefore, $L, M, N$ are collinear.
{ "problem_match": "\nProblem 3.", "resource_path": "APMO/segmented/en-apmo2021_sol.jsonl", "solution_match": "# Solution 1" }
120
1,171
2021
T1
4
null
APMO
Given a $32 \times 32$ table, we put a mouse (facing up) at the bottom left cell and a piece of cheese at several other cells. The mouse then starts moving. It moves forward except that when it reaches a piece of cheese, it eats a part of it, turns right, and continues moving forward. We say that a subset of cells containing cheese is good if, during this process, the mouse tastes each piece of cheese exactly once and then falls off the table. Show that: (a) No good subset consists of 888 cells. (b) There exists a good subset consisting of at least 666 cells.
(a) For the sake of contradiction, assume a good subset consisting of 888 cells exists. We call those cheese-cells and the other ones gap-cells. Observe that since each cheese-cell is visited once, each gap-cell is visited at most twice (once vertically and once horizontally). Define a finite sequence $s$ whose $i$-th element is $C$ if the $i$-th step of the mouse was onto a cheese-cell, and $G$ if it was onto a gap-cell. By assumption, $s$ contains $888 C$ 's. Note that $s$ does not contain a contiguous block of 4 (or more) $C$ 's. Hence $s$ contains at least $888 / 3=296$ such $C$-blocks and thus at least $295 G^{\prime}$ 's. But since each gap-cell is traversed at most twice, this implies there are at least $\lceil 295 / 2\rceil=148$ gap-cells, for a total of $888+148=1036>32^{2}$ cells, a contradiction. (b) Let $L_{i}, X_{i}$ be two $2^{i} \times 2^{i}$ tiles that allow the mouse to "turn left" and "cross", respectively. In detail, the "turn left" tiles allow the mouse to enter at its bottom left cell facing up and to leave at its bottom left cell facing left. The "cross" tiles allow the mouse to enter at its top right facing down and leave at its bottom left facing left, while also to enter at its bottom left facing up and leave at its top right facing right. (a) Basic tiles (b) Inductive construction (c) $16 \times 16$ Note that given two $2^{i} \times 2^{i}$ tiles $L_{i}, X_{i}$ we can construct larger $2^{i+1} \times 2^{i+1}$ tiles $L_{i+1}, X_{i+1}$ inductively as shown on in (b). The construction works because the path intersects itself (or the other path) only inside the smaller $X$-tiles where it works by induction. For a tile $T$, let $|T|$ be the number of pieces of cheese in it. By straightforward induction, $\left|L_{i}\right|=\left|X_{i}\right|+1$ and $\left|L_{i+1}\right|=4 \cdot\left|L_{i}\right|-1$. From the initial condition $\left|L_{1}\right|=3$. We now easily compute $\left|L_{2}\right|=11,\left|L_{3}\right|=43,\left|L_{4}\right|=171$, and $\left|L_{5}\right|=683$. Hence we get the desired subset. ## Another proof of (a). Let $X_{N}$ be the largest possible density of cheese-cells in a good subset on an $N \times N$ table. We will show that $X_{N} \leq 4 / 5+o(1)$. Specifically, this gives $X_{32} \leq 817 / 1024$. We look at the (discrete analogue) of the winding number of the trajectory of the mouse. Since the mouse enters and leaves the table, for every 4 right turns in its trajectory there has to be a self-crossing. But each self-crossing requires a different empty square, hence $X_{N} \leq 4 / 5$.
{ "problem_match": "\nProblem 4.", "resource_path": "APMO/segmented/en-apmo2021_sol.jsonl", "solution_match": "# Solution." }
137
798
2021
T1
5
null
APMO
Determine all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that $f(f(a)-b)+b f(2 a)$ is a perfect square for all integers $a$ and $b$.
. There are two families of functions which satisfy the condition: (1) $f(n)= \begin{cases}0 & \text { if } n \text { is even, and } \\ \text { any perfect square } & \text { if } n \text { is odd }\end{cases}$ (2) $f(n)=n^{2}$, for every integer $n$. It is straightforward to verify that the two families of functions are indeed solutions. Now, suppose that f is any function which satisfies the condition that $f(f(a)-b)+b f(2 a)$ is a perfect square for every pair $(a, b)$ of integers. We denote this condition by $\left(^{*}\right)$. We will show that $f$ must belong to either Family (1) or Family (2). Claim 1. $f(0)=0$ and $f(n)$ is a perfect square for every integer $n$. Proof. Plugging $(a, b) \rightarrow(0, f(0))$ in $\left(^{*}\right)$ shows that $f(0)(f(0)+1)=z^{2}$ for some integer $z$. Thus, $(2 f(0)+1-2 z)(2 f(0)+1+2 z)=1$. Therefore, $f(0)$ is either -1 or 0. Suppose, for sake of contradiction, that $f(0)=-1$. For any integer $a$, plugging $(a, b) \rightarrow(a, f(a))$ implies that $f(a) f(2 a)-1$ is a square. Thus, for each $a \in \mathbb{Z}$, there exists $x \in \mathbb{Z}$ such that $f(a) f(2 a)=x^{2}+1$ This implies that any prime divisor of $f(a)$ is either 2 or is congruent to $1(\bmod 4)$, and that $4 \nmid f(a)$, for every $a \in \mathbb{Z}$. Plugging $(a, b) \rightarrow(0,3)$ in $\left(^{*}\right)$ shows that $f(-4)-3$ is a square. Thus, there is $y \in \mathbb{Z}$ such that $f(-4)=y^{2}+3$. Since $4 \nmid f(-4)$, we note that $f(-4)$ is a positive integer congruent to $3(\bmod 4)$, but any prime dividing $f(-4)$ is either 2 or is congruent to $1(\bmod 4)$. This gives a contradiction. Therefore, $f(0)$ must be 0 . For every integer $n$, plugging $(a, b) \rightarrow(0,-n)$ in $\left(^{*}\right)$ shows that $f(n)$ is a square. Replacing $b$ with $f(a)-b$, we find that for all integers $a$ and $b$, $$ f(b)+(f(a)-b) f(2 a) \text { is a square. } $$ Now, let $S$ be the set of all integers $n$ such that $f(n)=0$. We have two cases: - Case 1: $S$ is unbounded from above. We claim that $f(2 n)=0$ for any integer $n$. Fix some integer $n$, and let $k \in S$ with $k>f(n)$. Then, plugging $(a, b) \mapsto(n, k)$ in $\left({ }^{* *}\right)$ gives us that $f(k)+(f(n)-k) f(2 n)=(f(n)-k) f(2 n)$ is a square. But $f(n)-k<0$ and $f(2 n)$ is a square by Claim 1. This is possible only if $f(2 n)=0$. In summary, $f(n)=0$ whenever $n$ is even and Claim 1 shows that $f(n)$ is a square whenever $n$ is odd. - Case 2: $S$ is bounded from above. Let $T$ be the set of all integers $n$ such that $f(n)=n^{2}$. We show that $T$ is unbounded from above. In fact, we show that $\frac{p+1}{2} \in T$ for all primes $p$ big enough. Fix a prime number $p$ big enough, and let $n=\frac{p+1}{2}$. Plugging $(a, b) \mapsto(n, 2 n)$ in ( $\left.{ }^{* *}\right)$ shows us that $f(2 n)(f(n)-2 n+1)$ is a square for any integer $n$. For $p$ big enough, we have $2 n \notin S$, so $f(2 n)$ is a non-zero square. As a result, when $p$ is big enough, $f(n)$ and $f(n)-2 n+1=f(n)-p$ are both squares. Writing $f(n)=k^{2}$ and $f(n)-p=m^{2}$ for some $k, m \geq 0$, we have $$ (k+m)(k-m)=k^{2}-m^{2}=p \Longrightarrow k+m=p, k-m=1 \Longrightarrow k=n, m=n-1 $$ Thus, $f(n)=k^{2}=n^{2}$, giving us $n=\frac{p+1}{2} \in T$. Next, for all $k \in T$ and $n \in \mathbb{Z}$, plugging $(a, b) \mapsto(n, k)$ in $(* *)$ shows us that $k^{2}+(f(n)-k) f(2 n)$ is a square. But that means $(2 k-f(2 n))^{2}-\left(f(2 n)^{2}-4 f(n) f(2 n)\right)=4\left(k^{2}+(f(n)-k) f(2 n)\right)$ is also a square. When $k$ is large enough, we have $\left|f(2 n)^{2}-4 f(n) f(2 n)\right|+1<|2 k-f(2 n)|$. As a result, we must have $f(2 n)^{2}=4 f(n) f(2 n)$ and thus $f(2 n) \in\{0,4 f(n)\}$ for all integers $n$. Finally, we prove that $f(n)=n^{2}$ for all integers $n$. Fix $n$, and take $k \in T$ big enough such that $2 k \notin S$. Then, we have $f(k)=k^{2}$ and $f(2 k)=4 f(k)=4 k^{2}$. Plugging $(a, b) \mapsto(k, n)$ to $(* *)$ shows us that $f(n)+\left(k^{2}-n\right) 4 k^{2}=\left(2 k^{2}-n\right)^{2}+\left(f(n)-n^{2}\right)$ is a square. Since $T$ is unbounded from above, we can take $k \in T$ such that $2 k \notin S$ and also $\left|2 k^{2}-n\right|>\left|f(n)-n^{2}\right|$. This forces $f(n)=n^{2}$, giving us the second family of solution. ## Another approach of Case 1. Claim 2. One of the following is true. (i) For every integer $n, f(2 n)=0$. (ii) There exists an integer $K>0$ such that for every integer $n \geq K, f(n)>0$. Proof. Suppose that there exists an integer $\alpha \neq 0$ such that $f(2 \alpha)>0$. We claim that for every integer $n \geq f(\alpha)+1$, we have $f(n)>0$. For every $n \geq f(\alpha)+1$, plugging $(a, b) \rightarrow(\alpha, f(\alpha)-n)$ in $\left(^{*}\right)$ shows that $f(n)+(f(\alpha)-n) f(2 \alpha)$ is a square, and in particular, is non-negative. Hence, $f(n) \geq(n-f(\alpha)) f(2 \alpha)>0$, as desired. If $f$ belongs to Case (i), Claim 1 shows that $f$ belongs to Family (1). If $f$ belongs to Case (ii), then $S$ is bounded from above. From Case 2 we get $f(n)=n^{2}$.
{ "problem_match": "\nProblem 5.", "resource_path": "APMO/segmented/en-apmo2021_sol.jsonl", "solution_match": "# Solution 1" }
50
1,913
2022
T1
1
null
APMO
Find all pairs $(a, b)$ of positive integers such that $a^{3}$ is a multiple of $b^{2}$ and $b-1$ is a multiple of $a-1$. Note: An integer $n$ is said to be a multiple of an integer $m$ if there is an integer $k$ such that $n=k m$.
.2 We will start by showing that there are positive integers $x, c, d$ such that $a=x^{2} c d$ and $b=x^{3} c$. Let $g=\operatorname{gcd}(a, b)$ so that $a=g d$ and $b=g x$ for some coprime $d$ and $x$. Then, $b^{2} \mid a^{3}$ is equivalent to $g^{2} x^{2} \mid g^{3} d^{3}$, which is equivalent to $x^{2} \mid g d^{3}$. Since $x$ and $d$ are coprime, this implies $x^{2} \mid g$. Hence, $g=x^{2} c$ for some $c$, giving $a=x^{2} c d$ and $b=x^{3} c$ as required. Now, it remains to find all positive integers $x, c, d$ satisfying $$ x^{2} c d-1 \mid x^{3} c-1 $$ That is, $x^{3} c \equiv 1\left(\bmod x^{2} c d-1\right)$. Assuming that this congruence holds, it follows that $d \equiv x^{3} c d \equiv x$ $\left(\bmod x^{2} c d-1\right)$. Then, either $x=d$ or $x-d \geq x^{2} c d-1$ or $d-x \geq x^{2} c d-1$. - If $x=d$ then $b=a$. - If $x-d \geq x^{2} c d-1$, then $x-d \geq x^{2} c d-1 \geq x-1 \geq x-d$. Hence, each of these inequalities must in fact be an equality. This implies that $x=c=d=1$, which implies that $a=b=1$. - If $d-x \geq x^{2} c d-1$, then $d-x \geq x^{2} c d-1 \geq d-1 \geq d-x$. Hence, each of these inequalities must in fact be an equality. This implies that $x=c=1$, which implies that $b=1$. Hence the only solutions are the pairs $(a, b)$ such that $a=b$ or $b=1$. These pairs can be checked to satisfy the given conditions.
{ "problem_match": "\nProblem 1.", "resource_path": "APMO/segmented/en-apmo2022_sol.jsonl", "solution_match": "# Solution 1" }
76
544
2022
T1
3
null
APMO
Find all positive integers $k<202$ for which there exists a positive integer $n$ such that $$ \left\{\frac{n}{202}\right\}+\left\{\frac{2 n}{202}\right\}+\cdots+\left\{\frac{k n}{202}\right\}=\frac{k}{2} $$ where $\{x\}$ denote the fractional part of $x$. Note: $\{x\}$ denotes the real number $k$ with $0 \leq k<1$ such that $x-k$ is an integer.
Denote the equation in the problem statement as $\left(^{*}\right)$, and note that it is equivalent to the condition that the average of the remainders when dividing $n, 2 n, \ldots, k n$ by 202 is 101 . Since $\left\{\frac{i n}{202}\right\}$ is invariant in each residue class modulo 202 for each $1 \leq i \leq k$, it suffices to consider $0 \leq n<202$. If $n=0$, so is $\left\{\frac{i n}{202}\right\}$, meaning that $(*)$ does not hold for any $k$. If $n=101$, then it can be checked that $\left(^{*}\right)$ is satisfied if and only if $k=1$. From now on, we will assume that $101 \nmid n$. For each $1 \leq i \leq k$, let $a_{i}=\left\lfloor\frac{i n}{202}\right\rfloor=\frac{i n}{202}-\left\{\frac{i n}{202}\right\}$. Rewriting $\left(^{*}\right)$ and multiplying the equation by 202, we find that $$ n(1+2+\ldots+k)-202\left(a_{1}+a_{2}+\ldots+a_{k}\right)=101 k $$ Equivalently, letting $z=a_{1}+a_{2}+\ldots+a_{k}$, $$ n k(k+1)-404 z=202 k $$ Since $n$ is not divisible by 101 , which is prime, it follows that $101 \mid k(k+1)$. In particular, $101 \mid k$ or $101 \mid k+1$. This means that $k \in\{100,101,201\}$. We claim that all these values of $k$ work. - If $k=201$, we may choose $n=1$. The remainders when dividing $n, 2 n, \ldots, k n$ by 202 are 1,2 , ..., 201, which have an average of 101 . - If $k=100$, we may choose $n=2$. The remainders when dividing $n, 2 n, \ldots, k n$ by 202 are 2,4 , ..., 200, which have an average of 101. - If $k=101$, we may choose $n=51$. To see this, note that the first four remainders are $51,102,153$, 2 , which have an average of 77 . The next four remainders $(53,104,155,4)$ are shifted upwards from the first four remainders by 2 each, and so on, until the 25 th set of the remainders ( 99 , $150,201,50)$ which have an average of 125 . Hence, the first 100 remainders have an average of $\frac{77+125}{2}=101$. The 101th remainder is also 101 , meaning that the average of all 101 remainders is 101 . In conclusion, all values $k \in\{1,100,101,201\}$ satisfy the initial condition.
{ "problem_match": "\nProblem 3.", "resource_path": "APMO/segmented/en-apmo2022_sol.jsonl", "solution_match": "# Solution\n\n" }
131
812
2022
T1
4
null
APMO
Let $n$ and $k$ be positive integers. Cathy is playing the following game. There are $n$ marbles and $k$ boxes, with the marbles labelled 1 to $n$. Initially, all marbles are placed inside one box. Each turn, Cathy chooses a box and then moves the marbles with the smallest label, say $i$, to either any empty box or the box containing marble $i+1$. Cathy wins if at any point there is a box containing only marble $n$. Determine all pairs of integers $(n, k)$ such that Cathy can win this game.
We claim Cathy can win if and only if $n \leq 2^{k-1}$. First, note that each non-empty box always contains a consecutive sequence of labeled marbles. This is true since Cathy is always either removing from or placing in the lowest marble in a box. As a consequence, every move made is reversible. Next, we prove by induction that Cathy can win if $n=2^{k-1}$. The base case of $n=k=1$ is trivial. Assume a victory can be obtained for $m$ boxes and $2^{m-1}$ marbles. Consider the case of $m+1$ boxes and $2^{m}$ marbles. Cathy can first perform a sequence of moves so that only marbles $2^{m-1}, \ldots, 2^{m}$ are left in the starting box, while keeping one box, say $B$, empty. Now move the marble $2^{m-1}$ to box $B$, then reverse all of the initial moves while treating $B$ as the starting box. At the end of that, we will have marbles $2^{m-1}+1, \ldots, 2^{m}$ in the starting box, marbles $1,2, \ldots, 2^{m-1}$ in box $B$, and $m-1$ empty boxes. By repeating the original sequence of moves on marbles $2^{m-1}+1, \ldots, 2^{m}$, using the $m$ boxes that are not box $B$, we can reach a state where only marble $2^{m}$ remains in the starting box. Therefore a victory is possible if $n=2^{k-1}$ or smaller. We now prove by induction that Cathy loses if $n=2^{k-1}+1$. The base case of $n=2$ and $k=1$ is trivial. Assume a victory is impossible for $m$ boxes and $2^{m-1}+1$ marbles. For the sake of contradiction, suppose that victory is possible for $m+1$ boxes and $2^{m}+1$ marbles. In a winning sequence of moves, consider the last time a marble $2^{m-1}+1$ leaves the starting box, call this move $X$. After $X$, there cannot be a time when marbles $1, \ldots, 2^{m-1}+1$ are all in the same box. Otherwise, by reversing these moves after $X$ and deleting marbles greater than $2^{m-1}+1$, it gives us a winning sequence of moves for $2^{m-1}+1$ marbles and $m$ boxes (as the original starting box is not used here), contradicting the inductive hypothesis. Hence starting from $X$, marbles 1 will never be in the same box as any marbles greater than or equal to $2^{m-1}+1$. Now delete marbles $2, \ldots, 2^{m-1}$ and consider the winning moves starting from $X$. Marble 1 would only move from one empty box to another, while blocking other marbles from entering its box. Thus we effectively have a sequence of moves for $2^{m-1}+1$ marbles, while only able to use $m$ boxes. This again contradicts the inductive hypothesis. Therefore, a victory is not possible if $n=2^{k-1}+1$ or greater.
{ "problem_match": "\nProblem 4.", "resource_path": "APMO/segmented/en-apmo2022_sol.jsonl", "solution_match": "# Solution\n\n" }
127
758
2022
T1
5
null
APMO
Let $a, b, c, d$ be real numbers such that $a^{2}+b^{2}+c^{2}+d^{2}=1$. Determine the minimum value of $(a-b)(b-c)(c-d)(d-a)$ and determine all values of $(a, b, c, d)$ such that the minimum value is achieved.
.1 Since the expression is cyclic, we could WLOG $a=\max \{a, b, c, d\}$. Let $$ S(a, b, c, d)=(a-b)(b-c)(c-d)(d-a) $$ Note that we have given $(a, b, c, d)$ such that $S(a, b, c, d)=-\frac{1}{8}$. Therefore, to prove that $S(a, b, c, d) \geq$ $-\frac{1}{8}$, we just need to consider the case where $S(a, b, c, d)<0$. - Exactly 1 of $a-b, b-c, c-d, d-a$ is negative. Since $a=\max \{a, b, c, d\}$, then we must have $d-a<0$. This forces $a>b>c>d$. Now, let us write $$ S(a, b, c, d)=-(a-b)(b-c)(c-d)(a-d) $$ Write $a-b=y, b-c=x, c-d=w$ for some positive reals $w, x, y>0$. Plugging to the original condition, we have $$ (d+w+x+y)^{2}+(d+w+x)^{2}+(d+w)^{2}+d^{2}-1=0(*) $$ and we want to prove that $w x y(w+x+y) \leq \frac{1}{8}$. Consider the expression $(*)$ as a quadratic in $d$ : $$ 4 d^{2}+d(6 w+4 x+2 y)+\left((w+x+y)^{2}+(w+x)^{2}+w^{2}-1\right)=0 $$ Since $d$ is a real number, then the discriminant of the given equation has to be non-negative, i.e. we must have $$ \begin{aligned} 4 & \geq 4\left((w+x+y)^{2}+(w+x)^{2}+w^{2}\right)-(3 w+2 x+y)^{2} \\ & =\left(3 w^{2}+2 w y+3 y^{2}\right)+4 x(w+x+y) \\ & \geq 8 w y+4 x(w+x+y) \\ & =4(x(w+x+y)+2 w y) \end{aligned} $$ However, AM-GM gives us $$ w x y(w+x+y) \leq \frac{1}{2}\left(\frac{x(w+x+y)+2 w y}{2}\right)^{2} \leq \frac{1}{8} $$ This proves $S(a, b, c, d) \geq-\frac{1}{8}$ for any $a, b, c, d \in \mathbb{R}$ such that $a>b>c>d$. Equality holds if and only if $w=y, x(w+x+y)=2 w y$ and $w x y(w+x+y)=\frac{1}{8}$. Solving these equations gives us $w^{4}=\frac{1}{16}$ which forces $w=\frac{1}{2}$ since $w>0$. Solving for $x$ gives us $x(x+1)=\frac{1}{2}$, and we will get $x=-\frac{1}{2}+\frac{\sqrt{3}}{2}$ as $x>0$. Plugging back gives us $d=-\frac{1}{4}-\frac{\sqrt{3}}{4}$, and this gives us $$ (a, b, c, d)=\left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}\right) $$ Thus, any cyclic permutation of the above solution will achieve the minimum equality. - Exactly 3 of $a-b, b-c, c-d, d-a$ are negative Since $a=\max \{a, b, c, d\}$, then $a-b$ has to be positive. So we must have $b<c<d<a$. Now, note that $$ \begin{aligned} S(a, b, c, d) & =(a-b)(b-c)(c-d)(d-a) \\ & =(a-d)(d-c)(c-b)(b-a) \\ & =S(a, d, c, b) \end{aligned} $$ Now, note that $a>d>c>b$. By the previous case, $S(a, d, c, b) \geq-\frac{1}{8}$, which implies that $$ S(a, b, c, d)=S(a, d, c, b) \geq-\frac{1}{8} $$ as well. Equality holds if and only if $$ (a, b, c, d)=\left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}\right) $$ and its cyclic permutation.
{ "problem_match": "\nProblem 5.", "resource_path": "APMO/segmented/en-apmo2022_sol.jsonl", "solution_match": "# Solution 5" }
77
1,191
2022
T1
5
null
APMO
Let $a, b, c, d$ be real numbers such that $a^{2}+b^{2}+c^{2}+d^{2}=1$. Determine the minimum value of $(a-b)(b-c)(c-d)(d-a)$ and determine all values of $(a, b, c, d)$ such that the minimum value is achieved.
.2 The minimum value is $-\frac{1}{8}$. There are eight equality cases in total. The first one is $$ \left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}\right) . $$ Cyclic shifting all the entries give three more quadruples. Moreover, flipping the sign $((a, b, c, d) \rightarrow$ $(-a,-b,-c,-d)$ ) all four entries in each of the four quadruples give four more equality cases. We then begin the proof by the following optimization: Claim 1. In order to get the minimum value, we must have $a+b+c+d=0$. Proof. Assume not, let $\delta=\frac{a+b+c+d}{4}$ and note that $$ (a-\delta)^{2}+(b-\delta)^{2}+(c-\delta)^{2}+(d-\delta)^{2}<a^{2}+b^{2}+c^{2}+d^{2} $$ so by shifting by $\delta$ and scaling, we get an even smaller value of $(a-b)(b-c)(c-d)(d-a)$. The key idea is to substitute the variables $$ \begin{aligned} & x=a c+b d \\ & y=a b+c d \\ & z=a d+b c \end{aligned} $$ so that the original expression is just $(x-y)(x-z)$. We also have the conditions $x, y, z \geq-0.5$ because of: $$ 2 x+\left(a^{2}+b^{2}+c^{2}+d^{2}\right)=(a+c)^{2}+(b+d)^{2} \geq 0 $$ Moreover, notice that $$ 0=(a+b+c+d)^{2}=a^{2}+b^{2}+c^{2}+d^{2}+2(x+y+z) \Longrightarrow x+y+z=\frac{-1}{2} $$ Now, we reduce to the following optimization problem. Claim 2. Let $x, y, z \geq-0.5$ such that $x+y+z=-0.5$. Then, the minimum value of $$ (x-y)(x-z) $$ is $-1 / 8$. Moreover, the equality case occurs when $x=-1 / 4$ and $\{y, z\}=\{1 / 4,-1 / 2\}$. Proof. We notice that $$ \begin{aligned} (x-y)(x-z)+\frac{1}{8} & =\left(2 y+z+\frac{1}{2}\right)\left(2 z+y+\frac{1}{2}\right)+\frac{1}{8} \\ & =\frac{1}{8}(4 y+4 z+1)^{2}+\left(y+\frac{1}{2}\right)\left(z+\frac{1}{2}\right) \geq 0 \end{aligned} $$ The last inequality is true since both $y+\frac{1}{2}$ and $z+\frac{1}{2}$ are not less than zero. The equality in the last inequality is attained when either $y+\frac{1}{2}=0$ or $z+\frac{1}{2}=0$, and $4 y+4 z+1=0$. This system of equations give $(y, z)=(1 / 4,-1 / 2)$ or $(y, z)=(-1 / 2,1 / 4)$ as the desired equality cases. Note: We can also prove (the weakened) Claim 2 by using Lagrange Multiplier, as follows. We first prove that, in fact, $x, y, z \in[-0.5,0.5]$. This can be proved by considering that $$ -2 x+\left(a^{2}+b^{2}+c^{2}+d^{2}\right)=(a-c)^{2}+(b-d)^{2} \geq 0 $$ We will prove the Claim 2, only that in this case, $x, y, z \in[-0.5,0.5]$. This is already sufficient to prove the original question. We already have the bounded domain $[-0.5,0.5]^{3}$, so the global minimum must occur somewhere. Thus, it suffices to consider two cases: - If the global minimum lies on the boundary of $[-0.5,0.5]^{3}$. Then, one of $x, y, z$ must be -0.5 or 0.5 . By symmetry between $y$ and $z$, we split to a few more cases. - If $x=0.5$, then $y=z=-0.5$, so $(x-y)(x-z)=1$, not the minimum. - If $x=-0.5$, then both $y$ and $z$ must be greater or equal to $x$, so $(x-y)(x-z) \geq 0$, not the minimum. - If $y=0.5$, then $x=z=-0.5$, so $(x-y)(x-z)=0$, not the minimum. - If $y=-0.5$, then $z=-x$, so $$ (x-y)(x-z)=2 x(x+0.5) $$ which obtain the minimum at $x=-1 / 4$. This gives the desired equality case. - If the global minimum lies in the interior $(-0.5,0.5)^{3}$, then we apply Lagrange multiplier: $$ \begin{aligned} & \frac{\partial}{\partial x}(x-y)(x-z)=\lambda \frac{\partial}{\partial x}(x+y+z) \\ & \frac{\partial}{\partial y}(x-y)(x-z)=\lambda \frac{\partial}{\partial y}(x+y+z) \\ & \frac{\partial}{\partial z}(x-y)(x-z) \Longrightarrow z-x=\lambda \frac{\partial}{\partial z}(x+y+z) \\ & \Longrightarrow y-x=\lambda . \end{aligned} $$ Adding the last two equations gives $\lambda=0$, or $x=y=z$. This gives $(x-y)(x-z)=0$, not the minimum. Having exhausted all cases, we are done.
{ "problem_match": "\nProblem 5.", "resource_path": "APMO/segmented/en-apmo2022_sol.jsonl", "solution_match": "# Solution 5" }
77
1,440
2023
T1
1
null
APMO
Let $n \geq 5$ be an integer. Consider $n$ squares with side lengths $1,2, \ldots, n$, respectively. The squares are arranged in the plane with their sides parallel to the $x$ and $y$ axes. Suppose that no two squares touch, except possibly at their vertices. Show that it is possible to arrange these squares in a way such that every square touches exactly two other squares.
Set aside the squares with sidelengths $n-3, n-2, n-1$, and $n$ and suppose we can split the remaining squares into two sets $A$ and $B$ such that the sum of the sidelengths of the squares in $A$ is 1 or 2 units larger than the sum of the sidelengths of the squares in $B$. String the squares of each set $A, B$ along two parallel diagonals, one for each diagonal. Now use the four largest squares along two perpendicular diagonals to finish the construction: one will have sidelengths $n$ and $n-3$, and the other, sidelengths $n-1$ and $n-2$. If the sum of the sidelengths of the squares in $A$ is 1 unit larger than the sum of the sidelengths of the squares in $B$, attach the squares with sidelengths $n-3$ and $n-1$ to the $A$-diagonal, and the other two squares to the $B$-diagonal. The resulting configuration, in which the $A$ and $B$-diagonals are represented by unit squares, and the sidelengths $a_{i}$ of squares from $A$ and $b_{j}$ of squares from $B$ are indicated within each square, follows: Since $\left(a_{1}+a_{2}+\cdots+a_{k}\right) \sqrt{2}+\frac{((n-3)+(n-2)) \sqrt{2}}{2}=\left(b_{1}+b_{2}+\cdots+b_{\ell}+2\right) \sqrt{2}+\frac{(n+(n-1)) \sqrt{2}}{2}$, this case is done. If the sum of the sidelengths of the squares in $A$ is 1 unit larger than the sum of the sidelengths of the squares in $B$, attach the squares with sidelengths $n-3$ and $n-2$ to the $A$-diagonal, and the other two squares to the $B$-diagonal. The resulting configuration follows: Since $\left(a_{1}+a_{2}+\cdots+a_{k}\right) \sqrt{2}+\frac{((n-3)+(n-1)) \sqrt{2}}{2}=\left(b_{1}+b_{2}+\cdots+b_{\ell}+1\right) \sqrt{2}+\frac{(n+(n-2)) \sqrt{2}}{2}$, this case is also done. In both cases, the distance between the $A$-diagonal and the $B$-diagonal is $\frac{((n-3)+n) \sqrt{2}}{2}=\frac{(2 n-3) \sqrt{2}}{2}$. Since $a_{i}, b_{j} \leq n-4, \frac{\left(a_{i}+b_{j}\right) \sqrt{2}}{2}<\frac{(2 n-4) \sqrt{2}}{2}<\frac{(2 n-3) \sqrt{2}}{2}$, and therefore the $A$ - and $B$-diagonals do not overlap. Finally, we prove that it is possible to split the squares of sidelengths 1 to $n-4$ into two sets $A$ and $B$ such that the sum of the sidelengths of the squares in $A$ is 1 or 2 units larger than the sum of the sidelengths of the squares in $B$. One can do that in several ways; we present two possibilities: - Direct construction: Split the numbers from 1 to $n-4$ into several sets of four consecutive numbers $\{t, t+1, t+2, t+3\}$, beginning with the largest numbers; put squares of sidelengths $t$ and $t+3$ in $A$ and squares of sidelengths $t+1$ and $t+2$ in $B$. Notice that $t+(t+3)=$ $(t+1)+(t+2)$. In the end, at most four numbers remain. - If only 1 remains, put the corresponding square in $A$, so the sum of the sidelengths of the squares in $A$ is one unit larger that those in $B$; - If 1 and 2 remains, put the square of sidelength 2 in $A$ and the square of sidelength 1 in $B$ (the difference is 1 ); - If 1,2 , and 3 remains, put the squares of sidelengths 1 and 3 in $A$, and the square of sidelength 2 in $B$ (the difference is 2 ); - If $1,2,3$, and 4 remains, put the squares of sidelengths 2 and 4 in $A$, and the squares of sidelengths 1 and 3 in $B$ (the difference is 2 ). - Indirect construction: Starting with $A$ and $B$ as empty sets, add the squares of sidelengths $n-4, n-3, \ldots, 2$ to either $A$ or $B$ in that order such that at each stage the difference between the sum of the sidelengths in $A$ and the sum of the sidelengths of B is minimized. By induction it is clear that after adding an integer $j$ to one of the sets, this difference is at most $j$. In particular, the difference is 0,1 or 2 at the end. Finally adding the final 1 to one of the sets can ensure that the final difference is 1 or 2 . If necessary, flip $A$ and $B$.
{ "problem_match": "# Problem 1", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution 1" }
91
1,266
2023
T1
2
null
APMO
Find all integers $n$ satisfying $n \geq 2$ and $\frac{\sigma(n)}{p(n)-1}=n$, in which $\sigma(n)$ denotes the sum of all positive divisors of $n$, and $p(n)$ denotes the largest prime divisor of $n$. Answer: $n=6$.
Let $n=p_{1}^{\alpha_{1}} \cdot \ldots \cdot p_{k}^{\alpha_{k}}$ be the prime factorization of $n$ with $p_{1}<\ldots<p_{k}$, so that $p(n)=p_{k}$ and $\sigma(n)=\left(1+p_{1}+\cdots+p_{1}^{\alpha_{1}}\right) \ldots\left(1+p_{k}+\cdots+p_{k}^{\alpha_{k}}\right)$. Hence $p_{k}-1=\frac{\sigma(n)}{n}=\prod_{i=1}^{k}\left(1+\frac{1}{p_{i}}+\cdots+\frac{1}{p_{i}^{\alpha_{i}}}\right)<\prod_{i=1}^{k} \frac{1}{1-\frac{1}{p_{i}}}=\prod_{i=1}^{k}\left(1+\frac{1}{p_{i}-1}\right) \leq \prod_{i=1}^{k}\left(1+\frac{1}{i}\right)=k+1$, that is, $p_{k}-1<k+1$, which is impossible for $k \geq 3$, because in this case $p_{k}-1 \geq 2 k-2 \geq k+1$. Then $k \leq 2$ and $p_{k}<k+2 \leq 4$, which implies $p_{k} \leq 3$. If $k=1$ then $n=p^{\alpha}$ and $\sigma(n)=1+p+\cdots+p^{\alpha}$, and in this case $n \nmid \sigma(n)$, which is not possible. Thus $k=2$, and $n=2^{\alpha} 3^{\beta}$ with $\alpha, \beta>0$. If $\alpha>1$ or $\beta>1$, $$ \frac{\sigma(n)}{n}>\left(1+\frac{1}{2}\right)\left(1+\frac{1}{3}\right)=2 . $$ Therefore $\alpha=\beta=1$ and the only answer is $n=6$. Comment: There are other ways to deal with the case $n=2^{\alpha} 3^{\beta}$. For instance, we have $2^{\alpha+2} 3^{\beta}=\left(2^{\alpha+1}-1\right)\left(3^{\beta+1}-1\right)$. Since $2^{\alpha+1}-1$ is not divisible by 2 , and $3^{\beta+1}-1$ is not divisible by 3 , we have $$ \left\{\begin{array} { l } { 2 ^ { \alpha + 1 } - 1 = 3 ^ { \beta } } \\ { 3 ^ { \beta + 1 } - 1 = 2 ^ { \alpha + 2 } } \end{array} \Longleftrightarrow \left\{\begin{array} { c } { 2 ^ { \alpha + 1 } - 1 = 3 ^ { \beta } } \\ { 3 \cdot ( 2 ^ { \alpha + 1 } - 1 ) - 1 = 2 \cdot 2 ^ { \alpha + 1 } } \end{array} \Longleftrightarrow \left\{\begin{array}{r} 2^{\alpha+1}=4 \\ 3^{\beta}=3 \end{array}\right.\right.\right. $$ and $n=2^{\alpha} 3^{\beta}=6$.
{ "problem_match": "# Problem 2", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution\n\n" }
70
823
2023
T1
3
null
APMO
Let $A B C D$ be a parallelogram. Let $W, X, Y$, and $Z$ be points on sides $A B, B C, C D$, and $D A$, respectively, such that the incenters of triangles $A W Z, B X W, C Y X$ and $D Z Y$ form a parallelogram. Prove that $W X Y Z$ is a parallelogram.
Let the four incenters be $I_{1}, I_{2}, I_{3}$, and $I_{4}$ with inradii $r_{1}, r_{2}, r_{3}$, and $r_{4}$ respectively (in the order given in the question). Without loss of generality, let $I_{1}$ be closer to $A B$ than $I_{2}$. Let the acute angle between $I_{1} I_{2}$ and $A B$ (and hence also the angle between $I_{3} I_{4}$ and $C D$ ) be $\theta$. Then $$ r_{2}-r_{1}=I_{1} I_{2} \sin \theta=I_{3} I_{4} \sin \theta=r_{4}-r_{3} $$ which implies $r_{1}+r_{4}=r_{2}+r_{3}$. Similar arguments show that $r_{1}+r_{2}=r_{3}+r_{4}$. Thus we obtain $r_{1}=r_{3}$ and $r_{2}=r_{4}$. Now let's consider the possible positions of $W, X, Y, Z$. Suppose $A Z \neq C X$. Without loss of generality assume $A Z>C X$. Since the incircles of $A W Z$ and $C Y X$ are symmetric about the centre of the parallelogram $A B C D$, this implies $C Y>A W$. Using similar arguments, we have $$ C Y>A W \Longrightarrow B W>D Y \Longrightarrow D Z>B X \Longrightarrow C X>A Z $$ which is a contradiction. Therefore $A Z=C X \Longrightarrow A W=C Y$ and $W X Y Z$ is a parallelogram. Comment: There are several ways to prove that $r_{1}=r_{3}$ and $r_{2}=r_{4}$. The proposer shows the following three alternative approaches: Using parallel lines: Let $O$ be the centre of parallelogram $A B C D$ and $P$ be the centre of parallelogram $I_{1} I_{2} I_{3} I_{4}$. Since $A I_{1}$ and $C I_{3}$ are angle bisectors, we must have $A I_{1} \| C I_{3}$. Let $\ell_{1}$ be the line through $O$ parallel to $A I_{1}$. Since $A O=O C, \ell_{1}$ is halfway between $A I_{1}$ and $C I_{3}$. Hence $P$ must lie on $\ell_{1}$. Similarly, $P$ must also lie on $\ell_{2}$, the line through $O$ parallel to $B I_{2}$. Thus $P$ is the intersection of $\ell_{1}$ and $\ell_{2}$, which must be $O$. So the four incentres and hence the four incircles must be symmetric about $O$, which implies $r_{1}=r_{3}$ and $r_{2}=r_{4}$. Using a rotation: Let the bisectors of $\angle D A B$ and $\angle A B C$ meet at $X$ and the bisectors of $\angle B C D$ and $\angle C D A$ meet at $Y$. Then $I_{1}$ is on $A X, I_{2}$ is on $B X, I_{3}$ is on $C Y$, and $I_{4}$ is on $D Y$. Let $O$ be the centre of $A B C D$. Then a 180 degree rotation about $O$ takes $\triangle A X B$ to $\triangle C Y D$. Under the same transformation $I_{1} I_{2}$ is mapped to a parallel segment $I_{1}^{\prime} I_{2}^{\prime}$ with $I_{1}^{\prime}$ on $C Y$ and $I_{2}^{\prime}$ on $D Y$. Since $I_{1} I_{2} I_{3} I_{4}$ is a parallelogram, $I_{3} I_{4}=I_{1} I_{2}$ and $I_{3} I_{4} \| I_{1} I_{2}$. Hence $I_{1}^{\prime} I_{2}^{\prime}$ and $I_{3} I_{4}$ are parallel, equal length segments on sides $C Y, D Y$ and we conclude that $I_{1}^{\prime}=I_{3}, I_{2}^{\prime}=I_{4}$. Hence the centre of $I_{1} I_{2} I_{3} I_{4}$ is also $O$ and we establish that by rotational symmetry that $r_{1}=r_{3}$ and $r_{2}=r_{4}$. Using congruent triangles: Let $A I_{1}$ and $B I_{2}$ intersect at $E$ and let $C I_{3}$ and $D I_{4}$ intersect at $F$. Note that $\triangle A B E$ and $\triangle C D F$ are congruent, since $A B=C D$ and corresponding pairs of angles are equal (equal opposite angles parallelogram $A B C D$ are each bisected). Since $A I_{1} \| C I_{3}$ and $I_{1} I_{2} \| I_{4} I_{3}, \angle I_{2} I_{1} E=\angle I_{4} I_{3} F$. Similarly $\angle I_{1} I_{2} E=\angle I_{3} I_{4} F$. Furthermore $I_{1} I_{2}=I_{3} I_{4}$. Hence triangles $I_{2} I_{1} E$ and $I 4 I_{3} F$ are also congruent. Hence $A B E I_{1} I_{2}$ and $D C F I_{3} I_{4}$ are congruent. Therefore, the perpendicular distance from $I_{1}$ to $A B$ equals the perpendicular distance from $I_{3}$ to $C D$, that is, $r_{1}=r_{3}$. Similarly $r_{2}=r_{4}$.
{ "problem_match": "# Problem 3", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution\n\n" }
93
1,372
2023
T1
4
null
APMO
Let $c>0$ be a given positive real and $\mathbb{R}_{>0}$ be the set of all positive reals. Find all functions $f: \mathbb{R}_{>0} \rightarrow \mathbb{R}_{>0}$ such that $$ f((c+1) x+f(y))=f(x+2 y)+2 c x \quad \text { for all } x, y \in \mathbb{R}_{>0} $$ Answer: $f(x)=2 x$ for all $x>0$.
We first prove that $f(x) \geq 2 x$ for all $x>0$. Suppose, for the sake of contradiction, that $f(y)<2 y$ for some positive $y$. Choose $x$ such that $f((c+1) x+f(y))$ and $f(x+2 y)$ cancel out, that is, $$ (c+1) x+f(y)=x+2 y \Longleftrightarrow x=\frac{2 y-f(y)}{c} $$ Notice that $x>0$ because $2 y-f(y)>0$. Then $2 c x=0$, which is not possible. This contradiction yields $f(y) \geq 2 y$ for all $y>0$. Now suppose, again for the sake of contradiction, that $f(y)>2 y$ for some $y>0$. Define the following sequence: $a_{0}$ is an arbitrary real greater than $2 y$, and $f\left(a_{n}\right)=f\left(a_{n-1}\right)+2 c x$, so that $$ \left\{\begin{array}{r} (c+1) x+f(y)=a_{n} \\ x+2 y=a_{n-1} \end{array} \Longleftrightarrow x=a_{n-1}-2 y \quad \text { and } \quad a_{n}=(c+1)\left(a_{n-1}-2 y\right)+f(y) .\right. $$ If $x=a_{n-1}-2 y>0$ then $a_{n}>f(y)>2 y$, so inductively all the substitutions make sense. For the sake of simplicity, let $b_{n}=a_{n}-2 y$, so $b_{n}=(c+1) b_{n-1}+f(y)-2 y \quad(*)$. Notice that $x=b_{n-1}$ in the former equation, so $f\left(a_{n}\right)=f\left(a_{n-1}\right)+2 c b_{n-1}$. Telescoping yields $$ f\left(a_{n}\right)=f\left(a_{0}\right)+2 c \sum_{i=0}^{n-1} b_{i} . $$ One can find $b_{n}$ from the recurrence equation $(*): b_{n}=\left(b_{0}+\frac{f(y)-2 y}{c}\right)(c+1)^{n}-\frac{f(y)-2 y}{c}$, and then $$ \begin{aligned} f\left(a_{n}\right) & =f\left(a_{0}\right)+2 c \sum_{i=0}^{n-1}\left(\left(b_{0}+\frac{f(y)-2 y}{c}\right)(c+1)^{i}-\frac{f(y)-2 y}{c}\right) \\ & =f\left(a_{0}\right)+2\left(b_{0}+\frac{f(y)-2 y}{c}\right)\left((c+1)^{n}-1\right)-2 n(f(y)-2 y) \end{aligned} $$ Since $f\left(a_{n}\right) \geq 2 a_{n}=2 b_{n}+4 y$, $$ \begin{aligned} & f\left(a_{0}\right)+2\left(b_{0}+\frac{f(y)-2 y}{c}\right)\left((c+1)^{n}-1\right)-2 n(f(y)-2 y) \geq 2 b_{n}+4 y \\ = & 2\left(b_{0}+\frac{f(y)-2 y}{c}\right)(c+1)^{n}-2 \frac{f(y)-2 y}{c} \end{aligned} $$ which implies $$ f\left(a_{0}\right)+2 \frac{f(y)-2 y}{c} \geq 2\left(b_{0}+\frac{f(y)-2 y}{c}\right)+2 n(f(y)-2 y) $$ which is not true for sufficiently large $n$. A contradiction is reached, and thus $f(y)=2 y$ for all $y>0$. It is immediate that this function satisfies the functional equation.
{ "problem_match": "# Problem 4", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution 1" }
121
951
2023
T1
5
null
APMO
There are $n$ line segments on the plane, no three intersecting at a point, and each pair intersecting once in their respective interiors. Tony and his $2 n-1$ friends each stand at a distinct endpoint of a line segment. Tony wishes to send Christmas presents to each of his friends as follows: First, he chooses an endpoint of each segment as a "sink". Then he places the present at the endpoint of the segment he is at. The present moves as follows: - If it is on a line segment, it moves towards the sink. - When it reaches an intersection of two segments, it changes the line segment it travels on and starts moving towards the new sink. If the present reaches an endpoint, the friend on that endpoint can receive their present. Prove Tony can send presents to exactly $n$ of his $2 n-1$ friends.
Draw a circle that encloses all the intersection points between line segments and extend all line segments until they meet the circle, and then move Tony and all his friends to the circle. Number the intersection points with the circle from 1 to $2 n$ anticlockwise, starting from Tony (Tony has number 1). We will prove that the friends eligible to receive presents are the ones on even-numbered intersection points. First part: at most $n$ friends can receive a present. The solution relies on a well-known result: the $n$ lines determine regions inside the circle; then it is possible to paint the regions with two colors such that no regions with a common (line) boundary have the same color. The proof is an induction on $n$ : the fact immediately holds for $n=0$, and the induction step consists on taking away one line $\ell$, painting the regions obtained with $n-1$ lines, drawing $\ell$ again and flipping all colors on exactly one half plane determined by $\ell$. Now consider the line starting on point 1. Color the regions in red and blue such that neighboring regions have different colors, and such that the two regions that have point 1 as a vertex are red on the right and blue on the left, from Tony's point of view. Finally, assign to each red region the clockwise direction and to each blue region the anticlockwise direction. Because of the coloring, every boundary will have two directions assigned, but the directions are the same since every boundary divides regions of different colors. Then the present will follow the directions assigned to the regions: it certainly does for both regions in the beginning, and when the present reaches an intersection it will keep bordering one of the two regions it was dividing. To finish this part of the problem, consider the regions that share a boundary with the circle. The directions alternate between outcoming and incoming, starting from 1 (outcoming), so all even-numbered vertices are directed as incoming and are the only ones able to receive presents. Second part: all even-numbered vertices can receive a present. First notice that, since every two chords intersect, every chord separates the endpoints of each of the other $n-1$ chords. Therefore, there are $n-1$ vertices on each side of every chord, and each chord connects vertices $k$ and $k+n, 1 \leq k \leq n$. We prove a stronger result by induction in $n$ : let $k$ be an integer, $1 \leq k \leq n$. Direct each chord from $i$ to $i+n$ if $1 \leq i \leq k$ and from $i+n$ to $i$ otherwise; in other words, the sinks are $k+1, k+2, \ldots, k+n$. Now suppose that each chord sends a present, starting from the vertex opposite to each sink, and all presents move with the same rules. Then $k-i$ sends a present to $k+i+1, i=0,1, \ldots, n-1$ (indices taken modulo $2 n$ ). In particular, for $i=k-1$, Tony, in vertex 1 , send a present to vertex $2 k$. Also, the $n$ paths the presents make do not cross (but they may touch.) More formally, for all $i, 1 \leq i \leq n$, if one path takes a present from $k-i$ to $k+i+1$, separating the circle into two regions, all paths taking a present from $k-j$ to $k+j+1, j<i$, are completely contained in one region, and all paths taking a present from $k-j$ to $k+j+1, j>i$, are completely contained in the other region. For instance, possible ${ }^{1}$ paths for $k=3$ and $n=5$ follow: The result is true for $n=1$. Let $n>1$ and assume the result is true for less chords. Consider the chord that takes $k$ to $k+n$ and remove it. Apply the induction hypothesis to the remaining $n-1$ lines: after relabeling, presents would go from $k-i$ to $k+i+2,1 \leq i \leq n-1$ if the chord were not there. Reintroduce the chord that takes $k$ to $k+n$. From the induction hypothesis, the chord intersects the paths of the presents in the following order: the $i$-th path the chord intersects is the the one that takes $k-i$ to $k+i, i=1,2, \ldots, n-1$. Paths without chord $k \rightarrow k+n$ Corrected paths with chord $k \rightarrow k+n$ Then the presents cover the following new paths: the present from $k$ will leave its chord and take the path towards $k+1$; then, for $i=1,2, \ldots, n-1$, the present from $k-i$ will meet the chord from $k$ to $k+n$, move towards the intersection with the path towards $k+i+1$ and go to $k+i+1$, as desired. Notice that the paths still do not cross. The induction (and the solution) is now complete.
{ "problem_match": "# Problem 5", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution 1" }
179
1,127
2023
T1
5
null
APMO
There are $n$ line segments on the plane, no three intersecting at a point, and each pair intersecting once in their respective interiors. Tony and his $2 n-1$ friends each stand at a distinct endpoint of a line segment. Tony wishes to send Christmas presents to each of his friends as follows: First, he chooses an endpoint of each segment as a "sink". Then he places the present at the endpoint of the segment he is at. The present moves as follows: - If it is on a line segment, it moves towards the sink. - When it reaches an intersection of two segments, it changes the line segment it travels on and starts moving towards the new sink. If the present reaches an endpoint, the friend on that endpoint can receive their present. Prove Tony can send presents to exactly $n$ of his $2 n-1$ friends.
First part: at most n friends can receive a present. Similarly to the first solution, consider a circle that encompasses all line segments, extend the lines, and use the endpoints of the chords instead of the line segments, and prove that each chord connects vertices $k$ and $k+n$. We also consider, even in the first part, $n$ presents leaving from $n$ outcoming vertices. First we prove that a present always goes to a sink. If it does not, then it loops; let it first enter the loop at point $P$ after turning from chord $a$ to chord $b$. Therefore after it loops once, [^0]it must turn to chord $b$ at $P$. But $P$ is the intersection of $a$ and $b$, so the present should turn from chord $a$ to chord $b$, which can only be done in one way - the same way it came in first. This means that some part of chord $a$ before the present enters the loop at $P$ is part of the loop, which contradicts the fact that $P$ is the first point in the loop. So no present enters a loop, and every present goes to a sink. There are no loops No two paths cross The present paths also do not cross: in fact, every time two paths share a point $P$, intersection of chords $a$ and $b$, one path comes from $a$ to $b$ and the other path comes from $b$ to $a$, and they touch at $P$. This implies the following sequence of facts: - Every path divides the circle into two regions with paths connecting vertices within each region. - All $n$ presents will be delivered to $n$ different persons; that is, all sinks receive a present. This implies that every vertex is an endpoint of a path. - The number of chord endpoints inside each region is even, because they are connected within their own region. Now consider the path starting at vertex 1 , with Tony. It divides the circle into two regions with an even number of vertices in their interior. Then there is an even number of vertices between Tony and the recipient of his present, that is, their vertex is an even numbered one. Second part: all even-numbered vertices can receive a present. The construction is the same as the in the previous solution: direct each chord from $i$ to $i+n$ if $1 \leq i \leq k$ and from $i+n$ to $i$ otherwise; in other words, the sinks are $k+1, k+2, \ldots, k+n$. Then, since the paths do not cross, $k$ will send a present to $k+1, k-1$ will send a present to $k+2$, and so on, until 1 sends a present to $(k+1)+(k-1)=2 k$. [^0]: ${ }^{1}$ The paths do not depend uniquely on $k$ and $n$; different chord configurations and vertex labelings may change the paths.
{ "problem_match": "# Problem 5", "resource_path": "APMO/segmented/en-apmo2023_sol.jsonl", "solution_match": "# Solution 2" }
179
644
2024
T1
2
null
APMO
Consider a $100 \times 100$ table, and identify the cell in row $a$ and column $b, 1 \leq a, b \leq 100$, with the ordered pair $(a, b)$. Let $k$ be an integer such that $51 \leq k \leq 99$. A $k$-knight is a piece that moves one cell vertically or horizontally and $k$ cells to the other direction; that is, it moves from $(a, b)$ to $(c, d)$ such that $(|a-c|,|b-d|)$ is either $(1, k)$ or $(k, 1)$. The $k$-knight starts at cell $(1,1)$, and performs several moves. A sequence of moves is a sequence of cells $\left(x_{0}, y_{0}\right)=(1,1)$, $\left(x_{1}, y_{1}\right),\left(x_{2}, y_{2}\right), \ldots,\left(x_{n}, y_{n}\right)$ such that, for all $i=1,2, \ldots, n, 1 \leq x_{i}, y_{i} \leq 100$ and the $k$-knight can move from $\left(x_{i-1}, y_{i-1}\right)$ to $\left(x_{i}, y_{i}\right)$. In this case, each cell $\left(x_{i}, y_{i}\right)$ is said to be reachable. For each $k$, find $L(k)$, the number of reachable cells. Answer: $L(k)=\left\{\begin{array}{ll}100^{2}-(2 k-100)^{2} & \text { if } k \text { is even } \\ \frac{100^{2}-(2 k-100)^{2}}{2} & \text { if } k \text { is odd }\end{array}\right.$.
Cell $(x, y)$ is directly reachable from another cell if and only if $x-k \geq 1$ or $x+k \leq 100$ or $y-k \geq 1$ or $y+k \leq 100$, that is, $x \geq k+1$ or $x \leq 100-k$ or $y \geq k+1$ or $y \leq 100-k(*)$. Therefore the cells $(x, y)$ for which $101-k \leq x \leq k$ and $101-k \leq y \leq k$ are unreachable. Let $S$ be this set of unreachable cells in this square, namely the square of cells $(x, y), 101-k \leq x, y \leq k$. If condition $(*)$ is valid for both $(x, y)$ and $(x \pm 2, y \pm 2)$ then one can move from $(x, y)$ to $(x \pm 2, y \pm 2)$, if they are both in the table, with two moves: either $x \leq 50$ or $x \geq 51$; the same is true for $y$. In the first case, move $(x, y) \rightarrow(x+k, y \pm 1) \rightarrow(x, y \pm 2)$ or $(x, y) \rightarrow$ $(x \pm 1, y+k) \rightarrow(x \pm 2, y)$. In the second case, move $(x, y) \rightarrow(x-k, y \pm 1) \rightarrow(x, y \pm 2)$ or $(x, y) \rightarrow(x \pm 1, y-k) \rightarrow(x \pm 2, y)$. Hence if the table is colored in two colors like a chessboard, if $k \leq 50$, cells with the same color as $(1,1)$ are reachable. Moreover, if $k$ is even, every other move changes the color of the occupied cell, and all cells are potentially reachable; otherwise, only cells with the same color as $(1,1)$ can be visited. Therefore, if $k$ is even then the reachable cells consists of all cells except the center square defined by $101-k \leq x \leq k$ and $101-k \leq y \leq k$, that is, $L(k)=100^{2}-(2 k-100)^{2}$; if $k$ is odd, then only half of the cells are reachable: the ones with the same color as $(1,1)$, and $L(k)=\frac{1}{2}\left(100^{2}-(2 k-100)^{2}\right)$.
{ "problem_match": "# Problem 2", "resource_path": "APMO/segmented/en-apmo2024_sol.jsonl", "solution_match": "# Solution\n\n" }
446
627
2024
T1
3
null
APMO
Let $n$ be a positive integer and $a_{1}, a_{2}, \ldots, a_{n}$ be positive real numbers. Prove that $$ \sum_{i=1}^{n} \frac{1}{2^{i}}\left(\frac{2}{1+a_{i}}\right)^{2^{i}} \geq \frac{2}{1+a_{1} a_{2} \ldots a_{n}}-\frac{1}{2^{n}} $$
We first prove the following lemma: Lemma 1. For $k$ positive integer and $x, y>0$, $$ \left(\frac{2}{1+x}\right)^{2^{k}}+\left(\frac{2}{1+y}\right)^{2^{k}} \geq 2\left(\frac{2}{1+x y}\right)^{2^{k-1}} $$ The proof goes by induction. For $k=1$, we have $$ \left(\frac{2}{1+x}\right)^{2}+\left(\frac{2}{1+y}\right)^{2} \geq 2\left(\frac{2}{1+x y}\right) $$ which reduces to $$ x y(x-y)^{2}+(x y-1)^{2} \geq 0 . $$ For $k>1$, by the inequality $2\left(A^{2}+B^{2}\right) \geq(A+B)^{2}$ applied at $A=\left(\frac{2}{1+x}\right)^{2^{k-1}}$ and $B=\left(\frac{2}{1+y}\right)^{2^{k-1}}$ followed by the induction hypothesis $$ \begin{aligned} 2\left(\left(\frac{2}{1+x}\right)^{2^{k}}+\left(\frac{2}{1+y}\right)^{2^{k}}\right) & \geq\left(\left(\frac{2}{1+x}\right)^{2^{k-1}}+\left(\frac{2}{1+y}\right)^{2^{k-1}}\right)^{2} \\ & \geq\left(2\left(\frac{2}{1+x y}\right)^{2^{k-2}}\right)^{2}=4\left(\frac{2}{1+x y}\right)^{2^{k-1}} \end{aligned} $$ from which the lemma follows. The problem now can be deduced from summing the following applications of the lemma, multiplied by the appropriate factor: $$ \begin{aligned} \frac{1}{2^{n}}\left(\frac{2}{1+a_{n}}\right)^{2^{n}}+\frac{1}{2^{n}}\left(\frac{2}{1+1}\right)^{2^{n}} & \geq \frac{1}{2^{n-1}}\left(\frac{2}{1+a_{n} \cdot 1}\right)^{2^{n-1}} \\ \frac{1}{2^{n-1}}\left(\frac{2}{1+a_{n-1}}\right)^{2^{n-1}}+\frac{1}{2^{n-1}}\left(\frac{2}{1+a_{n}}\right)^{2^{n-1}} & \geq \frac{1}{2^{n-2}}\left(\frac{2}{1+a_{n-1} a_{n}}\right)^{2^{n-2}} \\ \frac{1}{2^{n-2}}\left(\frac{2}{1+a_{n-2}}\right)^{2^{n-2}}+\frac{1}{2^{n-2}}\left(\frac{2}{1+a_{n-1} a_{n}}\right)^{2^{n-2}} & \geq \frac{1}{2^{n-3}}\left(\frac{2}{1+a_{n-2} a_{n-1} a_{n}}\right)^{2^{n-3}} \\ \ldots & )^{2^{k}} \\ \frac{1}{2^{k}}\left(\frac{2}{1+a_{k}}\right)^{2^{k}}+\frac{1}{2^{k}}\left(\frac{2}{1+a_{k+1} \ldots a_{n-1} a_{n}}\right)^{2^{k-1}} & \geq \frac{1}{2^{k-1}}\left(\frac{2}{1+a_{k} \ldots a_{n-2} a_{n-1} a_{n}}\right)^{2} \\ \frac{1}{2}\left(\frac{2}{1+a_{1}}\right)^{2}+\frac{1}{2}\left(\frac{2}{1+a_{2} \ldots a_{n-1} a_{n}}\right)^{2} & \geq \frac{2}{1+a_{1} \ldots a_{n-2} a_{n-1} a_{n}} \end{aligned} $$ Comment: Equality occurs if and only if $a_{1}=a_{2}=\cdots=a_{n}=1$. Comment: The main motivation for the lemma is trying to "telescope" the sum $$ \frac{1}{2^{n}}+\sum_{i=1}^{n} \frac{1}{2^{i}}\left(\frac{2}{1+a_{i}}\right)^{2^{i}} $$ that is, $$ \frac{1}{2}\left(\frac{2}{1+a_{1}}\right)^{2}+\cdots+\frac{1}{2^{n-1}}\left(\frac{2}{1+a_{n-1}}\right)^{2^{n-1}}+\frac{1}{2^{n}}\left(\frac{2}{1+a_{n}}\right)^{2^{n}}+\frac{1}{2^{n}}\left(\frac{2}{1+1}\right)^{2^{n}} $$ to obtain an expression larger than or equal to $$ \frac{2}{1+a_{1} a_{2} \ldots a_{n}} $$ It seems reasonable to obtain a inequality that can be applied from right to left, decreases the exponent of the factor $1 / 2^{k}$ by 1 , and multiplies the variables in the denominator. Given that, the lemma is quite natural: $$ \frac{1}{2^{k}}\left(\frac{2}{1+x}\right)^{2^{k}}+\frac{1}{2^{k}}\left(\frac{2}{1+y}\right)^{2^{k}} \geq \frac{1}{2^{k-1}}\left(\frac{2}{1+x y}\right)^{2^{i-1}} $$ or $$ \left(\frac{2}{1+x}\right)^{2^{k}}+\left(\frac{2}{1+y}\right)^{2^{k}} \geq 2\left(\frac{2}{1+x y}\right)^{2^{k-1}} $$
{ "problem_match": "# Problem 3", "resource_path": "APMO/segmented/en-apmo2024_sol.jsonl", "solution_match": "# Solution\n\n" }
110
1,506
2024
T1
4
null
APMO
Prove that for every positive integer $t$ there is a unique permutation $a_{0}, a_{1}, \ldots, a_{t-1}$ of $0,1, \ldots, t-$ 1 such that, for every $0 \leq i \leq t-1$, the binomial coefficient $\binom{t+i}{2 a_{i}}$ is odd and $2 a_{i} \neq t+i$.
We constantly make use of Kummer's theorem which, in particular, implies that $\binom{n}{k}$ is odd if and only if $k$ and $n-k$ have ones in different positions in binary. In other words, if $S(x)$ is the set of positions of the digits 1 of $x$ in binary (in which the digit multiplied by $2^{i}$ is in position $i),\binom{n}{k}$ is odd if and only if $S(k) \subseteq S(n)$. Moreover, if we set $k<n, S(k)$ is a proper subset of $S(n)$, that is, $|S(k)|<|S(n)|$. We start with a lemma that guides us how the permutation should be set. ## Lemma 1. $$ \sum_{i=0}^{t-1}|S(t+i)|=t+\sum_{i=0}^{t-1}|S(2 i)| $$ The proof is just realizing that $S(2 i)=\{1+x, x \in S(i)\}$ and $S(2 i+1)=\{0\} \cup\{1+x, x \in S(i)\}$, because $2 i$ in binary is $i$ followed by a zero and $2 i+1$ in binary is $i$ followed by a one. Therefore $$ \begin{aligned} \sum_{i=0}^{t-1}|S(t+i)| & =\sum_{i=0}^{2 t-1}|S(i)|-\sum_{i=0}^{t-1}|S(i)|=\sum_{i=0}^{t-1}|S(2 i)|+\sum_{i=0}^{t-1}|S(2 i+1)|-\sum_{i=0}^{t-1}|S(i)| \\ & =\sum_{i=0}^{t-1}|S(i)|+\sum_{i=0}^{t-1}(1+|S(i)|)-\sum_{i=0}^{t-1}|S(i)|=t+\sum_{i=0}^{t-1}|S(i)|=t+\sum_{i=0}^{t-1}|S(2 i)| \end{aligned} $$ The lemma has an immediate corollary: since $t+i>2 a_{i}$ and $\binom{t+i}{2 a_{i}}$ is odd for all $i, 0 \leq i \leq t-1$, $S\left(2 a_{i}\right) \subset S(t+i)$ with $\left|S\left(2 a_{i}\right)\right| \leq|S(t+i)|-1$. Since the sum of $\left|S\left(2 a_{i}\right)\right|$ is $t$ less than the sum of $|S(t+i)|$, and there are $t$ values of $i$, equality must occur, that is, $\left|S\left(2 a_{i}\right)\right|=|S(t+i)|-1$, which in conjunction with $S\left(2 a_{i}\right) \subset S(t+i)$ means that $t+i-2 a_{i}=2^{k_{i}}$ for every $i, 0 \leq i \leq t-1$, $k_{i} \in S(t+i)$ (more precisely, $\left\{k_{i}\right\}=S(t+i) \backslash S\left(2 a_{i}\right)$.) In particular, for $t+i$ odd, this means that $t+i-2 a_{i}=1$, because the only odd power of 2 is 1. Then $a_{i}=\frac{t+i-1}{2}$ for $t+i$ odd, which takes up all the numbers greater than or equal to $\frac{t-1}{2}$. Now we need to distribute the numbers that are smaller than $\frac{t-1}{2}$ (call these numbers small). If $t+i$ is even then by Lucas' Theorem $\binom{t+i}{2 a_{i}} \equiv\binom{\frac{t+i}{2}}{a_{i}}(\bmod 2)$, so we pair numbers from $\lceil t / 2\rceil$ to $t-1$ (call these numbers big) with the small numbers. Say that a set $A$ is paired with another set $B$ whenever $|A|=|B|$ and there exists a bijection $\pi: A \rightarrow B$ such that $S(a) \subset S(\pi(a))$ and $|S(a)|=|S(\pi(a))|-1$; we also say that $a$ and $\pi(a)$ are paired. We prove by induction in $t$ that $A_{t}=\{0,1,2, \ldots,\lfloor t / 2\rfloor-1\}$ (the set of small numbers) and $B_{t}=\{\lceil t / 2\rceil, \ldots, t-2, t-1\}$ (the set of big numbers) can be uniquely paired. The claim is immediate for $t=1$ and $t=2$. For $t>2$, there is exactly one power of two in $B_{t}$, since $t / 2 \leq 2^{a}<t \Longleftrightarrow a=\left\lceil\log _{2}(t / 2)\right\rceil$. Let $2^{a}$ be this power of two. Then, since $2^{a} \geq t / 2$, no number in $A_{t}$ has a one in position $a$ in binary. Since for every number $x, 2^{a} \leq x<t, a \in S(x)$ and $a \notin S(y)$ for all $y \in A_{t}, x$ can only be paired with $x-2^{a}$, since $S(x)$ needs to be stripped of exactly one position. This takes cares of $x \in B_{t}, 2^{a} \leq x<t$, and $y \in A_{t}, 0 \leq y<t-2^{a}$. Now we need to pair the numbers from $A^{\prime}=\left\{t-2^{a}, t-2^{a}+1, \ldots,\lfloor t / 2\rfloor-1\right\} \subset A$ with the numbers from $B^{\prime}=\left\{\lceil t / 2\rceil,\lceil t / 2\rceil+1, \ldots, 2^{a}-1\right\} \subset B$. In order to pair these $t-2\left(t-2^{a}\right)=$ $2^{a+1}-t<t$ numbers, we use the induction hypothesis and a bijection between $A^{\prime} \cup B^{\prime}$ and $B_{2^{a+1}-t} \cup A_{2^{a+1}-t}$. Let $S=S\left(2^{a}-1\right)=\{0,1,2, \ldots, a-1\}$. Then take a pair $x, y, x \in A_{2^{a+1}-t}$ and $y \in B_{2^{a+1}-t}$ and biject it with $2^{a}-1-x \in B^{\prime}$ and $2^{a}-1-y \in A^{\prime}$. In fact, $$ 0 \leq x \leq\left\lfloor\frac{2^{a+1}-t}{2}\right\rfloor-1=2^{a}-\left\lceil\frac{t}{2}\right\rceil-1 \Longleftrightarrow\left\lceil\frac{t}{2}\right\rceil \leq 2^{a}-1-x \leq 2^{a}-1 $$ and $$ \left\lceil\frac{2^{a+1}-t}{2}\right\rceil=2^{a}-\left\lfloor\frac{t}{2}\right\rfloor \leq y \leq 2^{a+1}-t-1 \Longleftrightarrow t-2^{a} \leq 2^{a}-1-y \leq\left\lfloor\frac{t}{2}\right\rfloor-1 $$ Moreover, $S\left(2^{a}-1-x\right)=S \backslash S(x)$ and $S\left(2^{a}-1-y\right)=S \backslash S(y)$ are complements with respect to $S$, and $S(x) \subset S(y)$ and $|S(x)|=|S(y)|-1$ implies $S\left(2^{a}-1-y\right) \subset S\left(2^{a}-1-x\right)$ and $\left|S\left(2^{a}-1-y\right)\right|=\left|S\left(2^{a}-1-x\right)\right|-1$. Therefore a pairing between $A^{\prime}$ and $B^{\prime}$ corresponds to a pairing between $A_{2^{a+1}-t}$ and $B_{2^{a+1}-t}$. Since the latter pairing is unique, the former pairing is also unique, and the result follows. We illustrate the bijection by showing the case $t=23$ : $$ A_{23}=\{0,1,2, \ldots, 10\}, \quad B_{23}=\{12,13,14, \ldots, 22\} $$ The pairing is $$ \left(\begin{array}{ccccccccccc} 12 & 13 & 14 & 15 & 16 & 17 & 18 & 19 & 20 & 21 & 22 \\ 8 & 9 & 10 & 7 & 0 & 1 & 2 & 3 & 4 & 5 & 6 \end{array}\right) $$ in which the bijection is between $$ \left(\begin{array}{cccc} 12 & 13 & 14 & 15 \\ 8 & 9 & 10 & 7 \end{array}\right) \quad \text { and } \quad\left(\begin{array}{llll} 3 & 2 & 1 & 0 \\ 7 & 6 & 5 & 8 \end{array}\right) \rightarrow\left(\begin{array}{llll} 5 & 6 & 7 & 8 \\ 1 & 2 & 3 & 0 \end{array}\right) . $$
{ "problem_match": "# Problem 4", "resource_path": "APMO/segmented/en-apmo2024_sol.jsonl", "solution_match": "# Solution\n\n" }
98
2,402
2024
T1
5
null
APMO
Line $\ell$ intersects sides $B C$ and $A D$ of cyclic quadrilateral $A B C D$ in its interior points $R$ and $S$ respectively, and intersects ray $D C$ beyond point $C$ at $Q$, and ray $B A$ beyond point $A$ at $P$. Circumcircles of the triangles $Q C R$ and $Q D S$ intersect at $N \neq Q$, while circumcircles of the triangles $P A S$ and $P B R$ intersect at $M \neq P$. Let lines $M P$ and $N Q$ meet at point $X$, lines $A B$ and $C D$ meet at point $K$ and lines $B C$ and $A D$ meet at point $L$. Prove that point $X$ lies on line $K L$.
We start with the following lemma. Lemma 1. Points $M, N, P, Q$ are concyclic. Point $M$ is the Miquel point of lines $A P=A B, P S=\ell, A S=A D$, and $B R=B C$, and point $N$ is the Miquel point of lines $C Q=C D, R C=B C, Q R=\ell$, and $D S=A D$. Both points $M$ and $N$ are on the circumcircle of the triangle determined by the common lines $A D, \ell$, and $B C$, which is $L R S$. Then, since quadrilaterals $Q N R C, P M A S$, and $A B C D$ are all cyclic, using directed angles (modulo $180^{\circ}$ ) $$ \begin{aligned} \measuredangle N M P & =\measuredangle N M S+\measuredangle S M P=\measuredangle N R S+\measuredangle S A P=\measuredangle N R Q+\measuredangle D A B=\measuredangle N R Q+\measuredangle D C B \\ & =\measuredangle N R Q+\measuredangle Q C R=\measuredangle N R Q+\measuredangle Q N R=\measuredangle N Q R=\measuredangle N Q P, \end{aligned} $$ which implies that $M N Q P$ is a cyclic quadrilateral. Let $E$ be the Miquel point of $A B C D$ (that is, of lines $A B, B C, C D, D A$ ). It is well known that $E$ lies in the line $t$ connecting the intersections of the opposite lines of $A B C D$. Let lines $N Q$ and $t$ meet at $T$. If $T \neq E$, using directed angles, looking at the circumcircles of $L A B$ (which contains, by definition, $E$ and $M$ ), $A P S$ (which also contains $M$ ), and $M N Q P$, $$ \measuredangle T E M=\measuredangle L E M=\measuredangle L A M=\measuredangle S A M=\measuredangle S P M=\measuredangle Q P M=\measuredangle Q N M=\measuredangle T N M, $$ that is, $T$ lies in the circumcircle $\omega$ of $E M N$. If $T=E$, the same computation shows that $\measuredangle L E M=\measuredangle E N M$, which means that $t$ is tangent to $\omega$. Now let lines $M P$ and $t$ meet at $V$. An analogous computation shows, by looking at the circumcircles of $L C D$ (which contains $E$ and $N$ ), $C Q R$, and $M N Q P$, that $V$ lies in $\omega$ as well, and that if $V=E$ then $t$ is tangent to $\omega$. Therefore, since $\omega$ meet $t$ at $T, V$, and $E$, either $T=V$ if both $T \neq E$ and $V \neq E$ or $T=V=E$. At any rate, the intersection of lines $M P$ and $N Q$ lies in $t$.
{ "problem_match": "# Problem 5", "resource_path": "APMO/segmented/en-apmo2024_sol.jsonl", "solution_match": "# Solution 1" }
187
739
2024
T1
5
null
APMO
Line $\ell$ intersects sides $B C$ and $A D$ of cyclic quadrilateral $A B C D$ in its interior points $R$ and $S$ respectively, and intersects ray $D C$ beyond point $C$ at $Q$, and ray $B A$ beyond point $A$ at $P$. Circumcircles of the triangles $Q C R$ and $Q D S$ intersect at $N \neq Q$, while circumcircles of the triangles $P A S$ and $P B R$ intersect at $M \neq P$. Let lines $M P$ and $N Q$ meet at point $X$, lines $A B$ and $C D$ meet at point $K$ and lines $B C$ and $A D$ meet at point $L$. Prove that point $X$ lies on line $K L$.
Barycentric coordinates are a viable way to solve the problem, but even the solution we have found had some clever computations. Here is an outline of this solution. Lemma 2. Denote by $\operatorname{pow}_{\omega} X$ the power of point $X$ with respect to circle $\omega$. Let $\Gamma_{1}$ and $\Gamma_{2}$ be circles with different centers. Considering $A B C$ as the reference triangle in barycentric coordinates, the radical axis of $\Gamma_{1}$ and $\Gamma_{2}$ is given by $$ \left(\operatorname{pow}_{\Gamma_{1}} A-\operatorname{pow}_{\Gamma_{2}} A\right) x+\left(\operatorname{pow}_{\Gamma_{1}} B-\operatorname{pow}_{\Gamma_{2}} B\right) y+\left(\operatorname{pow}_{\Gamma_{1}} C-\operatorname{pow}_{\Gamma_{2}} C\right) z=0 $$ Proof: Let $\Gamma_{i}$ have the equation $\Gamma_{i}(x, y, z)=-a^{2} y z-b^{2} z x-c^{2} x y+(x+y+z)\left(r_{i} x+s_{i} y+t_{i} z\right)$. Then $\operatorname{pow}_{\Gamma_{i}} P=\Gamma_{i}(P)$. In particular, $\operatorname{pow}_{\Gamma_{i}} A=\Gamma_{i}(1,0,0)=r_{i}$ and, similarly, $\operatorname{pow}_{\Gamma_{i}} B=s_{i}$ and $\operatorname{pow}_{\Gamma_{i}} C=t_{i}$. Finally, the radical axis is $$ \begin{aligned} & \operatorname{pow}_{\Gamma_{1}} P=\operatorname{pow}_{\Gamma_{2}} P \\ \Longleftrightarrow & \Gamma_{1}(x, y, z)=\Gamma_{2}(x, y, z) \\ \Longleftrightarrow & r_{1} x+s_{1} y+t_{1} z=r_{2} x+s_{2} y+t_{2} z \\ \Longleftrightarrow & \left(\operatorname{pow}_{\Gamma_{1}} A-\operatorname{pow}_{\Gamma_{2}} A\right) x+\left(\operatorname{pow}_{\Gamma_{1}} B-\operatorname{pow}_{\Gamma_{2}} B\right) y+\left(\operatorname{pow}_{\Gamma_{1}} C-\operatorname{pow}_{\Gamma_{2}} C\right) z=0 . \end{aligned} $$ We still use the Miquel point $E$ of $A B C D$. Notice that the problem is equivalent to proving that lines $M P, N Q$, and $E K$ are concurrent. The main idea is writing these three lines as radical axes. In fact, by definition of points $M, N$, and $E$ : - $M P$ is the radical axis of the circumcircles of $P A S$ and $P B R$; - $N Q$ is the radical axis of the circumcircles of $Q C R$ and $Q D S$; - $E K$ is the radical axis of the circumcircles of $K B C$ and $K A D$. Looking at these facts and the diagram, it makes sense to take triangle $K Q P$ the reference triangle. Because of that, we do not really need to draw circles nor even points $M$ and $N$, as all powers can be computed directly from points in lines $K P, K Q$, and $P Q$. Associate $P$ with the $x$-coordinate, $Q$ with the $y$-coordinate, and $K$ with the $z$-coordinate. Applying the lemma, the equations of lines $P M, Q N$, and $E K$ are - MP: $(K A \cdot K P-K B \cdot K P) x+(Q S \cdot Q P-Q R \cdot Q P) y=0$ - $N Q:(K C \cdot K Q-K D \cdot K Q) x+(P R \cdot P Q-P S \cdot P Q) z=0$ - MP: $(-Q C \cdot Q K+Q D \cdot Q K) y+(P B \cdot P K-P A \cdot P K) z=0$ These equations simplify to - $M P:(A B \cdot K P) x+(P Q \cdot R S) y=0$ - $N Q:(-C D \cdot K Q) x+(P Q \cdot R S) z=0$ - $M P:(C D \cdot K Q) y+(A B \cdot K P) z=0$ Now, if $u=A B \cdot K P, v=P Q \cdot R S$, and $w=C D \cdot K Q$, it suffices to show that $$ \left|\begin{array}{ccc} u & v & 0 \\ -w & 0 & v \\ 0 & w & u \end{array}\right|=0 $$ which is a straightforward computation.
{ "problem_match": "# Problem 5", "resource_path": "APMO/segmented/en-apmo2024_sol.jsonl", "solution_match": "# Solution 2" }
187
1,134
2025
T1
1
null
APMO
Let \(A B C\) be an acute triangle inscribed in a circle \(\Gamma\) . Let \(A_{1}\) be the orthogonal projection of \(A\) onto \(B C\) so that \(A A_{1}\) is an altitude. Let \(B_{1}\) and \(C_{1}\) be the orthogonal projections of \(A_{1}\) onto \(A B\) and \(A C\) , respectively. Point \(P\) is such that quadrilateral \(A B_{1}P C_{1}\) is convex and has the same area as triangle \(A B C\) . Is it possible that \(P\) strictly lies in the interior of circle \(\Gamma\) ? Justify your answer. Answer: No.
First notice that, since angles \(\angle A A_{1}B_{1}\) and \(\angle A A_{1}C_{1}\) are both right, the points \(B_{1}\) and \(C_{1}\) lie on the circle with \(A A_{1}\) as a diameter. Therefore, \(A C_{1} = A A_{1}\sin \angle A A_{1}C_{1} = A A_{1}\sin (90^{\circ}-\) \(\angle A_{1}A C) = A A_{1}\sin \angle C\) , similarly \(A B_{1} = A A_{1}\sin \angle B\) , and \(B_{1}C_{1} = A A_{1}\sin \angle A\) . Hence; triangles \(A C_{1}B_{1}\) and \(A B C\) are similar. ![md5:7df71c9e3d7cdb9412f6f7281a1563e8](7df71c9e3d7cdb9412f6f7281a1563e8.jpeg) Let \(O\) be the circumcenter of \(A B C\) and \(A D\) be one of its diameters. Since \(\angle O A C = \frac{1}{2} (180^{\circ}-\) \(\angle A O C) = 90^{\circ} - \angle B = 90^{\circ} - \angle A C_{1}B_{1}\) , it follows that \(A D\) is perpendicular to \(B_{1}C_{1}\) . Let \(A D = 2R\) ; recall that, from the law of sines, \(\frac{B C}{\sin\angle A} = 2R\iff B C = 2R\sin \angle A\) . The area of quadrilateral \(A B_{1}D C_{1}\) is \[\frac{B_{1}C_{1}\cdot A D}{2} = \frac{A A_{1}\sin\angle A\cdot 2R}{2} = \frac{A A_{1}\cdot B C}{2},\] which is indeed the area of \(A B C\) . Since \(B_{1}\) and \(C_{1}\) are fixed points, the loci of the points \(P\) such that \(A B_{1}P C_{1}\) is a convex quadrilateral with the same area as \(A B C\) is a line parallel to \(B_{1}C_{1}\) . That is, perpendicular to \(A D\) . Since the area of \(A B_{1}D C_{1}\) is the same as the area of \(A B C\) , this locus is the line perpendicular to \(A D\) through \(D\) , which is tangent to the circumcircle of \(A B C\) . Therefore, it is not possible that the point \(P\) lies inside the circumcircle of \(A B C\) .
{ "problem_match": "# Problem 1 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution \n\n" }
156
679
2025
T1
2
null
APMO
Let \(\alpha\) and \(\beta\) be positive real numbers. Emerald makes a trip in the coordinate plane, starting off from the origin \((0,0)\) . Each minute she moves one unit up or one unit to the right, restricting herself to the region \(|x - y|< 2025\) , in the coordinate plane. By the time she visits a point \((x,y)\) she writes down the integer \(\lfloor x\alpha +y\beta \rfloor\) on it. It turns out that Emerald wrote each non- negative integer exactly once. Find all the possible pairs \((\alpha ,\beta)\) for which such a trip would be possible. Answer: \((\alpha ,\beta)\) such that \(\alpha +\beta = 2\)
Let \((x_{n},y_{n})\) be the point that Emerald visits after \(n\) minutes. Then \((x_{n + 1},y_{n + 1})\in \{(x_{n}+\) \(1,y_{n}),(x_{n},y_{n} + 1)\}\) . Either way, \(x_{n + 1} + y_{n + 1} = x_{n} + y_{n} + 1\) , and since \(x_{0} + y_{0} = 0 + 0 = 0\) \(x_{n} + y_{n} = n\) The \(n\) - th number would be then \[z_{n} = \lfloor x_{n}\alpha +(n - x_{n})\beta \rfloor \Longrightarrow n\beta +x_{n}(\alpha -\beta) - 1< z_{n}< n\beta +x_{n}(\alpha -\beta),\] in which \[-2025< x_{n} - y_{n}< 2025\iff \frac{n - 2025}{2} < x_{n}< \frac{n + 2025}{2}.\] Suppose without loss of generality that \(\alpha \geq \beta\) . Then \[n\beta +\frac{n - 2025}{2} (\alpha -\beta) - 1< z_{n}< n\beta +\frac{n + 2025}{2} (\alpha -\beta),\] which reduces to \[\left|z_{n} - \frac{\alpha + \beta}{2} n\right|< \frac{2025}{2} (\alpha -\beta) + 1.\] On the other hand, \(z_{n + 1} = \lfloor x_{n + 1}\alpha +y_{n + 1}\beta \rfloor \in \{\lfloor x_{n}\alpha +y_{n}\beta +\alpha \rfloor ,\lfloor x_{n}\alpha +y_{n}\beta +\beta \rfloor \}\) , which implies \(z_{n + 1}\geq z_{n}\) . Since every non- negative integer appears exactly once, in increasing order, it follows that \(z_{n} = n\) . Therefore, for all positive integers \(n\) \[\left|n - \frac{\alpha + \beta}{2} n\right|< \frac{2025}{2} (\alpha -\beta) + 1,\] which can only be possible if \(\alpha +\beta = 2\) ; otherwise, the left hand side would be unbounded. If \(\alpha +\beta = 2\) , consider \(x_{n} = \left\lfloor \frac{n}{2}\right\rfloor\) and \(y_{n} = \left\lfloor \frac{n}{2}\right\rfloor\) . If \(n\) is even, \[z_{n} = \left\lfloor \frac{n}{2}\alpha +\frac{n}{2}\beta \right\rfloor = n;\] if \(n\) is odd, \[z_{n} = \left\lfloor \frac{n + 1}{2}\alpha +\frac{n - 1}{2}\beta \right\rfloor = n + \left\lfloor \frac{\alpha - \beta}{2}\right\rfloor ,\] which equals \(n\) because \(0< \beta \leq \alpha < \alpha +\beta = 2\Longrightarrow 0\leq \alpha -\beta < 2\)
{ "problem_match": "# Problem 2 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution \n\n" }
172
831
2025
T1
4
null
APMO
Let \(n \geq 3\) be an integer. There are \(n\) cells on a circle, and each cell is assigned either 0 or 1. There is a rooster on one of these cells, and it repeats the following operations: If the rooster is on a cell assigned 0, it changes the assigned number to 1 and moves to the next cell counterclockwise. If the rooster is on a cell assigned 1, it changes the assigned number to 0 and moves to the cell after the next cell counterclockwise. Prove that the following statement holds true after sufficiently many operations: If the rooster is on a cell \(C\) , then the rooster would go around the circle exactly three times, stopping again at \(C\) . Moreover, every cell would be assigned the same number as it was assigned right before the rooster went around the circle 3 times.
Reformulate the problem as a \(n\) - string of numbers in \(\{0,1\}\) and a position at which the action described in the problem is performed, and add 1 or 2 modulo \(n\) to the position according to the action. Say that a lap is complete for each time the position resets to 0 or 1. We will prove that the statement claim holds after at most two laps, after which the \(n\) - tuple cycles every three laps. Say the rooster stops at a position in a certain lap if it performs an action at that position on that lap; otherwise, the rooster bypasses that position. We start with some immediate claims: The rooster has to stop at at least one of each two consecutive positions. The rooster stops at every position preceded by a 0. Indeed, if the numbers preceding that position are 00 then the rooster will definitely stop at the second zero, and it the numbers preceding that position are 10 then the rooster will either stop at 1 and go directly to the position or bypass 1 and stop at the second zero, and then stop at the position. Therefore, if the rooster bypasses a position, then it is preceded by a 1, and that 1 must be changed to a 0. This means that the rooster never bypasses a position in two consecutive laps. The rooster bypasses every position preceded by 01. Indeed, the rooster stops at either 1 or at 0, after which it will move to 1; at any rate, it stops at 1 and bypasses the position. Our goal is to prove that, eventually, for every three consecutive laps, each position is bypassed exactly once. Then each position changes states exactly twice, so it gets back to its initial state after three laps. The following two lemmata achieve this goal: Lemma 1. If the rooster stops at a certain position in two laps in a row, it bypasses it on the next lap, except for the \(n\) - string \(1010\ldots 10\) , for which the problem statement holds. Proof. If the rooster stopped at a position in lap \(t\) , then it is preceded by either (A) a 0 that was changed to 1, (B) a 11 that was changed to 01, or (C) a 10 in which the rooster stopped at 1. In case (A), the position must be preceded by 11 in the lap \(t + 1\) , which becomes 01, so the rooster will bypass the position in the lap \(t + 2\) . In case (B), the position will be bypassed in lap \(t + 1\) . Now we deal with case (C): suppose that the position was preceded by \(m\) occurrences of 10, that is, \((10)^{m}\) , on lap \(t\) and take \(m \leq \frac{n}{2}\) maximal. The rooster stopped at the 1 from each occurrence of 10, except possibly the first one. First, suppose that \(n \geq 2m + 2\) . After lap \(t\) , \((10)^{m}\) becomes either \((00)^{m}\) or \(11(00)^{m - 1}\) in lap \(t + 1\) . In the latter case, initially we had \(1(10)^{m}\) , which became \(011(00)^{m - 1}\) . It will then become \(a01(11)^{m - 1}\) in lap \(t + 2\) , in which the rooster will bypass the position. In the former case, \((10)^{m}\) becomes \((00)^{m}\) , so it was either \(00(10)^{m}\) or \(11(10)^{m}\) in lap \(t\) , which becomes respectively \(a1(00)^{m}\) and \(01(00)^{m}\) in lap \(t + 1\) , respectively. In the second sub- case, it becomes \(b001(11)^{m - 1}\) in lap \(t + 2\) , and the position will be bypassed. In the first sub- case, it must be \(11(00)^{m}\) after which it becomes either \(01(11)^{m}\) or \(1001(11)^{m - 1}\) . In any case, the position will be bypassed in lap \(t + 2\) . If \(n = 2m + 1\) , the possible configurations are \[(10)^{m}0\rightarrow (00)^{m}1\rightarrow (11)^{m}0\rightarrow (10)^{m}0,\] the rooster stops at the 1 from the first 10 because it was preceded by a 0. \[(10)^{m}1\rightarrow (00)^{m}0\rightarrow 0(11)^{m}\rightarrow 1(01)^{m},\] or \[(10)^{m}1\rightarrow 11(00)^{m - 1}0\rightarrow 01(11)^{m - 1}1\rightarrow (10)^{m}1,\] In any case, the position is bypassed in lap \(t + 2\) . If \(n = 2m\) , the entire configuration is \((10)^{m}\) , \(m \geq 2\) . If the rooster did not stop at the first 1, it becomes \(11(00)^{m - 1}\) in the lap \(t + 1\) , then \(01(11)^{m - 1}\) in the lap \(t + 2\) , so the position is bypassed in this last lap. If the rooster stopped at the first 1, it becomes \((00)^{m}\) , then \((11)^{m}\) , then \((01)^{m}\) , then \(10(00)^{m - 1}\) , then \((11)^{m}\) , and then it cycles between \((11)^{m}\) , \((01)^{m}\) and \(10(00)^{m - 1}\) . So, apart from this specific string, the rooster will stop at most two laps in a row at each position. Lemma 2. If the rooster bypasses one position on a lap, then it stops at that position on the next two laps, with the same exception as lemma 1. Proof. The position must be preceded by 1 in lap \(t\) . If it is preceded by 11, it changes to 10 in lap \(t + 1\) . Then it becomes 00 because the 1 was already skipped in the previous lap, and the rooster will stop at the position in the lap \(t + 2\) . Now suppose that the position was preceded by \((01)^{m}\) on lap \(t\) and take \(m \leq \frac{n}{2}\) maximal. It becomes \(10(00)^{m - 1}\) or \((00)^{m}\) in lap \(t + 1\) . In the former case, in lap \(t + 2\) it becomes either \(00(11)^{m - 1}\) , after which the rooster stops at the position again, or \((11)^{m}\) , which we'll study later. In the former case, \((00)^{m}\) becomes \((11)^{m}\) or \(01(11)^{m - 1}\) . In the latter case, the 0 was bypassed, so it must be sopped in the next lap, becoming \((10)^{m}\) . In the \((11)^{m}\) case, in order to bypass the position in lap \(t + 2\) , it must become \((10)^{m}\) . All in all, the preceding terms are \((01)^{m}\) . Then, either \(10(00)^{m - 1}\) or \((00)^{m}\) , then either \((11)^{m}\) or \(01(11)^{m - 1}\) , then \((10)^{m}\) . Then the second term in \((01)^{m}\) is 1, then 0, then 1, and then 0, that is, it changed three times. So we fall under the exception to lemma 1. \(\square\) The result then immediately follows from lemmata 1 and 2.
{ "problem_match": "# Problem 4 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution 1" }
193
1,990
2025
T1
4
null
APMO
Let \(n \geq 3\) be an integer. There are \(n\) cells on a circle, and each cell is assigned either 0 or 1. There is a rooster on one of these cells, and it repeats the following operations: If the rooster is on a cell assigned 0, it changes the assigned number to 1 and moves to the next cell counterclockwise. If the rooster is on a cell assigned 1, it changes the assigned number to 0 and moves to the cell after the next cell counterclockwise. Prove that the following statement holds true after sufficiently many operations: If the rooster is on a cell \(C\) , then the rooster would go around the circle exactly three times, stopping again at \(C\) . Moreover, every cell would be assigned the same number as it was assigned right before the rooster went around the circle 3 times.
Define positions, laps, stoppings, and bypassing as in Solution 1. This other pair of lemmata also solves the problem. Lemma 3. There is a position and a lap in which the rooster stops twice and bypasses once (in some order) in the next three laps. Proof. There is a position \(j\) the rooster stops for infinitely many times. Each time it stops at \(j\) , it changes between stopping and bypassing \(j + 1\) . So the rooster stops and bypasses \(j + 1\) infinitely many times. Then there is a lap in which the rooster stops at \(j + 1\) , and bypasses it in the next. As in solution 1, it cannot bypass \(j + 1\) two times in a row, so it stops at \(j + 1\) in the next lap. \(\square\) Lemma 4. If the rooster stops twice and bypasses once (in some order) at some position in three consecutive laps, it also stops twice and bypasses once at the next position (in some order) in the same laps (or in the next laps, in case the lap changes from one position to the other). Proof. When the rooster bypasses the position, it must stop at the next one. In the two times it stops at the position, the cell has different numbers on it, so the rooster will stop once and bypass once at the next position. \(\square\) By lemmata 3 and 4, there would be a moment that the rooster stops twice and bypasses once (in some order) at any position after this moment. After this moment, if the rooster is in a cell \(C\) in lap \(t\) , we know that it stopped; stopped- bypassed; and bypassed- stopped at \(C\) in laps \(t, t + 1, t + 2\) . Since it stopped twice and bypassed once (in some order) in laps \(t + 1, t + 2, t + 3\) , it must stop at \(C\) in lap \(t + 3\) . Moreover, the rooster stopped twice and bypassed once (in some order) each cell between stopping at \(C\) in laps \(t\) and \(t + 3\) , so every cell has the same assigned number before and after going around the circle three times.
{ "problem_match": "# Problem 4 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution 2" }
193
514
2025
T1
4
null
APMO
Let \(n \geq 3\) be an integer. There are \(n\) cells on a circle, and each cell is assigned either 0 or 1. There is a rooster on one of these cells, and it repeats the following operations: If the rooster is on a cell assigned 0, it changes the assigned number to 1 and moves to the next cell counterclockwise. If the rooster is on a cell assigned 1, it changes the assigned number to 0 and moves to the cell after the next cell counterclockwise. Prove that the following statement holds true after sufficiently many operations: If the rooster is on a cell \(C\) , then the rooster would go around the circle exactly three times, stopping again at \(C\) . Moreover, every cell would be assigned the same number as it was assigned right before the rooster went around the circle 3 times.
Let us reformulate the problem in terms of Graphs: we have a directed graph \(G\) with \(V = \{v_{1}, v_{2}, \ldots , v_{n}\}\) representing positions and \(E = \{v_{i} \to v_{i + 1}, v_{i} \to v_{i + 2} \mid 1 \le i \le n\}\) representing moves. Indices are taken mod \(n\) . Note that each vertex has in- degree and out- degree both equal to 2. We say that the edge \(v_{i} \to v_{i + 1}\) is active and \(v_{i} \to v_{i + 2}\) is inactive if the number on \(v_{i}\) is 0, or the edge \(v_{i} \to v_{i + 2}\) is active and \(v_{i} \to v_{i + 1}\) is inactive if the number on \(v_{i}\) is 1. The rooster then traces an infinite trail on the graph in the following manner; - it starts at \(v_{1}\) ; - if the rooster is at \(v_{i}\) , it uses the active edge going out of \(v_{i}\) to continue the path, and changes the number on \(v_{i}\) . Take the first vertex that appears 3 times on the rooster's trail, and suppose without any loss of generality that it is \(v_{1}\) (otherwise, just ignore the path before the first time that this vertex appears). Consider the sub- trail from the first to the third time \(v_{1}\) appears: \(C = v_{1} \to \dots \to v_{1} \to \dots \to v_{1}\) . Trail \(C\) induces a circuit \(C^{*}\) on \(G\) that passes through \(v_{1}\) twice. In between two occurrences of \(v_{1}\) , the rooster must have completed at least one lap. Vertex \(v_{1}\) appears three times at \(C\) , so \(C\) contains at least two laps. Since (as per Solution 1) no vertex is bypassed twice in a row, \(C^{*}\) must contain every vertex. Moreover, \(v_{1}\) is the first (and only) vertex that appeared three times on the rooster's path, so each vertex appear at most twice on \(C^{*}\) . Lemma 5. Take \(V^{\prime}\) to be the subset of \(V\) containing the vertices that only appears once on \(C^{*}\) and \(E^{\prime}\) to be the edges of \(G\) that don't appear on \(C^{*}\) . So \(G^{\prime} = (V^{\prime}, E^{\prime})\) is a simple cycle or \(V^{\prime} = E^{\prime} = \emptyset\) . Proof. We will first prove that each edge in \(C^{*}\) appears exactly one. Suppose, for the sake of contradiction, that there is an edge \(u \to v\) that appears twice on \(C^{*}\) . So \(u\) must appear times in \(C\) , because the active edge going out of \(u\) changes at each visit to it. So \(u = v_{1}\) , but the rooster only goes out of \(v_{1}\) twice in \(C\) , which is a contradiction. Now, since \(C^{*}\) does not have repeated edges, all four edges through \(v\) are in \(C^{*}\) if \(v\) is visited twice in this cycle. So the edges on \(E^{\prime}\) cannot pass through vertices in \(V \setminus V^{\prime}\) , then \(G^{\prime}\) is well- defined. Since \(v \in V^{\prime}\) is visited once on \(C^{*}\) , it has \(\deg_{in}(v) = \deg_{out}(v) = 1\) in \(G^{\prime}\) , so \(G^{\prime}\) is a union of disjoint simple cycles. Each of these cycles completes at least one lap, and \(v_{1}\) is skipped on these laps, so all cycles must use the edge \(v_{n} \to v_{2}\) . But the cycles are disjoint, so there is at most one cycle. \(\square\) Lemma 6. The rooster eventually traverses a contiguous Eulerian circuit of \(G\) . Proof. If \(V^{\prime} = E^{\prime} = \emptyset\) , \(C^{*}\) is already an Eulerian circuit traversed in \(C\) . If not, take \(u_{1}\) to be the first vertex of \(C\) that is in \(V^{\prime}\) . Let \(U = u_{1}\to \dots \to u_{k}\to u_{1}\) be the cycle determined by \(G^{\prime}\) by Lemma 5, \(C_{1} = v_{1}\to \dots \to u_{1}\) be the sub- path of \(C\) from the first \(v_{1}\) to \(u_{1}\) , and \(C_{2} = u_{1}\to \dots \to v_{1}\) be the rest of \(C\) . Each vertex on \(V\backslash V^{\prime}\) has been changed twice, so they would be in their initial states after \(C\) ; every vertex on \(V^{\prime}\) has been changed only once, and therefore are not on their initial states. Let us trace the rooster's trail after it traversed \(C\) . By the minimality of \(u_{1}\) , all the edges of \(C_{1}\) are active after \(C\) , so the rooster traverses \(C_{1}\) after \(C\) . Moreover, each \(u_{i}\) was visited exactly once in \(C\) and has not yet used the edge \(u_{i}\to u_{i + 1}\) . Since all their states have changed, all edges of \(U\) are active after \(C\) . Therefore, the rooster traverse \(U\) after \(C_{1}\) , flipping all the vertices in \(U\) to their initial states. Then, since every state in \(U\) was changed, the rooster traverses \(C_{2}\) instead of \(U\) . The trail is then \(C\to C_{1}\to U\to C_{2}\) , and hen \(C_{1}\to U\to C_{2}\) is an Eulerian circuit. \(\square\) Having this in mind, after the rooster completes an Eulerian circuit, it has passed through each vertex twice and returned to its initial vertex, so the state of the rooster and of the edges are the same before and after the Eulerian cycle. The rooster will then traverse the Eulerian circuit repeatedly. The edges \(v_{i}\to v_{i + 1}\) move forward by one position and the edges \(v_{i}\to v_{i + 2}\) move forward by two positions. Since all edges are used, each time the rooster traverses the Eulerian circuit, it moves forward a total of \(n(1 + 2) = 3n\) positions, which corresponds to three laps. The proof is now complete. Comment: Solution 1 presents a somewhat brute- force case analysis; the main ideas are - Lemma 1: The rooster stops at one position in at most two consecutive laps, with one notable exception. - Lemma 2: If the rooster bypasses one position then it stops at it in the next two laps, with the same notable exception. - Solution 2 has a recursive nature; the main ideas are - Lemma 3: Proving that one position changes states exactly two out of three laps. - Lemma 4: Given that this happens to one position, it also happens to the next position in the same laps, so it happens to every position. - Solution 3 cleverly identifies the moves the rooster performs within a graph theoretical framework. The main goal is to prove that the rooster traces an Eulerian circuit in a graph. - Lemma 5: Analyzing what happens after the rooster first visits a position three times. - Lemma 6: Proving that the rooster traces an Eulerian circuit.
{ "problem_match": "# Problem 4 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution 3" }
193
1,854
2025
T1
5
null
APMO
Consider an infinite sequence \(a_{1},a_{2},\ldots\) of positive integers such that \[100!(a_{m} + a_{m + 1} + \cdot \cdot \cdot +a_{n})\quad \mathrm{is~a~multiple~of}\quad a_{n - m + 1}a_{n + m}\] for all positive integers \(m,n\) such that \(m\leq n\) Prove that the sequence is either bounded or linear. Observation: A sequence of positive integers is bounded if there exists a constant \(N\) such that \(a_{n}< N\) for all \(n\in \mathbb{Z}_{>0}\) . A sequence is linear if \(a_{n} = n\cdot a_{1}\) for all \(n\in \mathbb{Z}_{>0}\)
Let \(c = 100!\) . Suppose that \(n\geq m + 2\) . Then \(a_{m + n} = a_{(m + 1) + (n - 1)}\) divides both \(c(a_{m} + a_{m + 1}+\) \(\cdot \cdot \cdot +a_{n - 1} + a_{n})\) and \(c(a_{m + 1} + \cdot \cdot \cdot +a_{n - 1})\) , so it also divides the difference \(c(a_{m} + a_{n})\) . Notice that if \(n = m + 1\) then \(a_{m + n}\) divides \(c(a_{m} + a_{m + 1}) = c(a_{m} + a_{n})\) , and if \(n = m\) then \(a_{m + n}\) divides both \(c a_{m}\) and \(2c a_{m} = c(a_{m} + a_{n})\) . In either cases; \(a_{m + n}\) divides \(c(a_{m} + a_{n})\) Analogously, one can prove that if \(m > n\) , \(a_{m - n} = a_{(m - 1) - (n - 1)}\) divides \(c(a_{m} - a_{n})\) , as it divides both \(c(a_{n + 1} + \cdot \cdot \cdot +a_{m})\) and \(c(a_{n} + \cdot \cdot \cdot +a_{m - 1})\) From now on, drop the original divisibility statement and keep the statements " \(a_{m + n}\) divides \(c(a_{m} + a_{n})\) " and " \(a_{m - n}\) divides \(c(a_{m} - a_{n})\) . Now, all conditions are linear, and we can suppose without loss of generality that there is no integer \(D > 1\) that divides every term of the sequence; if there is such an integer \(D\) , divide all terms by \(D\) . Having this in mind, notice that \(a_{m} = a_{m + n - n}\) divides \(c(a_{m + n} - a_{n})\) and also \(c(a_{m + n} - a_{m} - a_{n})\) analogously, \(a_{n}\) also divides \(c(a_{m + n} - a_{m} - a_{n})\) , and since \(a_{m + n}\) divides \(c(a_{m} + a_{n})\) , it also divides \(c(a_{m + n} - a_{m} - a_{n})\) . Therefore, \(c(a_{m + n} - a_{m} - a_{n})\) is divisible by \(a_{m}\) , \(a_{n}\) , and \(a_{m + n}\) , and therefore also by \(\operatorname {lcm}(a_{m},a_{n},a_{m + n})\) . In particular, \(c a_{m + n}\equiv c(a_{m} + a_{n})\pmod {\operatorname {lcm}(a_{m},a_{n})}\) Since \(a_{m + n}\) divides \(c(a_{m} + a_{n})\) , \(a_{m + n}\leq c(a_{m} + a_{n})\) From now on, we divide the problem in two cases. Case 1: there exist \(m,n\) such that \(\operatorname {lcm}(a_{m},a_{n}) > c^{2}(a_{m} + a_{n})\) If \(\operatorname {lcm}(a_{m},a_{n}) > c^{2}(a_{m} + a_{n}) > c(a_{m} + a_{n})\) then both \(c(a_{m} + a_{n})\) and \(c a_{m + n}\) are less than \(c a_{m + n}\leq c^{2}(a_{m} + a_{n})< \operatorname {lcm}(a_{m},a_{n})\) . This implies \(c a_{m + n} = c(a_{m} + a_{n})\iff a_{m + n} = a_{m} + a_{n}\) Now we can extend this further: since \(\gcd (a_{m},a_{m + n}) = \gcd (a_{m},a_{m} + a_{n}) = \gcd (a_{m},a_{n})\) , it follows that \[\operatorname {lcm}(a_{m},a_{m + n}) = \frac{a_{m}a_{m + n}}{\gcd (a_{m},a_{n})} = \frac{a_{m + n}}{a_{n}}\operatorname {lcm}(a_{m},a_{n}) > \frac{c^{2}(a_{m} + a_{n})^{2}}{a_{n}}\] \[\qquad >\frac{c^{2}(2a_{m}a_{n} + a_{n}^{2})}{a_{n}} = c^{2}(2a_{m} + a_{n}) = c^{2}(a_{m} + a_{m + n}).\] We can iterate this reasoning to obtain that \(a_{k m + n} = k a_{m} + a_{n}\) , for all \(k\in \mathbb{Z}_{>0}\) . In fact, if the condition \(\operatorname {lcm}(a_{m},a_{n}) > c^{2}(a_{m} + a_{n})\) holds for the pair \((n,m)\) , then it also holds for the pairs \((m + n,m)\) , \((2m + n,m)\) , ..., \(((k - 1)m + n,m)\) , which implies \(a_{k m + n} = a_{(k - 1)m + n} + a_{m} =\) \(a_{(k - 2)m + n} + 2a_{m} = \cdot \cdot \cdot = a_{n} + k a_{m}\) Similarly, \(a_{m + k n} = a_{m} + k a_{n}\) Now, \(a_{m + n + m n} = a_{n + (n + 1)m} = a_{m + (m + 1)n}\implies a_{n} + (n + 1)a_{m} = a_{m} + (m + 1)a_{n}\iff m a_{n} =\) \(n a_{m}\) . If \(d = \gcd (m,n)\) then \(\frac{n}{d} a_{m} = \frac{m}{d} a_{n}\) Therefore, since \(\gcd (\frac{m}{d},\frac{n}{d}) = 1\) , \(\frac{m}{d}\) divides \(a_{m}\) and \(\frac{n}{d}\) divides \(a_{n}\) , which means that \[a_{n} = \frac{m}{d}\cdot t = \frac{t}{d} m\quad \mathrm{and}\quad a_{m} = \frac{n}{d}\cdot t = \frac{t}{d} n,\quad \mathrm{for~some~}t\in \mathbb{Z}_{>0},\] which also implies \[a_{k m + n} = \frac{t}{d} (k m + n)\quad \mathrm{and}\quad a_{m + k n} = \frac{t}{d} (m + k n),\quad \mathrm{for~all~}k\in \mathbb{Z}_{>0}.\] Now let's prove that \(a_{kd} = tk = \frac{t}{d} (kd)\) for all \(k \in \mathbb{Z}_{>0}\) . In fact, there exist arbitrarily large positive integers \(R\) , \(S\) such that \(kd = Rm - Sn = (n + (R + 1)m) - (m + (S + 1)n)\) (for instance, let \(u\) , \(v \in \mathbb{Z}\) such that \(kd = mu - nv\) and take \(R = u + Qn\) and \(S = v + Qm\) for \(Q\) sufficiently large.) Let \(x = n + (R + 1)m\) and \(y = m + (S + 1)n\) . Then \(kd = x - y \iff x = y + kd\) , \(a_{x} = \frac{t}{d} x\) , and \(a_{y} = \frac{t}{d} y = \frac{t}{d} (x - kd) = a_{x} - tk\) . Thus \(a_{x}\) divides \(c(a_{y} + a_{kd}) = c(a_{kd} + a_{x} - tk)\) , and therefore also \(c(a_{kd} - tk)\) . Since \(a_{x} = \frac{t}{d} x\) can be arbitrarily large, \(a_{kd} = tk = \frac{t}{d} (kd)\) . In particular, \(a_{d} = t\) , so \(a_{kd} = ka_{d}\) . Since \(ka_{d} = a_{kd} = a_{1 + (kd - 1)}\) divides \(c(a_{1} + a_{kd - 1})\) , \(b_{k} = a_{kd - 1}\) is unbounded. Pick \(p > a_{kd - 1}\) a large prime and consider \(a_{pd} = pa_{d}\) . Then \[\operatorname {lcm}(a_{pd},a_{kd - 1})\geq \operatorname {lcm}(p,a_{kd - 1}) = pa_{kd - 1}.\] We can pick \(a_{kd - 1}\) and \(p\) large enough so that their product is larger than a particular linear combination of them, that is, \[\operatorname {lcm}(p,a_{kd - 1}) = pa_{kd - 1} > c^{2}(pa_{d} + a_{kd - 1}) = c^{2}(a_{pd} + a_{kd - 1}).\] Then all the previous facts can be applied, and since \(\gcd (pd, kd - 1) = 1\) , \(a_{k} = a_{k\gcd (pd, kd - 1)} = ka_{\gcd (pd, kd - 1)}\) , that is, the sequence is linear. Also, since \(a_{1}\) divides all terms, \(a_{1} = 1\) . Case 2: \(\operatorname {lcm}(a_{m}, a_{n}) \leq c^{2}(a_{m} + a_{n})\) for all \(m, n\) . Suppose that \(a_{m} \leq a_{n}\) ; then \(\operatorname {lcm}(a_{m}, a_{n}) = Ma_{n} \leq c^{2}(a_{m} + a_{n}) \leq 2c^{2}a_{n} \Rightarrow M \leq 2c^{2}\) , that is, the factor in the smaller term that is not in the larger term is at most \(2c^{2}\) . We prove that in this case the sequence must be bounded. Suppose on the contrary; then there is a term \(a_{m}\) that is divisible by a large prime power \(p^{d}\) . Then every larger term \(a_{n}\) is divisible by a factor larger than \(\frac{p^{d}}{2c^{2}}\) . So we pick \(p^{d} > (2c^{2})^{2}\) , so that every large term \(a_{n}\) is divisible by the prime power \(p^{e} > 2c^{2}\) . Finally, fix \(a_{k}\) for any \(k\) . It follows from \(a_{k + n} \mid c(a_{k} + a_{n})\) that \((a_{n})\) is unbounded, so we can pick \(a_{n}\) and \(a_{k + n}\) large enough such that both are divisible by \(p^{e}\) . Hence any \(a_{k}\) is divisible by \(p\) , which is a contradiction to the fact that there is no \(D > 1\) that divides every term in the sequence.
{ "problem_match": "# Problem 5 ", "resource_path": "APMO/segmented/en-apmo2025_sol.jsonl", "solution_match": "# Solution \n\n" }
192
2,860
2008
T1
3
null
Balkan_MO
Let $n$ be a positive integer. The rectangle $A B C D$ with side lengths $A B=90 n+1$ and $B C=90 n+5$ is partitioned into unit squares with sides parallel to the sides of $A B C D$. Let $S$ be the set of all points which are vertices of these unit squares. Prove that the number of lines which pass through at least two points from $S$ is divisible by 4.
Denote $90 n+1=m$. We investigate the number of the lines modulo 4 consecutively reducing different types of lines. The vertical and horizontal lines are $(m+5)+(m+1)=2(m+3)$ which is divisible to 4. Moreover, every line which makes an acute angle to the axe $O x$ (i.e. that line has a positive angular coefficient) corresponds to unique line with an obtuse angle (consider the symmetry with respect to the line through the midpoints of $A B$ and $C D$ ). Therefore it is enough to prove that the lines with acute angles are an even number. Every line which does not pass through the center $O$ of the rectangle corresponds to another line with the same angular coefficent(consider the symmetry with respect to $O$ ). Therefore it is enough to consider the lines through $O$. Every line through $O$ has an angular coefficient $\frac{p}{q}$, where $(p, q)=1, p$ and $q$ are odd positive integers. (To see this, consider the two nearest, from the two sides, to $O$ points of the line). If $p \neq 1, q \neq 1, \quad p \leq m$ and $q \leq m$, the line with angular coefficient $\frac{p}{q}$, uniquely corresponds to the line with angular coefficient $\frac{q}{p}$. It remains to prove that the number of the remaining lines is even. The last number is $$ 1+\frac{\varphi(m+2)}{2}+\frac{\varphi(m+4)}{2}-1=\frac{\varphi(m+2)+\varphi(m+4)}{2} $$ because we have: 1) one line with $p=q=1$; 2) $\frac{\varphi(m+2)}{2}$ lines with angular coefficient $\frac{p}{m+2}, p \leq m$ is odd and $(p, m+2)=1$; 3) $\frac{\varphi(m+4)}{2}-1$ lines with angular coefficient $\frac{p}{m+4}, p \leq m$ is odd and $(p, m+4)=1$. Now the assertion follows from the fact that the number $\varphi(m+2)+\varphi(m+4)=\varphi(90 n+3)+\varphi(90 n+5)$ is divisible to 4.
{ "problem_match": "# Problem 3", "resource_path": "Balkan_MO/segmented/en-2008-BMO-type1.jsonl", "solution_match": "# Solution." }
102
535
2008
T1
4
null
Balkan_MO
Let $c$ be a positive integer. The sequence $a_{1}, a_{2}, \ldots, a_{n}, \ldots$ is defined by $a_{1}=c$, and $a_{n+1}=a_{n}^{2}+a_{n}+c^{3}$, for every positive integer $n$. Find all values of $c$ for which there exist some integers $k \geq 1$ and $m \geq 2$, such that $a_{k}^{2}+c^{3}$ is the $m^{\text {th }}$ power of some positive integer.
First, notice: $$ a_{n+1}^{2}+c^{3}=\left(a_{n}^{2}+a_{n}+c^{3}\right)^{2}+c^{3}=\left(a_{n}^{2}+c^{3}\right)\left(a_{n}^{2}+2 a_{n}+1+c^{3}\right) $$ We first prove that $a_{n}^{2}+c^{3}$ and $a_{n}^{2}+2 a_{n}+1+c^{3}$ are coprime. We prove by induction that $4 c^{3}+1$ is coprime with $2 a_{n}+1$, for every $n \geq 1$. Let $n=1$ and $p$ be a prime divisor of $4 c^{3}+1$ and $2 a_{1}+1=2 c+1$. Then $p$ divides $2\left(4 c^{3}+1\right)=(2 c+1)\left(4 c^{2}-2 c+1\right)+1$, hence $p$ divides 1 , a contradiction. Assume now that $\left(4 c^{3}+1,2 a_{n}+1\right)=1$ for some $n \geq 1$ and the prime $p$ divides $4 c^{3}+1$ and $2 a_{n+1}+1$. Then $p$ divides $4 a_{n+1}+2=\left(2 a_{n}+1\right)^{2}+4 c^{3}+1$, which gives a contradiction. Assume that for some $n \geq 1$ the number $$ a_{n+1}^{2}+c^{3}=\left(a_{n}^{2}+a_{n}+c^{3}\right)^{2}+c^{3}=\left(a_{n}^{2}+c^{3}\right)\left(a_{n}^{2}+2 a_{n}+1+c^{3}\right) $$ is a power. Since $a_{n}^{2}+c^{3}$ and $a_{n}^{2}+2 a_{n}+1+c^{3}$ are coprime, than $a_{n}^{2}+c^{3}$ is a power as well. The same argument can be further applied giving that $a_{1}^{2}+c^{3}=c^{2}+c^{3}=c^{2}(c+1)$ is a power. If $a^{2}(a+1)=t^{m}$ with odd $m \geq 3$, then $a=t_{1}^{m}$ and $a+1=t_{2}^{m}$, which is impossible. If $a^{2}(a+1)=t^{2 m_{1}}$ with $m_{1} \geq 2$, then $a=t_{1}^{m_{1}}$ and $a+1=t_{2}^{m_{1}}$, which is impossible. Therefore $a^{2}(a+1)=t^{2}$ whence we obtain the solutions $a=s^{2}-1, s \geq 2, s \in \mathbb{N}$.
{ "problem_match": "# Problem 4", "resource_path": "Balkan_MO/segmented/en-2008-BMO-type1.jsonl", "solution_match": "# Solution." }
137
736
2009
T1
1
null
Balkan_MO
We start by observing that $z$ must be even, so $z^{2}=3^{x}-5^{y} \equiv(-1)^{x}-1(\bmod 4)$ is divisible by 4 , which implies that $x$ is even, say $x=2 t$. Then our equation can be rewritten as $\left(3^{t}-z\right)\left(3^{t}+z\right)=5^{y}$, which means that both $3^{t}-z=5^{k}$ and $3^{t}+z=5^{y-k}$ for some nonnegative integer $k$. Since $5^{k}+5^{y-k}=2 \cdot 3^{t}$ is not divisible by 5 , it follows that $k=0$ and $$ 2 \cdot 3^{t}=5^{y}+1 $$ Suppose that $t \geq 2$. Then $5^{y}+1$ is divisible by 9 , which is only possible if $y \equiv 3$ $(\bmod 6)$. However, in this case $5^{y}+1 \equiv 5^{3}+1 \equiv 0(\bmod 7)$, so $5^{y}+1$ is also divisible by 7 , which is impossible. Therefore we must have $t \leq 1$, which yields a (unique) solution $(x, y, z)=(2,1,2)$.
We start by observing that $f$ is injective. From the known identity $$ \left(a^{2}+2 b^{2}\right)\left(c^{2}+2 d^{2}\right)=(a c \pm 2 b d)^{2}+2(a d \mp b c)^{2} $$ we obtain $f(a c+2 b d)^{2}+2 f(a d-b c)^{2}=f(a c-2 b d)^{2}+2 f(a d+b c)^{2}$, assuming that the arguments are positive integers. Specially, for $b=c=d=1$ and $a \geq 3$ we have $f(a+2)^{2}+2 f(a-1)^{2}=f(a-2)^{2}+2 f(a+1)^{2}$. Denoting $g(n)=f(n)^{2}$ we get a recurrent relation $g(a+2)-2 g(a+1)+2 g(a-1)-g(a-2)=0$ whose characteristic polynomial is $(x+1)(x-1)^{3}$, which leads to $$ g(n)=A(-1)^{n}+B+C n+D n^{2} . $$ Substituting $m=n$ in the original equation yields $g(3 g(n))=9 n^{4}$, which together with $(\dagger)$ gives us $$ \begin{aligned} L=9 n^{4} & =A(-1)^{3\left(A(-1)^{n}+B+C n+D n^{2}\right)}+B+\underbrace{3 C\left[A(-1)^{n}+B+C n+D n^{2}\right]} \\ & +9 D\left[A(-1)^{n}+B+C n+D n^{2}\right]^{2}=R . \end{aligned} $$ Since $0=\lim _{n \rightarrow \infty} \frac{R-L}{n^{4}}=9 D^{3}-9$, we have $D^{3}=1$ (so $D \neq 0$ ); similarly, $0=\lim _{n \rightarrow \infty} \frac{R-L}{n^{3}}=18 D^{2} C$, so $C=0$. Moreover, for $n=2 k$ and $n=2 k+1$ respectively we obtain $0=\lim _{k \rightarrow \infty} \frac{R-L}{(2 k)^{2}}=18 D^{2}(A+B)$ and $0=\lim _{k \rightarrow \infty} \frac{R-L}{(2 k+1)^{2}}=$ $18 D^{2}(-A+B)$, implying $A+B=-A+B=0$; hence $A=B=0$. Finally, $g(n)=D n^{2}, D^{3}=1$ and $g: \mathbb{N} \rightarrow \mathbb{N}$ gives us $D=1$, i.e. $f(n)=n$. It is directly verified that this function satisfies the conditions of the problem. Remark. Using limits can be avoided. Since the rigth-hand side in ( $\dagger$ ) takes only integer values, it follows that $A, B, C, D$ are rational, so taking suitable multiples of integers for $n$ eliminates the powers of -1 and leaves a polynomial equality.
{ "problem_match": "\n1.", "resource_path": "Balkan_MO/segmented/en-2009-BMO-type2.jsonl", "solution_match": "\n4." }
321
762
2009
T1
2
null
Balkan_MO
In a triangle $A B C$, points $M$ and $N$ on the sides $A B$ and $A C$ respectively are such that $M N \| B C$. Let $B N$ and $C M$ intersect at point $P$. The circumcircles of triangles $B M P$ and $C N P$ intersect at two distinct points $P$ and $Q$. Prove that $\angle B A Q=\angle C A P$. (Moldova)
Since the quadrilaterals $B M P Q$ and $C N P Q$ are cyclic, we have $\angle B Q N=\angle B Q P+$ $\angle P Q N=\angle A M C+\angle M C A=180^{\circ}-$ $\angle C A B$, so $A B Q N$ is cyclic as well. Hence $\frac{\sin \angle B A Q}{\sin \angle N A Q}=\frac{B Q}{N Q}$. Moreover, triangles $M B Q$ and $C N Q$ are similar, so $$ \frac{\sin \angle B A Q}{\sin \angle C A Q}=\frac{B Q}{N Q}=\frac{B M}{C N}=\frac{A B}{A C} $$ On the other hand, if $A P$ meets $B C$ at $A_{1}$, then by the Cheva theorem $\frac{B A_{1}}{A_{1} C}=$ $\frac{B M}{M A} \cdot \frac{A N}{N C}=1$, so $A_{1}$ is the midpoint of $B C$ and $$ \frac{\sin \angle C A P}{\sin \angle B A P}=\frac{A B}{A C} \cdot \frac{A C \cdot A A_{1} \sin \angle C A P}{A B \cdot A A_{1} \sin \angle B A P}=\frac{A B}{A C} \cdot \frac{S_{\triangle C A A_{1}}}{S_{\triangle B A A_{1}}}=\frac{A B}{A C} $$ Therefore, if we denote $\angle C A P=\varphi, \angle B A Q=\psi$ and $\angle B A C=\alpha$, we have $\frac{\sin \psi}{\sin (\alpha-\psi)}=\frac{\sin \varphi}{\sin (\alpha-\varphi)}$, which is equivalent to $\sin \psi \sin (\alpha-\varphi)=\sin \varphi \sin (\alpha-\psi)$. The addition formulas reduce the last equality to $0=\sin \alpha(\sin \varphi \cos \psi-\sin \psi \cos \varphi)=$ $\sin \alpha \sin (\varphi-\psi)$, from which we conclude that $\psi=\varphi$, as desired.
{ "problem_match": "\n2.", "resource_path": "Balkan_MO/segmented/en-2009-BMO-type2.jsonl", "solution_match": "\n2." }
103
524
2009
T1
3
null
Balkan_MO
A $9 \times 12$ rectangle is divided into unit squares. The centers of all the unit squares, except the four corner squares and the eight squares adjacent (by side) to them, are colored red. Is it possible to numerate the red centers by $C_{1}, C_{2}, \ldots, C_{96}$ so that the following two conditions are fulfilled: $1^{\circ}$ All segments $C_{1} C_{2}, C_{2} C_{3}, \ldots C_{95} C_{96}, C_{96} C_{1}$ have the length $\sqrt{13}$; $2^{\circ}$ The poligonal line $C_{1} C_{2} \ldots C_{96} C_{1}$ is centrally symmetric? (Bulgaria)
Place the given rectangle into the coordinate plane so that the center of the square at the intersection of $i$-th column and $j$-th row has the coordinates $(i, j)$. Suppose that a desired numeration of the red points exists; it corresponds to a path, i.e. a closed poligonal line consisting of 96 segments of length $\sqrt{13}$, passing through each red point exactly once. Note that points $(i, j)$ and $(k, l)$ are adjacent in the path if and only if $\{|i-k|,|j-l|\}=\{2,3\}$. The center of symmetry must be at point $C\left(5 \frac{1}{2}, 5\right)$. Consider the points $A(2,2)$, $B(11,8)$. These two points are symmetric with respect to $C$ and divide the path into two parts $\gamma_{1}$ and $\gamma_{2}$. Note that, if the rectangular board is colored alternately white and black (like a chessboard), $A$ and $B$ are of different colors, and each segment connects two squares of different colors. It follows that each of $\gamma_{1}, \gamma_{2}$ consists of an odd number of segments. Thus these two parts are of different lengths and cannot be symmetric to each other. Therefore each of $\gamma_{1}, \gamma_{2}$ is centrally symmetric itself. Being of an odd length, each of the parts $\gamma_{1}, \gamma_{2}$ must contain a segment which is centrally symmetric with respect to $C$. There are only two such segments one connecting $(5,4)$ and $(8,6)$, and one connecting $(5,6)$ and $(8,4)$, so these two segments must be parts of our path. Moreover, point $(2,2)$ is connected with only two points, namely $(4,5)$ and $(5,4)$, so these three points are directly connected. Analogous conclusions can be made about points $(2,8),(11,2)$ and $(11,8)$, so the closed path $(5,4)-(2,2)-(4,5)-(2,8)-(5,6)-(8,4)-(11,2)-(9,5)-(11,8)-$ $(8,6)-(5,4)$ is entirely contained in our path, which is clearly a contradiction.
{ "problem_match": "\n3.", "resource_path": "Balkan_MO/segmented/en-2009-BMO-type2.jsonl", "solution_match": "\n3." }
179
518
2009
T1
4
null
Balkan_MO
Determine all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfying $$ f\left(f(m)^{2}+2 f(n)^{2}\right)=m^{2}+2 n^{2} \quad \text { for all } m, n \in \mathbb{N} . \quad \text { (Bulgaria) } $$ Time allowed: 270 minutes. Each problem is worth 10 points. ## SOLUTIONS
We start by observing that $f$ is injective. From the known identity $$ \left(a^{2}+2 b^{2}\right)\left(c^{2}+2 d^{2}\right)=(a c \pm 2 b d)^{2}+2(a d \mp b c)^{2} $$ we obtain $f(a c+2 b d)^{2}+2 f(a d-b c)^{2}=f(a c-2 b d)^{2}+2 f(a d+b c)^{2}$, assuming that the arguments are positive integers. Specially, for $b=c=d=1$ and $a \geq 3$ we have $f(a+2)^{2}+2 f(a-1)^{2}=f(a-2)^{2}+2 f(a+1)^{2}$. Denoting $g(n)=f(n)^{2}$ we get a recurrent relation $g(a+2)-2 g(a+1)+2 g(a-1)-g(a-2)=0$ whose characteristic polynomial is $(x+1)(x-1)^{3}$, which leads to $$ g(n)=A(-1)^{n}+B+C n+D n^{2} . $$ Substituting $m=n$ in the original equation yields $g(3 g(n))=9 n^{4}$, which together with $(\dagger)$ gives us $$ \begin{aligned} L=9 n^{4} & =A(-1)^{3\left(A(-1)^{n}+B+C n+D n^{2}\right)}+B+\underbrace{3 C\left[A(-1)^{n}+B+C n+D n^{2}\right]} \\ & +9 D\left[A(-1)^{n}+B+C n+D n^{2}\right]^{2}=R . \end{aligned} $$ Since $0=\lim _{n \rightarrow \infty} \frac{R-L}{n^{4}}=9 D^{3}-9$, we have $D^{3}=1$ (so $D \neq 0$ ); similarly, $0=\lim _{n \rightarrow \infty} \frac{R-L}{n^{3}}=18 D^{2} C$, so $C=0$. Moreover, for $n=2 k$ and $n=2 k+1$ respectively we obtain $0=\lim _{k \rightarrow \infty} \frac{R-L}{(2 k)^{2}}=18 D^{2}(A+B)$ and $0=\lim _{k \rightarrow \infty} \frac{R-L}{(2 k+1)^{2}}=$ $18 D^{2}(-A+B)$, implying $A+B=-A+B=0$; hence $A=B=0$. Finally, $g(n)=D n^{2}, D^{3}=1$ and $g: \mathbb{N} \rightarrow \mathbb{N}$ gives us $D=1$, i.e. $f(n)=n$. It is directly verified that this function satisfies the conditions of the problem. Remark. Using limits can be avoided. Since the rigth-hand side in ( $\dagger$ ) takes only integer values, it follows that $A, B, C, D$ are rational, so taking suitable multiples of integers for $n$ eliminates the powers of -1 and leaves a polynomial equality.
{ "problem_match": "\n4.", "resource_path": "Balkan_MO/segmented/en-2009-BMO-type2.jsonl", "solution_match": "\n4." }
108
762
2010
T1
1
null
Balkan_MO
The left-hand side is equal to $$ \frac{a^{3} b^{3}+b^{3} c^{3}+c^{3} a^{3}-a^{3} b^{2} c-b^{3} c^{2} a-c^{3} a^{2} b}{(a+b)(b+c)(c+a)} $$ so it is enough to show that $a^{3} b^{3}+b^{3} c^{3}+c^{3} a^{3} \geq a^{3} b^{2} c+b^{3} c^{2} a+c^{3} a^{2} b$. The AM-GM inequality gives us $a^{3} b^{3}+a^{3} b^{3}+a^{3} c^{3} \geq 3 \sqrt[3]{a^{3} b^{3} \cdot a^{3} b^{3} \cdot a^{3} c^{3}}=3 a^{3} b^{2} c$; summing this inequality and its cyclic analogs yields the desired inequality. Equality holds if and only if $a=b=c$.
There are $n+1-\varphi(n)$ nonnegative integers not coprime with $n$, and whenever $r$ is among them, so is $n-r$. This gives us the formula $f(n)=\frac{1}{2} n(n+1-\varphi(n))$. Suppose that $f(n)=f(n+p)$. We observe first that $n$ and $n+p$ divide $2 f(n)<n(n+p)$, so $n$ and $n+p$ are not coprime, which implies that $n=k p$ for some $k \in \mathbb{N}$. Then the equality $f(n)=f(n+p)$ is equivalent to $k(k p+1-\varphi(k p))=(k+1)(k p+p+$ $1-\varphi(k p+p)$ ), so $$ k p+1-\varphi(k p)=(k+1) x \quad \text { and } \quad k p+p+1-\varphi(k p+p)=k x $$ for some $x \in \mathbb{N}, x<p$. Subtraction gives us $x=\varphi(k p+p)-\varphi(k p)-p$. Since $\varphi(k p)$ and $\varphi(k p+p)$ are both divisible by $p-1$ (by the formula for $\varphi(n)$ ), we obtain $x \equiv-1(\bmod p-1)$. If $p=2$ then $x=1$ and $\varphi(2 k+2)=k+3$, which is impossible because $\varphi(2 k+2) \leq$ $k+1$. If $p=3$ then $x=1$ and $\varphi(3 k+3)=2 k+4$, again impossible because $\varphi(3 k+3) \leq 2 k+2$. Therefore $p \geq 5$, so $x \equiv-1(\bmod p-1)$ implies $x=p-2$. Plugging this value in (1) leads to $$ \varphi(k p)=2 k+3-p \quad \text { and } \quad \varphi(k p+p)=2 k+1+p $$ If $k$ is divisible by $p$, then $\varphi(k p)$ is also divisible by $p$, so $p \mid 2 k+3$ and hence $p \mid 3$, a contradiction. Similarly, $p \nmid k+1$. It follows that $\varphi(k p)=(p-1) \varphi(k)$ and $\varphi(k p+p)=(p-1) \varphi(k+1)$ which together with (1) yields $$ \varphi(k)=\frac{2 k+2}{p-1}-1 \quad \text { and } \quad \varphi(k+1)=\frac{2 k+2}{p-1}+1 $$ From here we see that $\varphi(t)$ is not divisible by 4 either for $t=k$ or for $t=k+1$, which is only possible if $t=q^{i}$ or $t=2 q^{i}$ for some odd prime $q$ and $i \in \mathbb{N}$, or $t \in\{1,2,4\}$. The cases $t=1,2,4$ are easily ruled out, so either $k$ or $k+1$ is of the form $q^{i}$ or $2 q^{i}$. For $t=k=q^{i}, \varphi\left(q^{i}\right)+1=q^{i-1}(q-1)+1$ divides $2 q^{i}+2$ which is impossible because $q^{i}+1>q^{i-1}(q-1)+1>\frac{2}{3}\left(2 q^{i}+2\right)$. The other three cases are similarly shown to be impossible.
{ "problem_match": "\n1.", "resource_path": "Balkan_MO/segmented/en-2010-BMO-type2.jsonl", "solution_match": "\n4." }
254
864
2010
T1
4
null
Balkan_MO
For every integer $n \geq 2$, denote by $f(n)$ the sum of positive integers not exceeding $n$ that are not coprime to $n$. Prove that $f(n+p) \neq f(n)$ for any such $n$ and any prime number $p$. (Turkey) Time allowed: 270 minutes. Each problem is worth 10 points. ## SOLUTIONS
There are $n+1-\varphi(n)$ nonnegative integers not coprime with $n$, and whenever $r$ is among them, so is $n-r$. This gives us the formula $f(n)=\frac{1}{2} n(n+1-\varphi(n))$. Suppose that $f(n)=f(n+p)$. We observe first that $n$ and $n+p$ divide $2 f(n)<n(n+p)$, so $n$ and $n+p$ are not coprime, which implies that $n=k p$ for some $k \in \mathbb{N}$. Then the equality $f(n)=f(n+p)$ is equivalent to $k(k p+1-\varphi(k p))=(k+1)(k p+p+$ $1-\varphi(k p+p)$ ), so $$ k p+1-\varphi(k p)=(k+1) x \quad \text { and } \quad k p+p+1-\varphi(k p+p)=k x $$ for some $x \in \mathbb{N}, x<p$. Subtraction gives us $x=\varphi(k p+p)-\varphi(k p)-p$. Since $\varphi(k p)$ and $\varphi(k p+p)$ are both divisible by $p-1$ (by the formula for $\varphi(n)$ ), we obtain $x \equiv-1(\bmod p-1)$. If $p=2$ then $x=1$ and $\varphi(2 k+2)=k+3$, which is impossible because $\varphi(2 k+2) \leq$ $k+1$. If $p=3$ then $x=1$ and $\varphi(3 k+3)=2 k+4$, again impossible because $\varphi(3 k+3) \leq 2 k+2$. Therefore $p \geq 5$, so $x \equiv-1(\bmod p-1)$ implies $x=p-2$. Plugging this value in (1) leads to $$ \varphi(k p)=2 k+3-p \quad \text { and } \quad \varphi(k p+p)=2 k+1+p $$ If $k$ is divisible by $p$, then $\varphi(k p)$ is also divisible by $p$, so $p \mid 2 k+3$ and hence $p \mid 3$, a contradiction. Similarly, $p \nmid k+1$. It follows that $\varphi(k p)=(p-1) \varphi(k)$ and $\varphi(k p+p)=(p-1) \varphi(k+1)$ which together with (1) yields $$ \varphi(k)=\frac{2 k+2}{p-1}-1 \quad \text { and } \quad \varphi(k+1)=\frac{2 k+2}{p-1}+1 $$ From here we see that $\varphi(t)$ is not divisible by 4 either for $t=k$ or for $t=k+1$, which is only possible if $t=q^{i}$ or $t=2 q^{i}$ for some odd prime $q$ and $i \in \mathbb{N}$, or $t \in\{1,2,4\}$. The cases $t=1,2,4$ are easily ruled out, so either $k$ or $k+1$ is of the form $q^{i}$ or $2 q^{i}$. For $t=k=q^{i}, \varphi\left(q^{i}\right)+1=q^{i-1}(q-1)+1$ divides $2 q^{i}+2$ which is impossible because $q^{i}+1>q^{i-1}(q-1)+1>\frac{2}{3}\left(2 q^{i}+2\right)$. The other three cases are similarly shown to be impossible.
{ "problem_match": "\n4.", "resource_path": "Balkan_MO/segmented/en-2010-BMO-type2.jsonl", "solution_match": "\n4." }
90
864
2011
T1
2
null
Balkan_MO
Given real numbers $x, y, z$ such that $x+y+z=0$, show that $$ \frac{x(x+2)}{2 x^{2}+1}+\frac{y(y+2)}{2 y^{2}+1}+\frac{z(z+2)}{2 z^{2}+1} \geq 0 . $$ When does equality hold?
The inequality is clear if $x y z=0$, in which case equality holds if and only if $x=y=z=0$. Henceforth assume $x y z \neq 0$ and rewrite the inequality as $$ \frac{(2 x+1)^{2}}{2 x^{2}+1}+\frac{(2 y+1)^{2}}{2 y^{2}+1}+\frac{(2 z+1)^{2}}{2 z^{2}+1} \geq 3 . $$ Notice that (exactly) one of the products $x y, y z, z x$ is positive, say $y z>0$, to get $$ \begin{array}{rlr} \frac{(2 y+1)^{2}}{2 y^{2}+1}+\frac{(2 z+1)^{2}}{2 z^{2}+1} & \geq \frac{2(y+z+1)^{2}}{y^{2}+z^{2}+1} & \text { (by Jensen) } \\ & =\frac{2(x-1)^{2}}{x^{2}-2 y z+1} & (\text { for } x+y+z=0) \\ & \geq \frac{2(x-1)^{2}}{x^{2}+1} . & (\text { for } y z>0) \end{array} $$ Here equality holds if and only if $x=1$ and $y=z=-1 / 2$. Finally, since $$ \frac{(2 x+1)^{2}}{2 x^{2}+1}+\frac{2(x-1)^{2}}{x^{2}+1}-3=\frac{2 x^{2}(x-1)^{2}}{\left(2 x^{2}+1\right)\left(x^{2}+1\right)} \geq 0, \quad x \in \mathbb{R}, $$ the conclusion follows. Clearly, equality holds if and only if $x=1$, so $y=z=-1 / 2$. Therefore, if $x y z \neq 0$, equality holds if and only if one of the numbers is 1 , and the other two are $-1 / 2$. Marking Scheme. Proving the inequality and identifying the equality case when one of the variables vanishes Applying Jensen or Cauchy-Schwarz inequality to the fractions involving the pair of numbers of the same sign 3p Producing the corresponding lower bound in the third variable ................... 3p Remark. Any partial or equivalent approach should be marked accordingly.
{ "problem_match": "# PROBLEM 2", "resource_path": "Balkan_MO/segmented/en-2011-BMO-type1.jsonl", "solution_match": "\nSolution." }
87
588
2011
T1
3
null
Balkan_MO
Let $S$ be a finite set of positive integers which has the following property: if $x$ is a member of $S$, then so are all positive divisors of $x$. A non-empty subset $T$ of $S$ is good if whenever $x, y \in T$ and $x<y$, the ratio $y / x$ is a power of a prime number. A non-empty subset $T$ of $S$ is bad if whenever $x, y \in T$ and $x<y$, the ratio $y / x$ is not a power of a prime number. We agree that a singleton subset of $S$ is both good and bad. Let $k$ be the largest possible size of a good subset of $S$. Prove that $k$ is also the smallest number of pairwise-disjoint bad subsets whose union is $S$.
Notice first that a bad subset of $S$ contains at most one element from a good one, to deduce that a partition of $S$ into bad subsets has at least as many members as a maximal good subset. Notice further that the elements of a good subset of $S$ must be among the terms of a geometric sequence whose ratio is a prime: if $x<y<z$ are elements of a good subset of $S$, then $y=x p^{\alpha}$ and $z=y q^{\beta}=x p^{\alpha} q^{\beta}$ for some primes $p$ and $q$ and some positive integers $\alpha$ and $\beta$, so $p=q$ for $z / x$ to be a power of a prime. Next, let $P=\{2,3,5,7,11, \cdots\}$ denote the set of all primes, let $$ m=\max \left\{\exp _{p} x: x \in S \text { and } p \in P\right\} $$ where $\exp _{p} x$ is the exponent of the prime $p$ in the canonical decomposition of $x$, and notice that a maximal good subset of $S$ must be of the form $\left\{a, a p, \cdots, a p^{m}\right\}$ for some prime $p$ and some positive integer $a$ which is not divisible by $p$. Consequently, a maximal good subset of $S$ has $m+1$ elements, so a partition of $S$ into bad subsets has at least $m+1$ members. Finally, notice by maximality of $m$ that the sets $$ S_{k}=\left\{x: x \in S \text { and } \sum_{p \in P} \exp _{p} x \equiv k(\bmod m+1)\right\}, \quad k=0,1, \cdots, m $$ form a partition of $S$ into $m+1$ bad subsets. The conclusion follows. Considering the maximal exponent $m$ of a prime and deriving $k=m+1 \ldots \ldots \mathbf{1 p}$ Noticing that the intersection of a bad set and a good set contains at most one element and infering that a partition of $S$ into bad sets has at least $k$ members.....2p Producing a partition of $S$ into $k$ bad subsets . . . . . . . . . . . . . . . . . . . . . . . Remark. Any partial or equivalent approach should be marked accordingly.
{ "problem_match": "# PROBLEM 3", "resource_path": "Balkan_MO/segmented/en-2011-BMO-type1.jsonl", "solution_match": "\nSolution." }
182
568
2011
T1
4
null
Balkan_MO
Let $A B C D E F$ be a convex hexagon of area 1 , whose opposite sides are parallel. The lines $A B, C D$ and $E F$ meet in pairs to determine the vertices of a triangle. Similarly, the lines $B C, D E$ and $F A$ meet in pairs to determine the vertices of another triangle. Show that the area of at least one of these two triangles is at least $3 / 2$.
Unless otherwise stated, throughout the proof indices take on values from 0 to 5 and are reduced modulo 6 . Label the vertices of the hexagon in circular order, $A_{0}, A_{1}, \cdots, A_{5}$, and let the lines of support of the alternate sides $A_{i} A_{i+1}$ and $A_{i+2} A_{i+3}$ meet at $B_{i}$. To show that the area of at least one of the triangles $B_{0} B_{2} B_{4}, B_{1} B_{3} B_{5}$ is greater than or equal to $3 / 2$, it is sufficient to prove that the total area of the six triangles $A_{i+1} B_{i} A_{i+2}$ is at least 1: $$ \sum_{i=0}^{5} \operatorname{area} A_{i+1} B_{i} A_{i+2} \geq 1 $$ To begin with, reflect each $B_{i}$ through the midpoint of the segment $A_{i+1} A_{i+2}$ to get the points $B_{i}^{\prime}$. We shall prove that the six triangles $A_{i+1} B_{i}^{\prime} A_{i+2}$ cover the hexagon. To this end, reflect $A_{2 i+1}$ through the midpoint of the segment $A_{2 i} A_{2 i+2}$ to get the points $A_{2 i+1}^{\prime}$, $i=0,1,2$. The hexagon splits into three parallelograms, $A_{2 i} A_{2 i+1} A_{2 i+2} A_{2 i+1}^{\prime}, i=0,1,2$, and a (possibly degenerate) triangle, $A_{1}^{\prime} A_{3}^{\prime} A_{5}^{\prime}$. Notice first that each parallelogram $A_{2 i} A_{2 i+1} A_{2 i+2} A_{2 i+1}^{\prime}$ is covered by the pair of triangles $\left(A_{2 i} B_{2 i+5}^{\prime} A_{2 i+1}, A_{2 i+1} B_{2 i}^{\prime} A_{2 i+2}\right)$, $i=0,1,2$. The proof is completed by showing that at least one of these pairs contains a triangle that covers the triangle $A_{1}^{\prime} A_{3}^{\prime} A_{5}^{\prime}$. To this end, it is sufficient to prove that $A_{2 i} B_{2 i+5}^{\prime} \geq A_{2 i} A_{2 i+5}^{\prime}$ and $A_{2 j+2} B_{2 j}^{\prime} \geq A_{2 j+2} A_{2 j+3}^{\prime}$ for some indices $i, j \in\{0,1,2\}$. To establish the first inequality, notice that $$ \begin{gathered} A_{2 i} B_{2 i+5}^{\prime}=A_{2 i+1} B_{2 i+5}, \quad A_{2 i} A_{2 i+5}^{\prime}=A_{2 i+4} A_{2 i+5}, \quad i=0,1,2, \\ \\ \frac{A_{1} B_{5}}{A_{4} A_{5}}=\frac{A_{0} B_{5}}{A_{5} B_{3}} \quad \text { and } \quad \frac{A_{3} B_{1}}{A_{0} A_{1}}=\frac{A_{2} A_{3}}{A_{0} B_{5}}, \end{gathered} $$ to get $$ \prod_{i=0}^{2} \frac{A_{2 i} B_{2 i+5}^{\prime}}{A_{2 i} A_{2 i+5}^{\prime}}=1 $$ Similarly, $$ \prod_{j=0}^{2} \frac{A_{2 j+2} B_{2 j}^{\prime}}{A_{2 j+2} A_{2 j+3}^{\prime}}=1 $$ whence the conclusion. Marking Scheme. Stating that the total area of the small triangles $\geq 1 \ldots \ldots . . \mathbf{1 p}$ Decomposition of the hexagon into three adequate parallelograms and a triangle $\mathbf{1 p}$ Proving that each pair of triangles adjacent to a parallelogram covers that parallelogram Proving the central triangle also covered 5p Remark. Any partial or equivalent approach should be marked accordingly.
{ "problem_match": "# PROBLEM 4", "resource_path": "Balkan_MO/segmented/en-2011-BMO-type1.jsonl", "solution_match": "\nSolution." }
98
1,105
2012
T1
3
null
Balkan_MO
Let $n$ be a positive integer. Let $P_{n}=\left\{2^{n}, 2^{n-1} \cdot 3,2^{n-2} \cdot 3^{2}, \ldots, 3^{n}\right\}$. For each subset $X$ of $P_{n}$, we write $S_{X}$ for the sum of all elements of $X$, with the convention that $S_{\emptyset}=0$ where $\emptyset$ is the empty set. Suppose that $y$ is a real number with $0 \leq y \leq 3^{n+1}-2^{n+1}$. Prove that there is a subset $Y$ of $P_{n}$ such that $0 \leq y-S_{Y}<2^{n}$
Note that $3^{m+1}-2^{m+1}=(3-2)\left(3^{m}+3^{m-1} \cdot 2+\cdots+3 \cdot 2^{m-1}+2^{m}\right)=S_{P_{m}}$. Dividing every element of $P_{m}$ by $2^{m}$ gives us the following equivalent problem: Let $m$ be a positive integer, $a=3 / 2$, and $Q_{m}=\left\{1, a, a^{2}, \ldots, a^{m}\right\}$. Show that for any real number $x$ satisfying $0 \leq x \leq 1+a+a^{2}+\cdots+a^{m}$, there exists a subset $X$ of $Q_{m}$ such that $0 \leq x-S_{X}<1$. We will prove this problem by induction on $m$. When $m=1, S_{\varnothing}=0, S_{\{1\}}=1, S_{\{a\}}=3 / 2$, $S_{\{1, a\}}=5 / 2$. Since the difference between any two consecutive of them is at most 1, the claim is true. Suppose that the statement is true for positive integer $m$. Let $x$ be a real number with $0 \leq$ $x \leq 1+a+a^{2}+\cdots+a^{m+1}$. If $0 \leq x \leq 1+a+a^{2}+\cdots+a^{m}$, then by the induction hypothesis there exists a subset $X$ of $Q_{m} \subset Q_{m+1}$ such that $0 \leq x-S_{X}<1$. If $\frac{a^{m+1}-1}{a-1}=1+a+a^{2}+\cdots+a^{m}<x$, then $x>a^{m+1}$ as $$ \frac{a^{m+1}-1}{a-1}=2\left(a^{m+1}-1\right)=a^{m+1}+\left(a^{m+1}-2\right) \geq a^{m+1}+a^{2}-2=a^{m+1}+\frac{1}{4} . $$ Therefore $0<\left(x-a^{m+1}\right) \leq 1+a+a^{2}+\cdots+a^{m}$. Again by the induction hypothesis, there exists a subset $X$ of $Q_{m}$ satisfying $0 \leq\left(x-a^{m+1}\right)-S_{X}<1$. Hence $0 \leq x-S_{X^{\prime}}<1$ where $X^{\prime}=X \cup\left\{a^{m+1}\right\} \subset Q_{m+1}$.
{ "problem_match": "\n3. ", "resource_path": "Balkan_MO/segmented/en-2012-BMO-type3.jsonl", "solution_match": "\nSolution 2." }
179
642
2012
T1
4
null
Balkan_MO
\quad$ Let $\mathbb{Z}^{+}$be the set of positive integers. Find all functions $f: \mathbb{Z}^{+} \rightarrow \mathbb{Z}^{+}$such that the following conditions both hold: (i) $f(n!)=f(n)$ ! for every positive integer $n$, (ii) $m-n$ divides $f(m)-f(n)$ whenever $m$ and $n$ are different positive integers.
There are three such functions: the constant functions 1, 2 and the identity function $\mathrm{id}_{\mathbf{Z}^{+}}$. These functions clearly satisfy the conditions in the hypothesis. Let us prove that there are only ones. Consider such a function $f$ and suppose that it has a fixed point $a \geq 3$, that is $f(a)=a$. Then $a!,(a!)!, \cdots$ are all fixed points of $f$, hence the function $f$ has a strictly increasing sequence $a_{1}<a_{2}<\cdots<a_{k}<\cdots$ of fixed points. For a positive integer $n$, $a_{k}-n$ divides $a_{k}-f(n)=$ $f\left(a_{k}\right)-f(n)$ for every $k \in \mathbf{Z}^{+}$. Also $a_{k}-n$ divides $a_{k}-n$, so it divides $a_{k}-f(n)-\left(a_{k}-n\right)=$ $n-f(n)$. This is possible only if $f(n)=n$, hence in this case we get $f=\mathrm{id}_{\mathbf{Z}^{+}}$. Now suppose that $f$ has no fixed points greater than 2 . Let $p \geq 5$ be a prime and notice that by Wilson's Theorem we have $(p-2)!\equiv 1(\bmod p)$. Therefore $p$ divides $(p-2)!-1$. But $(p-2)!-1$ divides $f((p-2)!)-f(1)$, hence $p$ divides $f((p-2)!)-f(1)=(f(p-2))!-f(1)$. Clearly we have $f(1)=1$ or $f(1)=2$. As $p \geq 5$, the fact that $p$ divides $(f(p-2))!-f(1)$ implies that $f(p-2)<p$. It is easy to check, again by Wilson's Theorem, that $p$ does not divide $(p-1)!-1$ and $(p-1)!-2$, hence we deduce that $f(p-2) \leq p-2$. On the other hand, $p-3=(p-2)-1$ divides $f(p-2)-f(1) \leq(p-2)-1$. Thus either $f(p-2)=f(1)$ or $f(p-2)=p-2$. As $p-2 \geq 3$, the last case is excluded, since the function $f$ has no fixed points greater than 2 . It follows $f(p-2)=f(1)$ and this property holds for all primes $p \geq 5$. Taking $n$ any positive integer, we deduce that $p-2-n$ divides $f(p-2)-f(n)=f(1)-f(n)$ for all primes $p \geq 5$. Thus $f(n)=f(1)$, hence $f$ is the constant function 1 or 2 .
{ "problem_match": "\n4. ", "resource_path": "Balkan_MO/segmented/en-2012-BMO-type3.jsonl", "solution_match": "\nSolution 1." }
100
684
2012
T1
4
null
Balkan_MO
\quad$ Let $\mathbb{Z}^{+}$be the set of positive integers. Find all functions $f: \mathbb{Z}^{+} \rightarrow \mathbb{Z}^{+}$such that the following conditions both hold: (i) $f(n!)=f(n)$ ! for every positive integer $n$, (ii) $m-n$ divides $f(m)-f(n)$ whenever $m$ and $n$ are different positive integers.
Note first that if $f\left(n_{0}\right)=n_{0}$, then $m-n_{0} \mid f(m)-m$ for all $m \in \mathbf{Z}^{+}$. If $f\left(n_{0}\right)=n_{0}$ for infinitely many $n_{0} \in \mathbf{Z}^{+}$, then $f(m)-m$ has infinitely many divisors, hence $f(m)=m$ for all $m \in \mathbf{Z}^{+}$. On the other hand, if $f\left(n_{0}\right)=n_{0}$ for some $n_{0} \geq 3$, then $f$ fixes each term of the sequence $\left(n_{k}\right)_{k=0}^{\infty}$, which is recursively defined by $n_{k}=n_{k-1}!$. Hence if $f(3)=3$, then $f(n)=n$ for all $n \in \mathbf{Z}^{+}$. We may assume that $f(3) \neq 3$. Since $f(1)=f(1)!$, and $f(2)=f(2)!, f(1), f(2) \in\{1,2\}$. We have $4=3!-2 \mid f(3)!-f(2)$. This together with $f(3) \neq 3$ implies that $f(3) \in\{1,2\}$. Let $n>3$, then $n!-3 \mid f(n)!-f(3)$ and $3 \nmid f(n)!$, i.e. $f(n)!\in\{1,2\}$. Hence we conclude that $f(n) \in\{1,2\}$ for all $n \in \mathbf{Z}^{+}$. If $f$ is not constant, then there exist positive integers $m, n$ with $\{f(n), f(m)\}=\{1,2\}$. Let $k=2+\max \{m, n\}$. If $f(k) \neq f(m)$, then $k-m \mid f(k)-f(m)$. This is a contradiction as $|f(k)-f(m)|=1$ and $k-m \geq 2$. Therefore the functions satisfying the conditions are $f \equiv 1, f \equiv 2, f=\mathrm{id}_{\mathbf{z}^{+}}$.
{ "problem_match": "\n4. ", "resource_path": "Balkan_MO/segmented/en-2012-BMO-type3.jsonl", "solution_match": "\nSolution 2." }
100
559
2014
T1
1
null
Balkan_MO
Let $x, y$ and $z$ be positive real numbers such that $x y+y z+z x=3 x y z$. Prove that $$ x^{2} y+y^{2} z+z^{2} x \geq 2(x+y+z)-3 $$ and determine when equality holds.
The given condition can be rearranged to $\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=3$. Using this, we obtain: $$ \begin{aligned} x^{2} y+y^{2} z+z^{2} x-2(x+y+z)+3 & =x^{2} y-2 x+\frac{1}{y}+y^{2} z-2 y+\frac{1}{z}+z^{2} x-2 x+\frac{1}{x}= \\ & =y\left(x-\frac{1}{y}\right)^{2}+z\left(y-\frac{1}{z}\right)^{2}+x\left(z-\frac{1}{z}\right)^{2} \geq 0 \end{aligned} $$ Equality holds if and only if we have $x y=y z=z x=1$, or, in other words, $x=y=z=1$. Alternative solution. It follows from $\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=3$ and Cauchy-Schwarz inequality that $$ \begin{aligned} 3\left(x^{2} y+y^{2} z+z^{2} x\right) & =\left(\frac{1}{x}+\frac{1}{y}+\frac{1}{z}\right)\left(x^{2} y+y^{2} z+z^{2} x\right) \\ & \left.=\left(\left(\frac{1}{\sqrt{y}}\right)^{2}+\left(\frac{1}{\sqrt{z}}\right)^{2}+\left(\frac{1}{\sqrt{x}}\right)^{2}\right)\left((x \sqrt{y})^{2}\right)+(y \sqrt{z})^{2}+(z \sqrt{x})^{2}\right) \\ & \geq(x+y+z)^{2} \end{aligned} $$ Therefore, $x^{2} y+y^{2} z+z^{2} x \geq \frac{(x+y+z)^{2}}{3}$ and if $x+y+z=t$ it suffices to show that $\frac{t^{2}}{3} \geq 2 t-3$. The latter is equivalent to $(t-3)^{2} \geq 0$. Equality holds when $$ x \sqrt{y} \sqrt{y}=y \sqrt{z} \sqrt{z}=z \sqrt{x} \sqrt{x}, $$ i.e. $x y=y z=z x$ and $t=x+y+z=3$. Hence, $x=y=z=1$. Comment. The inequality is true with the condition $x y+y z+z x \leq 3 x y z$.
{ "problem_match": "\nProblem 1.", "resource_path": "Balkan_MO/segmented/en-2014-BMO-type1.jsonl", "solution_match": "\nSolution." }
69
620
2014
T1
2
null
Balkan_MO
A special number is a positive integer $n$ for which there exist positive integers $a, b, c$ and $d$ with $$ n=\frac{a^{3}+2 b^{3}}{c^{3}+2 d^{3}} $$ Prove that: (a) there are infinitely many special numbers; (b) 2014 is not a special number.
(a) Every perfect cube $k^{3}$ of a positive integer is special because we can write $$ k^{3}=k^{3} \frac{a^{3}+2 b^{3}}{a^{3}+2 b^{3}}=\frac{(k a)^{3}+2(k b)^{3}}{a^{3}+2 b^{3}} $$ for some positive integers $a, b$. (b) Observe that $2014=2.19 .53$. If 2014 is special, then we have, $$ x^{3}+2 y^{3}=2014\left(u^{3}+2 v^{3}\right) $$ for some positive integers $x, y, u, v$. We may assume that $x^{3}+2 y^{3}$ is minimal with this property. Now, we will use the fact that if 19 divides $x^{3}+2 y^{3}$, then it divides both $x$ and $y$. Indeed, if 19 does not divide $x$, then it does not divide $y$ too. The relation $x^{3} \equiv-2 y^{3}(\bmod 19)$ implies $\left(x^{3}\right)^{6} \equiv\left(-2 y^{3}\right)^{6}(\bmod 19)$. The latter congruence is equivalent to $x^{18} \equiv 2^{6} y^{18}(\bmod 19)$. Now, according to the Fermat's Little Theorem, we obtain $1 \equiv 2^{6}(\bmod 19)$, that is 19 divides 63 , not possible. It follows $x=19 x_{1}, y=19 y_{1}$, for some positive integers $x_{1}$ and $y_{1}$. Replacing in (1) we get $$ 19^{2}\left(x_{1}^{3}+2 y_{1}^{3}\right)=2.53\left(u^{3}+2 v^{3}\right) $$ i.e. $19 \mid u^{3}+2 v^{3}$. It follows $u=19 u_{1}$ and $v=19 v_{1}$, and replacing in (2) we get $$ x_{1}^{3}+2 y_{1}^{3}=2014\left(u_{1}^{3}+2 v_{1}^{3}\right) . $$ Clearly, $x_{1}^{3}+2 y_{1}^{3}<x^{3}+2 y^{3}$, contradicting the minimality of $x^{3}+2 y^{3}$.
{ "problem_match": "\nProblem 2.", "resource_path": "Balkan_MO/segmented/en-2014-BMO-type1.jsonl", "solution_match": "\nSolution." }
84
620
2015
T1
1
null
Balkan_MO
Let $a, b$ and $c$ be positive real numbers. Prove that $$ a^{3} b^{6}+b^{3} c^{6}+c^{3} a^{6}+3 a^{3} b^{3} c^{3} \geq a b c\left(a^{3} b^{3}+b^{3} c^{3}+c^{3} a^{3}\right)+a^{2} b^{2} c^{2}\left(a^{3}+b^{3}+c^{3}\right) $$
After dividing both sides of the given inequality by $a^{3} b^{3} c^{3}$ it becomes $$ \left(\frac{b}{c}\right)^{3}+\left(\frac{c}{a}\right)^{3}+\left(\frac{a}{b}\right)^{3}+3 \geq\left(\frac{a}{c} \cdot \frac{b}{c}+\frac{b}{a} \cdot \frac{c}{a}+\frac{c}{b} \cdot \frac{a}{b}\right)+\left(\frac{a}{b} \cdot \frac{a}{c}+\frac{b}{a} \cdot \frac{b}{c}+\frac{c}{a} \cdot \frac{c}{b}\right) . $$ Set $$ \frac{b}{a}=\frac{1}{x}, \quad \frac{c}{b}=\frac{1}{y}, \quad \frac{a}{c}=\frac{1}{z} . $$ Then we have that $x y z=1$ and by substituting (2) into (1), we find that $$ x^{3}+y^{3}+z^{3}+3 \geq\left(\frac{y}{z}+\frac{z}{x}+\frac{x}{y}\right)+\left(\frac{x}{z}+\frac{y}{x}+\frac{z}{y}\right) . $$ Multiplying the inequality (3) by $x y z$, and using the fact that $x y z=1$, the inequality is equivalent to $$ x^{3}+y^{3}+z^{3}+3 x y z-x y^{2}-y z^{2}-z x^{2}-y x^{2}-z y^{2}-x z^{2} \geq 0 . $$ Finally, notice that by the special case of Schur's inequality $$ x^{r}(x-y)(x-z)+y^{r}(y-x)(y-z)+z^{r}(z-y)(z-x) \geq 0, \quad x, y, z \geq 0, r>0, $$ with $r=1$ there holds $$ x(x-y)(x-z)+y(y-x)(y-z)+z(z-y)(z-x) \geq 0 $$ which after expansion actually coincides with the congruence (4). Remark 1. The inequality (5) immediately follows by supposing (without loss of generality) that $x \geq y \geq z$, and then writing the left hand side of the inequality (5) in the form $$ (x-y)(x(x-z)-y(y-z))+z(y-z)(x-z) $$ which is obviously $\geq 0$. Remark 2. One can obtain the relation (4) using also the substitution $x=a b^{2}, y=b c^{2}$ and $z=c a^{2}$.
{ "problem_match": "\nProblem 1.", "resource_path": "Balkan_MO/segmented/en-2015-BMO-type1.jsonl", "solution_match": "\nSolution." }
127
667
2015
T1
2
null
Balkan_MO
Let $A B C$ be a scalene triangle with incentre $I$ and circumcircle ( $\omega$ ). The lines $A I, B I, C I$ intersect $(\omega)$ for the second time at the points $D, E, F$, respectively. The lines through $I$ parallel to the sides $B C, A C, A B$ intersect the lines $E F, D F, D E$ at the points $K, L, M$, respectively. Prove that the points $K, L, M$ are collinear.
First we will prove that $K A$ is tangent to $(\omega)$. Indeed, it is a well-known fact that $F A=F B=F I$ and $E A=E C=E I$, so $F E$ is the perpendicular bisector of $A I$. It follows that $K A=K I$ and $$ \angle K A F=\angle K I F=\angle F C B=\angle F E B=\angle F E A, $$ so $K A$ is tangent to $(\omega)$. Similarly we can prove that $L B, M C$ are tangent to $(\omega)$ as well. Let $A^{\prime}, B^{\prime}, C^{\prime}$ the intersections of $A I, B I, C I$ with $B C, C A, A B$ respectively. From Pascal's Theorem on the cyclic hexagon $A A C D E B$ we get $K, C^{\prime}, B^{\prime}$ collinear. Similarly $L, C^{\prime}, A^{\prime}$ collinear and $M, B^{\prime}, A^{\prime}$ collinear. Then from Desargues' Theorem for $\triangle D E F, \triangle A^{\prime} B^{\prime} C^{\prime}$ which are perspective from the point $I$, we get that points $K, L, M$ of the intersection of their corresponding sides are collinear as wanted. Remark (P.S.C.). After proving that $K A, L B, M C$ are tangent to ( $\omega$ ), we can argue as follows: It readily follows that $\triangle K A F \sim \triangle K A E$ and so $\frac{K A}{K E}=\frac{K F}{K A}=\frac{A F}{A E}$, thus $\frac{K F}{K E}=\left(\frac{A F}{A E}\right)^{2}$. In a similar way we can find that $\frac{M E}{M D}=\left(\frac{C E}{C D}\right)^{2}$ and $\frac{L D}{L F}=\left(\frac{B D}{B F}\right)^{2}$. Multiplying we obtain $\frac{K F}{K E} \cdot \frac{M E}{M D} \cdot \frac{L D}{L F}=1$, so by the converse of Menelaus theorem applied in the triangle $D E F$ we get that the points $K, L, M$ are collinear.
{ "problem_match": "\nProblem 2.", "resource_path": "Balkan_MO/segmented/en-2015-BMO-type1.jsonl", "solution_match": "\nSolution." }
119
550
2015
T1
3
null
Balkan_MO
A jury of 3366 film critics are judging the Oscars. Each critic makes a single vote for his favourite actor, and a single vote for his favourite actress. It turns out that for every integer $n \in\{1,2, \ldots, 100\}$ there is an actor or actress who has been voted for exactly $n$ times. Show that there are two critics who voted for the same actor and for the same actress.
Let us assume that every critic votes for a different pair of actor and actress. We'll arrive at a contradiction proving the required result. Indeed: Call the vote of each critic, i.e his choice for the pair of an actor and an actress, as a double-vote, and call as a single-vote each one of the two choices he makes, i.e. the one for an actor and the other one for an actress. In this terminology, a double-vote corresponds to two single-votes. For each $n=34,35, \ldots, 100$ let us pick out one actor or one actress who has been voted by exactly $n$ critics (i.e. appears in exactly $n$ single-votes) and call $S$ the set of these movie stars. Calling $a, b$ the number of men and women in $S$, we have $a+b=67$. Now let $S_{1}$ be the set of double-votes, each having exactly one of its two corresponding singlevotes in $S$, and let $S_{2}$ be the set of double-votes with both its single-votes in $S$. If $s_{1}, s_{2}$ are the number of elements in $S_{1}, S_{2}$ respectively, we have that the number of all double-votes with at least one single-vote in $S$ is $s_{1}+s_{2}$, whereas the number of all double-votes with both single-votes in $S$ is $s_{2} \leq a b$. Since all double-votes are distinct, there must exist at least $s_{1}+s_{2}$ critics. But the number of all single-votes in $S$ is $s_{1}+2 s_{2}=34+35+\cdots+100=4489$, and moreover $s \leq a b$. So there exist at least $s_{1}+s_{2}=s_{1}+2 s_{2}-s_{2} \geq 4489-a b$ critics. Now notice that as $a+b=67$, the maximum value of $a b$ with $a, b$ integers is obtained for $\{a, b\}=$ $\{33,34\}$, so $a b \leq 33 \cdot 34=1122$. A quick proof of this is the following: $a b=\frac{(a+b)^{2}-(a-b)^{2}}{4}=$ $\frac{67^{2}-(a-b)^{2}}{4}$ which is maximized (for not equal integers $a, b$ as $a+b=67$ ) whenever $|a-b|=1$, thus for $\{a, b\}=\{33,34\}$. Thus there exist at least $4489-1122=3367$ critics which is a contradiction and we are done. Remark. We are going here to give some motivation about the choice of number 34, used in the above solution. Let us assume that every critic votes for a different pair of actor and actress. One can again start by picking out one actor or one actress who has been voted by exactly $n$ critics for $n=k, k+1, \ldots, 100$. Then $a+b=100-k+1=101-k$ and the number of all single-votes is $s_{1}+2 s_{2}=k+k+1+\cdots+100=$ $5050-\frac{k(k-1)}{2}$, so there exist at least $s_{1}+s_{2}=s_{1}+2 s_{2}-s_{2} \geq 5050-\frac{k(k-1)}{2}-a b$ and $$ a b=\frac{(a+b)^{2}-(a-b)^{2}}{4}=\frac{(101-k)^{2}-(a-b)^{2}}{4} \leq \frac{(101-k)^{2}-1}{4} . $$ After all, the number of critics is at least $$ 5050-\frac{k(k-1)}{2}-\frac{(101-k)^{2}-1}{4} $$ In order to arrive at a contradiction we have to choose $k$ such that $$ 5050-\frac{k(k-1)}{2}-\frac{(101-k)^{2}-1}{4} \geq 3367 $$ and solving the inequality with respect to $k$, the only value that makes the last one true is $k=34$.
{ "problem_match": "\nProblem 3.", "resource_path": "Balkan_MO/segmented/en-2015-BMO-type1.jsonl", "solution_match": "\nSolution." }
97
1,047
2016
T1
2
null
Balkan_MO
Let $A B C D$ be a cyclic quadrilateral with $A B<C D$. The diagonals intersect at the point $F$ and lines $A D$ and $B C$ intersect at the point $E$. Let $K$ and $L$ be the orthogonal projections of $F$ onto lines $A D$ and $B C$ respectively, and let $M, S$ and $T$ be the midpoints of $E F, C F$ and $D F$ respectively. Prove that the second intersection point of the circumcircles of triangles $M K T$ and $M L S$ lies on the segment $C D$.
Let $N$ be the midpoint of $C D$. We will prove that the circumcircles of the triangles $M K T$ and $M L S$ pass through $N$. (1) First will prove that the circumcircle of $M L S$ passes through $N$. Let $Q$ be the midpoint of $E C$. Note that the circumcircle of $M L S$ is the Euler circle (2) of the triangle $E F C$, so it passes also through $Q .\left({ }^{*}\right)(3)$ We will prove that $$ \angle S L Q=\angle Q N S \quad \text { or } \quad \angle S L Q+\angle Q N S=180^{\circ} $$ Indeed, since $F L C$ is right-angled and $L S$ is its median, we have that $S L=S C$ and $$ \angle S L C=\angle S C L=\angle A C B $$ In addition, since $N$ and $S$ are the midpoints of $D C$ and $F C$ we have that $S N \| F D$ and similarly, since $Q$ and $N$ are the midpoints of $E C$ and $C D$, so $Q N \| E D$. It follows that the angles $\angle E D B$ and $\angle Q N S$ have parallel sides, and since $A B<C D$, they are acute, and as a result we have that $$ \angle E D B=\angle Q N S \quad \text { or } \quad \angle E D B+\angle Q N S=180^{\circ} $$ But, from the cyclic quadrilateral $A B C D$, we get that $$ \angle E D B=\angle A C B $$ Now, from (2),(3) and (4) we obtain immediately (1), so the quadrilateral $L N S Q$ is cyclic. Since from $\left(^{*}\right)$, its circumcircle passes also through $M$, we get that the points $M, L, Q, S, N$ are cocylic and this means that the circumcircle of $M L S$ passes through $N$. Similarly, the circumcircle of $M K T$ passes also through $N$ and we have the desired.
{ "problem_match": "# Problem 2.", "resource_path": "Balkan_MO/segmented/en-2016-BMO-type1.jsonl", "solution_match": "\nSolution." }
139
513
2016
T1
3
null
Balkan_MO
Find all monic polynomials $f$ with integer coefficients satisfying the following condition: there exists a positive integer $N$ such that $p$ divides $2(f(p)!)+1$ for every prime $p>N$ for which $f(p)$ is a positive integer. Note: A monic polynomial has leading coefficient equal to 1.
If $f$ is a constant polynomial then it's obvious that the condition cannot hold for $$ p \geq 5 \text { since } f(p)=1 $$ From the divisibility relation $p \mid 2(f(p))$ ! +1 we conclude that: $$ f(p)<p, \text { for all primes } p>N \quad(*) $$ In fact, if for some prime number $p$ we have $f(p) \geq p$, then $p \mid(f(p))$ ! and then $p \mid 1$, which is absurd. Now suppose that $\operatorname{deg} f=m>1$. Then $f(x)=x^{m}+Q(x), \operatorname{deg} Q(x) \leq m-1$ and so $f(p)=$ $p^{m}+Q(p)$. Hence for some large enough prime number $p$ holds that $f(p)>p$, which contradicts $\left.{ }^{*}\right)$. Therefore we must have $\operatorname{deg} f(x)=1$ and $f(x)=x-a$, for some positive integer $a$. (3) Thus the given condition becomes: $$ p \mid 2(p-a)!+1 $$ But we have (using Wilsons theorem) $$ \begin{gathered} 2(p-3)!\equiv-(p-3)!(p-2) \equiv-(p-2)!\equiv-1(\bmod p) \\ \Rightarrow p \mid 2(p-3)!+1 \end{gathered} $$ From (1) and (2) we get $$ \begin{aligned} & (p-3)!\equiv(p-a)!(\bmod p) \\ & (p-3)!(-1)^{a}(a-1)!\equiv(p-a)!(-1)^{a}(a-1)!(\bmod p) \\ & (p-3)!(-1)^{a}(a-1)!\equiv 1(\bmod p) \end{aligned} $$ Since $-2(p-3)!\equiv 1(\bmod p)$, it follows that $$ (-1)^{a}(a-1)!\equiv-2(\bmod p) $$ Taking $p>(a-1)$ !, we conclude that $a=3$ and so $f(x)=x-3$, for all $x$. The function $f(x)=x-3$ satisfies the required condition.
{ "problem_match": "# Problem 3.", "resource_path": "Balkan_MO/segmented/en-2016-BMO-type1.jsonl", "solution_match": "\nSolution." }
71
546
2017
T1
2
null
Balkan_MO
Let $A B C$ be an acute triangle with with $A B<A C$ and let $\Gamma$ be its circumcircle. Let the tangents to $\Gamma$ at $B$ and $C$ be $t_{B}$ and $t_{C}$ respectively and let their point of intersection be $L$. The line through $B$ parallel to $A C$ intersects $t_{C}$ at $D$. The line through $C$ parallel to $A B$ intersects $t_{B}$ at $E$. The circumcircle of triangle $B D C$ meets the side $A C$ at $T$ where $T$ lies between $A$ and $C$. The circumcircle of triangle $B E C$ meets the line $A B$ at $S$ where $B$ lies between $A$ and $S$. Prove that the lines $S T, B C$ and $A L$ are concurrent.
How we attack this problem depends on how much triangle geometry we can effortlessly recall - a good knowledge of some standard results helps a great deal. We might instantly note that $A L$ is a symmedian of $A B C$, and so divides the line $B C$ in the ratio $c^{2}: b^{2}$. Now the plan is to show that $S T$ also divides $B C$ in this ratio. Since we are working with ratios of distances, Menelaus' theorem may prove useful. A key step is to notice (based on a careful diagram) that $A C$ is tangent to circle $C B S$. Once spotted this is easy to prove. The parallels give us $\angle B=\angle B C E$, and, since $B E$ is tangent to circle $A B C$, we have $\angle E B C=\angle A$ by the alternate segment theorem. Now angles in a triangle give $\angle C=\angle C E B$, and we have the converse to the alternate segment theorem. We obtain $A B$ is tangent to circle $C B D$ in the same way. Now we have some tangencies and want some ratios. Tangent-secant yields $A T . b=c^{2}$ and $c . A S=b^{2}$ or, equivalently, $b . C T=b^{2}-c^{2}$ and $c . B S=b^{2}-c^{2}$. By Menelaus we know that $S T$ divides $B C$ in the ratio $A T . B S: A S . C T$ and it's all over bar the shouting. If we are not lucky enough to have the stuff about the symmedian at our fingertips, we can still get essentially the same solution with a bit more work. We begin with the second half of the proof above, and establish that $S T$ divides $B C$ in the ratio $c^{2}: b^{2}$. Now we need to prove that $A L$ divides $B C$ in the same ratio. The next (non-obvious!) step is to draw a parallel to $B C$ through $A$ as shown. Now $\triangle A B C \sim \triangle B^{\prime} A B \sim \triangle C C^{\prime} A$ and the ratio $B^{\prime} A: A C^{\prime}$ which equals $B X: X C$ drops out as $c^{2}: b^{2}$ as required. Clearly knowing the standard symmedian configuration and corresponding ratio is an enormous advantage. Finally it is worth noting that, to the right sort of mind, the problem screams out for areal coordinates. These turn out to kill it fairly easily, not least because all three circles pass through at least two vertices of $\triangle A B C$.
{ "problem_match": "\n2. ", "resource_path": "Balkan_MO/segmented/en-2017-BMO-type3.jsonl", "solution_match": "\nSolution." }
200
594
2017
T1
3
null
Balkan_MO
Let $\mathbb{N}$ be the set of positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that: $$ n+f(m) \text { divides } f(n)+n f(m) $$
The striking thing about this problem is that the relation concerns divisibility rather than equality. How can we exploit this? We are given that $n+f(m) \mid f(n)+n f(m)$ but we can certainly add or subtract multiples of the left hand side from the right hand side and preserve the divisibility. This leads to a key idea: 'Eliminate one of the variables from the right hand side.' Clearly $n+f(m) \mid f(n)+n f(m)-n(n+f(m))$ so for any $n, m$ we have $$ n+f(m) \mid f(n)-n^{2} $$ This feels like a strong condition: if we fix $n$ and let $f(m)$ go to infinity, then $f(n)-n^{2}$ will have arbitrarily large factors, which implies it must be zero. We must be careful: this argument is fine, so long as the function $f$ takes arbitrarily large values. (We also need to check that $f(n)=n^{2}$ satisfies the original statement which it does.) We are left with the case where $f$ takes only finitely many values. In this case $f$ must take the same value infinitely often, so it is natural to focus on an infinite set $S \subset \mathbb{N}$ such that $f(s)=k$ for all $s \in S$. If $n, m \in S$ then the original statement gives $n+k \mid k+n k$ where $k$ is fixed and $n$ can be as large as we like. Now we recycle our key idea and eliminate $n$ from the right. $n+k \mid k+n k-k(n+k)$ so $n+k \mid k-k^{2}$ for arbitrarily large $n$. This means that $k-k^{2}=0$ so $k=1$, since it must be positive. At this point we suspect that $f(n)=1$ for all $n$ is the only bounded solution, so we pick some $t$ such that $f(t)=L>1$ and try to get a contradiction. In the original statement we can set $m=t$ and get $n+L \mid f(n)+n L$. Eliminating $L$ from the right gives us nothing new, so how can we proceed? Well, we have an infinite set $S$ such that $f$ is constantly 1 on $S$ so we can take $n \in S$ to obtain $n+L \mid 1+n L$ Using our key idea one more time and eliminating $n$ from the right, we get $n+L \mid 1-L^{2}$ for arbitrarily large $n$ which is impossible if $L>1$. A rather different solution can be found by playing around with small values of $m$ and $n$. As before it helps to establish $(\star)$ but now $(n, m)=(1,1)$ gives $1+f(1) \mid f(1)-1$. The left is bigger than the right, so the right must be zero $-f(1)=1$. Now try $(n, m)=(2,1)$ and obtain $2+f(2) \mid f(2)-4$. Subtracting the left from the right gives $2+f(2) \mid-6$. Since $f(2) \in \mathbb{N}$ the left is a factor of -6 which is bigger than 2 . This gives $f(2)=1$ or $f(2)=4$. In the first case we can plug this back into the orginal statement to get $2+f(m) \mid 1+2 f(m)$. Now taking two copies of the left away from the right we have $2+f(m) \mid-3$. Thus $2+f(m)$ must a factor of -3 which is bigger than 2 , so $f(m)=1$ for any $m$. Before proceeding with the case $f(2)=4$ we take another look at our strong result $(\star)$. Setting $n=m$ gives $n+f(n) \mid f(n)-n^{2}$ so taking $f(n)-n^{2}$ away from $n+f(n)$ shows that $$ n+f(n) \mid n+n^{2} $$ Let see if we can use $(\star)$ and $(\dagger)$ to pin down the value of $f(3)$, using $f(2)=4$. From $(\star)$ we have $3+4 \mid f(3)-9$ and from $(\dagger)$ we have $3+f(3) \mid 12$. The second of these shows $f(3)$ is 1,3 or 9 , but 1 and 3 are too small to work in the first relation. Similarly, setting $(n, m)=(4,3)$ in $(\star)$ gives $4+9 \mid f(4)-16$ while $n=4$ in $(\dagger)$ gives $4+f(4) \mid 20$. The latter shows $f(4) \leq 16$ so $13 \mid 16-f(4)$. The only possible multiples of 13 are 0 and 13 , of which only the first one works. Thus $f(4)=16$. Now we are ready to try induction. Assume $f(n-1)=(n-1)^{2}$ and use $(\star)$ and $(\dagger)$ to obtain $n+(n-1)^{2} \mid f(n)-n^{2}$ and $n+f(n) \mid n+n^{2}$. The latter implies $f(n) \leq n^{2}$ so the former becomes $n^{2}-n+1 \mid n^{2}-f(n)$. If $f(n) \neq n^{2}$ then $n^{2}-f(n)=1 \times\left(n^{2}-n+1\right)$ since any other multiple would be too large. However, putting $f(n)=n-1$ into $n+f(n) \mid n+n^{2}$ implies $2 n-1 \mid n(1+n)$. This is a contradiction since $2 n-1$ is coprime to $n$ and clearly cannot divide $1+n$. for all $m, n \in \mathbb{N}$.
{ "problem_match": "\n3. ", "resource_path": "Balkan_MO/segmented/en-2017-BMO-type3.jsonl", "solution_match": "\nSolution." }
56
1,387
2017
T1
4
null
Balkan_MO
There are $n>2$ students sitting at a round table. Initially each student has exactly one candy. At each step, each student chooses one of the following operations: (a) Pass one candy to the student on their left or the student on their right. (b) Divide all their candies into two, possibly empty, sets and pass one set to the student on their left and the other to the student on their right. At each step the students perform their chosen operations simultaneously. An arrangement of candies is legal if it can be obtained in a finite number of steps. Find the number of legal arrangements. (Two arrangements are different if there is a student who has different numbers of candies in each one.)
One possible initial reaction to this problem is that there is rather too much movement of caramels ${ }^{2}$ at each step to keep track of easily. This leads to the question: 'How little can I do in, say, two steps?' If every student passes all their caramels left on one step using (b), and all their caramels right on the next step, then no caramels move. (This is rather too little movement.) Let us see what a small change to this sequence can accomplish. We choose a student with at least one caramel. At the first step, she passes one caramel to the right and any others she has to the left. Every one else passes everything left. At the next step everybody passes everything right. The effect of this is that exactly one caramel has moved exactly two places to the right. Similarly, there is a double step which moves exactly one caramel to places to the left. If we have not already done so, now is the time to start working through some small values of $n$. The case $n=3$ yields a useful observation. Going two places (let's call this a double jump) to the left on a triangle is the same as going one place to the right. Indeed if $n$ is odd, say $2 k+1$, then $k$ double jumps to the left moves the caramel one place to the right and vice versa. It is now clear that, if $n$ is odd, any arrangement of caramels is possible. We simply move them into position one at a time. In the case $n=4$ it seems hard to get all the caramels into one place. Indeed, if we limit ourselves to double jumps, then we can only get $(1,1,1,1),(1,2,1,0),(2,2,0,0)$ and rotations of these arrangements. What can we say about these? Well it seems that students one and three always hold two candies between them. Having noticed this, it is not too hard to make a more general observation: if $n$ is even then a double jump cannot change the total number of caramels held by the odd numbered students. However, double jumps are not the only moves available to us. For example, it is possible to go from $(2,2,0,0)$ to $(3,1,0,0)$. A double jump now gives $(2,1,1,0)$ as well. To squeeze maximum value out of the $n=4$ case, it is worth looking at the arrangements we have not yet managed to get to. They are (rotations of) $(4,0,0,0),(3,0,1,0)$ and $(2,0,2,0)$. What do these have in common? They are precisely the arrangements where the even numbered students hold all the caramels. Can we prove that these are illegal? Well, what can we say about an arrangement which precedes one of these elusive ones? This question leads to the last big idea in the solution to this problem. If after some step the even numbered students have all the caramels, they cannot have had any at all before the step, else they would have passed at least one caramel to an odd numbered student. Turning this around gives a crucial lemma for even values of $n$. Let's call a caramel held by an odd numbered student an odd caramel and define even caramels similarly. Let's call an arrangement with at least one odd caramel and at least one even caramel balanced. If the arrangement is balanced before some step, then it will be balanced after the step. The initial position is balanced, so every legal position is balanced. Finally we are on the home straight. We claim that every balanced position is legal. Using double jumps we can move to $\left(\ldots, \frac{n}{2}, \frac{n}{2}, 0, \ldots\right)$. Now we need to tinker with the numbers of odd and even caramels. There are lots of usable sequences. For example: $$ \begin{gathered} (\ldots, a, b, 0, \ldots) \\ (\ldots, a-1,1, b, \ldots) \\ (\ldots, a-1, b+1,0, \ldots) \end{gathered} $$ can be used to change the number of odd caramels provided $a-1 \geq 1$. Once we have the correct number of odd and even caramels, they can be moved into place using double jumps. It remains to observe that there are $\binom{2 n-1}{n}$ possible arrangements of caramels, and that if $n$ is even, then $2\left(\frac{\frac{3 n}{2}-1}{n}\right)$ of these are not balanced. Another sensible approach is to think about which steps are reversible. It turns out that many are, including all those where the students all use option (b). It is possible to argue that if $n$ is odd, then we can start with any position, move to $(\ldots, n, \ldots)$ reversibly, then move to the initial position reversibly. Playing the whole tape backwards shows all positions are legal. If $n$ is even it is possible to start from any balanced position and reversibly move to $(\ldots, n-1,1, \ldots)$ and thence to the initial position so we are done. [^0] [^0]: ${ }^{2}$ The word 'candy' was a little too grating for my delicate British ears. I am grateful to the Italians for suggesting the more elegant alternative.
{ "problem_match": "\n4. ", "resource_path": "Balkan_MO/segmented/en-2017-BMO-type3.jsonl", "solution_match": "\nSolution." }
142
1,206
2018
T1
2
null
Balkan_MO
Let $q$ be a positive rational number. Two ants are initially at the same point $X$ in the plane. In the $n$-th minute $(n=1,2, \ldots)$ each of them chooses whether to walk due north, east, south or west and then walks the distance of $q^{n}$ metres. After a whole number of minutes, they are at the same point in the plane (not necessarily $X$ ), but have not taken exactly the same route within that time. Determine all possible values of $q$.
Answer: $q=1$. Let $x_{A}^{(n)}$ (resp. $x_{B}^{(n)}$ ) be the $x$-coordinates of the first (resp. second) ant's position after $n$ minutes. Then $x_{A}^{(n)}-x_{A}^{(n-1)} \in\left\{q^{n},-q^{n}, 0\right\}$, and so $x_{A}^{(n)}, x_{B}^{(n)}$ are given by polynomials in $q$ with coefficients in $\{-1,0,1\}$. So if the ants meet after $n$ minutes, then $$ 0=x_{A}^{(n)}-x_{B}^{(n)}=P(q), $$ where $P$ is a polynomial with degree at most $n$ and coefficients in $\{-2,-, 1,0,1,2\}$. Thus if $q=\frac{a}{b}(a, b \in \mathbb{N})$, we have $a \mid 2$ and $b \mid 2$, i.e. $q \in\left\{\frac{1}{2}, 1,2\right\}$. It is clearly possible when $q=1$. We argue that $q=\frac{1}{2}$ is not possible. Assume that the ants diverge for the first time after the $k$ th minute, for $k \geqslant 0$. Then $$ \left|x_{B}^{(k+1)}-x_{A}^{(k+1)}\right|+\left|y_{B}^{(k+1)}-y_{A}^{(k+1)}\right|=2 q^{k} . $$ But also $\left|x_{A}^{(\ell+1)}-x_{A}^{(\ell)}\right|+\left|y_{A}^{(\ell+1)}-y_{A}^{(\ell)}\right|=q^{\ell}$ for each $l \geqslant k+1$, and so $$ \left|x_{A}^{(n)}-x_{A}^{(k+1)}\right|+\left|y_{A}^{(n)}-y_{A}^{(k+1)}\right| \leqslant q^{k+1}+q^{k+2}+\ldots+q^{n-1} $$ and similarly for the second ant. Combining (1) and (2) with the triangle inequality, we obtain for any $n \geqslant k+1$ $$ \left|x_{B}^{(n)}-x_{A}^{(n)}\right|+\left|y_{B}^{(n)}-y_{A}^{(n)}\right| \geqslant 2 q^{k}-2\left(q^{k+1}+q^{k+2}+\ldots+q^{n-1}\right), $$ which is strictly positive for $q=\frac{1}{2}$. So for any $n \geqslant k+1$, the ants cannot meet after $n$ minutes. Thus $q \neq \frac{1}{2}$. Finally, we show that $q=2$ is also not possible. Suppose to the contrary that there is a pair of routes for $q=2$, meeting after $n$ minutes. Now consider rescaling the plane by a factor $2^{-n}$, and looking at the routes in the opposite direction. This would then be an example for $q=1 / 2$ and we have just shown that this is not possible.
{ "problem_match": "\n2. ", "resource_path": "Balkan_MO/segmented/en-2018-BMO-type3.jsonl", "solution_match": "\nSolution 1." }
115
821
2018
T1
3
null
Balkan_MO
Alice and Bob play the following game: They start with two non-empty piles of coins. Taking turns, with Alice playing first, each player chooses a pile with an even number of coins and moves half of the coins of this pile to the other pile. The game ends if a player cannot move, in which case the other player wins. Determine all pairs $(a, b)$ of positive integers such that if initially the two piles have $a$ and $b$ coins respectively, then Bob has a winning strategy.
By $v_{2}(n)$ we denote the largest nonnegative integer $r$ such that $2^{r} \mid n$. A position $(a, b)$ (i.e. two piles of sizes $a$ and $b$ ) is said to be $k$-happy if $v_{2}(a)=v_{2}(b)=k$ for some integer $k \geqslant 0$, and $k$-unhappy if $\min \left\{v_{2}(a), v_{2}(b)\right\}=k<\max \left\{v_{2}(a), v_{2}(b)\right\}$. We shall prove that Bob has a winning strategy if and only if the initial position is $k$-happy for some even $k$. - Given a 0-happy position, the player in turn is unable to play and loses. - Given a $k$-happy position $(a, b)$ with $k \geqslant 1$, the player in turn will transform it into one of the positions $\left(a+\frac{1}{2} b, \frac{1}{2} b\right)$ and $\left(b+\frac{1}{2} a, \frac{1}{2} a\right)$, both of which are ( $\left.k-1\right)$-happy because $v_{2}\left(a+\frac{1}{2} b\right)=v_{2}\left(\frac{1}{2} b\right)=v_{2}\left(b+\frac{1}{2} a\right)=v_{2}\left(\frac{1}{2} a\right)=k-1$. Therefore, if the starting position is $k$-happy, after $k$ moves they will get stuck at a 0 -happy position, so Bob will win if and only if $k$ is even. - Given a $k$-unhappy position $(a, b)$ with $k$ odd and $v_{2}(a)=k<v_{2}(b)=\ell$, Alice can move to position $\left(\frac{1}{2} a, b+\frac{1}{2} a\right)$. Since $v_{2}\left(\frac{1}{2} a\right)=v_{2}\left(b+\frac{1}{2} a\right)=k-1$, this position is ( $k-1$ )-happy with $2 \mid k-1$, so Alice will win. - Given a $k$-unhappy position $(a, b)$ with $k$ even and $v_{2}(a)=k<v_{2}(b)=\ell$, Alice must not play to position $\left(\frac{1}{2} a, b+\frac{1}{2} a\right)$, because the new position is ( $\left.k-1\right)$-happy and will lead to Bob's victory. Thus she must play to position $\left(a+\frac{1}{2} b, \frac{1}{2} b\right)$. We claim that this position is also $k$-unhappy. Indeed, if $\ell>k+1$, then $v_{2}\left(a+\frac{1}{2} b\right)=$ $k<v_{2}\left(\frac{1}{2} b\right)=\ell-1$, whereas if $\ell=k+1$, then $v_{2}\left(a+\frac{1}{2} b\right)>v_{2}\left(\frac{1}{2} b\right)=k$. Therefore a $k$-unhappy position is winning for Alice if $k$ is odd, and drawing if $k$ is even.
{ "problem_match": "\n3. ", "resource_path": "Balkan_MO/segmented/en-2018-BMO-type3.jsonl", "solution_match": "\nSolution." }
105
805
2018
T1
4
null
Balkan_MO
Find all primes $p$ and $q$ such that $3 p^{q-1}+1$ divides $11^{p}+17^{p}$. Time allowed: 4 hours and 30 minutes. Each problem is worth 10 points.
Answer: $(p, q)=(3,3)$. For $p=2$ it is directly checked that there are no solutions. Assume that $p>2$. Observe that $N=11^{p}+17^{p} \equiv 4(\bmod 8)$, so $8 \nmid 3 p^{q-1}+1>4$. Consider an odd prime divisor $r$ of $3 p^{q-1}+1$. Obviously, $r \notin\{3,11,17\}$. There exists $b$ such that $17 b \equiv 1$ $(\bmod r)$. Then $r \mid b^{p} N \equiv a^{p}+1(\bmod r)$, where $a=11 b$. Thus $r \mid a^{2 p}-1$, but $r \nmid a^{p}-1$, which means that $\operatorname{ord}_{r}(a) \mid 2 p$ and $\operatorname{ord}_{r}(a) \nmid p$, i.e. $\operatorname{ord}_{r}(a) \in\{2,2 p\}$. Note that if $\operatorname{ord}_{r}(a)=2$, then $r \mid a^{2}-1 \equiv\left(11^{2}-17^{2}\right) b^{2}(\bmod r)$, which gives $r=7$ as the only possibility. On the other hand, $\operatorname{ord}_{r}(a)=2 p$ implies $2 p \mid r-1$. Thus, all prime divisors of $3 p^{q-1}+1$ other than 2 or 7 are congruent to 1 modulo $2 p$, i.e. $$ 3 p^{q-1}+1=2^{\alpha} 7^{\beta} p_{1}^{\gamma_{1}} \cdots p_{k}^{\gamma_{k}} $$ where $p_{i} \notin\{2,7\}$ are prime divisors with $p_{i} \equiv 1(\bmod 2 p)$. We already know that $\alpha \leqslant 2$. Also, note that $$ \frac{11^{p}+17^{p}}{28}=11^{p-1}-11^{p-2} 17+11^{p-3} 17^{2}-\cdots+17^{p-1} \equiv p \cdot 4^{p-1} \quad(\bmod 7) $$ so $11^{p}+17^{p}$ is not divisible by $7^{2}$ and hence $\beta \leqslant 1$. If $q=2$, then $(*)$ becomes $3 p+1=2^{\alpha} 7^{\beta} p_{1}^{\gamma_{1}} \cdots p_{k}^{\gamma_{k}}$, but $p_{i} \geqslant 2 p+1$, which is only possible if $\gamma_{i}=0$ for all $i$, i.e. $3 p+1=2^{\alpha} 7^{\beta} \in\{2,4,14,28\}$, which gives us no solutions. Thus $q>2$, which implies $4 \mid 3 p^{q-1}+1$, i.e. $\alpha=2$. Now the right hand side of $(*)$ is congruent to 4 or 28 modulo $p$, which gives us $p=3$. Consequently $3^{q}+1 \mid 6244$, which is only possible for $q=3$. The pair $(p, q)=(3,3)$ is indeed a solution.
{ "problem_match": "\n4. ", "resource_path": "Balkan_MO/segmented/en-2018-BMO-type3.jsonl", "solution_match": "\nSolution." }
58
845
2019
T1
1
null
Balkan_MO
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 Albania
Obviously, the identical function $f(p)=p$ for all $p \in \mathbb{P}$ is a solution. We will show that this is the only one. First we will show that $f(2)=2$. Taking $q=2$ and $p$ any odd prime number, we have $$ f(p)^{f(2)}+2^{p}=f(2)^{f(p)}+p^{2} $$ Assume that $f(2) \neq 2$. It follows that $f(2)$ is odd and so $f(p)=2$ for any odd prime number $p$. Taking any two different odd prime numbers $p, q$ we have $$ 2^{2}+q^{p}=2^{2}+p^{q} \Rightarrow p^{q}=q^{p} \Rightarrow p=q, $$ contradiction. Hence, $f(2)=2$. So for any odd prime number $p$ we have $$ f(p)^{2}+2^{p}=2^{f(p)}+p^{2} . $$ Copy this relation as $$ 2^{p}-p^{2}=2^{f(p)}-f(p)^{2} $$ Let $T$ be the set of all positive integers greater than 2 , i.e. $T=\{3,4,5, \ldots\}$. The function $g: T \rightarrow \mathbb{Z}, g(n)=2^{n}-n^{2}$, is strictly increasing, i.e. $$ g(n+1)-g(n)=2^{n}-2 n-1>0 $$ for all $n \in T$. We show this by induction. Indeed, for $n=3$ it is true, $2^{3}-2 \cdot 3-1>0$. Assume that $2^{k}-2 k-1>0$. It follows that for $n=k+1$ we have $$ 2^{k+1}-2(k+1)-1=\left(2^{k}-2 k-1\right)+\left(2^{k}-2\right)>0 $$ for any $k \geq 3$. Therefore, (2) is true for all $n \in T$. As consequence, (1) holds if and only if $f(p)=p$ for all odd prime numbers $p$, as well as for $p=2$. Therefore, the only function that satisfies the given relation is $f(p)=p$, for all $p \in \mathbb{P}$.
{ "problem_match": "# Problem 1.", "resource_path": "Balkan_MO/segmented/en-2019-BMO-type1.jsonl", "solution_match": "\nSolution." }
86
564
2019
T1
3
null
Balkan_MO
Let $A B C$ be an acute scalene triangle. Let $X$ and $Y$ be two distinct interior points of the segment $B C$ such that $\angle C A X=\angle Y A B$. Suppose that: 1) $K$ and $S$ are the feet of perpendiculars from $B$ to the lines $A X$ and $A Y$ respectively; 2) $T$ and $L$ are the feet of perpendiculars from $C$ to the lines $A X$ and $A Y$ respectively. Prove that $K L$ and $S T$ intersect on the line $B C$. ## Proposed by Greece
Denote $\phi=\widehat{X A B}=\widehat{Y A C}, \alpha=\widehat{C A X}=\widehat{B A Y}$. Then, because the quadrilaterals ABSK and ACTL are cyclic, we have $$ \widehat{B S K}+\widehat{B A K}=180^{\circ}=\widehat{B S K}+\phi=\widehat{L A C}+\widehat{L T C}=\widehat{L T C}+\phi $$ so, due to the 90-degree angles formed, we have $\widehat{K S L}=\widehat{K T L}$. Thus, KLST is cyclic. Figure 1: G6 Consider $M$ to be the midpoint of $B C$ and $K^{\prime}$ to be the symmetric point of $K$ with respect to $M$. Then, $B K C K^{\prime}$ is a parallelogram, and so $B K \| C K^{\prime}$. But $B K \| C T$, because they are both perpendicular to $A X$. So, $K^{\prime}$ lies on $C T$ and, as $\widehat{K T K^{\prime}}=90$ and $M$ is the midpoint of $K K^{\prime}, M K=M T$. In a similar way, we have that $M S=M L$. Thus, the center of $(K L S T)$ is $M$. Consider $D$ to be the foot of altitude from $A$ to $B C$. Then, $D$ belongs in both $(A B K S)$ and $(A C L T)$. So, $$ \widehat{A D T}+\widehat{A C T}=180^{\circ}=\widehat{A B S}+\widehat{A D S}=\widehat{A D T}+90^{\circ}-\alpha=\widehat{A D S}+90^{\circ}-\alpha $$ and $A D$ is the bisector of $\widehat{S D T}$. Because $D M$ is perpendicular to $A D, D M$ is the external bisector of this angle, and, as $M S=M T$, it follows that $D M S T$ is cyclic. In a similar way, we have that $D M L K$ is also cyclic. So, we have that $S T, K L$ and $D M$ are the radical axes of these three circles, $(K L S T)$, $(D M S T),(D M K L)$. These lines are, therefore, concurrent, and we have proved the desired result.
{ "problem_match": "# Problem 3.", "resource_path": "Balkan_MO/segmented/en-2019-BMO-type1.jsonl", "solution_match": "\nSolution." }
140
595
2019
T1
4
null
Balkan_MO
A grid consists of all points of the form $(m, n)$ where $m$ and $n$ are integers with $|m| \leqslant 2019$, $|n| \leqslant 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 Cyprus
Anna does not have a winning strategy. We will provide a winning strategy for Bob. It is enough to describe his strategy for the deletions on the line $y=2019$. Bob starts by deleting $(0,2019)$ and $(-1,2019)$. Once Anna completes her turn, he deletes the next two available points on the left if Anna decreased her $x$-coordinate, the next two available points on the right if Anna increased her $x$-coordinate, and the next available point to the left and the next available point to the right if Anna did not change her $x$-coordinate. The only exception to the above rule is on the very first time Anna decreases $x$ by exactly 1 . In that turn, Bob deletes the next available point to the left and the next available point to the right. Bob's strategy guarantees the following: If Anna makes a sequence of steps reaching $(-x, y)$ with $x>0$ and the exact opposite sequence of steps in the horizontal direction reaching $(x, y)$, then Bob deletes at least as many points to the left of $(0,2019)$ in the first sequence than points to the right of $(0,2019)$ in the second sequence. So we may assume for contradiction that Anna wins by placing her token at $(k, 2019)$ for some $k>0$. Define $\Delta=3 m-(2 x+y)$, where $m$ is the total number of points deleted by Bob to the right of $(0,2019)$, and $(x, y)$ is the position of Anna's token. For each sequence of steps performed first by Anna and then by Bob, $\Delta$ does not decrease. This can be seen by looking at the following table exhibiting the changes in 3 m and $2 x+y$. We have excluded the cases where $2 x+y<0$. | Turn | $(0,3)$ | $(1,2)$ | $(-1,2)$ | $(2,1)$ | $(0,1)$ | $(3,0)$ | $(1,0)$ | $(2,-1)$ | $(1,-2)$ | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | $m$ | 1 | 2 | 0 (or 1$)$ | 2 | 1 | 2 | 2 | 2 | 2 | | $3 m$ | 3 | 6 | 0 (or 3$)$ | 6 | 3 | 6 | 6 | 6 | 6 | | $2 x+y$ | 3 | 4 | 0 | 5 | 1 | 6 | 2 | 3 | 0 | The table also shows that, if in this sequence of turns Anna changes $y$ by +1 or -2 , then $\Delta$ is increased by 1 . Also, if Anna changes $y$ by +2 or -1 , then the first time this happens $\Delta$ is increased by 2 . (This also holds if her turn is $(0,-1)$ or $(-2,-1)$, which are not shown in the table.) Since Anna wins by placing her token at $(k, 2019)$ we must have $m \leqslant k-1$ and $k \leqslant 2018$. So at that exact moment we have: $$ \Delta=3 m-(2 k+2019)=k-2022 \leqslant-4 . $$ So in her last turn she must have decreased $\Delta$ by at least 4 . So her last turn must have been $(1,2)$ or $(2,1)$, which give a decrease of 4 and 5 respectively. (It could not be $(3,0)$ because then she must have already won. Also she could not have done just one or two steps in her last turn since this is not enough for the required decrease in $\Delta$.) If her last turn was $(1,2)$, then just before doing it we had $y=2017$ and $\Delta=0$. This means that in one of her turns the total change in $y$ was not $0 \bmod 3$. However, in that case we have seen that $\Delta>0$, a contradiction. If her last turn was $(2,1)$, then just before doing it we had $y=2018$ and $\Delta=0$ or $\Delta=1$. So she must have made at least two turns with the change of $y$ being +1 or -2 or at least one step with the change of $y$ being +2 or -1 . In both cases, consulting the table, we get an increase of at least 2 in $\Delta$, a contradiction. Note 1: If Anna is allowed to make at most three steps at each turn, then she actually has a winning strategy. Note 2: If 2019 is replaced by $N>1$, then Bob has a winning strategy if and only if $3 \mid N$.
{ "problem_match": "# Problem 4.", "resource_path": "Balkan_MO/segmented/en-2019-BMO-type1.jsonl", "solution_match": "\nSolution." }
282
1,130
2020
T1
3
null
Balkan_MO
Let $k$ be a positive integer. Determine the least integer $n \geqslant k+1$ for which the game below can be played indefinitely: Consider $n$ boxes, labelled $b_{1}, b_{2}, \ldots, b_{n}$. For each index $i$, box $b_{i}$ contains initially exactly $i$ coins. At each step, the following three substeps are performed in order: (1) Choose $k+1$ boxes; (2) Of these $k+1$ boxes, choose $k$ and remove at least half of the coins from each, and add to the remaining box, if labelled $b_{i}$, a number of $i$ coins. (3) If one of the boxes is left empty, the game ends; otherwise, go to the next step.
The required minimum is $n=2^{k}+k-1$. In this case the game can be played indefinitely by choosing the last $k+1$ boxes, $b_{2^{k}-1}, b_{2^{k}}, \ldots, b_{2^{k}+k-1}$, at each step: At step $r$, if box $b_{2^{k}+i-1}$ has exactly $m_{i}$ coins, then $\left\lceil m_{i} / 2\right\rceil$ coins are removed from that box, unless $i \equiv r-1(\bmod k+1)$, in which case $2^{k}+i-1$ coins are added. Thus, after step $r$ has been performed, box $b_{2^{k}+i-1}$ contains exactly $\left\lfloor m_{i} / 2\right\rfloor$ coins, unless $i \equiv r-1(\bmod k+1)$, in which case it contains exactly $m_{i}+2^{k}+i-1$ coins. This game goes on indefinitely, since each time a box is supplied, at least $2^{k}-1$ coins are added, so it will then contain at least $2^{k}$ coins, good enough to survive the $k$ steps to its next supply. We now show that no smaller value of $n$ works. So, let $n \leqslant 2^{k}+k-2$ and suppose, if possible, that a game can be played indefinitely. Notice that a box currently containing exactly $m$ coins survives at most $w=\left\lfloor\log _{2} m\right\rfloor$ withdrawals; this $w$ will be referred to as the weight of that box. The sum of the weigths of all boxes will referred to as the total weight. The argument hinges on the lemma below, proved at the end of the solution. Lemma. Performing a step does not increase the total weight. Moreover, supplying one of the first $2^{k}-2$ boxes strictly decreases the total weight. Since the total weight cannot strictly decrease indefinitely, $n>2^{k}-2$, and from some stage on none of the first $2^{k}-2$ boxes is ever supplied. Recall that each step involves a $(k+1)$-box choice. Since $n \leqslant 2^{k}+k-2$, from that stage on, each step involves a withdrawal from at least one of the first $2^{k}-2$ boxes. This cannot go on indefinitely, so the game must eventually come to an end, contradicting the assumption. Consequently, a game that can be played indefinitely requires $n \geqslant 2^{k}+$ $k-1$. Proof of the Lemma. Since a withdrawal from a box decreases its weight by at least 1 , it is sufficient to show that supplying a box increases its weight by at most $k$; and if the latter is amongst the first $2^{k}-2$ boxes, then its weight increases by at most $k-1$. Let the box to be supplied be $b_{i}$ and let it currently contain exactly $m_{i}$ coins, to proceed by case analysis: If $m_{i}=1$, the weight increases by $\left\lfloor\log _{2}(i+1)\right\rfloor \leqslant\left\lfloor\log _{2}\left(2^{k}+k-1\right)\right\rfloor \leqslant$ $\left\lfloor\log _{2}\left(2^{k+1}-2\right)\right\rfloor \leqslant k$; and if, in addition, $i \leqslant 2^{k}-2$, then the weight increases by $\left\lfloor\log _{2}(i+1)\right\rfloor \leqslant\left\lfloor\log _{2}\left(2^{k}-1\right)\right\rfloor=k-1$. If $m_{i}=2$, then the weight increases by $\left\lfloor\log _{2}(i+2)\right\rfloor-\left\lfloor\log _{2} 2\right\rfloor \leqslant$ $\left\lfloor\log _{2}\left(2^{k}+k\right)\right\rfloor-1 \leqslant k-1$. If $m_{i} \geqslant 3$, then the weight increases by $$ \begin{aligned} \left\lfloor\log _{2}\left(i+m_{i}\right)\right\rfloor-\left\lfloor\log _{2} m_{i}\right\rfloor & \leqslant\left\lfloor\log _{2}\left(i+m_{i}\right)-\log _{2} m_{i}\right\rfloor+1 \\ & \leqslant\left\lfloor\log _{2}\left(1+\frac{2^{k}+k-2}{3}\right)\right\rfloor+1 \leqslant k, \end{aligned} $$ since $1+\frac{1}{3}\left(2^{k}+k-2\right)=\frac{1}{3}\left(2^{k}+k+1\right)<\frac{1}{3}\left(2^{k}+2^{k+1}\right)=2^{k}$. Finally, let $i \leqslant 2^{k}-2$ to consider the subcases $m_{i}=3$ and $m_{i} \geqslant 4$. In the former subcase, the weight increases by $$ \left\lfloor\log _{2}(i+3)\right\rfloor-\left\lfloor\log _{2} 3\right\rfloor \leqslant\left\lfloor\log _{2}\left(2^{k}+1\right)\right\rfloor-1=k-1, $$ and in the latter by $$ \begin{aligned} \left\lfloor\log _{2}\left(i+m_{i}\right)\right\rfloor-\left\lfloor\log _{2} m_{i}\right\rfloor & \leqslant\left\lfloor\log _{2}\left(i+m_{i}\right)-\log _{2} m_{i}\right\rfloor+1 \\ & \leqslant\left\lfloor\log _{2}\left(1+\frac{2^{k}-2}{4}\right)\right\rfloor+1 \leqslant k-1, \end{aligned} $$ since $1+\frac{1}{4}\left(2^{k}-2\right)=\frac{1}{4}\left(2^{k}+2\right)<2^{k-2}+1$. This ends the proof and completes the solution.
{ "problem_match": "## 2020 BMO, Problem 3", "resource_path": "Balkan_MO/segmented/en-2020-BMO-type1.jsonl", "solution_match": "\nSolution." }
178
1,566
2020
T1
4
null
Balkan_MO
Let $a_{1}=2$ and, for every positive integer $n$, let $a_{n+1}$ be the smallest integer strictly greater than $a_{n}$ that has more positive divisors than $a_{n}$. Prove that $2 a_{n+1}=3 a_{n}$ only for finitely many indices $n$.
Begin with a mere remark on the terms of the sequence under consideration. Lemma 1. Each $a_{n}$ is minimal amongst all positive integers having the same number of positive divisors as $a_{n}$. Proof. Suppose, if possible, that for some $n$, some positive integer $b<a_{n}$ has as many positive divisors as $a_{n}$. Then $a_{m}<b \leqslant a_{m+1}$ for some $m<n$, and the definition of the sequence forces $b=a_{m+1}$. Since $b<a_{n}$, it follows that $m+1<n$, which is a contradiction, as $a_{m+1}$ should have less positive divisors than $a_{n}$. Let $p_{1}<p_{2}<\cdots<p_{n}<\cdots$ be the strictly increasing sequence of prime numbers, and write canonical factorisations into primes in the form $N=\prod_{i \geqslant 1} p_{i}^{e_{i}}$, where $e_{i} \geqslant 0$ for all $i$, and $e_{i}=0$ for all but finitely many indices $i$; in this notation, the number of positive divisors of $N$ is $\tau(N)=$ $\prod_{i \geqslant 1}\left(e_{i}+1\right)$. Lemma 2. The exponents in the canonical factorisation of each $a_{n}$ into primes form a non-strictly decreasing sequence. Proof. Indeed, if $e_{i}<e_{j}$ for some $i<j$ in the canonical decomposition of $a_{n}$ into primes, then swapping the two exponents yields a smaller integer with the same number of positive divisors, contradicting Lemma 1. We are now in a position to prove the required result. For convenience, a term $a_{n}$ satisfying $3 a_{n}=2 a_{n+1}$ will be referred to as a special term of the sequence. Suppose now, if possible, that the sequence has infinitely many special terms, so the latter form a strictly increasing, and hence unbounded, subsequence. To reach a contradiction, it is sufficient to show that: (1) The exponents of the primes in the factorisation of special terms have a common upper bound $e$; and (2) For all large enough primes $p$, no special term is divisible by $p$. Refer to Lemma 2 to write $a_{n}=\prod_{i \geqslant 1} p_{i}^{e_{i}(n)}$, where $e_{i}(n) \geqslant e_{i+1}(n)$ for all $i$. Statement (2) is a straightforward consequence of (1) and Lemma 1. Suppose, if possible, that some special term $a_{n}$ is divisible by a prime $p_{i}>2^{e+1}$, where $e$ is the integer provided by (1). Then $e \geqslant e_{i}(n)>0$, so $2^{e_{1}(n) e_{i}(n)+e_{i}(n)} a_{n} / p_{i}^{e_{i}(n)}$ is a positive integer with the same number of positive divisors as $a_{n}$, but smaller than $a_{n}$. This contradicts Lemma 1. Consequently, no special term is divisible by a prime exceeding $2^{e+1}$. To prove (1), it is sufficient to show that, as $a_{n}$ runs through the special terms, the exponents $e_{1}(n)$ are bounded from above. Then, Lemma 2 shows that such an upper bound $e$ suits all primes. Consider a large enough special $a_{n}$. The condition $\tau\left(a_{n}\right)<\tau\left(a_{n+1}\right)$ is then equivalent to $\left(e_{1}(n)+1\right)\left(e_{2}(n)+1\right)<e_{1}(n)\left(e_{2}(n)+2\right)$. Alternatively, but equivalently, $e_{1}(n) \geqslant e_{2}(n)+2$. The latter implies that $a_{n}$ is divisible by 8 , for either $e_{1}(n) \geqslant 3$ or $a_{n}$ is a large enough power of 2 . Next, note that $9 a_{n} / 8$ is an integer strictly between $a_{n}$ and $a_{n+1}$, so $\tau\left(9 a_{n} / 8\right) \leqslant \tau\left(a_{n}\right)$, which is equivalent to $$ \left(e_{1}(n)-2\right)\left(e_{2}(n)+3\right) \leqslant\left(e_{1}(n)+1\right)\left(e_{2}(n)+1\right), $$ so $2 e_{1}(n) \leqslant 3 e_{2}(n)+7$. This shows that $a_{n}$ is divisible by 3 , for otherwise, letting $a_{n}$ run through the special terms, 3 would be an upper bound for all but finitely many $e_{1}(n)$, and the special terms would therefore form a bounded sequence. Thus, $4 a_{n} / 3$ is another integer strictly between $a_{n}$ and $a_{n+1}$. As before, $\tau\left(4 a_{n} / 3\right) \leqslant \tau\left(a_{n}\right)$. Alternatively, but equivalently, $$ \left(e_{1}(n)+3\right) e_{2}(n) \leqslant\left(e_{1}(n)+1\right)\left(e_{2}(n)+1\right), $$ so $2 e_{2}(n)-1 \leqslant e_{1}(n)$. Combine this with the inequality in the previous paragraph to write $4 e_{2}(n)-2 \leqslant 2 e_{1}(n) \leqslant 3 e_{2}(n)+7$ and infer that $e_{2}(n) \leqslant 9$. Consequently, $2 e_{1}(n) \leqslant 3 e_{2}(n)+7 \leqslant 34$, showing that $e=17$ is suitable for (1) to hold. This establishes (1) and completes the solution.
{ "problem_match": "## 2020 BMO, Problem 4", "resource_path": "Balkan_MO/segmented/en-2020-BMO-type1.jsonl", "solution_match": "\nSolution." }
76
1,461
2021
T1
1
null
Balkan_MO
Let $A B C$ be a triangle with $A B<A C$. Let $\omega$ be a circle passing through $B, C$ and assume that $A$ is inside $\omega$. Suppose $X, Y$ lie on $\omega$ such that $\angle B X A=\angle A Y C$. Suppose also that $X$ and $C$ lie on opposite sides of the line $A B$ and that $Y$ and $B$ lie on opposite sides of the line $A C$. Show that, as $X, Y$ vary on $\omega$, the line $X Y$ passes through a fixed point.
. Let $B^{\prime}$ and $C^{\prime}$ be the points of intersection of the lines $A B$ and $A C$ with $\omega$ respectively and let $\omega_{1}$ be the circumcircle of the triangle $A B^{\prime} C^{\prime}$. Let $\varepsilon$ be the tangent to $\omega_{1}$ at the point $A$. Because $A B<A C$ the lines $B^{\prime} C^{\prime}$ and $\varepsilon$ intersects at a point $Z$ which is fixed and independent of $X$ and $Y$. We have $$ \angle Z A C^{\prime}=\angle C^{\prime} B^{\prime} A=\angle C^{\prime} B^{\prime} B=\angle C^{\prime} C B . $$ Therefore, $\varepsilon \| B C$. Let $X^{\prime}, Y^{\prime}$ be the points of intersection of the lines $X A, Y A$ with $\omega$ respecively. From the hypothesis we have $\angle B X X^{\prime}=\angle Y^{\prime} Y C$. Therefore $$ \widehat{B X^{\prime}}=\widehat{Y^{\prime} C} \Longrightarrow \widehat{B C}+\widehat{C X^{\prime}}=\widehat{Y^{\prime} B}+\widehat{B C} \Longrightarrow \widehat{C X^{\prime}}=\widehat{Y^{\prime} B} $$ and so $X^{\prime} Y^{\prime}\|B C\| \varepsilon$. Thus $$ \angle X A Z=\angle X X^{\prime} Y^{\prime}=\angle X Y Y^{\prime}=\angle X Y A . $$ From the last equality we have that $\varepsilon$ is also tangent to the circmucircle $\omega_{2}$ of the triangle $X A Y$. Consider now the radical centre of the circles $\omega, \omega_{1}, \omega_{2}$. This is the point of intersection of the radical axes $B^{\prime} C^{\prime}\left(\right.$ of $\omega$ and $\left.\omega_{1}\right), \varepsilon\left(\right.$ of $\omega_{1}$ and $\left.\omega_{2}\right)$ and $X Y$ (of $\omega$ and $\omega_{2}$ ). This must be point $Z$ and therefore the variable line $X Y$ passes through the fixed point $Z$.
{ "problem_match": "## BMO 2021 - Problem 1", "resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "solution_match": "\nSolution 2" }
133
565
2021
T1
2
null
Balkan_MO
Find all functions $f:(0,+\infty) \rightarrow(0,+\infty)$ such that $$ f(x+f(x)+f(y))=2 f(x)+y $$ holds for all $x, y \in(0,+\infty)$.
. We will show that $f(x)=x$ for every $x \in \mathbb{R}^{+}$. It is easy to check that this function satisfies the equation. We write $P(x, y)$ for the assertion that $f(x+f(x)+f(y))=2 f(x)+y$. We first show that $f$ is injective. So assume $f(a)=f(b)$. Now $P(1, a)$ and $P(1, b)$ show that $$ 2 f(1)+a=f(1+f(1)+f(a))=f(1+f(1)+f(b))=2 f(1)+b $$ and therefore $a=b$. Let $A=\left\{x \in \mathbb{R}^{+}: f(x)=x\right\}$. It is enough to show that $A=\mathbb{R}^{+}$. $P(x, x)$ shows that $x+2 f(x) \in A$ for every $x \in \mathbb{R}^{+}$. Now $P(x, x+2 f(x))$ gives that $$ f(2 x+3 f(x))=x+4 f(x) $$ for every $x \in \mathbb{R}^{+}$. Therefore $P(x, 2 x+3 f(x))$ gives that $2 x+5 f(x) \in A$ for every $x \in \mathbb{R}^{+}$. Suppose $x, y \in \mathbb{R}^{+}$such that $x, 2 x+y \in A$. Then $P(x, y)$ gives that $$ f(2 x+f(y))=f(x+f(x)+f(y))=2 f(x)+y=2 x+y=f(2 x+y) $$ and by the injectivity of $f$ we have that $2 x+f(y)=2 x+y$. We conlude that $y \in A$ as well. Now since $x+2 f(x) \in A$ and $2 x+5 f(x)=2(x+2 f(x))+f(x) \in A$ we deduce that $f(x) \in A$ for every $x \in \mathbb{R}^{+}$. I.e. $f(f(x))=f(x)$ for every $x \in \mathbb{R}^{+}$. By injectivity of $f$ we now conclude that $f(x)=x$ for every $x \in \mathbb{R}^{+}$.
{ "problem_match": "## BMO 2021 - Problem 2", "resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "solution_match": "\nSolution 1" }
60
565
2021
T1
2
null
Balkan_MO
Find all functions $f:(0,+\infty) \rightarrow(0,+\infty)$ such that $$ f(x+f(x)+f(y))=2 f(x)+y $$ holds for all $x, y \in(0,+\infty)$.
. As in Solution 1, $f$ is injective. Furthermore, letting $m=2 f(1)$ we have that the image of $f$ contains $(m, \infty)$. Indeed, if $t>m$, say $t=m+y$ for some $y>0$, then $P(1, y)$ shows that $f(1+f(1)+f(y))=t$. Let $a, b \in \mathbb{R}$. We will show that $f(a)-a=f(b)-b$. Define $c=2 f(a)-2 f(b)$ and $d=a+f(a)-b-f(b)$. It is enough to show that $c=d$. By interchanging the roles of $a$ and $b$ in necessary, we may assume that $d \geqslant 0$. From $P(a, y)$ and $P(b, y)$, after subtraction, we get $$ f(a+f(a)+f(y))-f(b+f(b)+f(y))=2 f(a)-2 f(b)=c . $$ so for any $t>m$ (picking $y$ such that $f(y)=t$ in (1)) we get $$ f(a+f(a)+t)-f(b+f(b)+t)=2 f(a)-2 f(b)=c . $$ Now for any $z>m+b+f(b)$, taking $t=z-b-f(b)$ in (2) we get $$ f(z+d)-f(z)=c $$ Now for any $x>m+b+f(b)$ from (3) we get that $$ 2 f(x+d)+y=2 f(x)+y+2 c $$ Also, for any $x$ large enough, $(x>\max \{m+b+f(b), m+b+f(b)+c-d\}$ will do), by repeated application of (3), we have $$ \begin{aligned} f(x+d+f(x+d)+f(y)) & =f(x+f(x+d)+y)+c \\ & =f(x+f(x)+y+c)+c \\ & =f(x+f(x)+y+c-d)+2 c . \end{aligned} $$ (In the first equality we applied (3) with $z=x+f(x+d)+y>x>m+b+f(b)$, in the second with $z=x>m+b+f(b)$ and in the third with $z=x+f(x)+y-c+d>x+c-d>m+b+f(b)$. In particular, now $P(x+d, y)$ implies that $$ f(x+f(x)+y+c-d)=2 f(x)+y=f(x+f(x)+y) $$ for every large enough $x$. By injectivity of $f$ we deduce that $x+f(x)+y+c-d=x+f(x)+y$ and therefore $c=d$ as required. It now follows that $f(x)=x+k$ for every $x \in \mathbb{R}^{+}$and some fixed constant $k$. Substituting in the initial equation we get $k=0$.
{ "problem_match": "## BMO 2021 - Problem 2", "resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "solution_match": "\nSolution 2" }
60
658
2021
T1
3
null
Balkan_MO
Let $a, b$ and $c$ be positive integers satisfying the equation $$ (a, b)+[a, b]=2021^{c} . $$ If $|a-b|$ is a prime number, prove that the number $(a+b)^{2}+4$ is composite. Here, $(a, b)$ denotes the greatest common divisor of $a$ and $b$, and $[a, b]$ denotes the least common multiple of $a$ and $b$.
We write $p=|a-b|$ and assume for contradiction that $q=(a+b)^{2}+4$ is a prime number. Since $(a, b) \mid[a, b]$, we have that $(a, b) \mid 2021^{c}$. As $(a, b)$ also divides $p=|a-b|$, it follows that $(a, b) \in\{1,43,47\}$. We will consider all 3 cases separately: (1) If $(a, b)=1$, then $1+a b=2021^{c}$, and therefore $$ q=(a+b)^{2}+4=(a-b)^{2}+4(1+a b)=p^{2}+4 \cdot 2021^{c} . $$ (a) Suppose $c$ is even. Since $q \equiv 1 \bmod 4$, it can be represented uniquely (up to order) as a sum of two (non-negative) squares. But (1) gives potentially two such representations so in order to have uniqueness we must have $p=2$. But then $4 \mid q$ a contradiction. (b) If $c$ is odd then $a b=2021^{c}-1 \equiv 1 \bmod 3$. Thus $a \equiv b \bmod 3$ implying that $p=|a-b| \equiv 0 \bmod 3$. Therefore $p=3$. Without loss of generality $b=a+3$. Then $2021^{c}=a b+1=a^{2}+3 a+1$ and so $$ (2 a+3)^{2}=4 a^{2}+12 a+9=4 \cdot 2021^{c}+5 $$ So 5 is a quadratic residue modulo 47, a contradiction as $$ \left(\frac{5}{47}\right)=\left(\frac{47}{5}\right)=\left(\frac{2}{5}\right)=-1 . $$ (2) If $(a, b)=43$, then $p=|a-b|=43$ and we may assume that $a=43 k$ and $b=43(k+1)$, for some $k \in \mathbb{N}$. Then $2021^{c}=43+43 k(k+1)$ giving that $$ (2 k+1)^{2}=4 k^{2}+4 k+4-3=4 \cdot 43^{c-1} \cdot 47-3 . $$ So -3 is a quadratic residue modulo 47 , a contradiction as $$ \left(\frac{-3}{47}\right)=\left(\frac{-1}{47}\right)\left(\frac{3}{47}\right)=\left(\frac{47}{3}\right)=\left(\frac{2}{3}\right)=-1 $$ (3) If $(a, b)=47$ then analogously there is a $k \in \mathbb{N}$ such that $$ (2 k+1)^{2}=4 \cdot 43^{c} \cdot 47^{c-1}-3 . $$ If $c>1$ then we get a contradiction in exactly the same way as in (2). If $c=1$ then $(2 k+1)^{2}=169$ giving $k=6$. This implies that $a+b=47 \cdot 6+47 \cdot 7=47 \cdot 13 \equiv 1 \bmod 5$. Thus $q=(a+b)^{2}+4 \equiv 0 \bmod 5$, a contradiction.
{ "problem_match": "## BMO 2021 - Problem 3", "resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "solution_match": "\nSolution." }
106
844
2021
T1
4
null
Balkan_MO
Angel has a warehouse, which initially contains 100 piles of 100 pieces of rubbish each. Each morning, Angel performs exactly one of the following moves: (a) He clears every piece of rubbish from a single pile. (b) He clears one piece of rubbish from each pile. However, every evening, a demon sneaks into the warehouse and performs exactly one of the following moves: (a) He adds one piece of rubbish to each non-empty pile. (b) He creates a new pile with one piece of rubbish. What is the first morning when Angel can guarantee to have cleared all the rubbish from the warehouse?
. We will show that he can do so by the morning of day 199 but not earlier.If we have $n$ piles with at least two pieces of rubbish and $m$ piles with exactly one piece of rubbish, then we define the value of the pile to be $$ V= \begin{cases}n & m=0 \\ n+\frac{1}{2} & m=1 \\ n+1 & m \geqslant 2\end{cases} $$ We also denote this position by $(n, m)$. Implicitly we will also write $k$ for the number of piles with exactly two pieces of rubbish. Angel's strategy is the following: (i) From position $(0, m)$ remove one piece from each pile to go position $(0,0)$. The game ends. (ii) From position $(n, 0)$, where $n \geqslant 1$, remove one pile to go to position $(n-1,0)$. Either the game ends, or the demon can move to position $(n-1,0)$ or $(n-1,1)$. In any case $V$ reduces by at least $1 / 2$. (iii) From position $(n, 1)$, where $n \geqslant 1$, remove one pile with at least two pieces to go to position $(n-1,1)$. The demon can move to position $(n, 0)$ or $(n-1,2)$. In any case $V$ reduces by (at least) $1 / 2$. (iv) From position $(n, m)$, where $n \geqslant 1$ and $m \geqslant 2$, remove one piece from each pile to go to position $(n-k, k)$. The demon can move to position $(n, 0)$ or $(n-k, k+1)$. In any case $V$ reduces by at least $1 / 2$. (The value of position $(n-k, k+1)$ is $n+\frac{1}{2}$ if $k=0$, and $n-k+1 \leqslant n$ if $k \geqslant 1$.) So during every day if the game does not end then $V$ is decreased by at least $1 / 2$. So after 198 days if the game did not already end we will have $V \leqslant 1$ and we will be in one of positions $(0, m),(1,0)$. The game can then end on the morning of day 199. We will now provide a strategy for demon which guarantees that at the end of each day $V$ has decreased by at most $1 / 2$ and furthermore at the end of the day $m \leqslant 1$. (i) If Angel moves from $(n, 0)$ to $(n-1,0)$ (by removing a pile) then create a new pile with one piece to move to $(n-1,1)$. Then $V$ decreases by $1 / 2$ and and $m=1 \leqslant 1$ (ii) If Angel moves from $(n, 0)$ to $(n-k, k)$ (by removing one piece from each pile) then add one piece back to each pile to move to $(n, 0)$. Then $V$ stays the same and $m=0 \leqslant 1$. (iii) If Angels moves from $(n, 1)$ to $(n-1,1)$ or $(n, 0)$ (by removing a pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \leqslant 1$. (iv) If Angel moves from $(n, 1)$ to $(n-k, k)$ (by removing a piece from each pile) then add one piece to each pile to move to $(n, 0)$. Then $V$ decreases by $1 / 2$ and $m=0 \leqslant 1$. Since after every move of demon we have $m \leqslant 1$, in order for Angel to finish the game in the next morning we must have $n=1, m=0$ or $n=0, m=1$ and therefore we must have $V \leqslant 1$. But now inductively the demon can guarantee that by the end of day $N$, where $N \leqslant 198$ the game has not yet finished and that $V \geqslant 100-N / 2$.
{ "problem_match": "## BMO 2021 - Problem 4", "resource_path": "Balkan_MO/segmented/en-2021-BMO-type1.jsonl", "solution_match": "\nSolution 1" }
127
1,022
2022
T1
2
null
Balkan_MO
Problem. Let $a, b$ and $n$ be positive integers with $a>b$ such that all of the following hold: (i) $a^{2021}$ divides $n$, (ii) $b^{2021}$ divides $n$, (iii) 2022 divides $a-b$. Prove that there is a subset $T$ of the set of positive divisors of the number $n$ such that the sum of the elements of $T$ is divisible by 2022 but not divisible by $2022^{2}$.
If $1011 \mid a$, then $1011^{2021} \mid n$ and we can take $T=\left\{1011,1011^{2}\right\}$. So we can assume that $3 \nmid a$ or $337 \nmid a$. We continue with the following claim: Claim. If $k$ is a positive integer, then $a^{k} b^{2021-k} \mid n$. Proof of the Claim. We have that $n^{2021}=n^{k} \cdot n^{2021-k}$ is divisible by $a^{2021 k} \cdot b^{2021(2021-k)}$ and taking the 2021-root we get the desired result. Back to the problem, we will prove that the set $T=\left\{a^{k} b^{2021-k}: k \geqslant 0\right\}$ consisting of 2022 divisors of $n$, has the desired property. The sum of its elements is equal to $$ S=\sum_{k=0}^{2021} a^{k} b^{2021-k} \equiv \sum_{k=0}^{2021} a^{2021} \equiv 0 \bmod 2022 $$ On the other hand, the last sum is equal to $\frac{a^{2022}-b^{2022}}{a-b}$. If $3 \nmid a$, we will prove that $S$ is not divisible by 9 . Indeed if $3 \nmid a$ then we also have $3 \nmid b$. So if $3^{t} \| a-b$ then, since $3^{1} \| 2022$, by the Lifting the Exponent Lemma, we have that $3^{t+1} \| a^{2022}-b^{2022}$. This implies that $S$ is not divisible by 9 , therefore, $2022^{2}$ doesn't divide $S$. If $3 \mid a$, then we have $337 \nmid a$ and a similar argument shows that $337^{2} \nmid S$.
{ "problem_match": "# Problem 2", "resource_path": "Balkan_MO/segmented/en-2022-BMO-type1.jsonl", "solution_match": "\nSolution." }
127
521
2022
T1
3
null
Balkan_MO
Problem. Find all functions $f:(0, \infty) \rightarrow(0, \infty)$ such that $$ f\left(y(f(x))^{3}+x\right)=x^{3} f(y)+f(x) $$ for all $x, y>0$.
. Setting $y=\frac{t}{f(x)^{3}}$ we get $$ f(x+t)=x^{3} f\left(\frac{t}{f(x)^{3}}\right)+f(x) $$ for every $x, t>0$. From (1) it is immediate that $f$ is increasing. Claim. $f(1)=1$ Proof of Claim. Let $c=f(1)$. If $c<1$, taking $x=1$ and $y=\frac{1}{1-c^{3}}$ we have $y-y c^{3}=1$, so $y f(1)^{3}+1=y$ and $f\left(y f(1)^{3}+1\right)=f(y)=1^{3} f(y)$. Thus $f(1)=0$, a contradiction. Assume now for contradiction that $c>1$. We claim that $$ f\left(1+c^{3}+\cdots+c^{3 n}\right)=(n+1) c $$ for every $n \in \mathbb{N}$. We proceed by induction, the case $n=0$ being trivial. The inductive step follows easily by taking $x=1, t=c^{3}+c^{6}+\cdots+c^{3(k+1)}$ in (1). Now taking $x=1+c^{3}+\cdots+c^{3 n-3}, t=c^{3 n}$ in (1) we get $$ (n+1) c=f\left(1+c^{3}+\cdots+c^{3 n}\right)=\left(1+c^{3}+\cdots+c^{3 n-3}\right)^{3} f\left(\frac{c^{3 n}}{(c n)^{3}}\right)+n c $$ giving $$ f\left(\frac{c^{3 n-3}}{n^{3}}\right)=\frac{c}{\left(1+c^{3}+\cdots+c^{3 n}\right)^{3}}<c=f(1) \Longrightarrow \frac{c^{3 n-3}}{n^{3}}<1 . $$ But this leads to a contradiction if $n$ is large enough. Now for $x=1$ we get $f(y+1)=f(y)+1$ and since $f(1)=1$ inductively we get $f(n)=n$ for every $n \in \mathbb{N}$. For $m, n \in \mathbb{N}$, setting $x=n, y=q=m / n$ we get $$ m n^{2}+n=f\left(q n^{3}+n\right)=f\left(y f(x)^{3}+x\right)=x^{3} f(y)+f(x)=n^{3} f(q)+n \Longrightarrow f(q)=q . $$ Since $f$ is strictly increasing with $f(q)=q$ for every $q \in \mathbb{Q}^{>0}$ we deduce that $f(x)=x$ for every $x>0$. It is easily checked that this satisfies the functional equation.
{ "problem_match": "# Problem 3", "resource_path": "Balkan_MO/segmented/en-2022-BMO-type1.jsonl", "solution_match": "\nSolution 1" }
64
701
2022
T1
4
null
Balkan_MO
Problem. Consider an $n \times n$ grid consisting of $n^{2}$ unit cells, where $n \geqslant 3$ is a given odd positive integer. First, Dionysus colours each cell either red or blue. It is known that a frog can hop from one cell to another if and only if these cells have the same colour and share at least one vertex. Then, Xanthias views the colouring and next places $k$ frogs on the cells so that each of the $n^{2}$ cells can be reached by a frog in a finite number (possibly zero) of hops. Find the least value of $k$ for which this is always possible regardless of the colouring chosen by Dionysus. Note. Dionysus and Xanthias are characters from the play of Aristophanes 'frogs'. Dionysus is the known god of wine and Xanthias is his witty slave.
. Consider an $n \times m$ grid with $n, m \geqslant 3$ being odd. We say that a column is of 'Type A' if, when partitioned into its monochromatic pieces, the first and last piece have the same colour with each one containing at least two cells. Otherwise we say that that it is of 'Type B'. It is enough to show that the number $F$ of frogs required satisfies the inequality $$ F \leqslant \frac{(m+1)(n+1)}{4}+1-C $$ where $C$ is the number of boundary columns of Type $A$. We will proceed by induction but we first need a preliminary result. Claim. Consider two neighbouring columns of height $n$ which when taken alone need $k$ and $\ell$ frogs respectively. Let $k+t$ be the number of frogs required when both columns are taken together. (It is allowed for $t$ to be negative.) Then the maximum value of $t$ is given by the following table according to the types of the two columns: | Column 1 | Column 2 | $t$ | | :---: | :---: | :---: | | $A$ | $A$ | $\min \left\{\frac{\ell+1}{2}, \frac{n-k}{2}\right\}$ | | $A$ | $B$ | $\min \left\{\frac{\ell+1}{2}, \frac{n-k+2}{2}\right\}$ | | $B$ | $A$ | $\min \left\{\frac{\ell-1}{2}, \frac{n-k}{2}\right\}$ | | $B$ | $B$ | $\min \left\{\frac{\ell}{2}, \frac{n-k+1}{2}\right\}$ | Proof of Claim. Note that for every two consecutive monochromatic regions of the second column, one can be covered by a frog from the first column. This is because there is a cell in the first column which neighbours both of them and a from can jump from it to the region of the corresponding colour. So the new frogs needed is at most $\frac{\ell+1}{2}$. Furthermore, if we have equality, then $\ell$ must be odd so its top and bottom cell have the same colour. Furthermore the neighbouring cells in the first column must be of opposite colour, so the first column is of Type $A$. If the first column is of Type $B$ and the second column is of Type $A$, then even $\frac{\ell}{2}$ cannot be achieved. If it could, then $\ell$ ought to be even but this contradicts the fact that the second column is of type $A$. We draw the $k-1$ horizontal lines separating the first column into monochromatics regions and suppose that those they have heights $h_{1}, h_{2}, \ldots, h_{k}$. Note that the cells touching these lines in the second column do not need any frog as a frog from the first column can jump to them. So the remaining cells are partitioned in columns of heights $h_{1}-1, h_{2}-2, \ldots, h_{k-1}-$ $2, h_{k}-1$ all of whose cells to the left are the same colour. Now in each one of them we will need at most $\frac{h_{1}}{2}, \frac{h_{2}-1}{2}, \ldots, \frac{h_{k-1}-1}{2}, \frac{h_{k}}{2}$ frogs. Their sum is $\frac{n-k+2}{2}$ so we need at most that many frogs. Equality holds only if $h_{1}, h_{k}$ are even and the other $h_{i}$ 's are odd. In that case, since their sum is equal to $n$ which is odd we must have that $k$ is odd. So the first column must be of Type $A$. Furthermore, if the second column is of Type $A$, then the first and last monochromatic regions need at most $\frac{h_{1}-1}{2}$ and $\frac{h_{k}-1}{2}$ new frogs respectively. So the total number of new frogs needed is at most $\frac{n-k}{2}$. Suppose now that $m=3$ and the middle column needs $k$ frogs. So depending on the type of the three columns we need at most the following number of frogs: | Column 1 | Column 2 | Column 3 | Number of Frogs | | :---: | :---: | :---: | :---: | | $A$ | $A$ | $A$ | $k+\frac{n-k}{2}+\frac{n-k}{2}=n$ | | $A$ | $A$ | $B$ | $k+\frac{n-k}{2}+\frac{n-k+2}{2}=n+1$ | | $A$ | $B$ | $A$ | $k+\frac{n-k}{2}+\frac{n-k}{2}=n$ | | $A$ | $B$ | $B$ | $k+\frac{n-k}{2}+\frac{n-k+1}{2}=n-\frac{1}{2}$ | | $B$ | $A$ | $A$ | $k+\frac{n-k+2}{2}+\frac{n-k}{2}=n+1$ | | $B$ | $A$ | $B$ | $k+\frac{n-k+2}{2}+\frac{n-k+2}{2}=n+2$ | | $B$ | $B$ | $A$ | $k+\frac{n-k+1}{2}+\frac{n-k}{2}=n+\frac{1}{2}$ | | $B$ | $B$ | $B$ | $k+\frac{n-k+1}{2}+\frac{n-k+1}{2}=n+1$ | This proves (1) for the case $m=3$ as the claim is $F \leqslant n+2-C$ and it can be checked that this is satisfied in all cases. Suppose now by induction that the result is true for $m$ and we are trying to prove it for $m+2$. We attach two columns at the end of the table. We need to show that we need additionally at most $\frac{n+1}{2}+C_{\text {old }}-C_{\text {new }}$ number of frogs. Suppose they need $k$ and $\ell$ frogs respectively. So depending on the type of these two columns with the previous one we need at most the following additional number of frogs: | Column 1 | Column 2 | Column 3 | Number of Frogs | | :---: | :---: | :---: | :---: | | $A$ | $A$ | $A$ | $\frac{k+1}{2}+\frac{n-k}{2}=\frac{n+1}{2}$ | | $A$ | $A$ | $B$ | $\frac{k+1}{2}+\frac{n-k+2}{2}=\frac{n+3}{2}$ | | $A$ | $B$ | $A$ | $\frac{k+1}{2}+\frac{n-k}{2}=\frac{n+1}{2}$ | | $A$ | $B$ | $B$ | $\frac{k+1}{2}+\frac{n-k+1}{2}=\frac{n+2}{2}$ | | $B$ | $A$ | $A$ | $\frac{k-1}{2}+\frac{n-k}{2}=\frac{n-1}{2}$ | | $B$ | $A$ | $B$ | $\frac{k-1}{2}+\frac{n-k+2}{2}=\frac{n+1}{2}$ | | $B$ | $B$ | $A$ | $\frac{k}{2}+\frac{n-k}{2}=\frac{n}{2}$ | | $B$ | $B$ | $B$ | $\frac{k}{2}+\frac{n-k+1}{2}=\frac{n+1}{2}$ | It can now be checked (using also that $n$ is odd) that this completes the inductive step.
{ "problem_match": "# Problem 4", "resource_path": "Balkan_MO/segmented/en-2022-BMO-type1.jsonl", "solution_match": "\nSolution 2" }
195
1,812
2023
T1
1
null
Balkan_MO
Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all $x, y \in \mathbb{R}$, $$ x f(x+f(y))=(y-x) f(f(x)) $$
Answer: For any real $c, f(x)=c-x$ for all $x \in \mathbb{R}$ and $f(x)=0$ for all $x \in \mathbb{R}$. Let $P(x, y)$ denote the proposition that $x$ and $y$ satisfy the given equation. $P(0,1)$ gives us $f(f(0))=0$. From $P(x, x)$ we get that $x f(x+f(x))=0$ for all $x \in \mathbb{R}$, which together with $f(f(0))=$ 0 gives us $f(x+f(x))=0$ for all $x$. Now let $t$ be any real number such that $f(t)=0$. If $y$ is any number, we have from $P(t-f(y), y)$ the equality $$ (y+f(y)-t) f(f(t-f(y)))=0 $$ for all $y$ and all $t$ such that $f(t)=0$. So, by taking $y=f(0)$ we obtain $$ (f(0)-t) f(f(t))=0 \quad \text { and hence } \quad(f(0)-t) f(0)=0 $$ Recall that as $t$ with $f(t)=0$ we can take $x+f(x)$ for any real number $x$. If for all reals $x$ we have $x+f(x)=f(0)$, then $f(x)$ must be of the form $f(x)=c-x$ for some real $c$. It is straightforward that all functions of this form are indeed solutions. Otherwise we can find some $a \neq 0$ so that $a+f(a) \neq f(0)$. If $t=a+f(a)$ in (A1-1), then $f(0)$ must be equal to 0 . Now $P(x, 0)$ gives us $f(f(x))=-f(x)$ for all real $x$. From here $P(x, x+f(x))$ gives us $x f(x)=-f(x)^{2}$ for all real $x$, which means for every $x$ either $f(x)=0$ or $f(x)=-x$. Let us assume that in this case there is some $b \neq 0$ so that $f(b)=-b$. For any $y$ we get from $P(b, y)$ and $f(f(b))=-f(b)=b$ the equality $b f(b+f(y))=(y-b) b$, which gives us $f(b+f(y))=y-b$ for all $y$. If $y \neq b$, then the right hand side in the previous equality is not zero, so we must have $f(b+f(y))=-b-f(y)$, which means that $-b-f(y)=y-b$, or that $f(y)=-y$ for all real $y$. But we already covered this solution (take $c=0$ above). If there is no such $b$, then $f(x)=0$ for all $x$, which gives us the final solution. Thus, all such functions are of the form $c-x$ for real $c$ or the zero function.
{ "problem_match": "\nProblem 1.", "resource_path": "Balkan_MO/segmented/en-2023-BMO-type1.jsonl", "solution_match": "\nSolution." }
54
711
2023
T1
2
null
Balkan_MO
In triangle $A B C$, the incircle touches sides $B C, C A, A B$ at $D, E, F$ respectively. Assume there exists a point $X$ on the line $E F$ such that $$ \angle X B C=\angle X C B=45^{\circ} . $$ Let $M$ be the midpoint of the arc $B C$ on the circumcircle of $A B C$ not containing $A$. Prove that the line $M D$ passes through $E$ or $F$.
. Let $I$ be the incenter of $\triangle A B C$ and let $K$ be the foot of the perpendicular from $D$ to $E F$. We begin by proving that $B K X C$ is cyclic, which can be done in two ways: First Way. Note that $\angle K F D=90^{\circ}-\frac{\angle C}{2}$ and $\angle K E D=90^{\circ}-\frac{\angle B}{2}$, so by using $K D \perp E F$, we have $\frac{F K}{E D}=\frac{\tan \frac{\angle C}{2}}{\tan \frac{\angle B}{2}}$. Similarly, since $\angle I B D=\frac{\angle B}{2}$ and $\angle I C D=\frac{\angle C}{2}$, by using $I D \perp B C$, we have $\frac{B F}{E C}=\frac{B D}{D C}=\frac{\tan \frac{\angle C}{2}}{\tan \frac{\angle B}{2}}$. Then, since $\angle B F K=90^{\circ}+\frac{\angle A}{2}=$ $\angle K E C$, we conclude that $\triangle B F K$ and $\triangle C E K$ are similar, so $\angle F K B=\angle C K E$ which shows line $E F$ is the external-angle bisector of $\angle B K C$. Therefore, $X$ lies on both the perpendicular bisector of the segment $B C$ and the external angle bisector of $\angle B K C$ (and these lines are distinct) thus it lies on the circumcirle of $\triangle B K C$ (in particular the midpoint of arc $B K C$ ). Second Way. Let $T$ be the intersection of $E F$ and $B C$, and $N$ be the midpoint of the segment $B C$. It is well-known that $(T, D ; B, C)$ is harmonic and $T B \cdot T C=T D \cdot T N$. On the other hand, since $X B=X C$, we have $\angle X N D=90^{\circ}=\angle X K D$, so $X K D N$ is cyclic and $T D \cdot T N=T K \cdot T X$. Therefore, we have $T K \cdot T X=T B \cdot T C$, which implies $B K X C$ is cyclic. Now we will show that either $\angle B=90^{\circ}$ or $\angle C=90^{\circ}$. Note that $\angle B K C=\angle B X C=$ $90^{\circ}=\angle F K D=\angle E K D$ and $\angle F K B=\angle E K C$. Then we have $$ \angle F K B=\angle B K D=\angle D K C=\angle C K E=45^{\circ} . $$ Hence $B K$ bisects $\angle F K D$, but $B$ also lies on the perpendicular bisector of $D F$. Therefore, either $F K D B$ is cyclic or $K F=K D$ while the former implies that $\angle B=180^{\circ}-\angle F K D=$ $90^{\circ}$. In the latter case, we have $K B \perp F D$, which gives $90^{\circ}-\frac{\angle C}{2}=\angle K F D=90^{\circ}-$ $\angle F K B=45^{\circ}$ and so $\angle C=90^{\circ}$ as desired. We consider, without loss of generality, the case where $\angle B=90^{\circ}$. Observing that $A, I, M$ are collinear we get: $$ \angle C D I=90^{\circ}=\angle C B A=\angle C M A=\angle C M I $$ Hence $M D I C$ is cyclic so: $$ \angle M D C=\angle M I C=180^{\circ}-\angle C I A=180^{\circ}-\left(90^{\circ}+\frac{\angle B}{2}\right)=45^{\circ} $$ We also have $\angle F D B=90^{\circ}-\frac{\angle B}{2}=45^{\circ}$ so $\angle F D B=\angle M D C$ and thus $M, D, F$ are collinear as required.
{ "problem_match": "\nProblem 2.", "resource_path": "Balkan_MO/segmented/en-2023-BMO-type1.jsonl", "solution_match": "# Solution 2" }
119
993
2023
T1
3
null
Balkan_MO
For each positive integer $n$, denote by $\omega(n)$ the number of distinct prime divisors of $n$ (for example, $\omega(1)=0$ and $\omega(12)=2$ ). Find all polynomials $P(x)$ with integer coefficients, such that whenever $n$ is a positive integer satisfying $\omega(n)>2023^{2023}$, then $P(n)$ is also a positive integer with $$ \omega(n) \geq \omega(P(n)) . $$
Answer: All polynomials of the form $f(x)=x^{m}$ for some $m \in \mathbb{Z}^{+}$and $f(x)=c$ for some $c \in \mathbb{Z}^{+}$with $\omega(c) \leq 2023^{2023}+1$. First of all we prove the following (well-known) Lemma. Lemma: Let $f(x)$ be a nonconstant polynomial with integer coefficients. Then, the number of primes $p$ such that $p \mid f(n)$ for some $n$ is infinite. Proof: If $f(0)=0$, then the Lemma is obvious. Otherwise, define the polynomial $$ g(x)=\frac{f(x f(0))}{f(0)} $$ which has integer coefficients. Observe that $g(0)=1$ and if $g$ satisfies the property of the Lemma, then so does $f$. So, we need to prove that there are infinitely many primes $p$ such that $p \mid g(n)$ for some $n$. Suppose, for the sake of contradiction that the number of such primes is finite, and let those be $p_{1}, \ldots, p_{k}$. Then, set $n=N p_{1} \cdots p_{k}$ for some large $N$, such that $|g(n)|>1$. It is evident that $g(n)$ has a prime divisor, but it is none of the $p_{i}$ 's. This is a contradiction and therefore the result follows. Let $M=2023{ }^{2023}+1$. Observe that constant polynomials $f(x)=c$ with $c \in \mathbb{N}$ such that $\omega(c) \leq M$ satisfy the conditions of the problem. On the other hand, if $f(x)=c$ with $\omega(c)>M$, we can choose some $n$ such that $\omega(n)=M$ to see that the condition of the problem is not satisfied. Next, we look for non-constant polynomials that satisfy the conditions of the problem. Let $f(x)=x^{m} g(x)$, where $m \geq 0$ and $g(x)$ is a polynomial with $g(0) \neq 0$. We claim that $g$ is a constant polynomial. Indeed, if it is not, then (due to the Lemma) there exist pairwise distinct primes $q_{1}, \ldots, q_{M+1}$ and non-zero integers $n_{1}, \ldots, n_{M+1}$ such that $q_{i}>|g(0)|$ and $q_{i} \mid g\left(n_{i}\right)$ for $i=1,2, \ldots, M+1$. Set $n=p_{1} p_{2} \cdots p_{M}$, where $p_{1}, \ldots, p_{M}$ are distinct primes such that $$ p_{1} \equiv n_{i} \quad\left(\bmod q_{i}\right), \forall i=1,2, \ldots, M+1 $$ and $$ p_{j} \equiv 1 \quad\left(\bmod q_{i}\right), \forall i=1,2, \ldots, M+1, \forall j=2,3, \ldots, M $$ Observe that since $q_{i}>|g(0)|$, it is impossible to have $q_{i} \mid n_{i}$, so the existence of such primes is guaranteed by the Chinese Remainder Theorem and the Dirichlet's Theorem. Now, for every $i=1,2, \ldots, M+1$ we can see that $n=p_{1} \cdots p_{M} \equiv n_{i}\left(\bmod q_{i}\right)$, which means that $$ g(n) \equiv g\left(n_{i}\right) \equiv 0 \quad\left(\bmod q_{i}\right) \forall i=1,2, \ldots, M+1 $$ Thus, $\omega(f(n)) \geq \omega(g(n)) \geq M+1>M=\omega(n)$, which gives the desired contradiction. Therefore, $f(x)=c x^{m}$, for some $m \geq 1$ (since $f$ was non-constant). If $c<0$, take some $n$ with $\omega(n)=M$ to see that $f(n)$ is negative and so, does not satisfy the conditions of the problem. If $c>1$, choose some $n$ with $\omega(n)=M$ and $\operatorname{gcd}(n, c)=1$ to observe that $f$ cannot satisfy the conditions of the problem. This means that $f(x)=x^{m}$ (which is for sure a solution to the problem) for some $m \geq 1$ and $f(x)=c$ for some $c \in \mathbb{Z}^{+}$with $\omega(c) \leq M$ are the only polynomials that satisfy the conditions of the problem.
{ "problem_match": "\nProblem 3.", "resource_path": "Balkan_MO/segmented/en-2023-BMO-type1.jsonl", "solution_match": "\nSolution." }
111
1,145
2023
T1
4
null
Balkan_MO
Find the greatest integer $k \leq 2023$ for which the following holds: whenever Alice colours exactly $k$ numbers of the set $\{1,2, \ldots, 2023\}$ in red, Bob can colour some of the remaining uncoloured numbers in blue, such that the sum of the red numbers is the same as the sum of the blue numbers.
Answer: 592. For $k \geq 593$, Alice can color the greatest 593 numbers $1431,1432, \ldots, 2023$ and any other $(k-593)$ numbers so that their sum $s$ would satisfy $$ s \geq \frac{2023 \cdot 2024}{2}-\frac{1430 \cdot 1431}{2}>\frac{1}{2} \cdot\left(\frac{2023 \cdot 2024}{2}\right), $$ thus anyhow Bob chooses his numbers, the sum of his numbers will be less than Alice's numbers' sum. We now show that $k=592$ satisfies the condition. Let $s$ be the sum of Alice's 592 numbers; note that $s<\frac{1}{2} \cdot\left(\frac{2023 \cdot 2024}{2}\right)$. Below is a strategy for Bob to find some of the remaining 1431 numbers so that their sum is $$ s_{0}=\min \left\{s, \frac{2023.2024}{2}-2 s\right\} \leqslant \frac{1}{3} \cdot\left(\frac{2023 \cdot 2024}{2}\right) $$ (Clearly, if Bob finds some numbers whose sum is $\frac{2023.2024}{2}-2 s$, then the sum of remaining numbers will be $s$ ). Case 1. $s_{0} \geq 2024$. Let $s_{0}=2024 a+b$, where $0 \leqslant b \leqslant 2023$. Bob finds two of the remaining numbers with sum $b$ or $2024+b$, then he finds $a$ (or $a-1$ ) pairs among the remaining numbers with sum 2024 . Note that $a \leq 337$ since $s_{0} \leq \frac{1}{3} \cdot\left(\frac{2023 \cdot 2024}{2}\right)$. The $\left\lfloor\frac{b-1}{2}\right\rfloor$ pairs $$ (1, b-1),(2, b-2), \ldots,\left(\left\lfloor\frac{b-1}{2}\right\rfloor, b-\left\lfloor\frac{b-1}{2}\right\rfloor\right), $$ have sum of their components equal to $b$ and the $\left\lfloor\frac{2023+b}{2}\right\rfloor-b$ pairs $$ (2023, b+1),(2022, b+2), \ldots,\left(2024+b-\left\lfloor\frac{2023+b}{2}\right\rfloor,\left\lfloor\frac{2023+b}{2}\right\rfloor\right) $$ have sum of their components equal to $2024+b$. The total number of these pairs is $$ \left\lfloor\frac{2023+b}{2}\right\rfloor-b+\left\lfloor\frac{b-1}{2}\right\rfloor \geq \frac{2022+b}{2}+\frac{b-2}{2}-b=\frac{2020}{2}=1010>592 $$ hence some of these pairs have no red-colored components, so Bob can choose one of these pairs and color those two numbers in blue. Thus 594 numbers are colored so far. Further, the 1011 pairs $$ (1,2023),(2,2022), \ldots,(1011,1013) $$ have sum of the components equal to 2024. Among these, at least $1011-594=417>$ $337 \geq a$ pairs have no components colored, so Bob can choose $a$ (or $a-1$ ) uncolored pairs and color them all blue to achieve a collection of blue numbers with their sum equal to $s_{0}$. Case 2. $s_{0} \leq 2023$. Note that $s \geq 1+2+\ldots+592>2023$, thus we have $s_{0}=$ $\frac{2023 \cdot 2024}{2}-2 s$, i.e. $s=\frac{2023 \cdot 2024}{4}-\frac{s_{0}}{2}$. If $s_{0}>2 \cdot 593$, at least one of the 593 pairs $$ \left(1, s_{0}-1\right),\left(2, s_{0}-2\right), \ldots,\left(593, s_{0}-593\right) $$ have no red-colored components, so Bob can choose these two numbers and immediately achieve the sum of $s_{0}$. And if $s_{0} \leq 2 \cdot 593$, then $s=\frac{2023 \cdot 2024}{4}-\frac{s_{0}}{2} \geq(1432+1433+\ldots+2023)-593=839+(1434+1435+\ldots+2023)$, hence Alice cannot have colored any of the numbers $1,2, \ldots, 838$. Then Bob can easily choose one or two of these numbers having the sum of $s_{0}$.
{ "problem_match": "\nProblem 4.", "resource_path": "Balkan_MO/segmented/en-2023-BMO-type1.jsonl", "solution_match": "\nSolution." }
85
1,341
2024
T1
4
null
Balkan_MO
Let $\mathbb{R}^{+}=(0, \infty)$ be the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$ and polynomials $P(x)$ with non-negative real coefficients such that $P(0)=0$ which satisfy the equality $$ f(f(x)+P(y))=f(x-y)+2 y $$ for all real numbers $x>y>0$.
. Assume that $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$and the polynomial $P$ with non-negative coefficients and $P(0)=0$ satisfy the conditions of the problem. For positive reals with $x>y$, we shall write $Q(x, y)$ for the relation: $$ f(f(x)+P(y))=f(x-y)+2 y $$ 1. Step 1. $f(x) \geq x$. Assume that this is not true. Since $P(0)=0$ and $P$ is with non-negative coefficients, $P(x)+x$ is surjective on positive reals. If $f(x)<x$ for some positive real $x$, then setting $y$ such that $y+P(y)=x-f(x)$ (where obviously $y<x$ ), we shall get $f(x)+P(y)=x-y$ and by $Q(x, y), f(f(x)+P(y))=f(x-y)+2 y$, we get $2 y=0$, a contradiction. 2. Step 2. $P(x)=c x$ for some non-negative real $c$. We will show $\operatorname{deg} P \leq 1$ and together with $P(0)=0$ the result will follow. Assume the contrary. Hence there exists a positive $l$ such that $P(x) \geq 2 x$ for all $x \geq l$. By Step 1 we get $$ \forall x>y \geq l: f(x-y)+2 y=f(f(x)+P(y)) \geq f(x)+P(y) \geq f(x)+2 y $$ and therefore $f(x-y) \geq f(x)$. We get $f(y) \geq f(2 y) \geq \cdots \geq f(n y) \geq n y$ for all positive integers $n$, which is a contradiction. 3. Step 3. If $c \neq 0$, then $f\left(f(x)+2 z+c^{2}\right)=f(x+1)+2(z-1)+2 c$ for $z>1$. Indeed by $Q(f(x+z)+c z, c)$, we get $$ f\left(f(f(x+z)+c z)+c^{2}\right)=f(f(x+z)+c z-c)+2 c=f(x+1)+2(z-1)+2 c $$ On the other hand by $Q(x+z, z)$, we have: $$ f(x)+2 z+c^{2}=f(f(x+z)+P(z))+c^{2}=f(f(x+z)+c z)+c^{2} . $$ Substituting in the LHS of $Q(f(x+z)+c z, c)$, we get $f\left(f(x)+2 z+c^{2}\right)=f(x+1)+2(z-1)+2 c$. 4. Step 4. There is $x_{0}$, such that $f(x)$ is linear on $\left(x_{0}, \infty\right)$. If $c \neq 0$, then by Step 3 , fixing $x=1$, we get $f\left(f(1)+2 z+c^{2}\right)=f(2)+2(z-1)+2 c$ which implies that $f$ is linear for $z>f(1)+2+c^{2}$. As for the case $c=0$, consider $y, z \in(0, \infty)$. Pick $x>\max (y, z)$, then by $Q(x, x-y)$ and $Q(x, x-z)$ we get: $$ f(y)+2(x-y)=f(f(x))=f(z)+2(x-z) $$ which proves that $f(y)-2 y=f(z)-2 z$ and there fore $f$ is linear on $(0, \infty)$. 5. Step 5. $P(y)=y$ and $f(x)=x$ on $\left(x_{0}, \infty\right)$. By Step 4 , let $f(x)=a x+b$ on $\left(x_{0}, \infty\right)$. Since $f$ takes only positive values, $a \geq 0$. If $a=0$, then by $Q(x+y, y)$ for $y>x_{0}$ we get: $$ 2 y+f(x)=f(f(x+y)+P(y))=f(b+c y) $$ Since the LHS is not constant, we conclude $c \neq 0$, but then for $y>x_{0} / c$, we get that the RHS equals $b$ which is a contradiction. Hence $a>0$. Now for $x>x_{0}$ and $x>\left(x_{0}-b\right) / a$ large enough by $P(x+y, y)$ we get: $a x+b+2 y=f(x)+2 y=f(f(x+y)+P(y))=f(a x+a y+b+c y)=a(a x+a y+b+c y)+b$. Comparing the coefficients before $x$, we see $a^{2}=a$ and since $a \neq 0, a=1$. Now $2 b=b$ and thus $b=0$. Finally, equalising the coefficients before $y$, we conclude $2=1+c$ and therefore $c=1$. Now we know that $f(x)=x$ on $\left(x_{0}, \infty\right)$ and $P(y)=y$. Let $y>x_{0}$. Then by $Q(x+y, x)$ we conclude: $$ f(x)+2 y=f(f(x+y)+P(y))=f(x+y+y)=x+2 y . $$ Therefore $f(x)=x$ for every $x$. Conversely, it is straightforward that $f(x)=x$ and $P(y)=y$ do indeed satisfy the conditions of the problem.
{ "problem_match": "\nProblem 4.", "resource_path": "Balkan_MO/segmented/en-2024-BMO-type1.jsonl", "solution_match": "\nSolution 1" }
107
1,306
2024
T1
4
null
Balkan_MO
Let $\mathbb{R}^{+}=(0, \infty)$ be the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$ and polynomials $P(x)$ with non-negative real coefficients such that $P(0)=0$ which satisfy the equality $$ f(f(x)+P(y))=f(x-y)+2 y $$ for all real numbers $x>y>0$.
. Assume that the function $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$and the polynomial with non-negative coefficients $P(y)=y P_{1}(y)$ satisfy the given equation. Fix $x=x_{0}>0$ and note that: $$ f\left(f\left(x_{0}+y\right)+P(y)\right)=f\left(x_{0}+y-y\right)+2 y=f\left(x_{0}\right)+2 y $$ Assume that $g=0$. Then $f(f(x+y))=f(x)+2 y$ for $x, y>0$. Let $x>0$ and $z>0$. Pick $y>0$. Then: $$ 2 y+f(x+z)=f(f(x+y+z))=f(f(x+z+y))=f(x)+2(z+y) . $$ Therefore $f(x+z)=f(x)+2 z$ for any $x>0$ and $z>0$. Setting $c=f(1)$, we see that $f(z+1)=c+2 z$ for all positive $z$. Therefore if $x, y>1$ we have that $f(x+y)=c+2(x+y-1)>1$. This shows that: $$ f(f(x+y))=c+2(f(x+y)-1)=3 c+4(x+y)-4 $$ On the other hand $f(x)+2 y=c+2 x+2 y$. Therefore the equality $f(f(x+y))=f(x)+2 y$ is not universally satisfied. From now on, we assume that $g \neq 0$. Therefore $P$ is strictly increasing with $P(0)=0, \lim _{y \rightarrow \infty} P(y)=$ $\infty$, i.e. $g$ is bijective on $[0, \infty)$ and $P(0)=0$. Let $x>0, y>0$ and set $u=f(x+y), v=P(y)$. From above, we have $u>0$ and $v>0$. Therefore: $$ f(f(u+v)+P(v))=f(u)+2 v=f(f(x+y))+2 P(y) $$ On the other hand $f(u+v)=f(f(x+y)+P(y))=f(x)+2 y$. Therefore we obtain that: $$ f(f(x)+2 y+P(P(y)))=f(f(x+y))+2 P(y) $$ Since $g$ is bijective from $(0, \infty)$ to $(0, \infty)$ for any $z>0$ there is $t$ such that $P(t)=z$. Applying this observation to $z=P(P(y))+2 y$ and setting $x^{\prime}=x+t$, we obtain that: $f(f(x+t+y))+2 P(y)=f\left(f\left(x^{\prime}+y\right)\right)+2 P(y)=f\left(f\left(x^{\prime}\right)+P(P(y))+2 y\right)=f(f(x+t)+P(t))=f(x)+2 t$. Thus if we denote $h(y)=P(P(y))+2 y$, then $t=P^{(-1)}(h(y))$ and the above equality can be rewritten as: $f\left(f\left(x+P^{(-1)}(h(y))+y\right)\right)=f(x)+2 P^{(-1)}(h(y))-2 P(y)=f(x)+2 P^{(-1)}(h(y))+2 y-2 y-2 P(y)$. Let $s(y)=P^{(-1)}(h(y))+y$ and note that since $h$ is continuous and monotone increasing, $g$ is continuous and monotone increasing, then so are $P^{(-1)}$ and consequently $P^{(-1)} \circ h$ and $s$. It is also clear, that $\lim _{y \rightarrow 0} s(y)=0$ and $\lim _{y \rightarrow \infty} s(y)=\infty$. Therefore $s$ is continuously bijective from $[0, \infty)$ to $[0, \infty)$ with $s(0)=0$. Thus we have: $$ f(f(x+s(y)))=f(x)+2 s(y)-2 y-2 P(y) $$ and using that $s$ is invertible, we obtain: $$ f(f(x+y))=f(x)+2 y-2 s^{(-1)}(y)-2 P\left(s^{(-1)}(y)\right) $$ Now fix $x_{0}$, then for any $x>x_{0}$ and any $y>0$ we have: $$ \begin{aligned} f(x)+2 y-2 s^{(-1)}(y)-2 P\left(s^{(-1)}(y)\right) & =f(f(x+y))=f\left(f\left(x_{0}+x+y-x_{0}\right)\right) \\ & =f\left(x_{0}\right)+2\left(x+y-x_{0}\right)-2 s^{(-1)}\left(x+y-x_{0}\right)-2 P\left(s^{(-1)}\left(x+y-x_{0}\right)\right) . \end{aligned} $$ Setting $y=x_{0}$, we get: $$ f(x)+2 x_{0}-2 s^{(-1)}\left(x_{0}\right)-2 P\left(s^{(-1)}\left(x_{0}\right)\right)=f\left(x_{0}\right)+2 x-2 s^{(-1)}(x)-2 P\left(s^{(-1)}(x)\right) . $$ Since this equality is valid for any $x>x_{0}$ we actually have that: $$ f(x)-2 x+2 s^{(-1)}(x)+2 P\left(s^{(-1)}(x)\right)=c \text { for some fixed constant } c \in \mathbb{R} \text { and all } x \in \mathbb{R}^{+} . $$ Let $\phi(x)=-x+2 s^{(-1)}(x)+2 P\left(s^{(-1)}(x)\right)$. Then $f(x)=x-\phi(x)+c$ and since $\phi$ is a sum of continuous functions that are continuous at 0 . Therefore $f$ is continuous and can be extended to a continuous function on $[0, \infty)$. Back in the original equation we fix $x>0$ and let $y$ tend to 0 . Using the continuity of $f$ and $g$ on $[0, \infty)$ and $P(0)=0$ we obtain: $$ f(f(x))=\lim _{y \rightarrow 0+} f(f(x)+P(y))=\lim _{y \rightarrow 0+}(f(x-y)+P(y))=f(x)+P(0)=f(x) . $$ Finally, fixing $x=1$ and varying $y>0$, we obtain: $$ f(f(1+y)+P(y))=f(1)+2 y $$ It follows that $f$ takes every value on $(f(1), \infty)$. Therefore for any $y \in(f(1), \infty)$ there is $z$ such that $f(z)=y$. Using that $f(f(z))=f(z)$ we conclude that $f(y)=y$ for all $y \in(f(1), \infty)$. Now fix $x$ and take $y>f(1)$. Hence $$ f(x)+2 y=f(f(x+y)+P(y))=f(x+y+P(y))=x+y+P(y) $$ We conclude $f(x)-x=P(y)-y$ for every $x$ an $y>f(1)$. In particular $f\left(x_{1}\right)-x_{1}=f\left(x_{2}\right)-x_{2}$ for all $x_{1}, x_{2} \in(0, \infty)$ and since $f(x)=x$ for $x \in(f(1), \infty)$, we get $f(x)=x$ on $(0, \infty)$. Finally, $x+2 y=f(x)+2 y=f(f(x+y)+P(y))=f(x+y)+P(y)=x+y+P(y)$, which shows that $P(y)=y$ for every $y \in(0, \infty)$. It is also straightforward to check that $f(x)=x$ and $P(y)=y$ satisfy the equality: $$ f(f(x+y)+P(y))=f(x+2 y)=x+2 y=f(x)+2 y $$
{ "problem_match": "\nProblem 4.", "resource_path": "Balkan_MO/segmented/en-2024-BMO-type1.jsonl", "solution_match": "\nSolution 2" }
107
1,938
2025
T1
1
null
Balkan_MO
An integer \(n > 1\) is called good if there exists a permutation \(a_{1},a_{2},a_{3},\ldots ,a_{n}\) of the numbers \(1,2,3,\ldots ,n\) , such that: - \(a_{i}\) and \(a_{i + 1}\) have different parities for every \(1 \leqslant i \leqslant n - 1\) ; - the sum \(a_{1} + a_{2} + \dots + a_{k}\) is a quadratic residue modulo \(n\) for every \(1 \leqslant k \leqslant n\) . Prove that there exist infinitely many good numbers, as well as infinitely many positive integers which are not good. Remark: Here an integer \(x\) is considered a quadratic residue modulo \(n\) if there exists an integer \(y\) such that \(x \equiv y^{2} \pmod {n}\) .
We will split the problem into two parts - the first one proving there are infinitely many numbers that are not good, and the second part proving there are infinitely many good numbers. ## Infinitely many numbers are not good ## Proof #1 We will show that all numbers \(n = 4^{m}\) with \(m \in \mathbb{Z}^{+}\) are not good. Indeed, consider the last sum in the given condition \[a_{1} + a_{2} + \dots +a_{n} = 1 + 2 + \dots +n = \frac{4^{m}(4^{m} + 1)}{2}\] Suppose that there exists \(x \in \mathbb{Z}\) such that \[\frac{4^{m}(4^{m} + 1)}{2} \equiv x^{2} \pmod{4^{m}} \Longleftrightarrow 4^{m} \equiv 2x^{2} \pmod{2 \cdot 4^{m}} \Longleftrightarrow 2 \cdot 4^{m} \mid 4^{m} - 2x^{2}\] This means that \(4^{m} \mid 2x^{2}\) , that is \(2^{2m - 1} \mid x^{2}\) , so \(2^{m} \mid x\) . Let \(x = c \cdot 2^{m}\) with \(c \in \mathbb{Z}\) . Thus \[4^{m} \equiv 2(2^{m}c)^{2} \equiv 2c^{2} \cdot 4^{m} \equiv 0 \pmod{2 \cdot 4^{m}}\] this implies that \(4^{m} \equiv 0 \pmod{2 \cdot 4^{m}}\) , which is not true. This proves the second part of the problem, i.e. that there are infinitely many numbers that are not good. ## Proof #2.1 We will show that all numbers \(n = 4m\) with \(m\in \mathbb{Z}^{+}\) are not good. Assume otherwise and let \(a_{k} = 2\) for some \(1\leqslant k\leqslant n\) Let \(S_{i} = a_{1} + a_{2} + \cdot \cdot \cdot +a_{i}\) (if \(i< 1\) \(S_{i}\) is the empty sum). Let \(S_{k - 1}\equiv x^{2}\) (mod \(4m\) ) and \(S_{k}\equiv y^{2}\) (mod \(4m\) ). Thus \(x^{2} + 2\equiv y^{2}\) (mod \(4m\) ), which means that \(x\) and \(y\) have the same parity. Now \(4m\mid (x - y)(x + y) + 2\) , but since \(4\mid (x - y)(x + y)\) , we get \(4\mid 2\) , a contradiction. ## Proof #2.2 We will show that all numbers \(n = 2^{m}\) with \(m\in \mathbb{Z}^{+}\) , \(m > 3\) are not good. For the sake of contradiction, assume that \(n\) is good. Lemma. Let \(n = 2^{m}\) with \(m\in \mathbb{Z}^{+}\) , \(m > 3\) and let \(r\) be an odd quadratic residue modulo \(n\) . Then \(r\equiv 1\) (mod 8). Proof. Since \(r\) is a quadratic residue, we know that \(r\equiv t^{2}\) (mod \(2^{m}\) ) for some odd integer \(t\) . Then we have that \(2^{m}\mid r - t^{2}\) , and because \(m > 3\) , we have that \(8\mid r - t^{2}\) . Since \(t\) is odd, \(t^{2}\equiv 1\) (mod 8), so we get that \(r\equiv 1\) (mod 8). Claim. Let \(n = 2^{m}\) with \(m\in \mathbb{Z}^{+}\) , \(m > 3\) and let \(r\) be a quadratic residue modulo \(n\) . If \(v_{2}(r)\leqslant m - 3\) then \(r = 4^{a}\cdot (8b + 1)\) for some nonnegative integers \(a\) and \(b\) . Proof. If \(r\) is odd, from the previous lemma we have that \(r = 8b + 1\) ( \(a = 0\) ) for some integer \(b\) . If \(r = 2^{c}r_{1}\) for some \(1\leqslant c\leqslant m - 3\) and odd \(r_{1}\) , we get that \(2^{m}\mid r - k^{2}\) for some integer \(k\) . That is, we have \(2^{m}\mid 2^{c}r_{1} - k^{2}\) . Let \(k^{2} = 2^{2t}k_{1}^{2}\) for some nonnegative integer \(t\) and odd integer \(k_{1}\) . Since \(2^{c}\mid k^{2}\) , we get \(2t\geqslant c\) . If \(2t > c\) , it follows that \(v_{2}(2^{c}r_{1} - k^{2}) = c< m\) , a contradiction. Therefore \(c = 2t\) and so \(v_{2}(r)\) is even. Now we have that \(2^{m}\mid 2^{c}r_{1} - 2^{c}k_{1}^{2}\) , thus \(2^{m - c}\mid r_{1} - k_{1}^{2}\) . Since \(m - c\geqslant 3\) , we have that \(8\mid r_{1} - k_{1}^{2}\) and because \(k_{1}\) is odd we get \(r_{1}\equiv 1\) (mod 8). Assume \(2^{m}\) with \(m > 3\) is good with some permutation \(a_{1},a_{2},\ldots ,a_{2^{m}}\) and let \(a_{i} = 2\) , for some \(i > 1\) (from the claim we know that 2 is not a quadratic residue modulo \(2^{m}\) ). Consider the following cases: Case 1. If \(2^{m - 2}\mid a_{1} + a_{2} + \cdot \cdot \cdot +a_{i - 1}\) . Let \(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i- 1} = 2^{m- 2}c\) for some integer \(c\) . Then \(v_{2}(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i}) = v_{2}(2^{m- 2}c + 2) = 1\) and from the claim this is not a quadratic residue, a contradiction. Case 2. If \(2^{m - 2}\mid a_{1} + a_{2} + \cdot \cdot \cdot +a_{i}\) . Let \(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i} = 2^{m - 2}c\) for some integer \(c\) . Then \(v_{2}(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i - 1}) = v_{2}(2^{m - 2}c - 2) = 1\) and from the claim this is not a quadratic residue, a contradiction. Case 3. Otherwise, the claim implies \(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i - 1} = 4^{k_{1}}(8l_{1} + 1)\) and \(a_{1} + a_{2} + \cdot \cdot \cdot +a_{i} =\) \(4^{k_{2}}(8l_{2} + 1)\) for some nonnegative integers \(k_{1},k_{2},l_{1},l_{2}\) . Then we have \(4^{k_{1}}(8l_{1} + 1) + 2 =\) \(4^{k_{2}}(8l_{2} + 1)\) . Looking at the equation modulo 4, we get that at least one of \(k_{1},k_{2}\) is 0. If exactly one of \(k_{1},k_{2}\) is equal to 0 we get a contradiction modulo 2. Therefore \(k_{1} = k_{2} = 0\) and thus \(8l_{1} + 3 = 8l_{2} + 1\) , which is impossible. ## Infinitely many numbers are good ## Proof #1 Now let \(n = p\) be a prime number of the form \(4k + 3,k\in \mathbb{Z}\) . Consider the numbers \[1^{2},2^{2},\ldots ,\left(\frac{p - 1}{2}\right)^{2},p - 1^{2},p - 2^{2},\ldots ,p - \left(\frac{p - 1}{2}\right)^{2}.\] Clearly, in this sequence, no two numbers are congruent modulo \(p\) . Indeed, suppose that there is \(i^{2}\equiv j^{2}\) (mod \(p\) ) with \(1\leqslant i< j\leqslant{\frac{p - 1}{2}}\) then \(p\mid (j - i)(j + i)\) . But \(0< j + i< p\) \(0< j - i< p\) , a contradiction. From there, it follows that the first \(\textstyle{\frac{p - 1}{2}}\) numbers have distinct remainders in modulo \(p\) . We reason similarly for the last \(\textstyle{\frac{p - 1}{2}}\) numbers. Next suppose that there is \(i^{2}\equiv p - j^{2}\) (mod \(p\) ) with \(1\leqslant i,j\leqslant{\frac{p - 1}{2}}\) then \(p\mid i^{2} + j^{2}\) . According to the well known properties of quadratic residues modulo a prime \(p = 4k + 3\) , we conclude that \(p\mid i\) and \(p\mid j\) which is also a contradiction. Thus, the claim is proved. Notice that for \(1\leqslant i\leqslant{\frac{p - 1}{2}}\) , two numbers \(i^{2}\) and \(p - i^{2}\) have different parity remainders in modulo \(p\) (since the sum of the two remainders is \(p\) , which is odd). Consider the remainder of \(1^{2},2^{2},\ldots ,\left(\frac{p - 1}{2}\right)^{2}\) when divided by \(p\) . We denote by \(a_{1},a_{2},\ldots ,a_{m}\) the odd remainders and by \(b_{1},b_{2},\ldots ,b_{n}\) the even remainders; note that \(m + n = \textstyle {\frac{p - 1}{2}}\) . Finally, consider the following permutation: \[a_{1},p - a_{1},a_{2},p - a_{2},\ldots ,a_{m},p - a_{m},p,b_{1},p - b_{1},b_{2},p - b_{2},\ldots ,b_{n},p - b_{n}\] Obviously, according to the above arguments, two consecutive numbers in the above permutation have different parity, and the sum of any first \(i\) numbers in the permutation is either congruent to 0 or congruent to some number in \(\{1^{2},2^{2},\ldots ,\left(\frac{p - 1}{2}\right)^{2}\}\) , which is clearly a quadratic residue modulo \(p\) . Thus, the constructed permutation as above satisfies the given conditions. Since there are infinitely many primes of the form \(p = 4k + 3\) , we have proved that there are infinitely many good numbers as well. ## Proof #2 Let \(n\) be an odd integer. We will prove that the number \(2n\) is good. Consider the numbers: \[1,3 + n,5,7 + n,9,11 + n,\ldots ,4n - 1 + n.\] It can be easily proven that no two numbers in this sequence are congruent modulo \(2n\) . Since there are \(2n\) numbers in the sequence, they form a complete residue system modulo \(2n\) . Also, note that the sum of the first \(k\) ( \(1\leqslant k\leqslant 2n\) ) numbers in the sequence is a quadratic residue modulo \(2n\) (it is a quadratic residue modulo \(n\) as it is congruent to \(1 + 3 + \ldots +2k - 1 = k^{2}\) modulo \(n\) and since \(x^{2} + n\equiv (x + n)^{2}\) (mod \(2n\) ) for all integers \(x\) , it is also a quadratic residue modulo \(2n\) ). The parity condition is also satisfied (even after reduction by modulo \(2n\) , since \(2n\) is even). Finally, taking the numbers modulo \(2n\) gives the desired permutation. ## Proof #3 Let \(p > 2\) be a prime number of the form \(p = 3k + 2, k \in \mathbb{Z}\) . We will prove that the number \(n = 2p\) is good. Consider the numbers: \[1^{3},2^{3},3^{3},\ldots ,(2p)^{3}.\] It is well known that if \(p \equiv 2\) (mod 3) then the above numbers form a complete residue system modulo \(p\) . It can easily be proven that they also form a complete residue system modulo \(2p\) (by also taking parity into account). Now, since \(1^{3} + 2^{3} + \ldots + k^{3} = (1 + 2 + \ldots + k)^{2}\) , we get that the sum of the first \(k\) ( \(1 \leqslant k \leqslant 2p\) ) numbers in the sequence modulo \(p\) is a quadratic residue modulo \(p\) . The parity condition is also satisfied (even after reduction modulo \(n = 2p\) , since \(2p\) is even). Finally, taking the numbers modulo \(n\) gives the desired permutation.
{ "problem_match": "\nProblem 1.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution " }
216
3,404
2025
T1
2
null
Balkan_MO
Let \(\triangle ABC\) be an acute- angled triangle with orthocentre \(H\) and let \(D\) be an arbitrary interior point on side \(BC\) . Suppose \(E\) and \(F\) are points on the segments \(AB\) and \(AC\) respectively such that the quadrilaterals \(ABDF\) and \(ACDE\) are cyclic, and let \(BF\) and \(CE\) intersect at \(P\) . Let \(L\) be the point of line \(HA\) such that \(LC\) is tangent to the circumcircle of triangle \(\triangle PBC\) at point \(C\) . Let lines \(BH\) and \(CP\) intersect at \(X\) . Prove that \(D, L\) and \(X\) are collinear.
Let \(H_{A}\) and \(H_{C}\) be the feet of the altitudes from \(A\) and \(C\) , respectively. Also, let \(B A\) and \(B H\) meet \(C L\) at \(Z\) and \(T\) respectively. We prove that \(B C P H\) is cyclic as in Solution 1. \(C H_{A}H C_{A}\) and \(C D E A\) are cyclic, so \(\angle B H_{A}H_{C} = \angle B D E = \angle B A C\) . Since \(C L\) is tangent to \((B H P C)\) , we have \(\angle L C B = 180^{\circ}-\) \(\angle B H C = \angle B A C\) . We obtained \(\angle B H_{A}H_{C} = \angle B D E = \angle B C L\) , so \(H_{C}H_{A}\parallel E D\parallel L C\) Projecting from \(C\) , we obtain \((B,X;H,Z) = (B,E;H_{C},T)\) . From \(H_{C}H_{A}\parallel E D\parallel T C\) we have \((B,E;H_{C},T) = (B,D;H_{A},C)\) , which can be seen by applying Thales' theorem or by projecting from infinity. If we denote the intersection of \(L D\) and \(B Z\) as \(X^{\prime}\) , projecting from \(L\) we get \((B,X^{\prime};H,Z) =\) \((B,D;H_{A},C)\) . Combining the above, we have \((B,X;H,Z) = (B,D;H_{A},C) = (B,X^{\prime};H,Z)\) . It is well- known that, with 3 fixed points and a fixed cross- ratio, the fourth point is uniquely determined. This implies \(X\equiv X^{\prime}\) and we are done. ![md5:127f8321db36b2798ee21466abe0664d](127f8321db36b2798ee21466abe0664d.jpeg)
{ "problem_match": "\nProblem 2.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution 3" }
157
516
2025
T1
3
null
Balkan_MO
Find all functions \(f: \mathbb{R} \to \mathbb{R}\) such that, for all real numbers \(x\) and \(y\), \[f(x + y f(x)) + y = x y + f(x + y).\]
. Let \(P(x,y)\) denote the given relation. If there is an \(a\in \mathbb{R}\) such that \(f(a) = 0\) , then \(P(a,y)\) gives that \(y = a y + f(a + y)\) , and so \(f\) must be linear. Then we can easily check and get that the only linear solutions are \(f(x) = x\) and \(f(x) = 2 - x\) ( \(x\in \mathbb{R}\) ). Now suppose that \(f(x)\neq 0\) for all real numbers \(x\) . From \(P(x - y,y)\) we get that: \[f(x - y + y f(x - y)) = -y^{2} + y(x - 1) + f(x).\] Since \(f(t)\neq 0\) for all real numbers \(t\) , it follows that \(- y^{2} + y(x - 1) + f(x)\neq 0\) for all real numbers \(x,y\) , and so, its discriminant (as a polynomial in \(y\) ) must be negative. That is, \((x - 1)^{2} + 4f(x)< 0\) , which gives us \[f(x)< -\frac{(x - 1)^{2}}{4}\leqslant 0\] for all real numbers \(x\) . Since \((x + 1)^{2}\geqslant 0\) implies that \(- \frac{(x - 1)^{2}}{4}\leqslant x\) , we see that \[f(x)< -\frac{(x - 1)^{2}}{4}\leqslant x\] for all real numbers \(x\) . Now from \(P(x,y)\) for \(y > 0\) and \(x\in \mathbb{R}\) , we get that \[x y - y + f(x + y) = f(x + y f(x))< x + y f(x)< x - y\frac{(x - 1)^{2}}{4}\] and so \[f(x + y)< x + y - y(x + \frac{(x - 1)^{2}}{4}) = x + y - y\frac{(x + 1)^{2}}{4}.\] Setting \(x = - y\) above, we get that: \[f(0)< -y\frac{(-y + 1)^{2}}{4}.\] for all positive real numbers \(y\) . Letting \(y\to +\infty\) above, we reach a contradiction. Hence, the only solutions in this functional equation are \(f(x) = x\) and \(f(x) = 2 - x\)
{ "problem_match": "\nProblem 3.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution 1" }
57
621
2025
T1
3
null
Balkan_MO
Find all functions \(f: \mathbb{R} \to \mathbb{R}\) such that, for all real numbers \(x\) and \(y\), \[f(x + y f(x)) + y = x y + f(x + y).\]
. Let \(P(x,y)\) denote the given relation. Similarly to the first solution, if a root exists ( \(f(a) = 0\) for any \(a\) ), we get that the function is linear and that the two solutions are \(f(x) = x\) and \(f(x) = 2 - x\) . Assertion \(P(x,c - x)\) gives us the following relation: \[f(x + (c - x)f(x)) = (c - x)(x - 1) + f(c) = -x^{2} + (c + 1)x + (f(c) - c)\] The right hand side of the expression is a quadratic equation in \(x\) with the discriminant \(\Delta = \Delta (c) = (c + 1)^{2} + 4(f(c) - c) = (c - 1)^{2} + 4f(c)\) . Therefore, if there exists a \(c\) such that \((c - 1)^{2} + 4f(c)\geq 0\) , the quadratic equation has a real solution which implies the existence of a root, in which case we are done. If \(f(1) = 0\) , then we found a root and are done. If \(f(1) = 1\) , then by taking \(c = 1\) we obtain that \(\Delta (1) = 4\) , implying the existence of a root. We now check the case when \(f(1) = - 1\) . From the assertion \(P(1 - x,x)\) , we obtain: \[f(1 - x + x f(1 - x)) = -x^{2} - 1\] Plugging in \(x = 1\) , in the above assertion, we obtain that \(f(f(0)) = - 2\) . Now plugging in \(x = 1 - f(0)\) in the above assertion we get that \(f(f(0) + (1 - f(0))f(f(0))) = -(1 - f(0))^{2} - 1\) , simplifying and utilizing \(f(f(0)) = - 2\) we obtain \(f(3f(0) - 2) = - f(0)^{2} + 2f(0) - 2\) . Note that if \(f(0)\geq 0\) , we have that \(\Delta (0) = 1 + 4f(0) > 0\) , implying the existence of a root, so assume that \(f(0)< 0\) . Now using \(c = 3f(0) - 2\) for our discriminant value, we obtain \(\Delta (3f(0) - 2) = (3f(0) - 3)^{2} + 4f(3f(0) - 2) = 9(f(0) - 1)^{2} + 4(- f(0)^{2} + 2f(0) - 2) =\) \(5f(0)^{2} - 10f(0) + 1 > 0\) , implying the existence of a root, and resolving the case when \(f(1) = - 1\) Now assume that \(f(1)\notin \{0,1, - 1\}\) . From \(P(1,y)\) , we obtain the relation that \(f(1 + yf(1)) =\) \(f(1 + y)\) . As \(f(1)\neq 0\) , we can inductively show that \(f(1 + yf(1)^{k}) = f(1 + y)\) for all \(k\in \mathbb{Z}\) Since \(f(1)\notin \{1, - 1\}\) , there exists an unbounded sequence \(a_{n}\) such that \(f(a_{n})\) is constant. Namely, one can take \(a_{n} = 1 + f(1)^{2n}\) if \(|f(1)| > 1\) , and \(a_{n} = 1 + f(1)^{- 2n}\) if \(|f(1)|< 1\) both times it holds that \(f(a_{n}) = f(2)\) . The value of the discriminant along this sequence is \(\Delta (a_{n}) = (a_{n} - 1)^{2} + 4f(a_{n}) = (a_{n} - 1)^{2} + 4f(2)\) , and since \(a_{n}\) is unbounded this there exists \(n\) where the value of the discriminant is positive, yielding our root. This finishes the problem.
{ "problem_match": "\nProblem 3.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution 2" }
57
1,056
2025
T1
3
null
Balkan_MO
Find all functions \(f: \mathbb{R} \to \mathbb{R}\) such that, for all real numbers \(x\) and \(y\), \[f(x + y f(x)) + y = x y + f(x + y).\]
. (by Stefan Šebez) Let \(P(x,y)\) denote the given relation. Putting \(P(0,x + y)\) gives us: \[f((x + y)f(0)) + x + y = 0 + f(x + y)\] Subtracting this identity from the relation \(P(x,y)\) yields: \[P(x + yf(x)) - P((x + y)f(0)) = xy + x\] Suppose that \(f(x)\neq f(0)\) for some \(x\in \mathbf{R}\) (thus in particular \(x\neq 0\) ). Then letting \(y\) equal \(x(f(0) - 1) / (f(x) - f(0))\) makes the left- hand side vanish, so that \(x(y + 1) = 0\) and \(y = - 1\) We conclude that, for an arbitrary \(x\in \mathbf{R}\) , either \(f(x) = f(0)\) or \(f(x) = x(1 - f(0)) + f(0)\) Consider the values \(f(x)\) and \(f(xf(0))\) . They are related by \(P(0,x)\) .. \[f(xf(0)) = f(x) - x\] Fix some \(x\neq 0\) . Then, for this \(x\) , (at least) one of four possible cases holds: Case \(f(x) = f(0)\) and \(f(xf(0)) = f(0)\) Case \(f(x) = f(0)\) and \(f(xf(0)) = xf(0)(1 - f(0)) + f(0)\) Case \(f(x) = x(1 - f(0)) + f(0)\) and \(f(xf(0)) = f(0)\) Case \(f(x) = x(1 - f(0)) + f(0)\) and \(f(xf(0)) = xf(0)(1 - f(0)) + f(0)\) The first case implies that \(x = 0\) , a contradiction. The second gives \(f(0)^{2} - f(0) - 1 = 0\) . The third gives \(f(0) = 0\) and the fourth \(f(0)\in \{0,2\}\) . It is now clear that \(f(0) = 0\) implies \(f(x) = x\) for all \(x\) , and that \(f(0) = 2\) implies \(f(x) = 2 - x\) for all \(x\) . We check that these two functions indeed satisfy the starting equation. If, on the other hand, \(f(0)\notin \{0,2\}\) , then the second case holds for all \(x\neq 0\) and hence \(f(x) = f(0)\) for all \(x\) . However, this is a contradiction with \(P(0,x)\) . Thus there are no more solutions.
{ "problem_match": "\nProblem 3.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution 4" }
57
686
2025
T1
4
null
Balkan_MO
There are \(n\) cities in a country, where \(n \geqslant 100\) is an integer. Some pairs of cities are connected by direct (two- way) flights. For two cities \(A\) and \(B\) we define: - a path between \(A\) and \(B\) as a sequence of distinct cities \(A = C_{0}, C_{1}, \ldots , C_{k}, C_{k + 1} = B\) , \(k \geqslant 0\) , such that there are direct flights between \(C_{i}\) and \(C_{i + 1}\) for every \(0 \leqslant i \leqslant k\) ;- a long path between \(A\) and \(B\) as a path between \(A\) and \(B\) such that no other path between \(A\) and \(B\) has more cities;- a short path between \(A\) and \(B\) as a path between \(A\) and \(B\) such that no other path between \(A\) and \(B\) has fewer cities. Assume that for any pair of cities \(A\) and \(B\) in the country, there exist a long path and a short path between them that have no cities in common (except \(A\) and \(B\) ). Let \(F\) be the total number of pairs of cities in the country that are connected by direct flights. In terms of \(n\) , find all possible values of \(F\) .
Use the obvious graph interpretation. We show that any such graph is one of the following: the full graph \(K_{n}\) , the circular graph \(C_{n}\) , and for \(n\) even, the bipartite graph \(K_{\frac{n}{2}, \frac{n}{2}}\) . First, we show that these graphs satisfy the condition. - For \(K_{n}\) , we can choose any long path and the short path is the edge.- For \(C_{n}\) , we have exactly two paths between any two vertices, and one of them has at most as many vertices as the other.- For \(K_{\frac{n}{2}, \frac{n}{2}}\) , if the vertices are on different sides, the short path is the edge. Otherwise, take any long path. We observe that it alternates between the sides and begins and ends on one side. Therefore, there is a vertex on the other side that doesn't appear in the long path. Additionally, there is a short path that passes through this vertex. Next, we show that only these graphs work for \(n\) large enough. The graph is clearly connected, as any two vertices belong to a path. Consider a longest path in the graph. Let \(p\) be its length and denote the vertices in the path by \(V_{1}, V_{2}, \ldots , V_{p}\) in the corresponding order. We can assume that this path is the long path between \(V_{1}\) and \(V_{p}\) that has a corresponding short path through other vertices. We show that the edge \(V_{1} V_{p}\) belongs to the graph. If the edge doesn't exist, the short path has length at least two, implying that there is a vertex \(X\) different from \(V_{i}, i \in \{1, \ldots , p\}\) such that there exists an edge from \(V_{1}\) to \(X\) . Then the path \(X V_{1} V_{2} \ldots V_{p}\) has length \(p + 1\) , which gives a contradiction. Next we show that \(p = n\) , i.e. that the cycle \(V_{1} \ldots V_{p}\) contains all the vertices. If there exists another vertex \(A\) connected with an edge to a vertex \(V_{i}\) , then the path \(A V_{i} V_{i + 1} \ldots V_{i - 1}\) has length \(p + 1\) , which gives a contradiction. Since the graph is connected, the cycle contains all vertices. For two vertices of the graph, we say that they have distance \(r\) if there are exactly \(r - 1\) vertices between them on a side of the cycle. Observe that they also have distance \(n - r\) . If we relabel the vertices by \(A_{1},A_{2},\ldots ,A_{n}\) in such a way that we know the graph has \(n - 1\) of the edges \(A_{i}A_{i + 1},i\in \{1,\ldots ,n\}\) (where \(A_{n + 1} = A_{1}\) ), then it also has the last one. This is shown same as before. Next, we show that if we have an edge between \(V_{i}\) and \(V_{j}\) , then we also have an edge between \(V_{i + 1}\) and \(V_{j + 1}\) . Assume \(i< j\) . Consider the path \[V_{i + 1}V_{i + 2}\ldots V_{j}V_{i}V_{i - 1}\ldots V_{j + 1}\] ![md5:9316dac12bfa4d6097c691f6a5d17473](9316dac12bfa4d6097c691f6a5d17473.jpeg) of length \(n\) . As before, we conclude that there is an edge between \(V_{i + 1}\) and \(V_{j + 1}\) . Repeating this, we get that if we have an edge between two vertices at distance \(r\) , then we have edges between any two vertices at distance \(r\) . Define \(S\) as the set of numbers \(1\leqslant r\leqslant n - 1\) such that the graph has the edges of distance \(r\) . Note that \(1,n - 1\in S\) . For positive integers \(a\) and \(b\) with \(a + b\leqslant n - 1\) , consider the ordering \[V_{1},V_{a + b},V_{a + b - 1},\ldots ,V_{a + 1},V_{a + b + 1},V_{a + b + 2},\ldots ,V_{n},V_{a},V_{a - 1},\ldots ,V_{1}.\] ![md5:1c7eeed50d3d340ad16701f09e012735](1c7eeed50d3d340ad16701f09e012735.jpeg) The distance between two consecutive vertices in this ordering is \(1,a,b\) or \(a + b - 1\) . This implies that if two numbers from the multiset \(\{a,b,a + b - 1\}\) belong to \(S\) , so does the third one. Now, if \(2\in S\) , we take \(b = 2\) and easily get that that \(S\) contains any number from 1 to \(n - 1\) . This gives us the solution \(K_{n}\) . Assume now \(2 \notin S\) . This implies that we do not have two consecutive numbers smaller than \(n - 2\) in \(S\) . But as \(2 \notin S\) , we also have \(n - 2 \notin S\) , so \(S\) doesn’t contain two consecutive integers. If \(S = \{1, n - 1\}\) , we get the solution \(C_{n}\) . Otherwise, there exists \(t \in S\) such that \(3 \leqslant t \leqslant n - 3\) . Consider the path \[V_{t}V_{t - 1}\ldots V_{2}V_{t + 2}V_{t + 1}V_{1}V_{n}\ldots V_{t + 3}\] of length \(n\) . ![md5:9f113990806516ca18631ddb7848f20b](9f113990806516ca18631ddb7848f20b.jpeg) Same as before, we get that there is an edge between \(V_{t}\) and \(V_{t + 3}\) . Therefore, we have \(3 \in S\) . Now, taking \(b = 3\) , we get that any odd number smaller than or equal to \(n - 1\) lies in \(S\) . Since we assumed \(S\) doesn’t contain consecutive integers, we get that \(n\) is even and \(S = \{1 \leqslant i \leqslant n - 1 | i \text{odd}\}\) . This gives us the solution \(K_{\frac{n}{2}, \frac{n}{2}}\) . Finally, the number of edges can be \(n\) , \(\frac{n(n - 1)}{2}\) , and if \(n\) is even it can also be \(\frac{n^{2}}{4}\) . Remark: Even if \(n\) is not big enough, we still characterize all such graphs similarly. The condition was added as at some point we choose a number \(t\) between 3 and \(n - 3\) , and this wouldn’t make sense for small \(n\) and we would need to quickly discuss why those cases also have the same graphs.
{ "problem_match": "\nProblem 4.", "resource_path": "Balkan_MO/segmented/en-2025-BMO-type1.jsonl", "solution_match": "# Solution " }
318
1,827
2016
T1
A4
Algebra
Balkan_Shortlist
The positive real numbers $a, b, c$ satisfy the equality $a+b+c=1$. For every natural number $n$ find the minimal possible value of the expression $$ E=\frac{a^{-n}+b}{1-a}+\frac{b^{-n}+c}{1-b}+\frac{c^{-n}+a}{1-c} $$
We transform the first term of the expression $E$ in the following way: $$ \begin{aligned} \frac{a^{-n}+b}{1-a}=\frac{1+a^{n} b}{a^{n}(b+c)}=\frac{a^{n+1}+a^{n} b+1-a^{n+1}}{a^{n}(b+c)} & =\frac{a^{n}(a+b)+(1-a)\left(1+a+a^{2}+\ldots+a^{n}\right)}{a^{n}(b+c)} \\ \frac{a^{n}(a+b)}{a^{n}(b+c)}+\frac{(b+c)\left(1+a+a^{2}+\ldots+a^{n}\right)}{a^{n}(b+c)} & =\frac{a+b}{b+c}+1+\frac{1}{a}+\frac{1}{a^{2}}+\ldots+\frac{1}{a^{n}} \end{aligned} $$ Analogously, we obtain $$ \begin{aligned} & \frac{b^{-n}+c}{1-b}=\frac{b+c}{c+a}+1+\frac{1}{b}+\frac{1}{b^{2}}+\ldots+\frac{1}{b^{n}} \\ & \frac{c^{-n}+a}{1-c}=\frac{c+a}{a+b}+1+\frac{1}{c}+\frac{1}{c^{2}}+\ldots+\frac{1}{c^{n}} \end{aligned} $$ The expression $E$ can be written in the form $$ E=\frac{a+b}{b+c}+\frac{b+c}{c+a}+\frac{c+a}{a+b}+3+\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)+\left(\frac{1}{a^{2}}+\frac{1}{b^{2}}+\frac{1}{c^{2}}\right)+\ldots+\left(\frac{1}{a^{n}}+\frac{1}{b^{n}}+\frac{1}{c^{n}}\right) $$ By virtue of the inequalities $\quad \frac{a+b}{b+c}+\frac{b+c}{c+a}+\frac{c+a}{a+b} \geq 3 \sqrt{\frac{a+b}{b+c} \cdot \frac{b+c}{c+a} \cdot \frac{c+a}{a+b}}=3$ and $\quad m_{k}=\left(\frac{a^{k}+b^{k}+c^{k}}{3}\right)^{\frac{1}{k}} \leq m_{1}=\frac{a+b+c}{3}=\frac{1}{3}$ for every $k=-1,-2,-3, \ldots,-n$, we have $\quad \frac{1}{a^{m}}+\frac{1}{b^{m}}+\frac{1}{c^{m}} \geq 3^{m+1}$ for every $m=1,2, \ldots, m$ and $$ E=3+3+3^{2}+\ldots+3^{n+1}=2+\frac{3^{n+2}-1}{2}=\frac{3^{n+2}+3}{3} $$ For $a=b=c=\frac{1}{3}$ we obtain $E=\frac{3^{n+2}+3}{3}$. So, $\min E=\frac{3^{n+2}+3}{3}$. Remark(PSC): The original solution received from the PSC contained some typos, the correct result is $\min E=\frac{3^{n+2}+3}{2}$.
{ "problem_match": "\n## A4.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
80
841
2016
T1
A5
Algebra
Balkan_Shortlist
Let $a, b, c$ and $d$ be real numbers such that $a+b+c+d=2$ and $a b+b c+c d+d a+a c+b d=0$. Find the minimum value and the maximum value of the product $a b c d$.
Let's find the minimum first. $$ a^{2}+b^{2}+c^{2}+d^{2}=(a+b+c+d)^{2}-2(a b+b c+c d+d a+a c+b d)=4 $$ By AM-GM, $4=a^{2}+b^{2}+c^{2}+d^{2} \geq 4 \sqrt{|a b c d|} \Rightarrow 1 \geq|a b c d| \Rightarrow a b c d \geq-1$. Note that if $a=b=c=1$ and $d=-1$, then $a b c d=-1$. We'll find the maximum. We search for $a b c d>0$. Obviously, the numbers $a, b, c$ and $d$ can not be all positive or all negative. WLOG $a, b>0$ and $c, d<0$. Denote $-c=x,-d=y$. We have $a, b, x, y>0, a+b-x-y=2$ and $a^{2}+b^{2}+x^{2}+y^{2}=4$. We need to find $\max (a b x y)$. We get: $x+y=a+b-2$ and $x^{2}+y^{2}=4-\left(a^{2}+b^{2}\right)$. Since $(x+y)^{2} \leq 2\left(x^{2}+y^{2}\right)$, then $2\left(a^{2}+b^{2}\right)+(a+b-2)^{2} \leq 8 ;$ on the other hand, $(a+b)^{2} \leq 2\left(a^{2}+b^{2}\right) \Rightarrow(a+b)^{2}+(a+b-2)^{2} \leq 8$. Let $a+b=2 s \Rightarrow 2 s^{2}-2 s-1 \leq 0 \Rightarrow s \leq \frac{\sqrt{3}+1}{2}=k$. But $a b \leq s^{2} \Rightarrow a b \leq k^{2}$. Now $a+b=x+y+2$ and $a^{2}+b^{2}=4-\left(x^{2}+y^{2}\right)$. Since $(a+b)^{2} \leq 2\left(a^{2}+b^{2}\right)$, then $2\left(x^{2}+y^{2}\right)+(x+y+2)^{2} \leq 8$; on the other hand, $(x+y)^{2} \leq 2\left(x^{2}+y^{2}\right) \Rightarrow$ $\Rightarrow(x+y)^{2}+(x+y+2)^{2} \leq 8$. Let $x+y=2 q \Rightarrow 2 q^{2}+2 q-1 \leq 0 \Rightarrow q \leq \frac{\sqrt{3}-1}{2}=\frac{1}{2 k}$. But $x y \leq q^{2} \Rightarrow x y \leq \frac{1}{4 k^{2}}$. In conclusion, $a b x y \leq k^{2} \cdot \frac{1}{4 k^{2}}=\frac{1}{4} \Rightarrow a b c d \leq \frac{1}{4}$. Note that if $a=b=k$ and $c=d=-\frac{1}{2 k}$, then $a b c d=\frac{1}{4}$ In conclusion, $\min (a b c d)=-1$ and $\max (a b c d)=\frac{1}{4}$.
{ "problem_match": "\n## A5.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
60
838
2016
T1
A6
Algebra
Balkan_Shortlist
Prove that there is no function from positive real numbers to itself, $f:(0,+\infty) \rightarrow(0,+\infty)$ such that: $$ f(f(x)+y)=f(x)+3 x+y f(y) \quad \text {,for every } \quad x, y \in(0,+\infty) $$
First we prove that $f(x) \geq x$ for all $x>0$. Indeed, if there is an $a>0$ with $f(a)<a$ then from the initial for $x=a$ and $y=a-f(a)>0$ we get that $3 a+(a-f(a)) f(a-f(a))=0$. This is absurd since $3 a+(a-f(a)) f(a-f(a))>0$. So we have that $$ f(x) \geq x \quad \text {,for all } \quad x>0 $$ Then using (1) we have that $f(x)+3 x+y f(x)=f(f(x)+y) \geq f(x)+y$, so $$ 3 x+y f(y) \geq y \quad, \text { all } \quad x, y>0 $$ Suppose that $y f(y)<y$ for a $y>0$ and let $-y f(y)=b>0$ then for $x=\frac{b}{4}$ we get $\frac{3 b}{4}-b \geq 0$ so $b \leq 0$, absurd. So we have that $y f(y) \geq y$, for all $y>0$, and so $$ f(y) \geq 1 \quad \text {,for all } \quad y>0 $$ Substituting $y$ with $f(y)$ at the initial we have that $$ f(x)+3 x+f(y) f(f(y))=f(f(x)+f(y)) $$ and changing the roles of $x, y$ we have that: $$ f(y)+3 y+f(x) f(f(x))=f(f(x)+f(x)) $$ So we have $f(x) f(f(x))-f(x)-3 x=f(y) f(f(y))-f(y)-3 y$, which means that the function $f(x) f(f(x))-$ $f(x)-3 x$ is constant. That means that there exist a constant $c$ such that $$ f(x) f(f(x))=f(x)+3 x+c \quad \text {,for all } \quad x>0 $$ So we can write (6) in the form $f(x)(f(f(x))-1)=3 x+c$ and since $f(f(x))>1$ we have that $3 x+c \geq 0$, for all $x>0$. if $c<0$ then for $x=-\frac{c}{4}>0$ we get that $c>0$ which is absurd. So $c \geq 0$. We write (6) in the form $$ f(f(x))=1+\frac{3 x}{f(x)}+\frac{c}{f(x)} $$ Since $c \geq 0$ then from (7) with the help of (1) and (3) we have that $f(f(x)) \leq 4+c$. But from (1) we have that $f(f(x)) \geq f(x) \geq x$, for all $x \geq 0$, and so $$ 4+c \geq f(f(x)) \geq x \quad \text {,for all } \quad x>0 $$ Taking $x=5+c$ we get that the last one cannot hold. So there is no such a function.
{ "problem_match": "\n## A6.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
76
756
2016
T1
A7
Algebra
Balkan_Shortlist
Find all integers $n \geq 2$ for which there exist the real numbers $a_{k}, 1 \leq k \leq n$, which are satisfying the following conditions: $$ \sum_{k=1}^{n} a_{k}=0, \sum_{k=1}^{n} a_{k}^{2}=1 \text { and } \sqrt{n} \cdot\left(\sum_{k=1}^{n} a_{k}^{3}\right)=2(b \sqrt{n}-1), \text { where } b=\max _{1 \leq k \leq n}\left\{a_{k}\right\} $$
We have: $\left(a_{k}+\frac{1}{\sqrt{n}}\right)^{2}\left(a_{k}-b\right) \leq 0 \Rightarrow\left(a_{k}^{2}+\frac{2}{\sqrt{n}} \cdot a_{k}+\frac{1}{n}\right)\left(a_{k}-b\right) \leq 0 \Rightarrow$ $$ a_{k}^{3} \leq\left(b-\frac{2}{\sqrt{n}}\right) \cdot a_{k}^{2}+\left(\frac{2 b}{\sqrt{n}}-\frac{1}{n}\right) \cdot a_{k}+\frac{b}{n} \forall \in\{1,2, \cdot, n\} \cdot(k) $$ Adding up the inequalities ( $k$ ) we get $$ \begin{gathered} \sum_{k=1}^{n} a_{k}^{3} \leq\left(b-\frac{2}{\sqrt{n}}\right) \cdot\left(\sum_{k=1}^{n} a_{k}^{2}\right)+\left(\frac{2 b}{\sqrt{n}}-\frac{1}{n}\right) \cdot\left(\sum_{k=1}^{n} a_{k}\right)+b \leftrightarrow \\ \sum_{k=1}^{n} a_{k}^{3} \leq b-\frac{2}{\sqrt{n}}+b \leftrightarrow \sqrt{n} \cdot\left(\sum_{k=1}^{n} a_{k}^{3}\right) \leq 2(b \sqrt{n}-1) . \end{gathered} $$ But according to hypothesis, $$ \sqrt{n} \cdot\left(\sum_{k=1}^{n} a_{k}^{3}\right)=2(b \sqrt{n}-1) . $$ Hence is necessarily that $$ \begin{gathered} a_{k}^{3}=\left(b-\frac{2}{\sqrt{n}}\right) \cdot a_{k}^{2}+\left(\frac{2 b}{\sqrt{n}}-\frac{1}{n}\right) \cdot a_{k}+\frac{b}{n} \forall k \in\{1,2, \cdots, n\} \leftrightarrow \\ \left(a_{k}+\frac{1}{\sqrt{n}}\right)^{2}\left(a_{k}-b\right)=0 \forall k \in\{1,2, \cdots, n\} \leftrightarrow a_{k} \in\left\{-\frac{1}{\sqrt{n}}, b\right\} \forall k \in\{1,2, \cdots, n\} \end{gathered} $$ We'll prove that $b>0$. Indeed, if $b<0$ then $0=\sum_{k=1}^{n} a_{k} \leq n b<0$, which is absurd. If $b=0$, since $\sum_{k=1}^{n} a_{k}=0$, then $a_{k}=0 \forall k \in\{1,2, \cdots, n\} \Rightarrow 1=\sum_{k=1}^{n} a_{k}^{2}=0$, which is absurd. In conclusion $b>0$. If $a_{k}=-\frac{1}{\sqrt{n}} \forall k \in\{1,2, \cdots, n\}$ then $\sum_{k=1}^{n} a_{k}=-\sqrt{n}<0$, which is absurd and similarly if $a_{k}=b \forall k \in\{1,2, \cdots, n\}$ then $\sum_{k=1}^{n} a_{k}=n b>0$, which is absurd. Hence $\exists m \in\{1,2, \cdots, n-1\}$ such that among the numbers $a_{k}$ we have $n-m$ equal to $-\frac{1}{\sqrt{n}}$ and $m$ equal to $b$. We get $\left\{\begin{array}{l}-\frac{n-m}{\sqrt{n}}+m b=0 \\ \frac{n-m}{n}+m b^{2}=1\end{array}\right.$. From here, $b=\frac{n-m}{m \sqrt{n}} \Rightarrow \frac{n-m}{n}+\frac{(n-m)^{2}}{m n}=1 \Rightarrow$ $\Rightarrow n-m=m \Rightarrow m=\frac{n}{2}$. Hence $n$ is even. Conversely, for any even integer $n \geq 2$ we get that there exist the real numbers $a_{k}, 1 \leq k \leq n$, such that $$ \sum_{k=1}^{n} a_{k}=0, \sum_{k=1}^{n} a_{k}^{2}=1 \text { and } \sqrt{n} \cdot\left(\sum_{k=1}^{n} a_{k}^{3}\right)=2(b \sqrt{n}-1), \text { where } b=\max _{1 \leq k \leq n}\left\{a_{k}\right\} $$ (We may choose for example $a_{1}=\cdots=a_{\frac{n}{2}}=-\frac{1}{\sqrt{n}}$ and $a_{\frac{n}{2}+1}=\cdots=a_{n}=\frac{1}{\sqrt{n}}$ ).
{ "problem_match": "\nA7.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
148
1,259
2016
T1
A8
Algebra
Balkan_Shortlist
Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ for which $f(g(n))-g(f(n))$ is independent on $n$ for any $g: \mathbb{Z} \rightarrow \mathbb{Z}$.
First observe that if $f(n)=n$, then $f(g(n))-g(f(n))=0$. Therefore the identity function satisfies the problem condition. If there is $n_{0}$ with $f\left(n_{0}\right) \neq n_{0}$, consider the characteristic function $g$ that is defined as $g\left(f\left(n_{0}\right)\right)=1$ and $g(n)=0$ for $n \neq f\left(n_{0}\right)$. In this case, let $n \neq f\left(n_{0}\right)$ be arbirtrary. One has $f(g(n))-g(f(n))=$ $f\left(g\left(n_{0}\right)\right)-g\left(f\left(n_{0}\right)\right) \Rightarrow f(0)-g(f(n))=f(0)-g\left(f\left(n_{0}\right)\right) \Rightarrow g(f(n))=1 \Rightarrow f(n)=f\left(n_{0}\right)$. Now, consider the very similar function $g$ that is defined as $g\left(f\left(n_{0}\right)\right)=a$ and $g(n)=b$ for $n \neq f\left(n_{0}\right)$, where $a, b$ are integers with $a \neq b \neq f\left(n_{0}\right)$. We have chosen $a, b$ so as to ensure that $f(a)=f\left(n_{0}\right)=f(b)$. Now, we find that $f\left(g\left(f\left(n_{0}\right)\right)\right)-g\left(f\left(f\left(n_{0}\right)\right)\right)=f\left(g\left(n_{0}\right)\right)-g\left(f\left(n_{0}\right)\right) \Rightarrow f(a)-g\left(f\left(f\left(n_{0}\right)\right)\right)=f(b)-$ $g\left(f\left(n_{0}\right)\right) \Rightarrow g\left(f\left(f\left(n_{0}\right)\right)\right)=g\left(f\left(n_{0}\right)\right)=a \Rightarrow f\left(f\left(n_{0}\right)\right)=f\left(n_{0}\right)$. In summary, $f(n)=f\left(n_{0}\right)$ for any $n \neq f\left(n_{0}\right)$ and $f\left(f\left(n_{0}\right)\right)=f\left(n_{0}\right)$. Therefore $f$ is a constant function. Let us now see that a constant function indeed satisfies the problem condition: If $f(n)=c$ for all $n, f(g(n))-g(f(n))=c-g(c)$ is independent of $n$. The answers are the identity function $f(n)=n$ and the constant functions $f(n)=c$. ## Combinatorics
{ "problem_match": "\n## A8.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
58
658
2016
T1
C1
Combinatorics
Balkan_Shortlist
Let positive integers $K$ and $d$ be given. Prove that there exists a positive integer $n$ and a sequence of $K$ positive integers $b_{1}, b_{2}, \ldots, b_{K}$ such that the number $n$ is a $d$-digit palindrome in all number bases $b_{1}, b_{2}, \ldots, b_{K}$.
Let a positive integer $d$ be given. We shall prove that, for each large enough $n$, the number $(n!)^{d-1}$ is a $d$-digit palindrome in all number bases $\frac{n!}{i}-1$ for $1 \leqslant i \leqslant n$. In particular, we shall prove that the digit expansion of $(n!)^{d-1}$ in the base $\frac{n!}{i}-1$ is $$ \left\langle i^{d-1}\binom{d-1}{d-1}, i^{d-1}\binom{d-1}{d-2}, i^{d-1}\binom{d-1}{d-3}, \ldots, i^{d-1}\binom{d-1}{1}, i^{d-1}\binom{d-1}{0}\right\rangle_{\frac{n!}{i}-1} $$ We first show that, for each large enough $n$, all these digits are smaller than the considered base, that is, they are indeed digits in that base. It is enough to check this assertion for $i=n$, that is, to show the inequality $n^{d-1}\binom{d-1}{j}<(n-1)$ ! -1 . However, since for a fixed $d$ the right-hand side clearly grows faster than the left-hand side, this is indeed true for all large enough $n$. Everything that is left is to evaluate: $$ \begin{aligned} \sum_{j=0}^{d-1} i^{d-1}\binom{d-1}{j}\left(\frac{n!}{i}-1\right)^{j} & =i^{d-1} \sum_{j=0}^{d-1}\binom{d-1}{j}\left(\frac{n!}{i}-1\right)^{j}=i^{d-1} \sum_{j=0}^{d-1}\binom{d-1}{j}\left(\frac{n!}{i}-1\right)^{j} \\ & =i^{d-1}\left(\frac{n!}{i}-1+1\right)^{d-1}=(n!)^{d-1} \end{aligned} $$ which completes the proof.
{ "problem_match": "\n## C1.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
87
510
2016
T1
C2
Combinatorics
Balkan_Shortlist
There are 2016 costumers who entered a shop on a particular day. Every customer entered the shop exactly once. (i.e. the customer entered the shop, stayed there for some time and then left the shop without returning back.) Find the maximal $k$ such that the following holds: There are $k$ customers such that either all of them were in the shop at a specific time instance or no two of them were both in the shop at any time instance.
We show that the maximal $k$ is 45 . First we show that no larger $k$ can be achieved: We break the day at 45 disjoint time intervals and assume that at each time interval there were exactly 45 costumers who stayed in the shop only during that time interval (except in the last interval in which there were only 36 customers). We observe that there are no 46 people with the required property. Now we show that $k=45$ can be achieved: Suppose that customers $C_{1}, C_{2}, \ldots, C_{2016}$ visited the shop in this order. (If two or more customers entered the shop at exactly the same time then we break ties arbitrarily.) We define groups $A_{1}, A_{2}, \ldots$ of customers as follows: Starting with $C_{1}$ and proceeding in order, we place customer $C_{j}$ into the group $A_{i}$ where $i$ is the smallest index such that $A_{i}$ contains no customer $C_{j^{\prime}}$ with $j^{\prime}<j$ and such that $C_{j^{\prime}}$ was inside the shop once $C_{j}$ entered it. Clearly no two customers who are in the same group were inside the shop at the exact same time. So we may assume that every $A_{i}$ has at most 45 customers. Since $44 \cdot 45<2016$, by the pigeonhole principle there must be at least 45 (non-empty) groups. Let $C_{j}$ be a person in group $A_{45}$ and suppose that $C_{j}$ entered the shop at time $t_{j}$. Since we placed $C_{j}$ in group $A_{45}$ this means that for each $i<45$, there is a $j_{i}<j$ such that $C_{j_{i}} \in A_{i}$ and $C_{j_{i}}$ is still inside the shop at time $t_{j}$. Thus we have found a specific time instance, namely $t_{j}$, during which at least 45 customers were all inside the shop. Note: Instead of asking for the maximal $k$, an easier version is the following: Show that there are 45 customers such that either all of them were in the shop at a specific time instance or no two of them were both in the shop at any time instance.
{ "problem_match": "\n## C2.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
99
537
2016
T1
C3
Combinatorics
Balkan_Shortlist
The plane is divided into unit squares by means of two sets of parallel lines. The unit squares are coloured in 1201 colours so that no rectangle of perimeter 100 contains two squares of the same colour. Show that no rectangle of size $1 \times 1201$ contains two squares of the same colour.
Let the centers of the unit squares be the integer points in the plane, and denote each unit square by the coordinates of its center. Consider the set $D$ of all unit squares $(x, y)$ such that $|x|+|y| \leq 24$. Any translate of $D$ is called a diamond. Since any two unit squares that belong to the same diamond also belong to some rectangle of perimeter 100, a diamond cannot contain two unit squares of the same colour. Since a diamond contains exactly $24^{2}+25^{2}=1201$ unit squares, a diamond must contain every colour exactly once. Choose one colour, say, green, and let $a_{1}, a_{2}, \ldots$ be all green unit squares. Let $P_{i}$ be the diamond of center $a_{i}$. We will show that no unit square is covered by two $P$ 's and that every unit square is covered by some $P_{i}$. Indeed, suppose first that $P_{i}$ and $P_{j}$ contain the same unit square $b$. Then their centers lie within the same rectangle of perimeter 100, a contradiction. Let, on the other hand, $b$ be an arbitrary unit square. The diamond of center $b$ must contain some green unit square $a_{i}$. The diamond $P_{i}$ of center $a_{i}$ will then contain $b$. Therefore, $P_{1}, P_{2}, \ldots$ form a covering of the plane in exactly one layer. It is easy to see, though, that, up to translation and reflection, there exists a unique such covering. (Indeed, consider two neighbouring diamonds. Unless they fit neatly, uncoverable spaces of two unit squares are created near the corners: see Fig. 1.) Figure 1: Without loss of generality, then, this covering is given by the diamonds of centers $(x, y)$ such that $24 x+25 y$ is divisible by 1201. (See Fig. 2 for an analogous covering with smaller diamonds.) It follows from this that no rectangle of size $1 \times 1201$ can contain two green unit squares, and analogous reasoning works for the remaining colours. Figure 2: Remark(PSC): The number of the unit squares in a diamond can be evaluated alternatively with the formula $$ 2 \times(1+3+5+\ldots+47)+49=2 \times 24^{2}+49=1201 $$ ## Geometry
{ "problem_match": "\n## C3.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
70
558
2016
T1
G1
Geometry
Balkan_Shortlist
The point $M$ lies on the side $A B$ of the circumscribed quadrilateral $A B C D$. The points $I_{1}, I_{2}$, and $I_{3}$ are the incenters of $\triangle M B C, \triangle M C D$, and $\triangle M D A$. Show that the points $M, I_{1}, I_{2}$, and $I_{3}$ lie on a circle. ![](https://cdn.mathpix.com/cropped/2024_12_07_3d678d9c5978e897674eg-17.jpg?height=643&width=874&top_left_y=508&top_left_x=620)
Lemma. Let $I$ be the incenter of $\triangle A B C$ and let the points $P$ and $Q$ lie on the lines $A B$ and $A C$. Then the points $A, I, P$, and $Q$ lie on a circle if and only if $$ \overline{B P}+\overline{C Q}=B C $$ where $\overline{B P}$ equals $|B P|$ if $P$ lies in the ray $B A \rightarrow$ and $-|B P|$ if it does not, and similarly for $\overline{C Q}$. Proof of the lemma. We shall only consider the case when $P$ and $Q$ lie in the segments $A B$ and $A C$. All other cases are treated analogously. Suppose that $A, I, P$, and $Q$ lie on a circle. Let $D$ and $E$ be the contact points of the incircle of $\triangle A B C$ with $A B$ and $A C$. We have that $\angle P I Q=180^{\circ}-\alpha$, so $\angle D I P=\angle E I Q$ and, therefore, $\triangle D I P \simeq \triangle E I Q$. This gives us $D P=E Q$ and $B P+C Q=B D+C E=B C$, as needed. The converse is established by following the foregoing chain of inequalities in reverse. Let the circumcircle of $\triangle M I_{1} I_{3}$ meet the lines $A B, C M$, and $D M$ for the second time at $P, Q$, and $R$. By the lemma, $\overline{B P}+\overline{C Q}=B C$ and $\overline{D R}+\overline{A P}=D A$. Therefore, $\overline{C Q}+\overline{D R}=B C+D A-\overline{B P}-\overline{A P}=$ $B C+D A-A B$. Since $A B C D$ is circumscribed, this is equal to $C D$, and, by the lemma, the proof is complete. Second solution. Let $\omega_{1}, \omega_{2}$, and $\omega_{3}$ be the incircles of $\triangle M B C, \triangle M C D$, and $\triangle M D A$. The common internal tangent $t_{1}$ of $\omega_{1}$ and $\omega_{2}$ equals $\left[\right.$ tangent from $M$ to $\left.\omega_{2}\right]-\left[\right.$ tangent from $M$ to $\left.\omega_{1}\right]=\frac{1}{2}(M C+M D-C D-M B-M C+B C)$. Analogously, the common internal tangent $t_{2}$ of $\omega_{2}$ and $\omega_{3}$ equals $\left[\right.$ tangent from $M$ to $\left.\omega_{2}\right]-\left[\right.$ tangent from $M$ to $\left.\omega_{3}\right]=\frac{1}{2}(M C+M D-C D-M D-M A+D A)$. Finally, the common external tangent $t_{3}$ of $\omega_{1}$ and $\omega_{3}$ equals $\left[\right.$ tangent from $M$ to $\left.\omega_{1}\right]-\left[\right.$ tangent from $M$ to $\left.\omega_{3}\right]=\frac{1}{2}(M B+M C-B C+M D+M A-D A)$. Since $A B C D$ is circumscribed, we have $A B+C D=B C+D A$, and, therefore, $t_{1}+t_{2}=t_{3}$. It follows from this that $\omega_{1}, \omega_{2}$, and $\omega_{3}$ have a common tangent $s$ (which separates $\omega_{2}$ from $\omega_{1}$ and $\omega_{3}$ ). Let $\triangle M K L$ be the triangle formed by the lines $M C, M D$, and $s$. Then, since $I_{1} I_{2}$ and $I_{2} I_{3}$ are external angle bisectors in it, we have $\angle I_{1} I_{2} I_{3}=90^{\circ}-\frac{1}{2} \angle K M L=180^{\circ}-\angle I_{1} M I_{3}$ and, therefore, $M I_{1} I_{2} I_{3}$ is cyclic. $\operatorname{Remark}(\mathbf{P S C}):$ In the first solution, the angle $\alpha$ refers to the angle $\angle B A C$. $\operatorname{Remark}(\mathbf{P S C})$ : Referring to solution 1 , the inequality $t_{3} \leq t_{1}+t_{2}$ holds, the equality is possible if and only if the circles $\omega_{1}, \omega_{2}$, and $\omega_{3}$ have a common tangent. Remark(PSC): This problem was selected as G1 relative to the other Geometry problems proposed. PSC thinks the difficulty level of this problem is medium.
{ "problem_match": "\n## G1.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
170
1,153
2016
T1
G3
Geometry
Balkan_Shortlist
Given that $A B C$ is a triangle where $A B<A C$. On the half-lines $B A$ and $C A$ we take points $F$ and $E$ respectively such that $B F=C E=B C$. Let $M, N$ and $H$ be the mid-points of the segments $B F, C E$ and $B C$ respectively and $K$ and $O$ be the circumcircles of the triangles $A B C$ and $M N H$ respectively. We assume that $O K$ cuts $B E$ and $H N$ at the points $A_{1}$ and $B_{1}$ respectively and that $C_{1}$ is the point of intersection of $H N$ and $F E$. If the parallel line from $A_{1}$ to $O C_{1}$ cuts the line $F E$ at $D$ and the perpendicular from $A_{1}$ to the line $D B_{1}$ cuts $F E$ at the point $M_{1}$, prove that $E$ is the orthocenter of the triangle $A_{1} O M_{1}$.
The circumcenter of the triangle $\triangle M N H$ coincides with the incentre of the triangle $\triangle A B C$ because the triangles $\triangle B M H$ and $\triangle N H C$ are isosceles and therefore the perpendiculars of the $M H, H N$ are also the bisectors of the angles $\angle A B C, \angle A C B$, respectively. Let $G, I$ be the points of tangents of the incircle $(O, r)$ of the triangle $\triangle A B C$ with the sides $A B$ and $A C$ respectively. Now if $a, b, c$ are the sides of the triangle $\triangle A B C$ and $s$ the semiperimeter of the triangle , we have $$ O F^{2}=O G^{2}+F G^{2}=r^{2}+(a-s+b)^{2} $$ and $$ O E^{2}=O I^{2}+E I^{2}=r^{2}+(a-s+c)^{2} $$ Then $$ O F^{2}-O E^{2}=\alpha(b-c) $$ Applying two times the theorem of Stewarts at the triangles $\triangle K F B$ and $\triangle K A C$ we get $$ F A \cdot K A^{2}+c \cdot K F^{2}=a \cdot K A^{2}+a c \cdot F A \quad \text { or } \quad K F^{2}=K A^{2}+a(a-c) $$ and $$ E A \cdot K E^{2}+\alpha \cdot K A^{2}=b \cdot K E^{2}+a b \cdot E A \quad \text { or } \quad K E^{2}=K A^{2}+a(b-a) $$ From (2) and (3) we have $$ K F^{2}-K E^{2}=a(a-c)-a(b-a)=\alpha(b-c) $$ From (1),(4), because $O F^{2}-O E^{2}=K F^{2}-K E^{2}$ we have that $F E \perp O K$. Let $J$ the point of intersection of $F E, O K$. Because $A_{1} D / / O C_{1}$ we have $$ \frac{J O}{J A_{1}}=\frac{J C_{1}}{J D} $$ And since $A_{1} E / / H N$ we get $$ \frac{J E}{J A_{1}}=\frac{J C_{1}}{J B_{1}} $$ Therefore, we have $$ \frac{J O}{J E}=\frac{J B_{1}}{J D} $$ Thus, from the inverse of Thales theorem we have that $E O / / D B_{1}$, So $$ A M_{1} \perp E O $$ Consequently, the point $E$ is the orthocenter of the triangle $\triangle A_{1} O M_{1}$ Remark(PSC): Here in the solution the side $B C$ has been referred as $\alpha$ and $a$, which are equivalent. ## Number theory
{ "problem_match": "\nG3.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
248
719
2016
T1
N2
Number Theory
Balkan_Shortlist
Find all odd natural numbers $n$ such that $d(n)$ is the largest divisor of the number $n$ different from $n$ $(d(n)$ is the number of divisors of the number $n$ including 1 and $n$ ).
From $d(n)\left|n, \frac{n}{d(n)}\right| n$ one obtains $\frac{n}{d(n)} \leq d(n)$. Let $n=p_{1}^{\alpha_{1}} p_{2}^{\alpha_{2}} \ldots p_{s}^{\alpha_{s}}$ where $p_{i}, 1 \leq i \leq s$ are prime numbers. The number $n$ is odd from where we get $p_{i}>2,1 \leq i \leq s$. The multiplicativity of the function $d(n)$ implies $d(n)=\left(1+\alpha_{1}\right) \ldots\left(1+\alpha_{s}\right)$. From Bernoulli inequality, for every $p_{i}>3$ from the factorization of $n$, one obtain $$ p_{i}^{\frac{\alpha_{i}}{2}}=\left(1+\left(p_{i}-1\right)\right)^{\frac{\alpha_{i}}{2}} \geq 1+\frac{\alpha_{i}}{2}\left(p_{i}-1\right)>1+\alpha_{i} \quad \text { and } \quad 3^{\frac{\beta}{2}} \geq 1+\beta $$ The equality holds when $\beta=0, \beta=2$, and strict inequality for $\beta>2$. If $\beta=1$ and there is no prime number in the factorization of $n$, then $n=3, d(n)=2$, which is not a solution of the problem. If $\beta=1$ and there exist another prime in the factorization of $n$, then $n=3 p_{2}^{\alpha_{2}} \ldots p_{s}^{\alpha_{s}}>4\left(1+\alpha_{2}\right)^{2} \ldots\left(1+\alpha_{s}\right)^{2}$. Indeed, if there is $p_{i} \geq 7$ in the factorization, then $3 p_{i}^{\alpha_{i}}>4\left(1+\alpha_{i}\right)^{2}$ for every natural number $\alpha_{i}$. If the power of 5 in the factorization is bigger than 1 , then $3 \cdot p_{i}^{\alpha_{i}}>4\left(1+\alpha_{i}\right)^{2}$. Hence, if the power of 5 is 1 , then $n=3 \cdot 5=15, d(n)=4$, which again is not a solution. The conclusion is that $\beta \neq 1$. Finaly, we obtain $\sqrt{n} \geq d(n)$ and equality holds when there is no $p_{i}>3$ in the factorization of $n$ and $n=3^{2}=9$.
{ "problem_match": "\nN2.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
53
638
2016
T1
N5
Number Theory
Balkan_Shortlist
A positive integer $n$ is downhill if its decimal representation $\overline{a_{k} a_{k-1} \ldots a_{0}}$ satisfies $a_{k} \geq a_{k-1} \geq \ldots \geq a_{0}$. A real-coefficient polynomial $P$ is integer-valued if $P(n)$ is an integer for all integer $n$, and downhill-integervalued if $P(n)$ is an integer for all downhill positive integers $n$. Is it true that every downhill-integer-valued polynomial is also integer-valued?
No, it is not. A downhill number can always be written as $a-b_{1}-b_{2}-\ldots-b_{9}$, where $a$ is of the form $99 \ldots 99$ and each $b_{i}$ either equals 0 or is of the form $\overline{11 \ldots 11}$. Let $n$ be a positive integer. The numbers of the form $99 \ldots 99$ yield at most $n$ different remainders upon division by $2^{n}$, as do the numbers of the form $11 \ldots 11$. Therefore, downhill numbers yield at most $n(n+1)^{9}$ different remainders upon division by $2^{n}$. Let $n$ be so large that $n(n+1)^{9}<2^{n}$. ( $n=63$ works: $63 \times 64^{9}<64^{10}=2^{60}<2^{63}$.) Let $0 \leq r<2^{n}$ be such that no downhill number is congruent to $r$ modulo $2^{n}$. Consider the polynomial $$ P(x)=\frac{1}{2 \times\left(2^{n}-1\right)!} \prod_{1 \leq i<2^{n}}(x-r+i) . $$ We have that $P(r)=\frac{1}{2}$ is not an integer. Let, then, $x$ be a downhill number. The number $(x-r+1) \ldots\left(x-r+2^{n}-1\right)$ is a multiple of $\left(2^{n}-1\right)$ ! (as a product of $2^{n}-1$ consecutive integers); therefore, $2 P(x)$ is an integer. On the other hand, the number $(x-r)(x-r+1) \ldots\left(x-r+2^{n}-1\right)$ ia a multiple of $2^{n}$ ! (as a product of $2^{n}$ consecutive integers); therefore, $2(x-r) P(x)$ is an integer multiple of $2^{n}$. Since $x$ is downhill, $x-r$ is not divisible by $2^{n}$. Therefore, $2 P(x)$ is even and $P(x)$ is an integer. Alternative version. A positive integer $n$ is uphill if its decimal representation $\overline{a_{k} a_{k-1} \ldots a_{0}}$ satisfies $a_{k} \leq a_{k-1} \leq \ldots \leq a_{0}$. A real-coefficient polynomial $P$ is integer-valued if $P(n)$ is an integer for all integer $n$, and uphill-integer-valued if $P(n)$ is an integer for all uphill positive integers $n$. Is it true that every uphill-integer-valued polynomial is also integer-valued?
{ "problem_match": "\nN5.", "resource_path": "Balkan_Shortlist/segmented/en-2016_bmo_shortlist.jsonl", "solution_match": "\nSolution." }
128
651
2017
T1
A1
Algebra
Balkan_Shortlist
Let $a, b, c$ be positive real numbers such that $a b c=1$. Prove that $$ \frac{1}{a^{5}+b^{5}+c^{2}}+\frac{1}{b^{5}+c^{5}+a^{2}}+\frac{1}{c^{5}+a^{5}+b^{2}} \leq 1 . $$
First we remark that $$ a^{5}+b^{5} \geq a b\left(a^{3}+b^{3}\right) $$ Indeed $$ \begin{aligned} a^{5}+b^{5} \geq a b\left(a^{3}+b^{3}\right) & \Leftrightarrow a^{5}-a^{4} b-a b^{4}+b^{5} \geq 0 \\ & \Leftrightarrow a^{4}(a-b)-b^{4}(a-b) \geq 0 \\ (a-b)\left(a^{4}-b^{4}\right) \geq 0 & \Leftrightarrow(a-b)^{2}\left(a^{2}+b^{2}\right)(a+b) \geq 0 \end{aligned} $$ We rewrite the inequality as $$ \frac{1}{a^{5}+b^{5}+a b c^{3}}+\frac{1}{b^{5}+c^{5}+b c a^{3}}+\frac{1}{c^{5}+a^{5}+c a b^{3}} \leq 1 . $$ On the other hand the following inequality is true $$ a^{5}+b^{5}+a b c^{3} \geq a b\left(a^{3}+b^{3}+c^{3}\right) $$ and similar for the other two. Finally, using AM-GM we get: $$ \begin{aligned} \frac{1}{a^{5}+b^{5}+c^{2}}+\frac{1}{b^{5}+c^{5}+a^{2}}+\frac{1}{c^{5}+a^{5}+b^{2}} & \leq \frac{1}{a^{3}+b^{3}+c^{3}}\left(\frac{1}{a b}+\frac{1}{b c}+\frac{1}{c a}\right)=\frac{a+b+c}{a^{3}+b^{3}+c^{3}} \\ & \leq \frac{a+b+c}{\frac{(a+b+c)^{3}}{9}}=\frac{9}{(a+b+c)^{2}} \leq \frac{9}{(3 \sqrt[3]{a b c})^{2}}=1 \end{aligned} $$
{ "problem_match": "\n## A1", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
91
541
2017
T1
A3
Algebra
Balkan_Shortlist
Find all the functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that: $$ n+f(m) \mid f(n)+n f(m) $$ for any $m, n \in \mathbb{N}$
We will consider 2 cases, whether the range of the functions is infinite or finite or in other words the function take infinite or finite values. Case 1. The Function has an infinite range. Let's fix a random natural number $n$ and let $m$ be any natural number. Then using (1) we have $$ n+f(m)\left|f(n)+n f(m)=f(n)-n^{2}+n(f(m)+n) \quad \Rightarrow \quad n+f(m)\right| f(n)-n^{2} $$ Since $n$ is a fixed natural number, then $f(n)-n^{2}$ is as well a fixed natural number, and since the above results is true for any $m$ and the function $f$ has an infinite range, we can choose $m$ such that $n+f(m)>\left|f(n)-n^{2}\right|$. This implies that $f(n)=n^{2}$ for any natural number $n$. We now check that it is a solution. Since $$ n+f(m)=n+m^{2} $$ and $$ f(n)+n f(m)=n^{2}+n m^{2}=n\left(n+m^{2}\right) $$ it is straightforward that $n+f(m) \mid f(n)+n f(m)$ Case 2. The Function has a finite range. Since the function takes finite values, then it exists a natural number $k$ such that $\mathrm{I} \leq f(n) \leq k$ for any natural number $n$. It is clear that it exists at least one natural number $s$ (where $1 \leq s \leq k$ ) such that $f(n)=s$ for infinite natural numbers $n$. Let $m, n$ be any natural numbers such that $f(m)=f(n)=s$. Using (1) we have $$ n+s\left|s+n s=s-s^{2}+s(n+s) \Rightarrow n+s\right| s^{2}-s $$ Since this is true for any natural number $n$ such that $f(n)=s$ and since exist infinite natural numbers $n$ such that $f(n)=s$, we can choose the natural number $n$ such that $n+s>s^{2}-s$, which implies that $s^{2}=s \Rightarrow s=1$, or in other words $f(n)=1$ for an infinite natural number n Let's fix a random natural number $m$ and let $n$ be any natural number $f(n)=1$. Then using (1) we have $$ n+f(m)\left|1+n f(m)=1-(f(m))^{2}+f(m)(n+f(m)) \Rightarrow n+f(m)\right|(f(m))^{2}-1 $$ Since $m$ is a fixed a random natural number, then $(f(m))^{2}-1$ is a fixed non-negative integer and since $n$ is any natural nummber such that $f(n)=1$ and since exist infinite numbers $n$ such that $f(n)=1$, we can choose the the natural number $n$ such that $n+f(m)>(f(m))^{2}-1$. This implies $f(m)=1$ for any natural number $m$. We now check that it is a solution. Since $$ n+f(m)=n+1 $$ and $$ f(n)+n f(m)=1+n $$ it is straightforward that $n+f(m) \mid f(n)+n f(m)$. So, all the functions that satisfy the given condition are $f(n)=n^{2}$ for any $n \in \mathbb{N}$ or $f(n)=1$ for any $n \in \mathbb{N}$.
{ "problem_match": "\n## A3", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
55
827
2017
T1
A4
Algebra
Balkan_Shortlist
Let $M=\left\{(a, b, c) \in \mathbb{R}^{3}: 0<a, b, c<\frac{1}{2}\right.$ with $\left.a+b+c=1\right\}$ and $f: M \rightarrow \mathbb{R}$ given as $$ f(a, b, c)=4\left(\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)-\frac{1}{a b c} $$ Find the best (real) bounds $\alpha$ and $\beta$ such that $$ f(M)=\{f(a, b, c):(a, b, c) \in M\} \subseteq[\alpha, \beta] $$ and determine whether any of them is achievable.
Let $\forall(a, b, c) \in M, \alpha \leq f(a, b, c) \leq \beta$ and supose that there are no better bounds, i.e. $\alpha$ is the largest possible and $\beta$ is the smallest possible. Now, $$ \begin{aligned} \alpha \leq f(a, b, c) \leq \beta & \Leftrightarrow \alpha a b c \leq 4(a b+b c+c a)-1 \leq \beta a b c \\ & \Leftrightarrow(\alpha-8) a b c \leq 4(a b+b c+c a)-8 a b c-1 \leq(\beta-8) a b c \\ & \Leftrightarrow(\alpha-8) a b c \leq 1-2(a+b+c)+4(a b+b c+c a)-8 a b c \leq(\beta-8) a b c \\ & \Leftrightarrow(\alpha-8) a b c \leq(1-2 a)(1-2 b)(1-2 c) \leq(\beta-8) a b c \end{aligned} $$ For $\alpha<8$, we have $$ (1-2 a)(1-2 b)(1-2 c) \geq 0>(\alpha-8) a b c . $$ So $\alpha \geq 8$. But if we take $\varepsilon>0$ small and $a=b=\frac{1}{4}+\varepsilon, c=\frac{1}{2}-2 \varepsilon$, we'll have: $$ (\alpha-8)\left(\frac{1}{4}+\varepsilon\right)\left(\frac{1}{4}+\varepsilon\right)\left(\frac{1}{2}-2 \varepsilon\right) \leq\left(\frac{1}{2}-2 \varepsilon\right)\left(\frac{1}{2}-2 \varepsilon\right) 4 \varepsilon $$ Taking $\varepsilon \rightarrow 0^{+}$, we get $\alpha-8 \leq 0$. So $\alpha=8$ and it can never be achieved. For the right side, note that there is a triangle whose side-lengths are $a, b, c$. For this triangle, denote $p=\frac{1}{2}$ the half-perimeter, $S$ the area and $r, R$ respectively the radius of incircle,outcircle. Using the relations $R=\frac{a b c}{4 S}$ and $S=p r$, we will have: $$ \begin{aligned} (1-2 a)(1-2 b)(1-2 c) \leq(\beta-8) a b c & \Leftrightarrow(p-a)(p-b)(p-c) \leq \frac{(\beta-8) a b c}{8} \\ & \Leftrightarrow \frac{S^{2}}{p} \leq \frac{(\beta-8) a b c}{8} \\ & \Leftrightarrow 2 \frac{S}{p} \leq \frac{(\beta-8) a b c}{4 S} \\ & \Leftrightarrow \frac{R}{r} \geq 2(\beta-8)^{-1} \end{aligned} $$ Since the least value of $\frac{R}{r}$ is 2 (this is a well-known classic inequality), and it is achievable at $a=b=c=\frac{1}{3}$, we must have $\beta=9$. Answer: $\alpha=8$ not achievable and $\beta=9$ achievable.
{ "problem_match": "\nA4", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
176
821
2017
T1
A5
Algebra
Balkan_Shortlist
Consider integers $m \geq 2$ and $n \geq 1$. Show that there is a polynomial $P(x)$ of degree equal to $n$ with integer coefficients such that $P(0), P(1), \ldots, P(n)$ are all perfect powers of $m$.
Let $a_{0}, a_{1}, \ldots, a_{n}$ be integers to be chosen later, and consider the polynomial $P(x)=\frac{1}{n!} Q(x)$ where $$ Q(x)=\sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k} a_{k} \prod_{\substack{0 \leq i \leq n \\ i \neq k}}(x-i) . $$ Observe that for $l \in\{0,1, \ldots, n\}$ we have $$ \begin{aligned} P(l) & =\frac{1}{n!}(-1)^{n!}(\stackrel{n}{l}) a_{l} \prod_{\substack{0 \leq i \leq n \\ i \neq 1}}(l-i) \\ & =\frac{1}{n!}(-1)^{n-1}\binom{n}{l} a_{l} l!(-1)^{n-l}(n-l)! \\ & =a_{l} \end{aligned} $$ So $P(x)$ is the unique polynomial of degree at most $n$ such that $P(l)=a_{l}$. (Any two polynomials of degree at most $n$ agreeing on $n+1$ distinct values are equal.) Note in particular that $$ \sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k} \prod_{\substack{0 \leq i \leq n \\ i \neq k}}(x-i)=n! $$ If $p$ is a prime dividing $n$ !, we let $r_{p}$ be maximal such that $p^{r_{p}}$ divides $\boldsymbol{n}$ !. If $p$ divides $\boldsymbol{m}$, then there is an integer $d_{p}$ such that $m^{d_{p}} \approx 0\left(\bmod p^{r_{p}}\right)$, for example $d_{p}=r_{p}$ will do. If $p$ does not divide $m$, then there is an integer $d_{p}$ such that $m^{d_{p}} \equiv 1\left(\bmod p^{r_{p}}\right)$, for example, by Euler's theorem, $d_{p}=\varphi\left(p^{r_{p}}\right)$ will do. Let $d=d_{1} d_{2} \ldots d_{p}$ and observe that for every positive integer $t$ we have $m^{\prime d} \equiv 0\left(\bmod p^{r_{p}}\right)$ if $p \mid m$ and $m^{t d} \equiv 1\left(\bmod p^{r_{p}}\right)$ if $p \nmid m$. Now let $t_{0}, \ldots, t_{n}$ be positive integers to be chosen later and define $a_{k}=m^{t_{k} d}$. We will show that the polynomial $P(x)$ has integer coefficients. We will also show that there is an appropriate choice of $t_{0}, \ldots, t_{n}$ such that $P(x)$ has degree exactly equal to $n$. To show that $P(x)$ has integer coefficients it is enough to show that for every $\boldsymbol{p}$ dividing $\boldsymbol{n !}$, all coefficients of $Q(x)$ are multiples of $p^{r_{p}}$. This is immediate if $p$ divides $m$ as all $a_{k}$ 's are multiples of $p^{r_{p}}$. If $p$ does not divide $m$ then we have $a_{k} \equiv 1\left(\bmod p^{r_{p}}\right)$ for every $0 \leq k \leq n$ and so by (*) $$ Q(x) \equiv \sum_{k=0}^{n}(-1)^{n-k}\binom{n}{k} \prod_{\substack{0 \leq i \leq n \\ i \neq k}}(x-i) \equiv n!\equiv 0\left(\bmod p^{r_{p}}\right) $$ This shows that all coefficients of $Q(x)$ are indeed multiples of $p^{r_{p}}$. It remains to show that there is a choice of $t_{0}, \ldots, t_{n}$ guarantecing that the degree of $P(x)$ is exactly equal to $n$. One such choice is $t_{0}=2$ and $t_{1}=\ldots=t_{n}=1$. This works because if $P(x)$ had degree less than $n$, then looking at the values $P(1), \ldots, P(n)$ we would get that $P(x)$ is constant. But this is impossible as $P(0) \neq P(1)$. Note. Looking at the coefficient of $x^{n}$ in the definition of $P(x)$ it is not difficult to see that if we fix any $t_{1}, \ldots, t_{n}$ and pick $t_{0}$ large enough we will get that this coefficient is non-zero. In particular, we can additionally guarantee that $P(0), P(1), \ldots, P(n)$ are distinct perfect powers of $m$.
{ "problem_match": "\n## A5", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
65
1,195
2017
T1
A6
Algebra
Balkan_Shortlist
Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying $$ f\left(x+y f\left(x^{2}\right)\right)=f(x)+x f(x y) $$ for all real numbers $x$ and $y$.
Let $P(x, y)$ be the assertion $f\left(x+y f\left(x^{2}\right)\right)=f(x)+x f(x y) . P(1,0)$ yields $f(0)=0$. If there exists $x_{0} \neq 0$ satisfying $f\left(x_{0}^{2}\right)=0$, then considering $P\left(x_{0}, y\right)$, we get $f\left(x_{0} y\right)=0$ for all $y \in \mathbb{R}$. In this case, since $x_{0} \neq 0$, we can write any real number $c$ in the form $x_{0} y$ for some $y$ and hence we conclude that $f(c)=0$. It is clear that the zero function satisfies the given equation. Now assume that $f\left(x^{2}\right) \neq 0$ for all $x \neq 0$. By $P(1, y)$ we have $$ f(1+y f(1))=f(1)+f(y) $$ If $f(1) \neq 1$, there exists a real number $y$ satisfying $1+y f(1)=y$ which means that $f(1)=0$ which is a contradiction since $f\left(x^{2}\right) \neq 0$ for all $x \neq 0$. Therefore we get $f(1)=1$. Considering $P\left(x,-x / f\left(x^{2}\right)\right.$ ) for $x \neq 0$, we obtain that $$ f(x)=-x f\left(-\frac{x^{2}}{f\left(x^{2}\right)}\right) \quad \forall x \in \mathbb{R} \backslash\{0\} . $$ Replacing $x$ by $-x$ in (1), we obtain $f(x)=-f(-x)$ for all $x \neq 0$. Since $f(0)=0$, we have $f(x)=-f(-x)$ for all $x \in \mathbb{R}$. Since $f$ is odd, $P(x,-y)$ implies $$ f\left(x-y f\left(x^{2}\right)\right)=f(x)-x f(x y) $$ and hence by adding $P(x, y)$ and $P(x,-y)$, we get $$ f\left(x+y f\left(x^{2}\right)\right)+f\left(x-y f\left(x^{2}\right)\right)=2 f(x) \forall x, y \in \mathbb{R} $$ Putting $y=x / f\left(x^{2}\right)$ for $x \neq 0$ we get $$ f(2 x)=2 f(x) \quad \forall x \in \mathbb{R} $$ and hence we have $$ f\left(x+y f\left(x^{2}\right)\right)+f\left(x-y f\left(x^{2}\right)\right)=f(2 x) \forall x, y \in \mathbb{R} $$ It is clear that for any two real numbers $u$ and $v$ with $u \neq-v$, we can choose $$ x=\frac{u+v}{2} \text { and } y=\frac{v-u}{\left.2 f\left(\frac{u+v}{2}\right)^{2}\right)} $$ yielding $$ f(u)+f(v)=f(u+v) $$ Since $f$ is odd, (2) is also true for $u=-v$ and hence we obtain that $$ f(x)+f(y)=f(x+y) \quad \forall x, y \in \mathbb{R} . $$ Therefore, $P(x, y)$ implies $$ f\left(y f\left(x^{2}\right)\right)=x f(x y) \quad \forall x, y \in \mathbb{R} $$ Hence we have $$ f\left(f\left(x^{2}\right)\right)=x f(x) \quad \forall x \in \mathbb{R} $$ and $$ f\left(x f\left(x^{2}\right)\right)=x f\left(x^{2}\right) \forall x \in \mathbb{R} $$ Using (2) and (3), we get $$ \begin{aligned} x f(x)+y f(y)+x f(y)+y f(x) & =(x+y)(f(x)+f(y)) \\ & =f\left(f\left((x+y)^{2}\right)\right) \\ & =f\left(f\left(x^{2}+2 x y+y^{2}\right)\right) \\ & =f\left(f\left(x^{2}\right)+f\left(y^{2}\right)+f(2 x y)\right) \\ & =f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)+f(f(2 x y)) \\ & =x f(x)+y(f(y))+f(f(2 x y)) \\ & =x f(x)+y(f(y))+2 f(f(x y)) \end{aligned} $$ and hence $$ 2 f(f(x y))=x f(y)+y f(x) \forall x, y \in \mathbb{R} . $$ Using (5), we have $$ 2 f(f(x))=x+f(x) \quad \forall x \in \mathbb{R} . $$ Using (3) and (6), we obtain that $$ 2 x f(x)=2 f\left(f\left(x^{2}\right)\right)=x^{2}+f\left(x^{2}\right) \forall x \in \mathbb{R} . $$ Putting $y=f\left(x^{2}\right)$ in (5) yields $$ 2 f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(f\left(x^{2}\right)\right)+f\left(x^{2}\right) f(x) \forall x \in \mathbb{R} $$ Using (4), we get $f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(x^{2}\right)$ and by (3) and (8) we have $$ 2 x f\left(x^{2}\right)=2 f\left(f\left(x f\left(x^{2}\right)\right)\right)=x f\left(f\left(x^{2}\right)\right)+f\left(x^{2}\right) f(x)=x^{2} f(x)+f\left(x^{2}\right) f(x) \forall x \in \mathbb{R} $$ Now using (7), write $f\left(x^{2}\right)=2 x f(x)-x^{2}$ in (9) to obtain that $$ 2 x\left(2 x f(x)-x^{2}\right)=x^{2} f(x)+\left(2 x f(x)-x^{2}\right) f(x) $$ which is equivalent to $$ 2 x(x-f(x))^{2}=0 \quad \forall x \in \mathbb{R} $$ This shows that $f(x)=x \quad \forall x \in \mathbb{R}$ which satisfies the original equation. Therefore all solutions are $f(x)=0 \quad \forall x \in \mathbb{R}$ and $f(x)=x \quad \forall x \in \mathbb{R}$. ## NUMBER THEORY
{ "problem_match": "\nA6", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
61
1,728
2017
T1
NT2
Number Theory
Balkan_Shortlist
Find all functions $f: \mathbf{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that the number $x f(x)+f^{2}(y)+2 x f(y)$ is a perfect square for all positive integers $x, y$.
Let $p$ be a prime number. Then for $x=y=p$ the given condition gives us that the number $f^{2}(p)+3 p f(p)$ is a perfect square. Then, $f^{2}(p)+3 p f(p)=k^{2}$ for some positive integer $k$. Completing the square gives us that $(2 f(p)+3 p)^{2}-9 p^{2}=4 k^{2}$, or $$ (2 f(p)+3 p-2 k)(2 f(p)+3 p+2 k)=9 p^{2} . $$ Since $2 f(p)+3 p+3 k>3 p$, we have the following 4 cases. $$ \begin{aligned} & \left\{\begin{array} { l } { 2 f ( p ) + 3 p + 2 k = 9 p } \\ { 2 f ( p ) + 3 p - 2 k = p } \end{array} \text { or } \left\{\begin{array}{l} 2 f(p)+3 p+2 k=p^{2} \\ 2 f(p)+3 p-2 k=9 \end{array}\right.\right. \text { or } \\ & \left\{\begin{array} { l } { 2 f ( p ) + 3 p + 2 k = 3 p ^ { 2 } } \\ { 2 f ( p ) + 3 p - 2 k = 3 } \end{array} \text { or } \left\{\begin{array}{l} 2 f(p)+3 p+2 k=9 p^{2} \\ 2 f(p)+3 p-2 k=1 \end{array}\right.\right. \end{aligned} $$ Solving the systems, we have the following cases for $f(p)$. $$ f(p)=p \text { or } f(p)=\left(\frac{p-3}{2}\right)^{2} \text { or } f(p)=\frac{3 p^{2}-6 p-3}{4} \text { or } f(p)=\left(\frac{3 p-1}{2}\right)^{2} . $$ In all cases, we see that $f(p)$ can be arbitrary large whenever $p$ grows. Now fix a positive integer $x$. From the given condition we have that $$ (f(y)+x)^{2}+x f(x)-x^{2} $$ is a perfect square. Since for $y$ being a prime, let $y=q, f(q)$ can be arbitrary large and $x f(x)-x^{2}$ is fixed, it means that $x f(x)-x^{2}$ should be zero, since the difference of $(f(q)+x+1)^{2}$ and $(f(q)+x)^{2}$ can be arbitrary large. After all, we conclude that $x f(x)=x^{2}$, so $f(x)=x$, which clearly satisfies the given condition.
{ "problem_match": "\n## NT2", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
59
663
2017
T1
G1
Geometry
Balkan_Shortlist
Let $A B C$ be an acute triangle. Variable points $E$ and $F$ are on sides $A C$ and $A B$ respectively such that $B C^{2}=B A \cdot B F+C E \cdot C A$. As $E$ and $F$ vary prove that the circumcircle of $A E F$ passes through a fixed point other than $A$.
1 Let $H$ be the ortocenter of $A B C$ and $K, L, M$ be the feet of perpendiculars respectively from $A, B, C$ to their opposite sides of $A B C$. Also let $D$ be the intersection point of lines $B E$ and $C F$. From power of point we have $$ B A \cdot B M=B C \cdot B K $$ and $$ C A \cdot C L=C B \cdot C K $$ Adding (1) and (2) we have: $$ C A \cdot C L+B A \cdot B M=B C \cdot B K+C B \cdot C K=B C(B K+C K)=B C^{2} $$ Combining (3) with the problem statement $B C^{2}=B A \cdot B F+C E \cdot C A$ we have: $$ \begin{aligned} & B A \cdot B F-B A \cdot B M=C A \cdot C L-C E \cdot C A \\ & B A(B F-B M)=C A(C L-C E) \\ & B A \cdot F M=C A \cdot L E \\ & \quad \frac{L E}{F M}=\frac{A B}{A C}=\frac{B L}{C M} \end{aligned} $$ Where the last equality follows from $\triangle A M C \sim \triangle A L B$. Now since $\frac{L E}{F M}=\frac{B L}{C M}$ and $\angle F M C=\angle E L B=90^{\circ}$ we get that triangles $\triangle F M C \sim \triangle E L B$. From this similarity we get $$ \measuredangle A E D=\measuredangle A E B=\angle L E B=\measuredangle M F C=180^{\circ}-\angle A F C=180-\angle A F D, $$ meaning points $A, D, E, F$ are concylic. Since both pairs $\{E, F\}$ and $\{M, L\}$ satisfy the problem condition, we must have this fixed point we are looking for is the second intersection of the circumcircles around $A F D E$ and AMHL. Let this point be $X$. We now prove that $X$ is fixed on the circumcircle of $A M H L$ (which would imply $X$ is fixed). From the concylicity we have $$ \angle X L E=180^{\circ}-\measuredangle X L A=\measuredangle X M A=\angle X M F \text { and } \measuredangle X E L=\measuredangle X E A=180-\measuredangle X F A=\measuredangle X F M $$ and from here we get $\triangle X L E \sim \triangle X M F$. This similarity gives us $$ \frac{X L}{X M}=\frac{L E}{M F} . $$ Now combining (4) and (5) we get $\frac{X L}{X M}=\frac{A B}{A C}$ which is a fixed quantity. Since points $M, L$, the circumcircle of $A M L$, and ratio $\frac{X L}{X M}$ are fixed, this implies that point $X$ is fixed.
{ "problem_match": "\n## G1", "resource_path": "Balkan_Shortlist/segmented/en-2017_bmo_shortlist.jsonl", "solution_match": "\n## Solution" }
84
737