Solution: Observe that for each index $i \in\{1,2, \ldots, 9\}$ the product  $$ D_{i}=\prod_{1 \leq j \leq 9, j \neq i}\left|d_{i}-d_{j}\right| $$  is positive. We claim that $N=\max \left\{D_{1}-d_{1}, D_{2}-d_{2}, \ldots, D_{9}-d_{9}\right\}+1$ satisfies the statement of the problem. Suppose there exists an integer $x \geq N$ such that all primes dividing $P(x)$ are smaller than 20. For each index $i$ we reduce the fraction $\left(x+d_{i}\right) / D_{i}$ to lowest terms. Since $x+d_{i}>D_{i}$ the numerator of the fraction we thereby get cannot be 1 , and hence it has to be divisible by some prime number $p_{i}<20$.  By the pigeonhole principle, there are a prime number $p$ and two distinct indices $i$ and $j$ such that $p_{i}=p_{j}=p$. Let $p^{\alpha_{i}}$ and $p^{\alpha_{j}}$ be the greatest powers of $p$ dividing $x+d_{i}$ and $x+d_{j}$, respectively. Due to symmetry we may suppose $\alpha_{i} \leq \alpha_{j}$. But now $p^{\alpha_{i}}$ divides $d_{i}-d_{j}$ and hence also $D_{i}$, which means that all occurrences of $p$ in the numerator of the fraction $\left(x+d_{i}\right) / D_{i}$ cancel out, contrary to the choice of $p=p_{i}$. This contradiction proves our claim.


Consider a polynomial $P(x)=\left(x+d_{1}\right)\left(x+d_{2}\right) \cdot \ldots \cdot\left(x+d_{9}\right)$, where $d_{1}, d_{2}, \ldots, d_{9}$ are nine distinct integers. Prove that there exists an integer $N$ such that for all integers $x \geq N$ the number $P(x)$ is divisible by a prime number greater than 20 .

Solution: Given a nonzero integer $N$ as well as a prime number $p$ we write $v_{p}(N)$ for the exponent with which $p$ occurs in the prime factorization of $|N|$.  Evidently, if the statement of the problem were not true, then there would exist an infinite sequence $\left(x_{n}\right)$ of positive integers tending to infinity such that for each $n \in \mathbb{Z}_{+}$the integer $P\left(x_{n}\right)$ is not divisible by any prime number $>20$. Observe that the numbers $-d_{1},-d_{2}, \ldots,-d_{9}$ do not appear in this sequence.  Now clearly there exists a prime $p_{1}<20$ for which the sequence $v_{p_{1}}\left(x_{n}+d_{1}\right)$ is not bounded; thinning out the sequence $\left(x_{n}\right)$ if necessary we may even suppose that  $$ v_{p_{1}}\left(x_{n}+d_{1}\right) \longrightarrow \infty . $$  Repeating this argument eight more times we may similarly choose primes $p_{2}, \ldots, p_{9}<20$ and suppose that our sequence $\left(x_{n}\right)$ has been thinned out to such an extent that $v_{p_{i}}\left(x_{n}+d_{i}\right) \longrightarrow \infty$ holds for $i=2, \ldots, 9$ as well. In view of the pigeonhole principle, there are distinct indices $i$ and $j$ as well as a prime $p<20$ such that $p_{i}=p_{j}=p$. Setting $k=v_{p}\left(d_{i}-d_{j}\right)$ there now has to be some $n$ for which both $v_{p}\left(x_{n}+d_{i}\right)$ and $v_{p}\left(x_{n}+d_{j}\right)$ are greater than $k$. But now the numbers $x_{n}+d_{i}$ and $x_{n}+d_{j}$ are divisible by $p^{k+1}$ whilst their difference $d_{i}-d_{j}$ is not - a contradiction.  Comment. This problem is supposed to be a relatively easy one, so one might consider adding the hypothesis that the numbers $d_{1}, d_{2}, \ldots, d_{9}$ be positive. Then certain merely technical issues are not going to arise while the main ideas required to solve the problems remain the same.  Let $n \geq 1$ be an odd integer. Determine all functions $f$ from the set of integers to itself such that for all integers $x$ and $y$ the difference $f(x)-f(y)$ divides $x^{n}-y^{n}$.  Answer. All functions $f$ of the form $f(x)=\varepsilon x^{d}+c$, where $\varepsilon$ is in $\{1,-1\}$, the integer $d$ is a positive divisor of $n$, and $c$ is an integer.


Solution: Obviously, all functions in the answer satisfy the condition of the problem. We will show that there are no other functions satisfying that condition.  Let $f$ be a function satisfying the given condition. For each integer $n$, the function $g$ defined by $g(x)=f(x)+n$ also satisfies the same condition. Therefore, by subtracting $f(0)$ from $f(x)$ we may assume that $f(0)=0$.  For any prime $p$, the condition on $f$ with $(x, y)=(p, 0)$ states that $f(p)$ divides $p^{n}$. Since the set of primes is infinite, there exist integers $d$ and $\varepsilon$ with $0 \leq d \leq n$ and $\varepsilon \in\{1,-1\}$ such that for infinitely many primes $p$ we have $f(p)=\varepsilon p^{d}$. Denote the set of these primes by $P$. Since a function $g$ satisfies the given condition if and only if $-g$ satisfies the same condition, we may suppose $\varepsilon=1$.  The case $d=0$ is easily ruled out, because 0 does not divide any nonzero integer. Suppose $d \geq 1$ and write $n$ as $m d+r$, where $m$ and $r$ are integers such that $m \geq 1$ and $0 \leq r \leq d-1$. Let $x$ be an arbitrary integer. For each prime $p$ in $P$, the difference $f(p)-f(x)$ divides $p^{n}-x^{n}$. Using the equality $f(p)=p^{d}$, we get  $$ p^{n}-x^{n}=p^{r}\left(p^{d}\right)^{m}-x^{n} \equiv p^{r} f(x)^{m}-x^{n} \equiv 0 \quad\left(\bmod p^{d}-f(x)\right) $$  Since we have $r<d$, for large enough primes $p \in P$ we obtain  $$ \left|p^{r} f(x)^{m}-x^{n}\right|<p^{d}-f(x) . $$  Hence $p^{r} f(x)^{m}-x^{n}$ has to be zero. This implies $r=0$ and $x^{n}=\left(x^{d}\right)^{m}=f(x)^{m}$. Since $m$ is odd, we obtain $f(x)=x^{d}$.  Comment. If $n$ is an even positive integer, then the functions $f$ of the form  $$ f(x)=\left\{\begin{array}{l} x^{d}+c \text { for some integers, } \\ -x^{d}+c \text { for the rest of integers } \end{array}\right. $$  where $d$ is a positive divisor of $n / 2$ and $c$ is an integer, also satisfy the condition of the problem. Together with the functions in the answer, they are all functions that satisfy the condition when $n$ is even.


Let $n \geq 1$ be an odd integer. Determine all functions $f$ from the set of integers to itself such that for all integers $x$ and $y$ the difference $f(x)-f(y)$ divides $x^{n}-y^{n}$.


For each positive integer $k$, let $t(k)$ be the largest odd divisor of $k$. Determine all positive integers $a$ for which there exists a positive integer $n$ such that all the differences  $$ t(n+a)-t(n), \quad t(n+a+1)-t(n+1), \quad \ldots, \quad t(n+2 a-1)-t(n+a-1) $$  are divisible by 4 .

Solution: A pair $(a, n)$ satisfying the condition of the problem will be called a winning pair. It is straightforward to check that the pairs $(1,1),(3,1)$, and $(5,4)$ are winning pairs.  Now suppose that $a$ is a positive integer not equal to 1,3 , and 5 . We will show that there are no winning pairs $(a, n)$ by distinguishing three cases.  Case 1: $a$ is even. In this case we have $a=2^{\alpha} d$ for some positive integer $\alpha$ and some odd $d$. Since $a \geq 2^{\alpha}$, for each positive integer $n$ there exists an $i \in\{0,1, \ldots, a-1\}$ such that $n+i=2^{\alpha-1} e$, where $e$ is some odd integer. Then we have $t(n+i)=t\left(2^{\alpha-1} e\right)=e$ and  $$ t(n+a+i)=t\left(2^{\alpha} d+2^{\alpha-1} e\right)=2 d+e \equiv e+2 \quad(\bmod 4) . $$  So we get $t(n+i)-t(n+a+i) \equiv 2(\bmod 4)$, and $(a, n)$ is not a winning pair.  Case 2: $a$ is odd and $a>8$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, a-5\}$ such that $n+i=2 d$ for some odd $d$. We get  $$ t(n+i)=d \not \equiv d+2=t(n+i+4) \quad(\bmod 4) $$  and  $$ t(n+a+i)=n+a+i \equiv n+a+i+4=t(n+a+i+4) \quad(\bmod 4) $$  Therefore, the integers $t(n+a+i)-t(n+i)$ and $t(n+a+i+4)-t(n+i+4)$ cannot be both divisible by 4 , and therefore there are no winning pairs in this case.  Case 3: $a=7$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, 6\}$ such that $n+i$ is either of the form $8 k+3$ or of the form $8 k+6$, where $k$ is a nonnegative integer. But we have  $$ t(8 k+3) \equiv 3 \not \equiv 1 \equiv 4 k+5=t(8 k+3+7) \quad(\bmod 4) $$  and  $$ t(8 k+6)=4 k+3 \equiv 3 \not \equiv 1 \equiv t(8 k+6+7) \quad(\bmod 4) . $$  Hence, there are no winning pairs of the form $(7, n)$.


Let $f$ be a function from the set of integers to the set of positive integers. Suppose that for any two integers $m$ and $n$, the difference $f(m)-f(n)$ is divisible by $f(m-n)$. Prove that for all integers $m, n$ with $f(m) \leq f(n)$ the number $f(n)$ is divisible by $f(m)$.

Solution: Suppose that $x$ and $y$ are two integers with $f(x)<f(y)$. We will show that $f(x) \mid f(y)$. By taking $m=x$ and $n=y$ we see that  $$ f(x-y)|| f(x)-f(y) \mid=f(y)-f(x)>0 $$  so $f(x-y) \leq f(y)-f(x)<f(y)$. Hence the number $d=f(x)-f(x-y)$ satisfies  $$ -f(y)<-f(x-y)<d<f(x)<f(y) . $$  Taking $m=x$ and $n=x-y$ we see that $f(y) \mid d$, so we deduce $d=0$, or in other words $f(x)=f(x-y)$. Taking $m=x$ and $n=y$ we see that $f(x)=f(x-y) \mid f(x)-f(y)$, which implies $f(x) \mid f(y)$.


Solution: We split the solution into a sequence of claims; in each claim, the letters $m$ and $n$ denote arbitrary integers.  Claim 1. $f(n) \mid f(m n)$.  Proof. Since trivially $f(n) \mid f(1 \cdot n)$ and $f(n) \mid f((k+1) n)-f(k n)$ for all integers $k$, this is easily seen by using induction on $m$ in both directions.  Claim 2. $f(n) \mid f(0)$ and $f(n)=f(-n)$.  Proof. The first part follows by plugging $m=0$ into Claim 1. Using Claim 1 twice with $m=-1$, we get $f(n)|f(-n)| f(n)$, from which the second part follows.  From Claim 1, we get $f(1) \mid f(n)$ for all integers $n$, so $f(1)$ is the minimal value attained by $f$. Next, from Claim 2, the function $f$ can attain only a finite number of values since all these values divide $f(0)$.  Now we prove the statement of the problem by induction on the number $N_{f}$ of values attained by $f$. In the base case $N_{f} \leq 2$, we either have $f(0) \neq f(1)$, in which case these two numbers are the only values attained by $f$ and the statement is clear, or we have $f(0)=f(1)$, in which case we have $f(1)|f(n)| f(0)$ for all integers $n$, so $f$ is constant and the statement is obvious again.  For the induction step, assume that $N_{f} \geq 3$, and let $a$ be the least positive integer with $f(a)>f(1)$. Note that such a number exists due to the symmetry of $f$ obtained in Claim 2.  Claim 3. $f(n) \neq f(1)$ if and only if $a \mid n$.  Proof. Since $f(1)=\cdots=f(a-1)<f(a)$, the claim follows from the fact that  $$ f(n)=f(1) \Longleftrightarrow f(n+a)=f(1) . $$  So it suffices to prove this fact.  Assume that $f(n)=f(1)$. Then $f(n+a) \mid f(a)-f(-n)=f(a)-f(n)>0$, so $f(n+a) \leq$ $f(a)-f(n)<f(a)$; in particular the difference $f(n+a)-f(n)$ is stricly smaller than $f(a)$. Furthermore, this difference is divisible by $f(a)$ and nonnegative since $f(n)=f(1)$ is the least value attained by $f$. So we have $f(n+a)-f(n)=0$, as desired. For the converse direction we only need to remark that $f(n+a)=f(1)$ entails $f(-n-a)=f(1)$, and hence $f(n)=f(-n)=f(1)$ by the forward implication.  We return to the induction step. So let us take two arbitrary integers $m$ and $n$ with $f(m) \leq f(n)$. If $a \nmid m$, then we have $f(m)=f(1) \mid f(n)$. On the other hand, suppose that $a \mid m$; then by Claim $3 a \mid n$ as well. Now define the function $g(x)=f(a x)$. Clearly, $g$ satisfies the conditions of the problem, but $N_{g}<N_{f}-1$, since $g$ does not attain $f(1)$. Hence, by the induction hypothesis, $f(m)=g(m / a) \mid g(n / a)=f(n)$, as desired.  Comment. After the fact that $f$ attains a finite number of values has been established, there are several ways of finishing the solution. For instance, let $f(0)=b_{1}>b_{2}>\cdots>b_{k}$ be all these values. One may show (essentially in the same way as in Claim 3) that the set $S_{i}=\left\{n: f(n) \geq b_{i}\right\}$ consists exactly of all numbers divisible by some integer $a_{i} \geq 0$. One obviously has $a_{i} \mid a_{i-1}$, which implies $f\left(a_{i}\right) \mid f\left(a_{i-1}\right)$ by Claim 1. So, $b_{k}\left|b_{k-1}\right| \cdots \mid b_{1}$, thus proving the problem statement.  Moreover, now it is easy to describe all functions satisfying the conditions of the problem. Namely, all these functions can be constructed as follows. Consider a sequence of nonnegative integers $a_{1}, a_{2}, \ldots, a_{k}$ and another sequence of positive integers $b_{1}, b_{2}, \ldots, b_{k}$ such that $\left|a_{k}\right|=1, a_{i} \neq a_{j}$ and $b_{i} \neq b_{j}$ for all $1 \leq i<j \leq k$, and $a_{i} \mid a_{i-1}$ and $b_{i} \mid b_{i-1}$ for all $i=2, \ldots, k$. Then one may introduce the function  $$ f(n)=b_{i(n)}, \quad \text { where } \quad i(n)=\min \left\{i: a_{i} \mid n\right\} $$  These are all the functions which satisfy the conditions of the problem.


Let $P(x)$ and $Q(x)$ be two polynomials with integer coefficients such that no nonconstant polynomial with rational coefficients divides both $P(x)$ and $Q(x)$. Suppose that for every positive integer $n$ the integers $P(n)$ and $Q(n)$ are positive, and $2^{Q(n)}-1$ divides $3^{P(n)}-1$. Prove that $Q(x)$ is a constant polynomial.

Solution: First we show that there exists an integer $d$ such that for all positive integers $n$ we have $\operatorname{gcd}(P(n), Q(n)) \leq d$.  Since $P(x)$ and $Q(x)$ are coprime (over the polynomials with rational coefficients), EuCLID's algorithm provides some polynomials $R_{0}(x), S_{0}(x)$ with rational coefficients such that $P(x) R_{0}(x)-$ $Q(x) S_{0}(x)=1$. Multiplying by a suitable positive integer $d$, we obtain polynomials $R(x)=$ $d \cdot R_{0}(x)$ and $S(x)=d \cdot S_{0}(x)$ with integer coefficients for which $P(x) R(x)-Q(x) S(x)=d$. Then we have $\operatorname{gcd}(P(n), Q(n)) \leq d$ for any integer $n$.  To prove the problem statement, suppose that $Q(x)$ is not constant. Then the sequence $Q(n)$ is not bounded and we can choose a positive integer $m$ for which  $$ M=2^{Q(m)}-1 \geq 3^{\max \{P(1), P(2), \ldots, P(d)\}} $$  Since $M=2^{Q(n)}-1 \mid 3^{P(n)}-1$, we have $2,3 \not M$. Let $a$ and $b$ be the multiplicative orders of 2 and 3 modulo $M$, respectively. Obviously, $a=Q(m)$ since the lower powers of 2 do not reach $M$. Since $M$ divides $3^{P(m)}-1$, we have $b \mid P(m)$. Then $\operatorname{gcd}(a, b) \leq \operatorname{gcd}(P(m), Q(m)) \leq d$. Since the expression $a x$ - by attains all integer values divisible by $\operatorname{gcd}(a, b)$ when $x$ and $y$ run over all nonnegative integer values, there exist some nonnegative integers $x, y$ such that $1 \leq m+a x-b y \leq d$.  By $Q(m+a x) \equiv Q(m)(\bmod a)$ we have  $$ 2^{Q(m+a x)} \equiv 2^{Q(m)} \equiv 1 \quad(\bmod M) $$  and therefore  $$ M\left|2^{Q(m+a x)}-1\right| 3^{P(m+a x)}-1 . $$  Then, by $P(m+a x-b y) \equiv P(m+a x)(\bmod b)$ we have  $$ 3^{P(m+a x-b y)} \equiv 3^{P(m+a x)} \equiv 1 \quad(\bmod M) $$  Since $P(m+a x-b y)>0$ this implies $M \leq 3^{P(m+a x-b y)}-1$. But $P(m+a x-b y)$ is listed among $P(1), P(2), \ldots, P(d)$, so  $$ M<3^{P(m+a x-b y)} \leq 3^{\max \{P(1), P(2), \ldots, P(d)\}} $$  which contradicts (1).  Comment. We present another variant of the solution above.  Denote the degree of $P$ by $k$ and its leading coefficient by $p$. Consider any positive integer $n$ and let $a=Q(n)$. Again, denote by $b$ the multiplicative order of 3 modulo $2^{a}-1$. Since $2^{a}-1 \mid 3^{P(n)}-1$, we have $b \mid P(n)$. Moreover, since $2^{Q(n+a t)}-1 \mid 3^{P(n+a t)}-1$ and $a=Q(n) \mid Q(n+a t)$ for each positive integer $t$, we have $2^{a}-1 \mid 3^{P(n+a t)}-1$, hence $b \mid P(n+a t)$ as well.  Therefore, $b$ divides $\operatorname{gcd}\{P(n+a t): t \geq 0\}$; hence it also divides the number  $$ \sum_{i=0}^{k}(-1)^{k-i}\left(\begin{array}{c} k \\ i \end{array}\right) P(n+a i)=p \cdot k ! \cdot a^{k} $$  Finally, we get $b \mid \operatorname{gcd}\left(P(n), k ! \cdot p \cdot Q(n)^{k}\right)$, which is bounded by the same arguments as in the beginning of the solution. So $3^{b}-1$ is bounded, and hence $2^{Q(n)}-1$ is bounded as well.


Let $p$ be an odd prime number. For every integer $a$, define the number  $$ S_{a}=\frac{a}{1}+\frac{a^{2}}{2}+\cdots+\frac{a^{p-1}}{p-1} $$  Let $m$ and $n$ be integers such that  $$ S_{3}+S_{4}-3 S_{2}=\frac{m}{n} $$  Prove that $p$ divides $m$.

Solution: For rational numbers $p_{1} / q_{1}$ and $p_{2} / q_{2}$ with the denominators $q_{1}, q_{2}$ not divisible by $p$, we write $p_{1} / q_{1} \equiv p_{2} / q_{2}(\bmod p)$ if the numerator $p_{1} q_{2}-p_{2} q_{1}$ of their difference is divisible by $p$.  We start with finding an explicit formula for the residue of $S_{a}$ modulo $p$. Note first that for every $k=1, \ldots, p-1$ the number $\left(\begin{array}{l}p \\ k\end{array}\right)$ is divisible by $p$, and  $$ \frac{1}{p}\left(\begin{array}{l} p \\ k \end{array}\right)=\frac{(p-1)(p-2) \cdots(p-k+1)}{k !} \equiv \frac{(-1) \cdot(-2) \cdots(-k+1)}{k !}=\frac{(-1)^{k-1}}{k} \quad(\bmod p) $$  Therefore, we have  $$ S_{a}=-\sum_{k=1}^{p-1} \frac{(-a)^{k}(-1)^{k-1}}{k} \equiv-\sum_{k=1}^{p-1}(-a)^{k} \cdot \frac{1}{p}\left(\begin{array}{l} p \\ k \end{array}\right) \quad(\bmod p) $$  The number on the right-hand side is integer. Using the binomial formula we express it as  $$ -\sum_{k=1}^{p-1}(-a)^{k} \cdot \frac{1}{p}\left(\begin{array}{l} p \\ k \end{array}\right)=-\frac{1}{p}\left(-1-(-a)^{p}+\sum_{k=0}^{p}(-a)^{k}\left(\begin{array}{l} p \\ k \end{array}\right)\right)=\frac{(a-1)^{p}-a^{p}+1}{p} $$  since $p$ is odd. So, we have  $$ S_{a} \equiv \frac{(a-1)^{p}-a^{p}+1}{p} \quad(\bmod p) $$  Finally, using the obtained formula we get  $$ \begin{aligned} S_{3}+S_{4}-3 S_{2} & \equiv \frac{\left(2^{p}-3^{p}+1\right)+\left(3^{p}-4^{p}+1\right)-3\left(1^{p}-2^{p}+1\right)}{p} \\ & =\frac{4 \cdot 2^{p}-4^{p}-4}{p}=-\frac{\left(2^{p}-2\right)^{2}}{p} \quad(\bmod p) . \end{aligned} $$  By Fermat's theorem, $p \mid 2^{p}-2$, so $p^{2} \mid\left(2^{p}-2\right)^{2}$ and hence $S_{3}+S_{4}-3 S_{2} \equiv 0(\bmod p)$.


Solution: One may solve the problem without finding an explicit formula for $S_{a}$. It is enough to find the following property.  Lemma. For every integer $a$, we have $S_{a+1} \equiv S_{-a}(\bmod p)$.  Proof. We expand $S_{a+1}$ using the binomial formula as  $$ S_{a+1}=\sum_{k=1}^{p-1} \frac{1}{k} \sum_{j=0}^{k}\left(\begin{array}{l} k \\ j \end{array}\right) a^{j}=\sum_{k=1}^{p-1}\left(\frac{1}{k}+\sum_{j=1}^{k} a^{j} \cdot \frac{1}{k}\left(\begin{array}{l} k \\ j \end{array}\right)\right)=\sum_{k=1}^{p-1} \frac{1}{k}+\sum_{j=1}^{p-1} a^{j} \sum_{k=j}^{p-1} \frac{1}{k}\left(\begin{array}{l} k \\ j \end{array}\right) a^{k} . $$  Note that $\frac{1}{k}+\frac{1}{p-k}=\frac{p}{k(p-k)} \equiv 0(\bmod p)$ for all $1 \leq k \leq p-1$; hence the first sum vanishes modulo $p$. For the second sum, we use the relation $\frac{1}{k}\left(\begin{array}{c}k \\ j\end{array}\right)=\frac{1}{j}\left(\begin{array}{c}k-1 \\ j-1\end{array}\right)$ to obtain  $$ S_{a+1} \equiv \sum_{j=1}^{p-1} \frac{a^{j}}{j} \sum_{k=1}^{p-1}\left(\begin{array}{c} k-1 \\ j-1 \end{array}\right) \quad(\bmod p) $$  Finally, from the relation  $$ \sum_{k=1}^{p-1}\left(\begin{array}{l} k-1 \\ j-1 \end{array}\right)=\left(\begin{array}{c} p-1 \\ j \end{array}\right)=\frac{(p-1)(p-2) \ldots(p-j)}{j !} \equiv(-1)^{j} \quad(\bmod p) $$  we obtain  $$ S_{a+1} \equiv \sum_{j=1}^{p-1} \frac{a^{j}(-1)^{j}}{j !}=S_{-a} $$  Now we turn to the problem. Using the lemma we get  $$ S_{3}-3 S_{2} \equiv S_{-2}-3 S_{2}=\sum_{\substack{1 \leq k \leq p-1 \\ k \text { is even }}} \frac{-2 \cdot 2^{k}}{k}+\sum_{\substack{1 \leq k \leq p-1 \\ k \text { is odd }}} \frac{-4 \cdot 2^{k}}{k}(\bmod p) . $$  The first sum in (11) expands as  $$ \sum_{\ell=1}^{(p-1) / 2} \frac{-2 \cdot 2^{2 \ell}}{2 \ell}=-\sum_{\ell=1}^{(p-1) / 2} \frac{4^{\ell}}{\ell} $$  Next, using Fermat's theorem, we expand the second sum in (11) as  $$ -\sum_{\ell=1}^{(p-1) / 2} \frac{2^{2 \ell+1}}{2 \ell-1} \equiv-\sum_{\ell=1}^{(p-1) / 2} \frac{2^{p+2 \ell}}{p+2 \ell-1}=-\sum_{m=(p+1) / 2}^{p-1} \frac{2 \cdot 4^{m}}{2 m}=-\sum_{m=(p+1) / 2}^{p-1} \frac{4^{m}}{m}(\bmod p) $$  (here we set $m=\ell+\frac{p-1}{2}$ ). Hence,  $$ S_{3}-3 S_{2} \equiv-\sum_{\ell=1}^{(p-1) / 2} \frac{4^{\ell}}{\ell}-\sum_{m=(p+1) / 2}^{p-1} \frac{4^{m}}{m}=-S_{4} \quad(\bmod p) $$  Let $k$ be a positive integer and set $n=2^{k}+1$. Prove that $n$ is a prime number if and only if the following holds: there is a permutation $a_{1}, \ldots, a_{n-1}$ of the numbers $1,2, \ldots, n-1$ and a sequence of integers $g_{1}, g_{2}, \ldots, g_{n-1}$ such that $n$ divides $g_{i}^{a_{i}}-a_{i+1}$ for every $i \in\{1,2, \ldots, n-1\}$, where we set $a_{n}=a_{1}$.


Solution: Let $N=\{1,2, \ldots, n-1\}$. For $a, b \in N$, we say that $b$ follows $a$ if there exists an integer $g$ such that $b \equiv g^{a}(\bmod n)$ and denote this property as $a \rightarrow b$. This way we have a directed graph with $N$ as set of vertices. If $a_{1}, \ldots, a_{n-1}$ is a permutation of $1,2, \ldots, n-1$ such that $a_{1} \rightarrow a_{2} \rightarrow \ldots \rightarrow a_{n-1} \rightarrow a_{1}$ then this is a Hamiltonian cycle in the graph.  Step I. First consider the case when $n$ is composite. Let $n=p_{1}^{\alpha_{1}} \ldots p_{s}^{\alpha_{s}}$ be its prime factorization. All primes $p_{i}$ are odd.  Suppose that $\alpha_{i}>1$ for some $i$. For all integers $a, g$ with $a \geq 2$, we have $g^{a} \not \equiv p_{i}\left(\bmod p_{i}^{2}\right)$, because $g^{a}$ is either divisible by $p_{i}^{2}$ or it is not divisible by $p_{i}$. It follows that in any Hamiltonian cycle $p_{i}$ comes immediately after 1 . The same argument shows that $2 p_{i}$ also should come immediately after 1, which is impossible. Hence, there is no Hamiltonian cycle in the graph.  Now suppose that $n$ is square-free. We have $n=p_{1} p_{2} \ldots p_{s}>9$ and $s \geq 2$. Assume that there exists a Hamiltonian cycle. There are $\frac{n-1}{2}$ even numbers in this cycle, and each number which follows one of them should be a quadratic residue modulo $n$. So, there should be at least $\frac{n-1}{2}$ nonzero quadratic residues modulo $n$. On the other hand, for each $p_{i}$ there exist exactly $\frac{p_{i}+1}{2}$ quadratic residues modulo $p_{i}$; by the Chinese Remainder Theorem, the number of quadratic residues modulo $n$ is exactly $\frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2}$, including 0 . Then we have a contradiction by  $$ \frac{p_{1}+1}{2} \cdot \frac{p_{2}+1}{2} \cdot \ldots \cdot \frac{p_{s}+1}{2} \leq \frac{2 p_{1}}{3} \cdot \frac{2 p_{2}}{3} \cdot \ldots \cdot \frac{2 p_{s}}{3}=\left(\frac{2}{3}\right)^{s} n \leq \frac{4 n}{9}<\frac{n-1}{2} $$  This proves the "if"-part of the problem.  Step II. Now suppose that $n$ is prime. For any $a \in N$, denote by $\nu_{2}(a)$ the exponent of 2 in the prime factorization of $a$, and let $\mu(a)=\max \left\{t \in[0, k] \mid 2^{t} \rightarrow a\right\}$.  Lemma. For any $a, b \in N$, we have $a \rightarrow b$ if and only if $\nu_{2}(a) \leq \mu(b)$.  Proof. Let $\ell=\nu_{2}(a)$ and $m=\mu(b)$.  Suppose $\ell \leq m$. Since $b$ follows $2^{m}$, there exists some $g_{0}$ such that $b \equiv g_{0}^{2^{m}}(\bmod n)$. By $\operatorname{gcd}(a, n-1)=2^{\ell}$ there exist some integers $p$ and $q$ such that $p a-q(n-1)=2^{\ell}$. Choosing $g=g_{0}^{2^{m-\ell} p}$ we have $g^{a}=g_{0}^{2^{m-\ell} p a}=g_{0}^{2^{m}+2^{m-\ell} q(n-1)} \equiv g_{0}^{2^{m}} \equiv b(\bmod n)$ by FERMAT's theorem. Hence, $a \rightarrow b$.  To prove the reverse statement, suppose that $a \rightarrow b$, so $b \equiv g^{a}(\bmod n)$ with some $g$. Then $b \equiv\left(g^{a / 2^{\ell}}\right)^{2^{\ell}}$, and therefore $2^{\ell} \rightarrow b$. By the definition of $\mu(b)$, we have $\mu(b) \geq \ell$. The lemma is proved.  Now for every $i$ with $0 \leq i \leq k$, let  $$ \begin{aligned} A_{i} & =\left\{a \in N \mid \nu_{2}(a)=i\right\}, \\ B_{i} & =\{a \in N \mid \mu(a)=i\}, \\ \text { and } C_{i} & =\{a \in N \mid \mu(a) \geq i\}=B_{i} \cup B_{i+1} \cup \ldots \cup B_{k} . \end{aligned} $$  We claim that $\left|A_{i}\right|=\left|B_{i}\right|$ for all $0 \leq i \leq k$. Obviously we have $\left|A_{i}\right|=2^{k-i-1}$ for all $i=$ $0, \ldots, k-1$, and $\left|A_{k}\right|=1$. Now we determine $\left|C_{i}\right|$. We have $\left|C_{0}\right|=n-1$ and by Fermat's theorem we also have $C_{k}=\{1\}$, so $\left|C_{k}\right|=1$. Next, notice that $C_{i+1}=\left\{x^{2} \bmod n \mid x \in C_{i}\right\}$. For every $a \in N$, the relation $x^{2} \equiv a(\bmod n)$ has at most two solutions in $N$. Therefore we have $2\left|C_{i+1}\right| \leq\left|C_{i}\right|$, with the equality achieved only if for every $y \in C_{i+1}$, there exist distinct elements $x, x^{\prime} \in C_{i}$ such that $x^{2} \equiv x^{\prime 2} \equiv y(\bmod n)$ (this implies $\left.x+x^{\prime}=n\right)$. Now, since $2^{k}\left|C_{k}\right|=\left|C_{0}\right|$, we obtain that this equality should be achieved in each step. Hence $\left|C_{i}\right|=2^{k-i}$ for $0 \leq i \leq k$, and therefore $\left|B_{i}\right|=2^{k-i-1}$ for $0 \leq i \leq k-1$ and $\left|B_{k}\right|=1$.  From the previous arguments we can see that for each $z \in C_{i}(0 \leq i<k)$ the equation $x^{2} \equiv z^{2}$ $(\bmod n)$ has two solutions in $C_{i}$, so we have $n-z \in C_{i}$. Hence, for each $i=0,1, \ldots, k-1$, exactly half of the elements of $C_{i}$ are odd. The same statement is valid for $B_{i}=C_{i} \backslash C_{i+1}$ for $0 \leq i \leq k-2$. In particular, each such $B_{i}$ contains an odd number. Note that $B_{k}=\{1\}$ also contains an odd number, and $B_{k-1}=\left\{2^{k}\right\}$ since $C_{k-1}$ consists of the two square roots of 1 modulo $n$.  Step III. Now we construct a Hamiltonian cycle in the graph. First, for each $i$ with $0 \leq i \leq k$, connect the elements of $A_{i}$ to the elements of $B_{i}$ by means of an arbitrary bijection. After performing this for every $i$, we obtain a subgraph with all vertices having in-degree 1 and outdegree 1 , so the subgraph is a disjoint union of cycles. If there is a unique cycle, we are done. Otherwise, we modify the subgraph in such a way that the previous property is preserved and the number of cycles decreases; after a finite number of steps we arrive at a single cycle.  For every cycle $C$, let $\lambda(C)=\min _{c \in C} \nu_{2}(c)$. Consider a cycle $C$ for which $\lambda(C)$ is maximal. If $\lambda(C)=0$, then for any other cycle $C^{\prime}$ we have $\lambda\left(C^{\prime}\right)=0$. Take two arbitrary vertices $a \in C$ and $a^{\prime} \in C^{\prime}$ such that $\nu_{2}(a)=\nu_{2}\left(a^{\prime}\right)=0$; let their direct successors be $b$ and $b^{\prime}$, respectively. Then we can unify $C$ and $C^{\prime}$ to a single cycle by replacing the edges $a \rightarrow b$ and $a^{\prime} \rightarrow b^{\prime}$ by $a \rightarrow b^{\prime}$ and $a^{\prime} \rightarrow b$.  Now suppose that $\lambda=\lambda(C) \geq 1$; let $a \in C \cap A_{\lambda}$. If there exists some $a^{\prime} \in A_{\lambda} \backslash C$, then $a^{\prime}$ lies in another cycle $C^{\prime}$ and we can merge the two cycles in exactly the same way as above. So, the only remaining case is $A_{\lambda} \subset C$. Since the edges from $A_{\lambda}$ lead to $B_{\lambda}$, we get also $B_{\lambda} \subset C$. If $\lambda \neq k-1$ then $B_{\lambda}$ contains an odd number; this contradicts the assumption $\lambda(C)>0$. Finally, if $\lambda=k-1$, then $C$ contains $2^{k-1}$ which is the only element of $A_{k-1}$. Since $B_{k-1}=\left\{2^{k}\right\}=A_{k}$ and $B_{k}=\{1\}$, the cycle $C$ contains the path $2^{k-1} \rightarrow 2^{k} \rightarrow 1$ and it contains an odd number again. This completes the proof of the "only if"-part of the problem.  Comment 1. The lemma and the fact $\left|A_{i}\right|=\left|B_{i}\right|$ together show that for every edge $a \rightarrow b$ of the Hamiltonian cycle, $\nu_{2}(a)=\mu(b)$ must hold. After this observation, the Hamiltonian cycle can be built in many ways. For instance, it is possible to select edges from $A_{i}$ to $B_{i}$ for $i=k, k-1, \ldots, 1$ in such a way that they form disjoint paths; at the end all these paths will have odd endpoints. In the final step, the paths can be closed to form a unique cycle.  Comment 2. Step II is an easy consequence of some basic facts about the multiplicative group modulo the prime $n=2^{k}+1$. The Lemma follows by noting that this group has order $2^{k}$, so the $a$-th powers are exactly the $2^{\nu_{2}(a)}$-th powers. Using the existence of a primitive root $g$ modulo $n$ one sees that the map from $\{1,2, \ldots, n-1\}$ to itself that sends $a$ to $g^{a} \bmod n$ is a bijection that sends $A_{i}$ to $B_{i}$ for each $i \in\{0, \ldots, k\}$.


Let $k$ be a positive integer and set $n=2^{k}+1$. Prove that $n$ is a prime number if and only if the following holds: there is a permutation $a_{1}, \ldots, a_{n-1}$ of the numbers $1,2, \ldots, n-1$ and a sequence of integers $g_{1}, g_{2}, \ldots, g_{n-1}$ such that $n$ divides $g_{i}^{a_{i}}-a_{i+1}$ for every $i \in\{1,2, \ldots, n-1\}$, where we set $a_{n}=a_{1}$.


For any set $A=\left\{a_{1}, a_{2}, a_{3}, a_{4}\right\}$ of four distinct positive integers with sum $s_{A}=a_{1}+a_{2}+a_{3}+a_{4}$, let $p_{A}$ denote the number of pairs $(i, j)$ with $1 \leq i<j \leq 4$ for which $a_{i}+a_{j}$ divides $s_{A}$. Among all sets of four distinct positive integers, determine those sets $A$ for which $p_{A}$ is maximal.  Answer. The sets $A$ for which $p_{A}$ is maximal are the sets the form $\{d, 5 d, 7 d, 11 d\}$ and $\{d, 11 d, 19 d, 29 d\}$, where $d$ is any positive integer. For all these sets $p_{A}$ is 4 .

Solution: Firstly, we will prove that the maximum value of $p_{A}$ is at most 4 . Without loss of generality, we may assume that $a_{1}<a_{2}<a_{3}<a_{4}$. We observe that for each pair of indices $(i, j)$ with $1 \leq i<j \leq 4$, the sum $a_{i}+a_{j}$ divides $s_{A}$ if and only if $a_{i}+a_{j}$ divides $s_{A}-\left(a_{i}+a_{j}\right)=a_{k}+a_{l}$, where $k$ and $l$ are the other two indices. Since there are 6 distinct pairs, we have to prove that at least two of them do not satisfy the previous condition. We claim that two such pairs are $\left(a_{2}, a_{4}\right)$ and $\left(a_{3}, a_{4}\right)$. Indeed, note that $a_{2}+a_{4}>a_{1}+a_{3}$ and $a_{3}+a_{4}>a_{1}+a_{2}$. Hence $a_{2}+a_{4}$ and $a_{3}+a_{4}$ do not divide $s_{A}$. This proves $p_{A} \leq 4$.  Now suppose $p_{A}=4$. By the previous argument we have  $$ \begin{array}{lll} a_{1}+a_{4} \mid a_{2}+a_{3} & \text { and } & a_{2}+a_{3} \mid a_{1}+a_{4}, \\ a_{1}+a_{2} \mid a_{3}+a_{4} & \text { and } & a_{3}+a_{4} \not a_{1}+a_{2}, \\ a_{1}+a_{3} \mid a_{2}+a_{4} & \text { and } & a_{2}+a_{4} \not a_{1}+a_{3} . \end{array} $$  Hence, there exist positive integers $m$ and $n$ with $m>n \geq 2$ such that  $$ \left\{\begin{array}{l} a_{1}+a_{4}=a_{2}+a_{3} \\ m\left(a_{1}+a_{2}\right)=a_{3}+a_{4} \\ n\left(a_{1}+a_{3}\right)=a_{2}+a_{4} \end{array}\right. $$  Adding up the first equation and the third one, we get $n\left(a_{1}+a_{3}\right)=2 a_{2}+a_{3}-a_{1}$. If $n \geq 3$, then $n\left(a_{1}+a_{3}\right)>3 a_{3}>2 a_{2}+a_{3}>2 a_{2}+a_{3}-a_{1}$. This is a contradiction. Therefore $n=2$. If we multiply by 2 the sum of the first equation and the third one, we obtain  $$ 6 a_{1}+2 a_{3}=4 a_{2} $$  while the sum of the first one and the second one is  $$ (m+1) a_{1}+(m-1) a_{2}=2 a_{3} . $$  Adding up the last two equations we get  $$ (m+7) a_{1}=(5-m) a_{2} . $$  It follows that $5-m \geq 1$, because the left-hand side of the last equation and $a_{2}$ are positive. Since we have $m>n=2$, the integer $m$ can be equal only to either 3 or 4 . Substituting $(3,2)$ and $(4,2)$ for $(m, n)$ and solving the previous system of equations, we find the families of solutions $\{d, 5 d, 7 d, 11 d\}$ and $\{d, 11 d, 19 d, 29 d\}$, where $d$ is any positive integer.


Determine all sequences $\left(x_{1}, x_{2}, \ldots, x_{2011}\right)$ of positive integers such that for every positive integer $n$ there is an integer $a$ with  $$ x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=a^{n+1}+1 . $$  Answer. The only sequence that satisfies the condition is  $$ \left(x_{1}, \ldots, x_{2011}\right)=(1, k, \ldots, k) \quad \text { with } k=2+3+\cdots+2011=2023065 $$

Solution: Throughout this solution, the set of positive integers will be denoted by $\mathbb{Z}_{+}$.  Put $k=2+3+\cdots+2011=2023065$. We have  $$ 1^{n}+2 k^{n}+\cdots 2011 k^{n}=1+k \cdot k^{n}=k^{n+1}+1 $$  for all $n$, so $(1, k, \ldots, k)$ is a valid sequence. We shall prove that it is the only one.  Let a valid sequence $\left(x_{1}, \ldots, x_{2011}\right)$ be given. For each $n \in \mathbb{Z}_{+}$we have some $y_{n} \in \mathbb{Z}_{+}$with  $$ x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}=y_{n}^{n+1}+1 . $$  Note that $x_{1}^{n}+2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}<\left(x_{1}+2 x_{2}+\cdots+2011 x_{2011}\right)^{n+1}$, which implies that the sequence $\left(y_{n}\right)$ is bounded. In particular, there is some $y \in \mathbb{Z}_{+}$with $y_{n}=y$ for infinitely many $n$.  Let $m$ be the maximum of all the $x_{i}$. Grouping terms with equal $x_{i}$ together, the sum $x_{1}^{n}+$ $2 x_{2}^{n}+\cdots+2011 x_{2011}^{n}$ can be written as  $$ x_{1}^{n}+2 x_{2}^{n}+\cdots+x_{2011}^{n}=a_{m} m^{n}+a_{m-1}(m-1)^{n}+\cdots+a_{1} $$  with $a_{i} \geq 0$ for all $i$ and $a_{1}+\cdots+a_{m}=1+2+\cdots+2011$. So there exist arbitrarily large values of $n$, for which  $$ a_{m} m^{n}+\cdots+a_{1}-1-y \cdot y^{n}=0 \text {. } $$  The following lemma will help us to determine the $a_{i}$ and $y$ :  Lemma. Let integers $b_{1}, \ldots, b_{N}$ be given and assume that there are arbitrarily large positive integers $n$ with $b_{1}+b_{2} 2^{n}+\cdots+b_{N} N^{n}=0$. Then $b_{i}=0$ for all $i$.  Proof. Suppose that not all $b_{i}$ are zero. We may assume without loss of generality that $b_{N} \neq 0$.  Dividing through by $N^{n}$ gives  $$ \left|b_{N}\right|=\left|b_{N-1}\left(\frac{N-1}{N}\right)^{n}+\cdots+b_{1}\left(\frac{1}{N}\right)^{n}\right| \leq\left(\left|b_{N-1}\right|+\cdots+\left|b_{1}\right|\right)\left(\frac{N-1}{N}\right)^{n} . $$  The expression $\left(\frac{N-1}{N}\right)^{n}$ can be made arbitrarily small for $n$ large enough, contradicting the assumption that $b_{N}$ be non-zero.  We obviously have $y>1$. Applying the lemma to (1) we see that $a_{m}=y=m, a_{1}=1$, and all the other $a_{i}$ are zero. This implies $\left(x_{1}, \ldots, x_{2011}\right)=(1, m, \ldots, m)$. But we also have $1+m=a_{1}+\cdots+a_{m}=1+\cdots+2011=1+k$ so $m=k$, which is what we wanted to show.


Determine all pairs $(f, g)$ of functions from the set of real numbers to itself that satisfy  $$ g(f(x+y))=f(x)+(2 x+y) g(y) $$  for all real numbers $x$ and $y$.  Answer. Either both $f$ and $g$ vanish identically, or there exists a real number $C$ such that $f(x)=x^{2}+C$ and $g(x)=x$ for all real numbers $x$.

Solution: Clearly all these pairs of functions satisfy the functional equation in question, so it suffices to verify that there cannot be any further ones. Substituting $-2 x$ for $y$ in the given functional equation we obtain  $$ g(f(-x))=f(x) . $$  Using this equation for $-x-y$ in place of $x$ we obtain  $$ f(-x-y)=g(f(x+y))=f(x)+(2 x+y) g(y) . $$  Now for any two real numbers $a$ and $b$, setting $x=-b$ and $y=a+b$ we get  $$ f(-a)=f(-b)+(a-b) g(a+b) . $$  If $c$ denotes another arbitrary real number we have similarly  $$ f(-b)=f(-c)+(b-c) g(b+c) $$  as well as  $$ f(-c)=f(-a)+(c-a) g(c+a) . $$  Adding all these equations up, we obtain  $$ ((a+c)-(b+c)) g(a+b)+((a+b)-(a+c)) g(b+c)+((b+c)-(a+b)) g(a+c)=0 \text {. } $$  Now given any three real numbers $x, y$, and $z$ one may determine three reals $a, b$, and $c$ such that $x=b+c, y=c+a$, and $z=a+b$, so that we get  $$ (y-x) g(z)+(z-y) g(x)+(x-z) g(y)=0 . $$  This implies that the three points $(x, g(x)),(y, g(y))$, and $(z, g(z))$ from the graph of $g$ are collinear. Hence that graph is a line, i.e., $g$ is either a constant or a linear function.  Let us write $g(x)=A x+B$, where $A$ and $B$ are two real numbers. Substituting $(0,-y)$ for $(x, y)$ in (2) and denoting $C=f(0)$, we have $f(y)=A y^{2}-B y+C$. Now, comparing the coefficients of $x^{2}$ in (1I) we see that $A^{2}=A$, so $A=0$ or $A=1$.  If $A=0$, then (1) becomes $B=-B x+C$ and thus $B=C=0$, which provides the first of the two solutions mentioned above.  Now suppose $A=1$. Then (1) becomes $x^{2}-B x+C+B=x^{2}-B x+C$, so $B=0$. Thus, $g(x)=x$ and $f(x)=x^{2}+C$, which is the second solution from above.  Comment. Another way to show that $g(x)$ is either a constant or a linear function is the following. If we interchange $x$ and $y$ in the given functional equation and subtract this new equation from the given one, we obtain  $$ f(x)-f(y)=(2 y+x) g(x)-(2 x+y) g(y) . $$  Substituting $(x, 0),(1, x)$, and $(0,1)$ for $(x, y)$, we get  $$ \begin{aligned} & f(x)-f(0)=x g(x)-2 x g(0), \\ & f(1)-f(x)=(2 x+1) g(1)-(x+2) g(x), \\ & f(0)-f(1)=2 g(0)-g(1) . \end{aligned} $$  Taking the sum of these three equations and dividing by 2 , we obtain  $$ g(x)=x(g(1)-g(0))+g(0) . $$  This proves that $g(x)$ is either a constant of a linear function.


Determine all pairs $(f, g)$ of functions from the set of positive integers to itself that satisfy  $$ f^{g(n)+1}(n)+g^{f(n)}(n)=f(n+1)-g(n+1)+1 $$  for every positive integer $n$. Here, $f^{k}(n)$ means $\underbrace{f(f(\ldots f}_{k}(n) \ldots))$.  Answer. The only pair $(f, g)$ of functions that satisfies the equation is given by $f(n)=n$ and $g(n)=1$ for all $n$.

Solution: The given relation implies  $$ f\left(f^{g(n)}(n)\right)<f(n+1) \text { for all } n $$  which will turn out to be sufficient to determine $f$.  Let $y_{1}<y_{2}<\ldots$ be all the values attained by $f$ (this sequence might be either finite or infinite). We will prove that for every positive $n$ the function $f$ attains at least $n$ values, and we have (i) $)_{n}: f(x)=y_{n}$ if and only if $x=n$, and (ii) $)_{n} y_{n}=n$. The proof will follow the scheme  $$ (\mathrm{i})_{1},(\mathrm{ii})_{1},(\mathrm{i})_{2},(\mathrm{ii})_{2}, \ldots,(\mathrm{i})_{n},(\mathrm{ii})_{n}, \ldots $$  To start, consider any $x$ such that $f(x)=y_{1}$. If $x>1$, then (1) reads $f\left(f^{g(x-1)}(x-1)\right)<y_{1}$, contradicting the minimality of $y_{1}$. So we have that $f(x)=y_{1}$ is equivalent to $x=1$, establishing $(\mathrm{i})_{1}$.  Next, assume that for some $n$ statement (i) ${ }_{n}$ is established, as well as all the previous statements in (2). Note that these statements imply that for all $k \geq 1$ and $a<n$ we have $f^{k}(x)=a$ if and only if $x=a$.  Now, each value $y_{i}$ with $1 \leq i \leq n$ is attained at the unique integer $i$, so $y_{n+1}$ exists. Choose an arbitrary $x$ such that $f(x)=y_{n+1}$; we necessarily have $x>n$. Substituting $x-1$ into (1) we have $f\left(f^{g(x-1)}(x-1)\right)<y_{n+1}$, which implies  $$ f^{g(x-1)}(x-1) \in\{1, \ldots, n\} $$  Set $b=f^{g(x-1)}(x-1)$. If $b<n$ then we would have $x-1=b$ which contradicts $x>n$. So $b=n$, and hence $y_{n}=n$, which proves (ii) ${ }_{n}$. Next, from (i) ${ }_{n}$ we now get $f(k)=n \Longleftrightarrow k=n$, so removing all the iterations of $f$ in (3) we obtain $x-1=b=n$, which proves (i) ${ }_{n+1}$.  So, all the statements in (2) are valid and hence $f(n)=n$ for all $n$. The given relation between $f$ and $g$ now reads $n+g^{n}(n)=n+1-g(n+1)+1$ or $g^{n}(n)+g(n+1)=2$, from which it immediately follows that we have $g(n)=1$ for all $n$.  Comment. Several variations of the above solution are possible. For instance, one may first prove by induction that the smallest $n$ values of $f$ are exactly $f(1)<\cdots<f(n)$ and proceed as follows. We certainly have $f(n) \geq n$ for all $n$. If there is an $n$ with $f(n)>n$, then $f(x)>x$ for all $x \geq n$. From this we conclude $f^{g(n)+1}(n)>f^{g(n)}(n)>\cdots>f(n)$. But we also have $f^{g(n)+1}<f(n+1)$. Having squeezed in a function value between $f(n)$ and $f(n+1)$, we arrive at a contradiction.  In any case, the inequality (11) plays an essential rôle.


Let $a, b$, and $c$ be positive real numbers satisfying $\min (a+b, b+c, c+a)>\sqrt{2}$ and $a^{2}+b^{2}+c^{2}=3$. Prove that  $$ \frac{a}{(b+c-a)^{2}}+\frac{b}{(c+a-b)^{2}}+\frac{c}{(a+b-c)^{2}} \geq \frac{3}{(a b c)^{2}} $$  Throughout both solutions, we denote the sums of the form $f(a, b, c)+f(b, c, a)+f(c, a, b)$ by $\sum f(a, b, c)$.

Solution: The condition $b+c>\sqrt{2}$ implies $b^{2}+c^{2}>1$, so $a^{2}=3-\left(b^{2}+c^{2}\right)<2$, i.e. $a<\sqrt{2}<b+c$. Hence we have $b+c-a>0$, and also $c+a-b>0$ and $a+b-c>0$ for similar reasons.  We will use the variant of HÖLDER's inequality  $$ \frac{x_{1}^{p+1}}{y_{1}^{p}}+\frac{x_{1}^{p+1}}{y_{1}^{p}}+\ldots+\frac{x_{n}^{p+1}}{y_{n}^{p}} \geq \frac{\left(x_{1}+x_{2}+\ldots+x_{n}\right)^{p+1}}{\left(y_{1}+y_{2}+\ldots+y_{n}\right)^{p}} $$  which holds for all positive real numbers $p, x_{1}, x_{2}, \ldots, x_{n}, y_{1}, y_{2}, \ldots, y_{n}$. Applying it to the left-hand side of (11) with $p=2$ and $n=3$, we get  $$ \sum \frac{a}{(b+c-a)^{2}}=\sum \frac{\left(a^{2}\right)^{3}}{a^{5}(b+c-a)^{2}} \geq \frac{\left(a^{2}+b^{2}+c^{2}\right)^{3}}{\left(\sum a^{5 / 2}(b+c-a)\right)^{2}}=\frac{27}{\left(\sum a^{5 / 2}(b+c-a)\right)^{2}} . $$  To estimate the denominator of the right-hand part, we use an instance of SCHUR's inequality, namely  $$ \sum a^{3 / 2}(a-b)(a-c) \geq 0 $$  which can be rewritten as  $$ \sum a^{5 / 2}(b+c-a) \leq a b c(\sqrt{a}+\sqrt{b}+\sqrt{c}) . $$  Moreover, by the inequality between the arithmetic mean and the fourth power mean we also have  $$ \left(\frac{\sqrt{a}+\sqrt{b}+\sqrt{c}}{3}\right)^{4} \leq \frac{a^{2}+b^{2}+c^{2}}{3}=1 $$  i.e., $\sqrt{a}+\sqrt{b}+\sqrt{c} \leq 3$. Hence, (2) yields  $$ \sum \frac{a}{(b+c-a)^{2}} \geq \frac{27}{(a b c(\sqrt{a}+\sqrt{b}+\sqrt{c}))^{2}} \geq \frac{3}{a^{2} b^{2} c^{2}} $$  thus solving the problem.  Comment. In this solution, one may also start from the following version of HÖLDER's inequality  $$ \left(\sum_{i=1}^{n} a_{i}^{3}\right)\left(\sum_{i=1}^{n} b_{i}^{3}\right)\left(\sum_{i=1}^{n} c_{i}^{3}\right) \geq\left(\sum_{i=1}^{n} a_{i} b_{i} c_{i}\right)^{3} $$  applied as  $$ \sum \frac{a}{(b+c-a)^{2}} \cdot \sum a^{3}(b+c-a) \cdot \sum a^{2}(b+c-a) \geq 27 $$  After doing that, one only needs the slightly better known instances  $$ \sum a^{3}(b+c-a) \leq(a+b+c) a b c \quad \text { and } \quad \sum a^{2}(b+c-a) \leq 3 a b c $$  of Schur's Inequality.


Solution: As in   $$ a^{5}+b^{5}+c^{5} \geq 3 $$  which is weaker than the given one. Due to the symmetry we may assume that $a \geq b \geq c$.  In view of (3)), it suffices to prove the inequality  $$ \sum \frac{a^{3} b^{2} c^{2}}{(b+c-a)^{2}} \geq \sum a^{5} $$  or, moving all the terms into the left-hand part,  $$ \sum \frac{a^{3}}{(b+c-a)^{2}}\left((b c)^{2}-(a(b+c-a))^{2}\right) \geq 0 $$  Note that the signs of the expressions $(y z)^{2}-(x(y+z-x))^{2}$ and $y z-x(y+z-x)=(x-y)(x-z)$ are the same for every positive $x, y, z$ satisfying the triangle inequality. So the terms in (4) corresponding to $a$ and $c$ are nonnegative, and hence it is sufficient to prove that the sum of the terms corresponding to $a$ and $b$ is nonnegative. Equivalently, we need the relation  $$ \frac{a^{3}}{(b+c-a)^{2}}(a-b)(a-c)(b c+a(b+c-a)) \geq \frac{b^{3}}{(a+c-b)^{2}}(a-b)(b-c)(a c+b(a+c-b)) $$  Obviously, we have  $$ a^{3} \geq b^{3} \geq 0, \quad 0<b+c-a \leq a+c-b, \quad \text { and } \quad a-c \geq b-c \geq 0 $$  hence it suffices to prove that  $$ \frac{a b+a c+b c-a^{2}}{b+c-a} \geq \frac{a b+a c+b c-b^{2}}{c+a-b} . $$  Since all the denominators are positive, it is equivalent to  $$ (c+a-b)\left(a b+a c+b c-a^{2}\right)-\left(a b+a c+b c-b^{2}\right)(b+c-a) \geq 0 $$  or  $$ (a-b)\left(2 a b-a^{2}-b^{2}+a c+b c\right) \geq 0 . $$  Since $a \geq b$, the last inequality follows from  $$ c(a+b)>(a-b)^{2} $$  which holds since $c>a-b \geq 0$ and $a+b>a-b \geq 0$.


Let $n>0$ be an integer. We are given a balance and $n$ weights of weight $2^{0}, 2^{1}, \ldots, 2^{n-1}$. In a sequence of $n$ moves we place all weights on the balance. In the first move we choose a weight and put it on the left pan. In each of the following moves we choose one of the remaining weights and we add it either to the left or to the right pan. Compute the number of ways in which we can perform these $n$ moves in such a way that the right pan is never heavier than the left pan.  Answer. The number $f(n)$ of ways of placing the $n$ weights is equal to the product of all odd positive integers less than or equal to $2 n-1$, i.e. $f(n)=(2 n-1) ! !=1 \cdot 3 \cdot 5 \cdot \ldots \cdot(2 n-1)$.

Solution: Assume $n \geq 2$. We claim  $$ f(n)=(2 n-1) f(n-1) . $$  Firstly, note that after the first move the left pan is always at least 1 heavier than the right one. Hence, any valid way of placing the $n$ weights on the scale gives rise, by not considering weight 1 , to a valid way of placing the weights $2,2^{2}, \ldots, 2^{n-1}$.  If we divide the weight of each weight by 2 , the answer does not change. So these $n-1$ weights can be placed on the scale in $f(n-1)$ valid ways. Now we look at weight 1 . If it is put on the scale in the first move, then it has to be placed on the left side, otherwise it can be placed either on the left or on the right side, because after the first move the difference between the weights on the left pan and the weights on the right pan is at least 2 . Hence, there are exactly $2 n-1$ different ways of inserting weight 1 in each of the $f(n-1)$ valid sequences for the $n-1$ weights in order to get a valid sequence for the $n$ weights. This proves the claim.  Since $f(1)=1$, by induction we obtain for all positive integers $n$  $$ f(n)=(2 n-1) ! !=1 \cdot 3 \cdot 5 \cdot \ldots \cdot(2 n-1) $$  Comment 1. The word "compute" in the statement of the problem is probably too vague. An alternative but more artificial question might ask for the smallest $n$ for which the number of valid ways is divisible by 2011. In this case the answer would be 1006 .  Comment 2. It is useful to remark that the answer is the same for any set of weights where each weight is heavier than the sum of the lighter ones. Indeed, in such cases the given condition is equivalent to asking that during the process the heaviest weight on the balance is always on the left pan.  Comment 3. Instead of considering the lightest weight, one may also consider the last weight put on the balance. If this weight is $2^{n-1}$ then it should be put on the left pan. Otherwise it may be put on any pan; the inequality would not be violated since at this moment the heaviest weight is already put onto the left pan. In view of the previous comment, in each of these $2 n-1$ cases the number of ways to place the previous weights is exactly $f(n-1)$, which yields (1).


Solution: We present a different way of obtaining (1). Set $f(0)=1$. Firstly, we find a recurrent formula for $f(n)$.  Assume $n \geq 1$. Suppose that weight $2^{n-1}$ is placed on the balance in the $i$-th move with $1 \leq i \leq n$. This weight has to be put on the left pan. For the previous moves we have $\left(\begin{array}{c}n-1 \\ i-1\end{array}\right)$ choices of the weights and from Comment 2 there are $f(i-1)$ valid ways of placing them on the balance. For later moves there is no restriction on the way in which the weights are to be put on the pans. Therefore, all $(n-i) ! 2^{n-i}$ ways are possible. This gives  $$ f(n)=\sum_{i=1}^{n}\left(\begin{array}{c} n-1 \\ i-1 \end{array}\right) f(i-1)(n-i) ! 2^{n-i}=\sum_{i=1}^{n} \frac{(n-1) ! f(i-1) 2^{n-i}}{(i-1) !} $$  Now we are ready to prove (11). Using $n-1$ instead of $n$ in (2) we get  $$ f(n-1)=\sum_{i=1}^{n-1} \frac{(n-2) ! f(i-1) 2^{n-1-i}}{(i-1) !} . $$  Hence, again from (2) we get  $$ \begin{aligned} f(n)=2(n-1) \sum_{i=1}^{n-1} & \frac{(n-2) ! f(i-1) 2^{n-1-i}}{(i-1) !}+f(n-1) \\ & =(2 n-2) f(n-1)+f(n-1)=(2 n-1) f(n-1), \end{aligned} $$  QED.  Comment. There exist different ways of obtaining the formula (2). Here we show one of them.  Suppose that in the first move we use weight $2^{n-i+1}$. Then the lighter $n-i$ weights may be put on the balance at any moment and on either pan. This gives $2^{n-i} \cdot(n-1) ! /(i-1)$ ! choices for the moves (moments and choices of pan) with the lighter weights. The remaining $i-1$ moves give a valid sequence for the $i-1$ heavier weights and this is the only requirement for these moves, so there are $f(i-1)$ such sequences. Summing over all $i=1,2, \ldots, n$ we again come to (2).


Suppose that 1000 students are standing in a circle. Prove that there exists an integer $k$ with $100 \leq k \leq 300$ such that in this circle there exists a contiguous group of $2 k$ students, for which the first half contains the same number of girls as the second half.

Solution: Number the students consecutively from 1 to 1000. Let $a_{i}=1$ if the $i$ th student is a girl, and $a_{i}=0$ otherwise. We expand this notion for all integers $i$ by setting $a_{i+1000}=$ $a_{i-1000}=a_{i}$. Next, let  $$ S_{k}(i)=a_{i}+a_{i+1}+\cdots+a_{i+k-1} $$  Now the statement of the problem can be reformulated as follows:  There exist an integer $k$ with $100 \leq k \leq 300$ and an index $i$ such that $S_{k}(i)=S_{k}(i+k)$.  Assume now that this statement is false. Choose an index $i$ such that $S_{100}(i)$ attains the maximal possible value. In particular, we have $S_{100}(i-100)-S_{100}(i)<0$ and $S_{100}(i)-S_{100}(i+100)>0$, for if we had an equality, then the statement would hold. This means that the function $S(j)-$ $S(j+100)$ changes sign somewhere on the segment $[i-100, i]$, so there exists some index $j \in$ $[i-100, i-1]$ such that  $$ S_{100}(j) \leq S_{100}(j+100)-1, \quad \text { but } \quad S_{100}(j+1) \geq S_{100}(j+101)+1 $$  Subtracting the first inequality from the second one, we get $a_{j+100}-a_{j} \geq a_{j+200}-a_{j+100}+2$, so  $$ a_{j}=0, \quad a_{j+100}=1, \quad a_{j+200}=0 $$  Substituting this into the inequalities of (1), we also obtain $S_{99}(j+1) \leq S_{99}(j+101) \leq S_{99}(j+1)$, which implies  $$ S_{99}(j+1)=S_{99}(j+101) . $$  Now let $k$ and $\ell$ be the least positive integers such that $a_{j-k}=1$ and $a_{j+200+\ell}=1$. By symmetry, we may assume that $k \geq \ell$. If $k \geq 200$ then we have $a_{j}=a_{j-1}=\cdots=a_{j-199}=0$, so $S_{100}(j-199)=S_{100}(j-99)=0$, which contradicts the initial assumption. Hence $\ell \leq k \leq 199$.  Finally, we have  $$ \begin{gathered} S_{100+\ell}(j-\ell+1)=\left(a_{j-\ell+1}+\cdots+a_{j}\right)+S_{99}(j+1)+a_{j+100}=S_{99}(j+1)+1, \\ S_{100+\ell}(j+101)=S_{99}(j+101)+\left(a_{j+200}+\cdots+a_{j+200+\ell-1}\right)+a_{j+200+\ell}=S_{99}(j+101)+1 . \end{gathered} $$  Comparing with (2) we get $S_{100+\ell}(j-\ell+1)=S_{100+\ell}(j+101)$ and $100+\ell \leq 299$, which again contradicts our assumption.  Comment. It may be seen from the solution that the number 300 from the problem statement can be replaced by 299. Here we consider some improvements of this result. Namely, we investigate which interval can be put instead of $[100,300]$ in order to keep the problem statement valid.  First of all, the two examples  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-31.jpg?height=109&width=1054&top_left_y=454&top_left_x=501)  and  $$ \underbrace{1,1, \ldots, 1}_{249}, \underbrace{0,0, \ldots, 0}_{251}, \underbrace{1,1, \ldots, 1}_{249}, \underbrace{0,0, \ldots, 0}_{251} $$  show that the interval can be changed neither to $[84,248]$ nor to $[126,374]$.  On the other hand, we claim that this interval can be changed to $[125,250]$. Note that this statement is invariant under replacing all 1's by 0's and vice versa. Assume, to the contrary, that there is no admissible $k \in[125,250]$. The arguments from the solution easily yield the following lemma.  Lemma. Under our assumption, suppose that for some indices $i<j$ we have $S_{125}(i) \leq S_{125}(i+125)$ but $S_{125}(j) \geq S_{125}(j+125)$. Then there exists some $t \in[i, j-1]$ such that $a_{t}=a_{t-1}=\cdots=a_{t-125}=0$ and $a_{t+250}=a_{t+251}=\cdots=a_{t+375}=0$.  Let us call a segment $[i, j]$ of indices a crowd, if (a) $a_{i}=a_{i+1}=\cdots=a_{j}$, but $a_{i-1} \neq a_{i} \neq a_{j+1}$, and (b) $j-i \geq 125$. Now, using the lemma, one can get in the same way as in the solution that there exists some crowd. Take all the crowds in the circle, and enumerate them in cyclic order as $A_{1}, \ldots, A_{d}$. We also assume always that $A_{s+d}=A_{s-d}=A_{s}$.  Consider one of the crowds, say $A_{1}$. We have $A_{1}=[i, i+t]$ with $125 \leq t \leq 248$ (if $t \geq 249$, then $a_{i}=a_{i+1}=\cdots=a_{i+249}$ and therefore $S_{125}(i)=S_{125}(i+125)$, which contradicts our assumption). We may assume that $a_{i}=1$. Then we have $S_{125}(i+t-249) \leq 125=S_{125}(i+t-124)$ and $S_{125}(i)=125 \geq S_{125}(i+125)$, so by the lemma there exists some index $j \in[i+t-249, i-1]$ such that the segments $[j-125, j]$ and $[j+250, j+375]$ are contained in some crowds.  Let us fix such $j$ and denote the segment $[j+1, j+249]$ by $B_{1}$. Clearly, $A_{1} \subseteq B_{1}$. Moreover, $B_{1}$ cannot contain any crowd other than $A_{1}$ since $\left|B_{1}\right|=249<2 \cdot 126$. Hence it is clear that $j \in A_{d}$ and $j+250 \in A_{2}$. In particular, this means that the genders of $A_{d}$ and $A_{2}$ are different from that of $A_{1}$.  Performing this procedure for every crowd $A_{s}$, we find segments $B_{s}=\left[j_{s}+1, j_{s}+249\right]$ such that $\left|B_{s}\right|=249, A_{s} \subseteq B_{s}$, and $j_{s} \in A_{s-1}, j_{s}+250 \in A_{s+1}$. So, $B_{s}$ covers the whole segment between $A_{s-1}$ and $A_{s+1}$, hence the sets $B_{1}, \ldots, B_{d}$ cover some 1000 consecutive indices. This implies $249 d \geq 1000$, and $d \geq 5$. Moreover, the gender of $A_{i}$ is alternating, so $d$ is even; therefore $d \geq 6$.  Consider now three segments $A_{1}=\left[i_{1}, i_{1}^{\prime}\right], B_{2}=\left[j_{2}+1, j_{2}+249\right], A_{3}=\left[i_{3}, i_{3}^{\prime}\right]$. By construction, we have $\left[j_{2}-125, j_{2}\right] \subseteq A_{1}$ and $\left[j_{2}+250, j_{2}+375\right] \subseteq A_{3}$, whence $i_{1} \leq j_{2}-125, i_{3}^{\prime} \geq j_{2}+375$. Therefore $i_{3}^{\prime}-i_{1} \geq 500$. Analogously, if $A_{4}=\left[i_{4}, i_{4}^{\prime}\right], A_{6}=\left[i_{6}, i_{6}^{\prime}\right]$ then $i_{6}^{\prime}-i_{4} \geq 500$. But from $d \geq 6$ we get $i_{1}<i_{3}^{\prime}<i_{4}<i_{6}^{\prime}<i_{1}+1000$, so $1000>\left(i_{3}^{\prime}-i_{1}\right)+\left(i_{6}^{\prime}-i_{4}\right) \geq 500+500$. This final contradiction shows that our claim holds.  One may even show that the interval in the statement of the problem may be replaced by $[125,249]$ (both these numbers cannot be improved due to the examples above). But a proof of this fact is a bit messy, and we do not present it here.


Let $\mathcal{S}$ be a finite set of at least two points in the plane. Assume that no three points of $\mathcal{S}$ are collinear. By a windmill we mean a process as follows. Start with a line $\ell$ going through a point $P \in \mathcal{S}$. Rotate $\ell$ clockwise around the pivot $P$ until the line contains another point $Q$ of $\mathcal{S}$. The point $Q$ now takes over as the new pivot. This process continues indefinitely, with the pivot always being a point from $\mathcal{S}$.  Show that for a suitable $P \in \mathcal{S}$ and a suitable starting line $\ell$ containing $P$, the resulting windmill will visit each point of $\mathcal{S}$ as a pivot infinitely often.

Solution: Give the rotating line an orientation and distinguish its sides as the oranje side and the blue side. Notice that whenever the pivot changes from some point $T$ to another point $U$, after the change, $T$ is on the same side as $U$ was before. Therefore, the number of elements of $\mathcal{S}$ on the oranje side and the number of those on the blue side remain the same throughout the whole process (except for those moments when the line contains two points). ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-32.jpg?height=422&width=1108&top_left_y=1198&top_left_x=474)  First consider the case that $|\mathcal{S}|=2 n+1$ is odd. We claim that through any point $T \in \mathcal{S}$, there is a line that has $n$ points on each side. To see this, choose an oriented line through $T$ containing no other point of $\mathcal{S}$ and suppose that it has $n+r$ points on its oranje side. If $r=0$ then we have established the claim, so we may assume that $r \neq 0$. As the line rotates through $180^{\circ}$ around $T$, the number of points of $\mathcal{S}$ on its oranje side changes by 1 whenever the line passes through a point; after $180^{\circ}$, the number of points on the oranje side is $n-r$. Therefore there is an intermediate stage at which the oranje side, and thus also the blue side, contains $n$ points.  Now select the point $P$ arbitrarily, and choose a line through $P$ that has $n$ points of $\mathcal{S}$ on each side to be the initial state of the windmill. We will show that during a rotation over $180^{\circ}$, the line of the windmill visits each point of $\mathcal{S}$ as a pivot. To see this, select any point $T$ of $\mathcal{S}$ and select a line $\ell$ through $T$ that separates $\mathcal{S}$ into equal halves. The point $T$ is the unique point of $\mathcal{S}$ through which a line in this direction can separate the points of $\mathcal{S}$ into equal halves (parallel translation would disturb the balance). Therefore, when the windmill line is parallel to $\ell$, it must be $\ell$ itself, and so pass through $T$.  Next suppose that $|\mathcal{S}|=2 n$. Similarly to the odd case, for every $T \in \mathcal{S}$ there is an oriented line through $T$ with $n-1$ points on its oranje side and $n$ points on its blue side. Select such an oriented line through an arbitrary $P$ to be the initial state of the windmill.  We will now show that during a rotation over $360^{\circ}$, the line of the windmill visits each point of $\mathcal{S}$ as a pivot. To see this, select any point $T$ of $\mathcal{S}$ and an oriented line $\ell$ through $T$ that separates $\mathcal{S}$ into two subsets with $n-1$ points on its oranje and $n$ points on its blue side. Again, parallel translation would change the numbers of points on the two sides, so when the windmill line is parallel to $\ell$ with the same orientation, the windmill line must pass through $T$.  Comment. One may shorten this solution in the following way.  Suppose that $|\mathcal{S}|=2 n+1$. Consider any line $\ell$ that separates $\mathcal{S}$ into equal halves; this line is unique given its direction and contains some point $T \in \mathcal{S}$. Consider the windmill starting from this line. When the line has made a rotation of $180^{\circ}$, it returns to the same location but the oranje side becomes blue and vice versa. So, for each point there should have been a moment when it appeared as pivot, as this is the only way for a point to pass from on side to the other.  Now suppose that $|\mathcal{S}|=2 n$. Consider a line having $n-1$ and $n$ points on the two sides; it contains some point $T$. Consider the windmill starting from this line. After having made a rotation of $180^{\circ}$, the windmill line contains some different point $R$, and each point different from $T$ and $R$ has changed the color of its side. So, the windmill should have passed through all the points.  ## $\mathrm{C} 4$  Determine the greatest positive integer $k$ that satisfies the following property: The set of positive integers can be partitioned into $k$ subsets $A_{1}, A_{2}, \ldots, A_{k}$ such that for all integers $n \geq 15$ and all $i \in\{1,2, \ldots, k\}$ there exist two distinct elements of $A_{i}$ whose sum is $n$.  Answer. The greatest such number $k$ is 3 .


Solution: There are various examples showing that $k=3$ does indeed have the property under consideration. E.g. one can take  $$ \begin{gathered} A_{1}=\{1,2,3\} \cup\{3 m \mid m \geq 4\}, \\ A_{2}=\{4,5,6\} \cup\{3 m-1 \mid m \geq 4\}, \\ A_{3}=\{7,8,9\} \cup\{3 m-2 \mid m \geq 4\} \end{gathered} $$  To check that this partition fits, we notice first that the sums of two distinct elements of $A_{i}$ obviously represent all numbers $n \geq 1+12=13$ for $i=1$, all numbers $n \geq 4+11=15$ for $i=2$, and all numbers $n \geq 7+10=17$ for $i=3$. So, we are left to find representations of the numbers 15 and 16 as sums of two distinct elements of $A_{3}$. These are $15=7+8$ and $16=7+9$.  Let us now suppose that for some $k \geq 4$ there exist sets $A_{1}, A_{2}, \ldots, A_{k}$ satisfying the given property. Obviously, the sets $A_{1}, A_{2}, A_{3}, A_{4} \cup \cdots \cup A_{k}$ also satisfy the same property, so one may assume $k=4$.  Put $B_{i}=A_{i} \cap\{1,2, \ldots, 23\}$ for $i=1,2,3,4$. Now for any index $i$ each of the ten numbers $15,16, \ldots, 24$ can be written as sum of two distinct elements of $B_{i}$. Therefore this set needs to contain at least five elements. As we also have $\left|B_{1}\right|+\left|B_{2}\right|+\left|B_{3}\right|+\left|B_{4}\right|=23$, there has to be some index $j$ for which $\left|B_{j}\right|=5$. Let $B_{j}=\left\{x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right\}$. Finally, now the sums of two distinct elements of $A_{j}$ representing the numbers $15,16, \ldots, 24$ should be exactly all the pairwise sums of the elements of $B_{j}$. Calculating the sum of these numbers in two different ways, we reach  $$ 4\left(x_{1}+x_{2}+x_{3}+x_{4}+x_{5}\right)=15+16+\ldots+24=195 . $$  Thus the number 195 should be divisible by 4 , which is false. This contradiction completes our solution.  Comment. There are several variation of the proof that $k$ should not exceed 3. E.g., one may consider the sets $C_{i}=A_{i} \cap\{1,2, \ldots, 19\}$ for $i=1,2,3,4$. As in the previous solution one can show that for some index $j$ one has $\left|C_{j}\right|=4$, and the six pairwise sums of the elements of $C_{j}$ should represent all numbers $15,16, \ldots, 20$. Let $C_{j}=\left\{y_{1}, y_{2}, y_{3}, y_{4}\right\}$ with $y_{1}<y_{2}<y_{3}<y_{4}$. It is not hard to deduce $C_{j}=\{7,8,9,11\}$, so in particular we have $1 \notin C_{j}$. Hence it is impossible to represent 21 as sum of two distinct elements of $A_{j}$, which completes our argument.


Solution: Again we only prove that $k \leq 3$. Assume that $A_{1}, A_{2}, \ldots, A_{k}$ is a partition satisfying the given property. We construct a graph $\mathcal{G}$ on the set $V=\{1,2, \ldots, 18\}$ of vertices as follows. For each $i \in\{1,2, \ldots, k\}$ and each $d \in\{15,16,17,19\}$ we choose one pair of distinct elements $a, b \in A_{i}$ with $a+b=d$, and we draw an edge in the $i^{\text {th }}$ color connecting $a$ with $b$. By hypothesis, $\mathcal{G}$ has exactly 4 edges of each color.  Claim. The graph $\mathcal{G}$ contains at most one circuit.  Proof. Note that all the connected components of $\mathcal{G}$ are monochromatic and hence contain at most four edges. Thus also all circuits of $\mathcal{G}$ are monochromatic and have length at most four. Moreover, each component contains at most one circuit since otherwise it should contain at least five edges.  Suppose that there is a 4-cycle in $\mathcal{G}$, say with vertices $a, b, c$, and $d$ in order. Then $\{a+b, b+$ $c, c+d, d+a\}=\{15,16,17,19\}$. Taking sums we get $2(a+b+c+d)=15+16+17+19$ which is impossible for parity reasons. Thus all circuits of $\mathcal{G}$ are triangles.  Now if the vertices $a, b$, and $c$ form such a triangle, then by a similar reasoning the set $\{a+b, b+$ $c, c+a\}$ coincides with either $\{15,16,17\}$, or $\{15,16,19\}$, or $\{16,17,19\}$, or $\{15,17,19\}$. The last of these alternatives can be excluded for parity reasons again, whilst in the first three cases the set $\{a, b, c\}$ appears to be either $\{7,8,9\}$, or $\{6,9,10\}$, or $\{7,9,10\}$, respectively. Thus, a component containing a circuit should contain 9 as a vertex. Therefore there is at most one such component and hence at most one circuit.  By now we know that $\mathcal{G}$ is a graph with $4 k$ edges, at least $k$ components and at most one circuit. Consequently, $\mathcal{G}$ must have at least $4 k+k-1$ vertices. Thus $5 k-1 \leq 18$, and $k \leq 3$.


Let $m$ be a positive integer and consider a checkerboard consisting of $m$ by $m$ unit squares. At the midpoints of some of these unit squares there is an ant. At time 0 , each ant starts moving with speed 1 parallel to some edge of the checkerboard. When two ants moving in opposite directions meet, they both turn $90^{\circ}$ clockwise and continue moving with speed 1 . When more than two ants meet, or when two ants moving in perpendicular directions meet, the ants continue moving in the same direction as before they met. When an ant reaches one of the edges of the checkerboard, it falls off and will not re-appear.  Considering all possible starting positions, determine the latest possible moment at which the last ant falls off the checkerboard or prove that such a moment does not necessarily exist.  Antswer. The latest possible moment for the last ant to fall off is $\frac{3 m}{2}-1$.

Solution: For $m=1$ the answer is clearly correct, so assume $m>1$. In the sequel, the word collision will be used to denote meeting of exactly two ants, moving in opposite directions.  If at the beginning we place an ant on the southwest corner square facing east and an ant on the southeast corner square facing west, then they will meet in the middle of the bottom row at time $\frac{m-1}{2}$. After the collision, the ant that moves to the north will stay on the board for another $m-\frac{1}{2}$ time units and thus we have established an example in which the last ant falls off at time $\frac{m-1}{2}+m-\frac{1}{2}=\frac{3 m}{2}-1$. So, we are left to prove that this is the latest possible moment.  Consider any collision of two ants $a$ and $a^{\prime}$. Let us change the rule for this collision, and enforce these two ants to turn anticlockwise. Then the succeeding behavior of all the ants does not change; the only difference is that $a$ and $a^{\prime}$ swap their positions. These arguments may be applied to any collision separately, so we may assume that at any collision, either both ants rotate clockwise or both of them rotate anticlockwise by our own choice.  For instance, we may assume that there are only two types of ants, depending on their initial direction: $N E$-ants, which move only north or east, and $S W$-ants, moving only south and west. Then we immediately obtain that all ants will have fallen off the board after $2 m-1$ time units. However, we can get a better bound by considering the last moment at which a given ant collides with another ant.  Choose a coordinate system such that the corners of the checkerboard are $(0,0),(m, 0),(m, m)$ and $(0, m)$. At time $t$, there will be no NE-ants in the region $\{(x, y): x+y<t+1\}$ and no $\mathrm{SW}$-ants in the region $\{(x, y): x+y>2 m-t-1\}$. So if two ants collide at $(x, y)$ at time $t$, we have  $$ t+1 \leq x+y \leq 2 m-t-1 $$  Analogously, we may change the rules so that each ant would move either alternatingly north and west, or alternatingly south and east. By doing so, we find that apart from (1) we also have $|x-y| \leq m-t-1$ for each collision at point $(x, y)$ and time $t$.  To visualize this, put  $$ B(t)=\left\{(x, y) \in[0, m]^{2}: t+1 \leq x+y \leq 2 m-t-1 \text { and }|x-y| \leq m-t-1\right\} . $$  An ant can thus only collide with another ant at time $t$ if it happens to be in the region $B(t)$. The following figure displays $B(t)$ for $t=\frac{1}{2}$ and $t=\frac{7}{2}$ in the case $m=6$ :  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-37.jpg?height=622&width=623&top_left_y=771&top_left_x=722)  Now suppose that an NE-ant has its last collision at time $t$ and that it does so at the point $(x, y)$ (if the ant does not collide at all, it will fall off the board within $m-\frac{1}{2}<\frac{3 m}{2}-1$ time units, so this case can be ignored). Then we have $(x, y) \in B(t)$ and thus $x+y \geq t+1$ and $x-y \geq-(m-t-1)$. So we get  $$ x \geq \frac{(t+1)-(m-t-1)}{2}=t+1-\frac{m}{2} $$  By symmetry we also have $y \geq t+1-\frac{m}{2}$, and hence $\min \{x, y\} \geq t+1-\frac{m}{2}$. After this collision, the ant will move directly to an edge, which will take at $\operatorname{most} m-\min \{x, y\}$ units of time. In sum, the total amount of time the ant stays on the board is at most  $$ t+(m-\min \{x, y\}) \leq t+m-\left(t+1-\frac{m}{2}\right)=\frac{3 m}{2}-1 $$  By symmetry, the same bound holds for $\mathrm{SW}$-ants as well.


On a square table of 2011 by 2011 cells we place a finite number of napkins that each cover a square of 52 by 52 cells. In each cell we write the number of napkins covering it, and we record the maximal number $k$ of cells that all contain the same nonzero number. Considering all possible napkin configurations, what is the largest value of $k$ ?  Answer. $2011^{2}-\left(\left(52^{2}-35^{2}\right) \cdot 39-17^{2}\right)=4044121-57392=3986729$.

Solution: Let $m=39$, then $2011=52 m-17$. We begin with an example showing that there can exist 3986729 cells carrying the same positive number.  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-40.jpg?height=577&width=580&top_left_y=1022&top_left_x=744)  To describe it, we number the columns from the left to the right and the rows from the bottom to the top by $1,2, \ldots, 2011$. We will denote each napkin by the coordinates of its lowerleft cell. There are four kinds of napkins: first, we take all napkins $(52 i+36,52 j+1)$ with $0 \leq j \leq i \leq m-2$; second, we use all napkins $(52 i+1,52 j+36)$ with $0 \leq i \leq j \leq m-2$; third, we use all napkins $(52 i+36,52 i+36)$ with $0 \leq i \leq m-2$; and finally the napkin $(1,1)$. Different groups of napkins are shown by different types of hatchings in the picture.  Now except for those squares that carry two or more different hatchings, all squares have the number 1 written into them. The number of these exceptional cells is easily computed to be $\left(52^{2}-35^{2}\right) m-17^{2}=57392$.  We are left to prove that 3986729 is an upper bound for the number of cells containing the same number. Consider any configuration of napkins and any positive integer $M$. Suppose there are $g$ cells with a number different from $M$. Then it suffices to show $g \geq 57392$. Throughout the solution, a line will mean either a row or a column.  Consider any line $\ell$. Let $a_{1}, \ldots, a_{52 m-17}$ be the numbers written into its consecutive cells. For $i=1,2, \ldots, 52$, let $s_{i}=\sum_{t \equiv i(\bmod 52)} a_{t}$. Note that $s_{1}, \ldots, s_{35}$ have $m$ terms each, while $s_{36}, \ldots, s_{52}$ have $m-1$ terms each. Every napkin intersecting $\ell$ contributes exactly 1 to each $s_{i}$; hence the number $s$ of all those napkins satisfies $s_{1}=\cdots=s_{52}=s$. Call the line $\ell$ rich if $s>(m-1) M$ and poor otherwise.  Suppose now that $\ell$ is rich. Then in each of the sums $s_{36}, \ldots, s_{52}$ there exists a term greater than $M$; consider all these terms and call the corresponding cells the rich bad cells for this line. So, each rich line contains at least 17 cells that are bad for this line.  If, on the other hand, $\ell$ is poor, then certainly $s<m M$ so in each of the sums $s_{1}, \ldots, s_{35}$ there exists a term less than $M$; consider all these terms and call the corresponding cells the poor bad cells for this line. So, each poor line contains at least 35 cells that are bad for this line.  Let us call all indices congruent to $1,2, \ldots$, or 35 modulo 52 small, and all other indices, i.e. those congruent to $36,37, \ldots$, or 52 modulo 52 , big. Recall that we have numbered the columns from the left to the right and the rows from the bottom to the top using the numbers $1,2, \ldots, 52 m-17$; we say that a line is big or small depending on whether its index is big or small. By definition, all rich bad cells for the rows belong to the big columns, while the poor ones belong to the small columns, and vice versa.  In each line, we put a strawberry on each cell that is bad for this line. In addition, for each small rich line we put an extra strawberry on each of its (rich) bad cells. A cell gets the strawberries from its row and its column independently.  Notice now that a cell with a strawberry on it contains a number different from $M$. If this cell gets a strawberry by the extra rule, then it contains a number greater than $M$. Moreover, it is either in a small row and in a big column, or vice versa. Suppose that it is in a small row, then it is not bad for its column. So it has not more than two strawberries in this case. On the other hand, if the extra rule is not applied to some cell, then it also has not more than two strawberries. So, the total number $N$ of strawberries is at most $2 g$.  We shall now estimate $N$ in a different way. For each of the $2 \cdot 35 m$ small lines, we have introduced at least 34 strawberries if it is rich and at least 35 strawberries if it is poor, so at least 34 strawberries in any case. Similarly, for each of the $2 \cdot 17(m-1)$ big lines, we put at least $\min (17,35)=17$ strawberries. Summing over all lines we obtain  $$ 2 g \geq N \geq 2(35 m \cdot 34+17(m-1) \cdot 17)=2(1479 m-289)=2 \cdot 57392 $$  as desired.  Comment. The same reasoning applies also if we replace 52 by $R$ and 2011 by $R m-H$, where $m, R$, and $H$ are integers with $m, R \geq 1$ and $0 \leq H \leq \frac{1}{3} R$. More detailed information is provided after the next solution.


Solution: We present a different proof of the estimate which is the hard part of the problem. Let $S=35, H=17, m=39$; so the table size is $2011=S m+H(m-1)$, and the napkin size is $52=S+H$. Fix any positive integer $M$ and call a cell vicious if it contains a number distinct from $M$. We will prove that there are at least $H^{2}(m-1)+2 S H m$ vicious cells.  Firstly, we introduce some terminology. As in the previous solution, we number rows and columns and we use the same notions of small and big indices and lines; so, an index is small if it is congruent to one of the numbers $1,2, \ldots, S$ modulo $(S+H)$. The numbers $1,2, \ldots, S+H$ will be known as residues. For two residues $i$ and $j$, we say that a cell is of type $(i, j)$ if the index of its row is congruent to $i$ and the index of its column to $j$ modulo $(S+H)$. The number of vicious cells of this type is denoted by $v_{i j}$.  Let $s, s^{\prime}$ be two variables ranging over small residues and let $h, h^{\prime}$ be two variables ranging over big residues. A cell is said to be of class $A, B, C$, or $D$ if its type is of shape $\left(s, s^{\prime}\right),(s, h),(h, s)$, or $\left(h, h^{\prime}\right)$, respectively. The numbers of vicious cells belonging to these classes are denoted in this order by $a, b, c$, and $d$. Observe that each cell belongs to exactly one class.  Claim 1. We have  $$ m \leq \frac{a}{S^{2}}+\frac{b+c}{2 S H} $$  Proof. Consider an arbitrary small row $r$. Denote the numbers of vicious cells on $r$ belonging to the classes $A$ and $B$ by $\alpha$ and $\beta$, respectively. As in the previous solution, we obtain that $\alpha \geq S$ or $\beta \geq H$. So in each case we have $\frac{\alpha}{S}+\frac{\beta}{H} \geq 1$.  Performing this argument separately for each small row and adding up all the obtained inequalities, we get $\frac{a}{S}+\frac{b}{H} \geq m S$. Interchanging rows and columns we similarly get $\frac{a}{S}+\frac{c}{H} \geq m S$. Summing these inequalities and dividing by $2 S$ we get what we have claimed.  Claim 2. Fix two small residue $s, s^{\prime}$ and two big residues $h, h^{\prime}$. Then $2 m-1 \leq v_{s s^{\prime}}+v_{s h^{\prime}}+v_{h h^{\prime}}$. Proof. Each napkin covers exactly one cell of type $\left(s, s^{\prime}\right)$. Removing all napkins covering a vicious cell of this type, we get another collection of napkins, which covers each cell of type $\left(s, s^{\prime}\right)$ either 0 or $M$ times depending on whether the cell is vicious or not. Hence $\left(m^{2}-v_{s s^{\prime}}\right) M$ napkins are left and throughout the proof of Claim 2 we will consider only these remaining napkins. Now, using a red pen, write in each cell the number of napkins covering it. Notice that a cell containing a red number greater than $M$ is surely vicious.  We call two cells neighbors if they can be simultaneously covered by some napkin. So, each cell of type $\left(h, h^{\prime}\right)$ has not more than four neighbors of type $\left(s, s^{\prime}\right)$, while each cell of type $\left(s, h^{\prime}\right)$ has not more than two neighbors of each of the types $\left(s, s^{\prime}\right)$ and $\left(h, h^{\prime}\right)$. Therefore, each red number at a cell of type $\left(h, h^{\prime}\right)$ does not exceed $4 M$, while each red number at a cell of type $\left(s, h^{\prime}\right)$ does not exceed $2 M$.  Let $x, y$, and $z$ be the numbers of cells of type $\left(h, h^{\prime}\right)$ whose red number belongs to $(M, 2 M]$, $(2 M, 3 M]$, and $(3 M, 4 M]$, respectively. All these cells are vicious, hence $x+y+z \leq v_{h h^{\prime}}$. The red numbers appearing in cells of type $\left(h, h^{\prime}\right)$ clearly sum up to $\left(m^{2}-v_{s s^{\prime}}\right) M$. Bounding each of these numbers by a multiple of $M$ we get  $$ \left(m^{2}-v_{s s^{\prime}}\right) M \leq\left((m-1)^{2}-(x+y+z)\right) M+2 x M+3 y M+4 z M $$  i.e.  $$ 2 m-1 \leq v_{s s^{\prime}}+x+2 y+3 z \leq v_{s s^{\prime}}+v_{h h^{\prime}}+y+2 z $$  So, to prove the claim it suffices to prove that $y+2 z \leq v_{s h^{\prime}}$.  For a cell $\delta$ of type $\left(h, h^{\prime}\right)$ and a cell $\beta$ of type $\left(s, h^{\prime}\right)$ we say that $\delta$ forces $\beta$ if there are more than $M$ napkins covering both of them. Since each red number in a cell of type $\left(s, h^{\prime}\right)$ does not exceed $2 M$, it cannot be forced by more than one cell.  On the other hand, if a red number in a $\left(h, h^{\prime}\right)$-cell belongs to $(2 M, 3 M]$, then it forces at least one of its neighbors of type $\left(s, h^{\prime}\right)$ (since the sum of red numbers in their cells is greater than $2 M)$. Analogously, an $\left(h, h^{\prime}\right)$-cell with the red number in $(3 M, 4 M]$ forces both its neighbors of type $\left(s, h^{\prime}\right)$, since their red numbers do not exceed $2 M$. Therefore there are at least $y+2 z$ forced cells and clearly all of them are vicious, as desired.  Claim 3. We have  $$ 2 m-1 \leq \frac{a}{S^{2}}+\frac{b+c}{2 S H}+\frac{d}{H^{2}} $$  Proof. Averaging the previous result over all $S^{2} H^{2}$ possibilities for the quadruple $\left(s, s^{\prime}, h, h^{\prime}\right)$, we get $2 m-1 \leq \frac{a}{S^{2}}+\frac{b}{S H}+\frac{d}{H^{2}}$. Due to the symmetry between rows and columns, the same estimate holds with $b$ replaced by $c$. Averaging these two inequalities we arrive at our claim.  Now let us multiply (2) by $H^{2}$, multiply (II) by $\left(2 S H-H^{2}\right)$ and add them; we get  $H^{2}(2 m-1)+\left(2 S H-H^{2}\right) m \leq a \cdot \frac{H^{2}+2 S H-H^{2}}{S^{2}}+(b+c) \frac{H^{2}+2 S H-H^{2}}{2 S H}+d=a \cdot \frac{2 H}{S}+b+c+d$.  The left-hand side is exactly $H^{2}(m-1)+2 S H m$, while the right-hand side does not exceed $a+b+c+d$ since $2 H \leq S$. Hence we come to the desired inequality.  Comment 1. Claim 2 is the key difference between the two solutions, because it allows to get rid of the notions of rich and poor cells. However, one may prove it by the "strawberry method" as well. It suffices to put a strawberry on each cell which is bad for an $s$-row, and a strawberry on each cell which is bad for an $h^{\prime}$-column. Then each cell would contain not more than one strawberry.  Comment 2. Both solutions above work if the residue of the table size $T$ modulo the napkin size $R$ is at least $\frac{2}{3} R$, or equivalently if $T=S m+H(m-1)$ and $R=S+H$ for some positive integers $S, H$, $m$ such that $S \geq 2 H$. Here we discuss all other possible combinations.  Case 1. If $2 H \geq S \geq H / 2$, then the sharp bound for the number of vicious cells is $m S^{2}+(m-1) H^{2}$; it can be obtained by the same methods as in any of the solutions. To obtain an example showing that the bound is sharp, one may simply remove the napkins of the third kind from the example in Solution 1 (with an obvious change in the numbers).  Case 2. If $2 S \leq H$, the situation is more difficult. If $(S+H)^{2}>2 H^{2}$, then the answer and the example are the same as in the previous case; otherwise the answer is $(2 m-1) S^{2}+2 S H(m-1)$, and the example is provided simply by $(m-1)^{2}$ nonintersecting napkins.  Now we sketch the proof of both estimates for Case 2. We introduce a more appropriate notation based on that from Solution 2. Denote by $a_{-}$and $a_{+}$the number of cells of class $A$ that contain the number which is strictly less than $M$ and strictly greater than $M$, respectively. The numbers $b_{ \pm}, c_{ \pm}$, and $d_{ \pm}$are defined in a similar way. One may notice that the proofs of Claim 1 and Claims 2, 3 lead in fact to the inequalities  $$ m-1 \leq \frac{b_{-}+c_{-}}{2 S H}+\frac{d_{+}}{H^{2}} \quad \text { and } \quad 2 m-1 \leq \frac{a}{S^{2}}+\frac{b_{+}+c_{+}}{2 S H}+\frac{d_{+}}{H^{2}} $$  (to obtain the first one, one needs to look at the big lines instead of the small ones). Combining these inequalities, one may obtain the desired estimates.  These estimates can also be proved in some different ways, e.g. without distinguishing rich and poor cells.


Let $A B C$ be an acute triangle. Let $\omega$ be a circle whose center $L$ lies on the side $B C$. Suppose that $\omega$ is tangent to $A B$ at $B^{\prime}$ and to $A C$ at $C^{\prime}$. Suppose also that the circumcenter $O$ of the triangle $A B C$ lies on the shorter arc $B^{\prime} C^{\prime}$ of $\omega$. Prove that the circumcircle of $A B C$ and $\omega$ meet at two points.

Solution: The point $B^{\prime}$, being the perpendicular foot of $L$, is an interior point of side $A B$. Analogously, $C^{\prime}$ lies in the interior of $A C$. The point $O$ is located inside the triangle $A B^{\prime} C^{\prime}$, hence $\angle C O B<\angle C^{\prime} O B^{\prime}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-45.jpg?height=837&width=674&top_left_y=895&top_left_x=697)  Let $\alpha=\angle C A B$. The angles $\angle C A B$ and $\angle C^{\prime} O B^{\prime}$ are inscribed into the two circles with centers $O$ and $L$, respectively, so $\angle C O B=2 \angle C A B=2 \alpha$ and $2 \angle C^{\prime} O B^{\prime}=360^{\circ}-\angle C^{\prime} L B^{\prime}$. From the kite $A B^{\prime} L C^{\prime}$ we have $\angle C^{\prime} L B^{\prime}=180^{\circ}-\angle C^{\prime} A B^{\prime}=180^{\circ}-\alpha$. Combining these, we get  $$ 2 \alpha=\angle C O B<\angle C^{\prime} O B^{\prime}=\frac{360^{\circ}-\angle C^{\prime} L B^{\prime}}{2}=\frac{360^{\circ}-\left(180^{\circ}-\alpha\right)}{2}=90^{\circ}+\frac{\alpha}{2}, $$  So  $$ \alpha<60^{\circ} \text {. } $$  Let $O^{\prime}$ be the reflection of $O$ in the line $B C$. In the quadrilateral $A B O^{\prime} C$ we have  $$ \angle C O^{\prime} B+\angle C A B=\angle C O B+\angle C A B=2 \alpha+\alpha<180^{\circ}, $$  so the point $O^{\prime}$ is outside the circle $A B C$. Hence, $O$ and $O^{\prime}$ are two points of $\omega$ such that one of them lies inside the circumcircle, while the other one is located outside. Therefore, the two circles intersect.  Comment. There are different ways of reducing the statement of the problem to the case $\alpha<60^{\circ}$. E.g., since the point $O$ lies in the interior of the isosceles triangle $A B^{\prime} C^{\prime}$, we have $O A<A B^{\prime}$. So, if $A B^{\prime} \leq 2 L B^{\prime}$ then $O A<2 L O$, which means that $\omega$ intersects the circumcircle of $A B C$. Hence the only interesting case is $A B^{\prime}>2 L B^{\prime}$, and this condition implies $\angle C A B=2 \angle B^{\prime} A L<2 \cdot 30^{\circ}=60^{\circ}$.


Let $A B C$ be an acute triangle with circumcircle $\omega$. Let $t$ be a tangent line to $\omega$. Let $t_{a}, t_{b}$, and $t_{c}$ be the lines obtained by reflecting $t$ in the lines $B C, C A$, and $A B$, respectively. Show that the circumcircle of the triangle determined by the lines $t_{a}, t_{b}$, and $t_{c}$ is tangent to the circle $\omega$.  To avoid a large case distinction, we will use the notion of oriented angles. Namely, for two lines $\ell$ and $m$, we denote by $\angle(\ell, m)$ the angle by which one may rotate $\ell$ anticlockwise to obtain a line parallel to $m$. Thus, all oriented angles are considered modulo $180^{\circ}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-61.jpg?height=1090&width=1676&top_left_y=820&top_left_x=196)

Solution: Denote by $T$ the point of tangency of $t$ and $\omega$. Let $A^{\prime}=t_{b} \cap t_{c}, B^{\prime}=t_{a} \cap t_{c}$, $C^{\prime}=t_{a} \cap t_{b}$. Introduce the point $A^{\prime \prime}$ on $\omega$ such that $T A=A A^{\prime \prime}\left(A^{\prime \prime} \neq T\right.$ unless $T A$ is a diameter). Define the points $B^{\prime \prime}$ and $C^{\prime \prime}$ in a similar way.  Since the points $C$ and $B$ are the midpoints of arcs $T C^{\prime \prime}$ and $T B^{\prime \prime}$, respectively, we have  $$ \begin{aligned} \angle\left(t, B^{\prime \prime} C^{\prime \prime}\right) & =\angle\left(t, T C^{\prime \prime}\right)+\angle\left(T C^{\prime \prime}, B^{\prime \prime} C^{\prime \prime}\right)=2 \angle(t, T C)+2 \angle\left(T C^{\prime \prime}, B C^{\prime \prime}\right) \\ & =2(\angle(t, T C)+\angle(T C, B C))=2 \angle(t, B C)=\angle\left(t, t_{a}\right) . \end{aligned} $$  It follows that $t_{a}$ and $B^{\prime \prime} C^{\prime \prime}$ are parallel. Similarly, $t_{b} \| A^{\prime \prime} C^{\prime \prime}$ and $t_{c} \| A^{\prime \prime} B^{\prime \prime}$. Thus, either the triangles $A^{\prime} B^{\prime} C^{\prime}$ and $A^{\prime \prime} B^{\prime \prime} C^{\prime \prime}$ are homothetic, or they are translates of each other. Now we will prove that they are in fact homothetic, and that the center $K$ of the homothety belongs to $\omega$. It would then follow that their circumcircles are also homothetic with respect to $K$ and are therefore tangent at this point, as desired.  We need the two following claims.  Claim 1. The point of intersection $X$ of the lines $B^{\prime \prime} C$ and $B C^{\prime \prime}$ lies on $t_{a}$.  Proof. Actually, the points $X$ and $T$ are symmetric about the line $B C$, since the lines $C T$ and $C B^{\prime \prime}$ are symmetric about this line, as are the lines $B T$ and $B C^{\prime \prime}$.  Claim 2. The point of intersection $I$ of the lines $B B^{\prime}$ and $C C^{\prime}$ lies on the circle $\omega$.  Proof. We consider the case that $t$ is not parallel to the sides of $A B C$; the other cases may be regarded as limit cases. Let $D=t \cap B C, E=t \cap A C$, and $F=t \cap A B$.  Due to symmetry, the line $D B$ is one of the angle bisectors of the lines $B^{\prime} D$ and $F D$; analogously, the line $F B$ is one of the angle bisectors of the lines $B^{\prime} F$ and $D F$. So $B$ is either the incenter or one of the excenters of the triangle $B^{\prime} D F$. In any case we have $\angle(B D, D F)+\angle(D F, F B)+$ $\angle\left(B^{\prime} B, B^{\prime} D\right)=90^{\circ}$, so  $$ \angle\left(B^{\prime} B, B^{\prime} C^{\prime}\right)=\angle\left(B^{\prime} B, B^{\prime} D\right)=90^{\circ}-\angle(B C, D F)-\angle(D F, B A)=90^{\circ}-\angle(B C, A B) \text {. } $$  Analogously, we get $\angle\left(C^{\prime} C, B^{\prime} C^{\prime}\right)=90^{\circ}-\angle(B C, A C)$. Hence,  $$ \angle(B I, C I)=\angle\left(B^{\prime} B, B^{\prime} C^{\prime}\right)+\angle\left(B^{\prime} C^{\prime}, C^{\prime} C\right)=\angle(B C, A C)-\angle(B C, A B)=\angle(A B, A C), $$  which means exactly that the points $A, B, I, C$ are concyclic.  Now we can complete the proof. Let $K$ be the second intersection point of $B^{\prime} B^{\prime \prime}$ and $\omega$. Applying PASCAL's theorem to hexagon $K B^{\prime \prime} C I B C^{\prime \prime}$ we get that the points $B^{\prime}=K B^{\prime \prime} \cap I B$ and $X=B^{\prime \prime} C \cap B C^{\prime \prime}$ are collinear with the intersection point $S$ of $C I$ and $C^{\prime \prime} K$. So $S=$ $C I \cap B^{\prime} X=C^{\prime}$, and the points $C^{\prime}, C^{\prime \prime}, K$ are collinear. Thus $K$ is the intersection point of $B^{\prime} B^{\prime \prime}$ and $C^{\prime} C^{\prime \prime}$ which implies that $K$ is the center of the homothety mapping $A^{\prime} B^{\prime} C^{\prime}$ to $A^{\prime \prime} B^{\prime \prime} C^{\prime \prime}$, and it belongs to $\omega$.


Solution: Define the points $T, A^{\prime}, B^{\prime}$, and $C^{\prime}$ in the same way as in the previous solution. Let $X, Y$, and $Z$ be the symmetric images of $T$ about the lines $B C, C A$, and $A B$, respectively. Note that the projections of $T$ on these lines form a Simson line of $T$ with respect to $A B C$, therefore the points $X, Y, Z$ are also collinear. Moreover, we have $X \in B^{\prime} C^{\prime}, Y \in C^{\prime} A^{\prime}$, $Z \in A^{\prime} B^{\prime}$.  Denote $\alpha=\angle(t, T C)=\angle(B T, B C)$. Using the symmetry in the lines $A C$ and $B C$, we get  $$ \angle(B C, B X)=\angle(B T, B C)=\alpha \quad \text { and } \quad \angle\left(X C, X C^{\prime}\right)=\angle(t, T C)=\angle\left(Y C, Y C^{\prime}\right)=\alpha . $$  Since $\angle\left(X C, X C^{\prime}\right)=\angle\left(Y C, Y C^{\prime}\right)$, the points $X, Y, C, C^{\prime}$ lie on some circle $\omega_{c}$. Define the circles $\omega_{a}$ and $\omega_{b}$ analogously. Let $\omega^{\prime}$ be the circumcircle of triangle $A^{\prime} B^{\prime} C^{\prime}$.  Now, applying Miquel's theorem to the four lines $A^{\prime} B^{\prime}, A^{\prime} C^{\prime}, B^{\prime} C^{\prime}$, and $X Y$, we obtain that the circles $\omega^{\prime}, \omega_{a}, \omega_{b}, \omega_{c}$ intersect at some point $K$. We will show that $K$ lies on $\omega$, and that the tangent lines to $\omega$ and $\omega^{\prime}$ at this point coincide; this implies the problem statement.  Due to symmetry, we have $X B=T B=Z B$, so the point $B$ is the midpoint of one of the $\operatorname{arcs} X Z$ of circle $\omega_{b}$. Therefore $\angle(K B, K X)=\angle(X Z, X B)$. Analogously, $\angle(K X, K C)=$ $\angle(X C, X Y)$. Adding these equalities and using the symmetry in the line $B C$ we get  $$ \angle(K B, K C)=\angle(X Z, X B)+\angle(X C, X Z)=\angle(X C, X B)=\angle(T B, T C) . $$  Therefore, $K$ lies on $\omega$.  Next, let $k$ be the tangent line to $\omega$ at $K$. We have  $$ \begin{aligned} \angle\left(k, K C^{\prime}\right) & =\angle(k, K C)+\angle\left(K C, K C^{\prime}\right)=\angle(K B, B C)+\angle\left(X C, X C^{\prime}\right) \\ & =(\angle(K B, B X)-\angle(B C, B X))+\alpha=\angle\left(K B^{\prime}, B^{\prime} X\right)-\alpha+\alpha=\angle\left(K B^{\prime}, B^{\prime} C^{\prime}\right), \end{aligned} $$  which means exactly that $k$ is tangent to $\omega^{\prime}$.  ![](https://cdn.mathpix.com/cropped/2024_04_17_481ddb3576adc2313a2eg-63.jpg?height=1165&width=1219&top_left_y=1185&top_left_x=424)  Comment. There exist various solutions combining the ideas from the two solutions presented above. For instance, one may define the point $X$ as the reflection of $T$ with respect to the line $B C$, and then introduce the point $K$ as the second intersection point of the circumcircles of $B B^{\prime} X$ and $C C^{\prime} X$. Using the fact that $B B^{\prime}$ and $C C^{\prime}$ are the bisectors of $\angle\left(A^{\prime} B^{\prime}, B^{\prime} C^{\prime}\right)$ and $\angle\left(A^{\prime} C^{\prime}, B^{\prime} C^{\prime}\right)$ one can show successively that $K \in \omega, K \in \omega^{\prime}$, and that the tangents to $\omega$ and $\omega^{\prime}$ at $K$ coincide.


For each positive integer $k$, let $t(k)$ be the largest odd divisor of $k$. Determine all positive integers $a$ for which there exists a positive integer $n$ such that all the differences  $$ t(n+a)-t(n), \quad t(n+a+1)-t(n+1), \quad \ldots, \quad t(n+2 a-1)-t(n+a-1) $$  are divisible by 4 .  Answer. $a=1,3$, or 5 .

Solution: A pair $(a, n)$ satisfying the condition of the problem will be called a winning pair. It is straightforward to check that the pairs $(1,1),(3,1)$, and $(5,4)$ are winning pairs.  Now suppose that $a$ is a positive integer not equal to 1,3 , and 5 . We will show that there are no winning pairs $(a, n)$ by distinguishing three cases.  Case 1: $a$ is even. In this case we have $a=2^{\alpha} d$ for some positive integer $\alpha$ and some odd $d$. Since $a \geq 2^{\alpha}$, for each positive integer $n$ there exists an $i \in\{0,1, \ldots, a-1\}$ such that $n+i=2^{\alpha-1} e$, where $e$ is some odd integer. Then we have $t(n+i)=t\left(2^{\alpha-1} e\right)=e$ and  $$ t(n+a+i)=t\left(2^{\alpha} d+2^{\alpha-1} e\right)=2 d+e \equiv e+2 \quad(\bmod 4) . $$  So we get $t(n+i)-t(n+a+i) \equiv 2(\bmod 4)$, and $(a, n)$ is not a winning pair.  Case 2: $a$ is odd and $a>8$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, a-5\}$ such that $n+i=2 d$ for some odd $d$. We get  $$ t(n+i)=d \not \equiv d+2=t(n+i+4) \quad(\bmod 4) $$  and  $$ t(n+a+i)=n+a+i \equiv n+a+i+4=t(n+a+i+4) \quad(\bmod 4) $$  Therefore, the integers $t(n+a+i)-t(n+i)$ and $t(n+a+i+4)-t(n+i+4)$ cannot be both divisible by 4 , and therefore there are no winning pairs in this case.  Case 3: $a=7$. For each positive integer $n$, there exists an $i \in\{0,1, \ldots, 6\}$ such that $n+i$ is either of the form $8 k+3$ or of the form $8 k+6$, where $k$ is a nonnegative integer. But we have  $$ t(8 k+3) \equiv 3 \not \equiv 1 \equiv 4 k+5=t(8 k+3+7) \quad(\bmod 4) $$  and  $$ t(8 k+6)=4 k+3 \equiv 3 \not \equiv 1 \equiv t(8 k+6+7) \quad(\bmod 4) . $$  Hence, there are no winning pairs of the form $(7, n)$.