Let $n$ be a fixed positive integer. Find the maximum possible value of  $$ \sum_{1 \leqslant r<s \leqslant 2 n}(s-r-n) x_{r} x_{s}, $$  where $-1 \leqslant x_{i} \leqslant 1$ for all $i=1,2, \ldots, 2 n$. (Austria) Answer. $n(n-1)$.

Solution: Let $Z$ be the expression to be maximized. Since this expression is linear in every variable $x_{i}$ and $-1 \leqslant x_{i} \leqslant 1$, the maximum of $Z$ will be achieved when $x_{i}=-1$ or 1 . Therefore, it suffices to consider only the case when $x_{i} \in\{-1,1\}$ for all $i=1,2, \ldots, 2 n$.  For $i=1,2, \ldots, 2 n$, we introduce auxiliary variables  $$ y_{i}=\sum_{r=1}^{i} x_{r}-\sum_{r=i+1}^{2 n} x_{r} $$  Taking squares of both sides, we have  $$ \begin{aligned} y_{i}^{2} & =\sum_{r=1}^{2 n} x_{r}^{2}+\sum_{r<s \leqslant i} 2 x_{r} x_{s}+\sum_{i<r<s} 2 x_{r} x_{s}-\sum_{r \leqslant i<s} 2 x_{r} x_{s} \\ & =2 n+\sum_{r<s \leqslant i} 2 x_{r} x_{s}+\sum_{i<r<s} 2 x_{r} x_{s}-\sum_{r \leqslant i<s} 2 x_{r} x_{s}, \end{aligned} $$  where the last equality follows from the fact that $x_{r} \in\{-1,1\}$. Notice that for every $r<s$, the coefficient of $x_{r} x_{s}$ in (1) is 2 for each $i=1, \ldots, r-1, s, \ldots, 2 n$, and this coefficient is -2 for each $i=r, \ldots, s-1$. This implies that the coefficient of $x_{r} x_{s}$ in $\sum_{i=1}^{2 n} y_{i}^{2}$ is $2(2 n-s+r)-2(s-r)=$ $4(n-s+r)$. Therefore, summing (1) for $i=1,2, \ldots, 2 n$ yields  $$ \sum_{i=1}^{2 n} y_{i}^{2}=4 n^{2}+\sum_{1 \leqslant r<s \leqslant 2 n} 4(n-s+r) x_{r} x_{s}=4 n^{2}-4 Z $$  Hence, it suffices to find the minimum of the left-hand side. Since $x_{r} \in\{-1,1\}$, we see that $y_{i}$ is an even integer. In addition, $y_{i}-y_{i-1}=2 x_{i}= \pm 2$, and so $y_{i-1}$ and $y_{i}$ are consecutive even integers for every $i=2,3, \ldots, 2 n$. It follows that $y_{i-1}^{2}+y_{i}^{2} \geqslant 4$, which implies  $$ \sum_{i=1}^{2 n} y_{i}^{2}=\sum_{j=1}^{n}\left(y_{2 j-1}^{2}+y_{2 j}^{2}\right) \geqslant 4 n $$  Combining (2) and (3), we get  $$ 4 n \leqslant \sum_{i=1}^{2 n} y_{i}^{2}=4 n^{2}-4 Z $$  Hence, $Z \leqslant n(n-1)$. If we set $x_{i}=1$ for odd indices $i$ and $x_{i}=-1$ for even indices $i$, then we obtain equality in (3) (and thus in (4)). Therefore, the maximum possible value of $Z$ is $n(n-1)$, as desired.  Comment 1. $Z=n(n-1)$ can be achieved by several other examples. In particular, $x_{i}$ needs not be $\pm 1$. For instance, setting $x_{i}=(-1)^{i}$ for all $2 \leqslant i \leqslant 2 n$, we find that the coefficient of $x_{1}$ in $Z$ is 0 . Therefore, $x_{1}$ can be chosen arbitrarily in the interval $[-1,1]$.  Nevertheless, if $x_{i} \in\{-1,1\}$ for all $i=1,2, \ldots, 2 n$, then the equality $Z=n(n-1)$ holds only when $\left(y_{1}, y_{2}, \ldots, y_{2 n}\right)=(0, \pm 2,0, \pm 2, \ldots, 0, \pm 2)$ or $( \pm 2,0, \pm 2,0, \ldots, \pm 2,0)$. In each case, we can reconstruct $x_{i}$ accordingly. The sum $\sum_{i=1}^{2 n} x_{i}$ in the optimal cases needs not be 0 , but it must equal 0 or $\pm 2$.  Comment 2. Several variations in setting up the auxiliary variables are possible. For instance, one may let $x_{2 n+i}=-x_{i}$ and $y_{i}^{\prime}=x_{i}+x_{i+1}+\cdots+x_{i+n-1}$ for any $1 \leqslant i \leqslant 2 n$. Similarly to Solution 1 , we obtain $Y:=y_{1}^{\prime 2}+y_{2}^{\prime 2}+\cdots+y_{2 n}^{\prime 2}=2 n^{2}-2 Z$. Then, it suffices to show that $Y \geqslant 2 n$. If $n$ is odd, then each $y_{i}^{\prime}$ is odd, and so $y_{i}^{\prime 2} \geqslant 1$. If $n$ is even, then each $y_{i}^{\prime}$ is even. We can check that at least one of $y_{i}^{\prime}, y_{i+1}^{\prime}, y_{n+i}^{\prime}$, and $y_{n+i+1}^{\prime}$ is nonzero, so that $y_{i}^{\prime 2}+y_{i+1}^{\prime 2}+y_{n+i}^{\prime 2}+y_{n+i+1}^{\prime 2} \geqslant 4$; summing these up for $i=1,3, \ldots, n-1$ yields $Y \geqslant 2 n$.


Solution: We present a different method of obtaining the bound $Z \leqslant n(n-1)$. As in the previous solution, we reduce the problem to the case $x_{i} \in\{-1,1\}$. For brevity, we use the notation $[2 n]=\{1,2, \ldots, 2 n\}$.  Consider any $x_{1}, x_{2}, \ldots, x_{2 n} \in\{-1,1\}$. Let  $$ A=\left\{i \in[2 n]: x_{i}=1\right\} \quad \text { and } \quad B=\left\{i \in[2 n]: x_{i}=-1\right\} $$  For any subsets $X$ and $Y$ of [2n] we define  $$ e(X, Y)=\sum_{r<s, r \in X, s \in Y}(s-r-n) $$  One may observe that  $$ e(A, A)+e(A, B)+e(B, A)+e(B, B)=e([2 n],[2 n])=\sum_{1 \leqslant r<s \leqslant 2 n}(s-r-n)=-\frac{(n-1) n(2 n-1)}{3} . $$  Therefore, we have  $$ Z=e(A, A)-e(A, B)-e(B, A)+e(B, B)=2(e(A, A)+e(B, B))+\frac{(n-1) n(2 n-1)}{3} . $$  Thus, we need to maximize $e(A, A)+e(B, B)$, where $A$ and $B$ form a partition of [2n]. Due to the symmetry, we may assume that $|A|=n-p$ and $|B|=n+p$, where $0 \leqslant p \leqslant n$. From now on, we fix the value of $p$ and find an upper bound for $Z$ in terms of $n$ and $p$.  Let $a_{1}<a_{2}<\cdots<a_{n-p}$ and $b_{1}<b_{2}<\cdots<b_{n+p}$ list all elements of $A$ and $B$, respectively. Then  $$ e(A, A)=\sum_{1 \leqslant i<j \leqslant n-p}\left(a_{j}-a_{i}-n\right)=\sum_{i=1}^{n-p}(2 i-1-n+p) a_{i}-\binom{n-p}{2} \cdot n $$  and similarly  $$ e(B, B)=\sum_{i=1}^{n+p}(2 i-1-n-p) b_{i}-\binom{n+p}{2} \cdot n $$  Thus, now it suffices to maximize the value of  $$ M=\sum_{i=1}^{n-p}(2 i-1-n+p) a_{i}+\sum_{i=1}^{n+p}(2 i-1-n-p) b_{i} $$  In order to get an upper bound, we will apply the rearrangement inequality to the sequence $a_{1}, a_{2}, \ldots, a_{n-p}, b_{1}, b_{2}, \ldots, b_{n+p}$ (which is a permutation of $1,2, \ldots, 2 n$ ), together with the sequence of coefficients of these numbers in (8). The coefficients of $a_{i}$ form the sequence  $$ n-p-1, n-p-3, \ldots, 1-n+p $$  and those of $b_{i}$ form the sequence  $$ n+p-1, n+p-3, \ldots, 1-n-p $$  Altogether, these coefficients are, in descending order:  - $n+p+1-2 i$, for $i=1,2, \ldots, p$; - $n-p+1-2 i$, counted twice, for $i=1,2, \ldots, n-p$; and - $-(n+p+1-2 i)$, for $i=p, p-1, \ldots, 1$.  Thus, the rearrangement inequality yields  $$ \begin{aligned} & M \leqslant \sum_{i=1}^{p}(n+p+1-2 i)(2 n+1-i) \\ & \quad+\sum_{i=1}^{n-p}(n-p+1-2 i)((2 n+2-p-2 i)+(2 n+1-p-2 i)) \\ & \quad-\sum_{i=1}^{p}(n+p+1-2 i) i \end{aligned} $$  Finally, combining the information from (5), (6), (7), and (9), we obtain  $$ \begin{aligned} Z \leqslant & \frac{(n-1) n(2 n-1)}{3}-2 n\left(\binom{n-p}{2}+\binom{n+p}{2}\right) \\ & +2 \sum_{i=1}^{p}(n+p+1-2 i)(2 n+1-2 i)+2 \sum_{i=1}^{n-p}(n-p+1-2 i)(4 n-2 p+3-4 i), \end{aligned} $$  which can be simplified to  $$ Z \leqslant n(n-1)-\frac{2}{3} p(p-1)(p+1) $$  Since $p$ is a nonnegative integer, this yields $Z \leqslant n(n-1)$.


Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying the equation  $$ f(x+f(x+y))+f(x y)=x+f(x+y)+y f(x) $$  for all real numbers $x$ and $y$. (Albania) Answer. There are two such functions, namely the identity function and $x \mapsto 2-x$.

Solution: Clearly, each of the functions $x \mapsto x$ and $x \mapsto 2-x$ satisfies (1). It suffices now to show that they are the only solutions to the problem.  Suppose that $f$ is any function satisfying (1). Then setting $y=1$ in (1), we obtain  $$ f(x+f(x+1))=x+f(x+1) $$  in other words, $x+f(x+1)$ is a fixed point of $f$ for every $x \in \mathbb{R}$. We distinguish two cases regarding the value of $f(0)$. Case 1. $\quad f(0) \neq 0$. By letting $x=0$ in (1), we have  $$ f(f(y))+f(0)=f(y)+y f(0) $$  So, if $y_{0}$ is a fixed point of $f$, then substituting $y=y_{0}$ in the above equation we get $y_{0}=1$. Thus, it follows from (2) that $x+f(x+1)=1$ for all $x \in \mathbb{R}$. That is, $f(x)=2-x$ for all $x \in \mathbb{R}$. Case 2. $\quad f(0)=0$.  By letting $y=0$ and replacing $x$ by $x+1$ in (1), we obtain  $$ f(x+f(x+1)+1)=x+f(x+1)+1 $$  From (1), the substitution $x=1$ yields  $$ f(1+f(y+1))+f(y)=1+f(y+1)+y f(1) $$  By plugging $x=-1$ into (2), we see that $f(-1)=-1$. We then plug $y=-1$ into (4) and deduce that $f(1)=1$. Hence, (4) reduces to  $$ f(1+f(y+1))+f(y)=1+f(y+1)+y $$  Accordingly, if both $y_{0}$ and $y_{0}+1$ are fixed points of $f$, then so is $y_{0}+2$. Thus, it follows from (2) and (3) that $x+f(x+1)+2$ is a fixed point of $f$ for every $x \in \mathbb{R}$; i.e.,  $$ f(x+f(x+1)+2)=x+f(x+1)+2 $$  Replacing $x$ by $x-2$ simplifies the above equation to  $$ f(x+f(x-1))=x+f(x-1) $$  On the other hand, we set $y=-1$ in (1) and get  $$ f(x+f(x-1))=x+f(x-1)-f(x)-f(-x) $$  Therefore, $f(-x)=-f(x)$ for all $x \in \mathbb{R}$. Finally, we substitute $(x, y)$ by $(-1,-y)$ in (1) and use the fact that $f(-1)=-1$ to get  $$ f(-1+f(-y-1))+f(y)=-1+f(-y-1)+y $$  Since $f$ is an odd function, the above equation becomes  $$ -f(1+f(y+1))+f(y)=-1-f(y+1)+y $$  By adding this equation to (5), we conclude that $f(y)=y$ for all $y \in \mathbb{R}$.


Let $2 \mathbb{Z}+1$ denote the set of odd integers. Find all functions $f: \mathbb{Z} \rightarrow 2 \mathbb{Z}+1$ satisfying  $$ f(x+f(x)+y)+f(x-f(x)-y)=f(x+y)+f(x-y) $$  for every $x, y \in \mathbb{Z}$.  Answer. Fix an odd positive integer $d$, an integer $k$, and odd integers $\ell_{0}, \ell_{1}, \ldots, \ell_{d-1}$. Then the function defined as  $$ f(m d+i)=2 k m d+\ell_{i} d \quad(m \in \mathbb{Z}, \quad i=0,1, \ldots, d-1) $$  satisfies the problem requirements, and these are all such functions.

Solution: Throughout the solution, all functions are assumed to map integers to integers. For any function $g$ and any nonzero integer $t$, define  $$ \Delta_{t} g(x)=g(x+t)-g(x) $$  For any nonzero integers $a$ and $b$, notice that $\Delta_{a} \Delta_{b} g=\Delta_{b} \Delta_{a} g$. Moreover, if $\Delta_{a} g=0$ and $\Delta_{b} g=0$, then $\Delta_{a+b} g=0$ and $\Delta_{a t} g=0$ for all nonzero integers $t$. We say that $g$ is $t$-quasiperiodic if $\Delta_{t} g$ is a constant function (in other words, if $\Delta_{1} \Delta_{t} g=0$, or $\Delta_{1} g$ is $t$-periodic). In this case, we call $t$ a quasi-period of $g$. We say that $g$ is quasi-periodic if it is $t$-quasi-periodic for some nonzero integer $t$.  Notice that a quasi-period of $g$ is a period of $\Delta_{1} g$. So if $g$ is quasi-periodic, then its minimal positive quasi-period $t$ divides all its quasi-periods.  We now assume that $f$ satisfies (1). First, by setting $a=x+y$, the problem condition can be rewritten as  $$ \Delta_{f(x)} f(a)=\Delta_{f(x)} f(2 x-a-f(x)) \quad \text { for all } x, a \in \mathbb{Z} $$  Let $b$ be an arbitrary integer and let $k$ be an arbitrary positive integer. Applying (2) when $a$ is substituted by $b, b+f(x), \ldots, b+(k-1) f(x)$ and summing up all these equations, we get  $$ \Delta_{k f(x)} f(b)=\Delta_{k f(x)} f(2 x-b-k f(x)) $$  Notice that a similar argument works when $k$ is negative, so that  $$ \Delta_{M} f(b)=\Delta_{M} f(2 x-b-M) \quad \text { for any nonzero integer } M \text { such that } f(x) \mid M $$  We now prove two lemmas. Lemma 1. For any distinct integers $x$ and $y$, the function $\Delta_{\operatorname{lcm}(f(x), f(y))} f$ is $2(y-x)$-periodic. Proof. Denote $L=\operatorname{lcm}(f(x), f(y))$. Applying (3) twice, we obtain  $$ \Delta_{L} f(b)=\Delta_{L} f(2 x-b-L)=\Delta_{L} f(2 y-(b+2(y-x))-L)=\Delta_{L} f(b+2(y-x)) $$  Thus, the function $\Delta_{L} f$ is $2(y-x)$-periodic, as required. Lemma 2. Let $g$ be a function. If $t$ and $s$ are nonzero integers such that $\Delta_{t s} g=0$ and $\Delta_{t} \Delta_{t} g=0$, then $\Delta_{t} g=0$. Proof. Assume, without loss of generality, that $s$ is positive. Let $a$ be an arbitrary integer. Since $\Delta_{t} \Delta_{t} g=0$, we have  $$ \Delta_{t} g(a)=\Delta_{t} g(a+t)=\cdots=\Delta_{t} g(a+(s-1) t) $$  The sum of these $s$ equal numbers is $\Delta_{t s} g(a)=0$, so each of them is zero, as required.  We now return to the solution. Step 1. We prove that $f$ is quasi-periodic. Let $Q=\operatorname{lcm}(f(0), f(1))$. Applying Lemma 1, we get that the function $g=\Delta_{Q} f$ is 2-periodic. In other words, the values of $g$ are constant on even numbers and on odd numbers separately. Moreover, setting $M=Q$ and $x=b=0$ in (3), we get $g(0)=g(-Q)$. Since 0 and $-Q$ have different parities, the value of $g$ at even numbers is the same as that at odd numbers. Thus, $g$ is constant, which means that $Q$ is a quasi-period of $f$. Step 2. Denote the minimal positive quasi-period of $f$ by $T$. We prove that $T \mid f(x)$ for all integers $x$.  Since an odd number $Q$ is a quasi-period of $f$, the number $T$ is also odd. Now suppose, to the contrary, that there exist an odd prime $p$, a positive integer $\alpha$, and an integer $u$ such that $p^{\alpha} \mid T$ but $p^{\alpha} \nmid f(u)$. Setting $x=u$ and $y=0$ in (1), we have $2 f(u)=f(u+f(u))+f(u-f(u))$, so $p^{\alpha}$ does not divide the value of $f$ at one of the points $u+f(u)$ or $u-f(u)$. Denote this point by $v$.  Let $L=\operatorname{lcm}(f(u), f(v))$. Since $|u-v|=f(u)$, from Lemma 1 we get $\Delta_{2 f(u)} \Delta_{L} f=0$. Hence the function $\Delta_{L} f$ is $2 f(u)$-periodic as well as $T$-periodic, so it is $\operatorname{gcd}(T, 2 f(u))$-periodic, or $\Delta_{\operatorname{gcd}(T, 2 f(u))} \Delta_{L} f=0$. Similarly, observe that the function $\Delta_{\operatorname{gcd}(T, 2 f(u))} f$ is $L$-periodic as well as $T$-periodic, so we may conclude that $\Delta_{\operatorname{gcd}(T, L)} \Delta_{\operatorname{gcd}(T, 2 f(u))} f=0$. Since $p^{\alpha} \nmid L$, both $\operatorname{gcd}(T, 2 f(u))$ and $\operatorname{gcd}(T, L)$ divide $T / p$. We thus obtain $\Delta_{T / p} \Delta_{T / p} f=0$, which yields  $$ \Delta_{T / p} \Delta_{T / p} \Delta_{1} f=0 $$  Since $\Delta_{T} \Delta_{1} f=0$, we can apply Lemma 2 to the function $\Delta_{1} f$, obtaining $\Delta_{T / p} \Delta_{1} f=0$. However, this means that $f$ is $(T / p)$-quasi-periodic, contradicting the minimality of $T$. Our claim is proved.


Let $n$ be a fixed integer with $n \geqslant 2$. We say that two polynomials $P$ and $Q$ with real coefficients are block-similar if for each $i \in\{1,2, \ldots, n\}$ the sequences  $$ \begin{aligned} & P(2015 i), P(2015 i-1), \ldots, P(2015 i-2014) \quad \text { and } \\ & Q(2015 i), Q(2015 i-1), \ldots, Q(2015 i-2014) \end{aligned} $$  are permutations of each other. (a) Prove that there exist distinct block-similar polynomials of degree $n+1$. (b) Prove that there do not exist distinct block-similar polynomials of degree $n$. (Canada)

Solution: For convenience, we set $k=2015=2 \ell+1$. Part (a). Consider the following polynomials of degree $n+1$ :  $$ P(x)=\prod_{i=0}^{n}(x-i k) \quad \text { and } \quad Q(x)=\prod_{i=0}^{n}(x-i k-1) $$  Since $Q(x)=P(x-1)$ and $P(0)=P(k)=P(2 k)=\cdots=P(n k)$, these polynomials are block-similar (and distinct).  Part (b). For every polynomial $F(x)$ and every nonnegative integer $m$, define $\Sigma_{F}(m)=$ $\sum_{i=1}^{m} F(i)$; in particular, $\Sigma_{F}(0)=0$. It is well-known that for every nonnegative integer $d$ the sum $\sum_{i=1}^{m} i^{d}$ is a polynomial in $m$ of degree $d+1$. Thus $\Sigma_{F}$ may also be regarded as a real polynomial of degree $\operatorname{deg} F+1$ (with the exception that if $F=0$, then $\Sigma_{F}=0$ as well). This allows us to consider the values of $\Sigma_{F}$ at all real points (where the initial definition does not apply).  Assume for the sake of contradiction that there exist two distinct block-similar polynomials $P(x)$ and $Q(x)$ of degree $n$. Then both polynomials $\Sigma_{P-Q}(x)$ and $\Sigma_{P^{2}-Q^{2}}(x)$ have roots at the points $0, k, 2 k, \ldots, n k$. This motivates the following lemma, where we use the special polynomial  $$ T(x)=\prod_{i=0}^{n}(x-i k) $$  Lemma. Assume that $F(x)$ is a nonzero polynomial such that $0, k, 2 k, \ldots, n k$ are among the roots of the polynomial $\Sigma_{F}(x)$. Then $\operatorname{deg} F \geqslant n$, and there exists a polynomial $G(x)$ such that $\operatorname{deg} G=\operatorname{deg} F-n$ and $F(x)=T(x) G(x)-T(x-1) G(x-1)$. Proof. If $\operatorname{deg} F<n$, then $\Sigma_{F}(x)$ has at least $n+1$ roots, while its degree is less than $n+1$. Therefore, $\Sigma_{F}(x)=0$ and hence $F(x)=0$, which is impossible. Thus $\operatorname{deg} F \geqslant n$.  The lemma condition yields that $\Sigma_{F}(x)=T(x) G(x)$ for some polynomial $G(x)$ such that $\operatorname{deg} G=\operatorname{deg} \Sigma_{F}-(n+1)=\operatorname{deg} F-n$.  Now, let us define $F_{1}(x)=T(x) G(x)-T(x-1) G(x-1)$. Then for every positive integer $n$ we have  $$ \Sigma_{F_{1}}(n)=\sum_{i=1}^{n}(T(x) G(x)-T(x-1) G(x-1))=T(n) G(n)-T(0) G(0)=T(n) G(n)=\Sigma_{F}(n) $$  so the polynomial $\Sigma_{F-F_{1}}(x)=\Sigma_{F}(x)-\Sigma_{F_{1}}(x)$ has infinitely many roots. This means that this polynomial is zero, which in turn yields $F(x)=F_{1}(x)$, as required.  First, we apply the lemma to the nonzero polynomial $R_{1}(x)=P(x)-Q(x)$. Since the degree of $R_{1}(x)$ is at most $n$, we conclude that it is exactly $n$. Moreover, $R_{1}(x)=\alpha \cdot(T(x)-T(x-1))$ for some nonzero constant $\alpha$.  Our next aim is to prove that the polynomial $S(x)=P(x)+Q(x)$ is constant. Assume the contrary. Then, notice that the polynomial $R_{2}(x)=P(x)^{2}-Q(x)^{2}=R_{1}(x) S(x)$ is also nonzero and satisfies the lemma condition. Since $n<\operatorname{deg} R_{1}+\operatorname{deg} S=\operatorname{deg} R_{2} \leqslant 2 n$, the lemma yields  $$ R_{2}(x)=T(x) G(x)-T(x-1) G(x-1) $$  with some polynomial $G(x)$ with $0<\operatorname{deg} G \leqslant n$. Since the polynomial $R_{1}(x)=\alpha(T(x)-T(x-1))$ divides the polynomial  $$ R_{2}(x)=T(x)(G(x)-G(x-1))+G(x-1)(T(x)-T(x-1)) $$  we get $R_{1}(x) \mid T(x)(G(x)-G(x-1))$. On the other hand,  $$ \operatorname{gcd}\left(T(x), R_{1}(x)\right)=\operatorname{gcd}(T(x), T(x)-T(x-1))=\operatorname{gcd}(T(x), T(x-1))=1 $$  since both $T(x)$ and $T(x-1)$ are the products of linear polynomials, and their roots are distinct. Thus $R_{1}(x) \mid G(x)-G(x-1)$. However, this is impossible since $G(x)-G(x-1)$ is a nonzero polynomial of degree less than $n=\operatorname{deg} R_{1}$.  Thus, our assumption is wrong, and $S(x)$ is a constant polynomial, say $S(x)=\beta$. Notice that the polynomials $(2 P(x)-\beta) / \alpha$ and $(2 Q(x)-\beta) / \alpha$ are also block-similar and distinct. So we may replace the initial polynomials by these ones, thus obtaining two block-similar polynomials $P(x)$ and $Q(x)$ with $P(x)=-Q(x)=T(x)-T(x-1)$. It remains to show that this is impossible.  For every $i=1,2 \ldots, n$, the values $T(i k-k+1)$ and $T(i k-1)$ have the same sign. This means that the values $P(i k-k+1)=T(i k-k+1)$ and $P(i k)=-T(i k-1)$ have opposite signs, so $P(x)$ has a root in each of the $n$ segments $[i k-k+1, i k]$. Since $\operatorname{deg} P=n$, it must have exactly one root in each of them.  Thus, the sequence $P(1), P(2), \ldots, P(k)$ should change sign exactly once. On the other hand, since $P(x)$ and $-P(x)$ are block-similar, this sequence must have as many positive terms as negative ones. Since $k=2 \ell+1$ is odd, this shows that the middle term of the sequence above must be zero, so $P(\ell+1)=0$, or $T(\ell+1)=T(\ell)$. However, this is not true since  $$ |T(\ell+1)|=|\ell+1| \cdot|\ell| \cdot \prod_{i=2}^{n}|\ell+1-i k|<|\ell| \cdot|\ell+1| \cdot \prod_{i=2}^{n}|\ell-i k|=|T(\ell)| $$  where the strict inequality holds because $n \geqslant 2$. We come to the final contradiction.  Comment 1. In the solution above, we used the fact that $k>1$ is odd. One can modify the arguments of the last part in order to work for every (not necessarily odd) sufficiently large value of $k$; namely, when $k$ is even, one may show that the sequence $P(1), P(2), \ldots, P(k)$ has different numbers of positive and negative terms.  On the other hand, the problem statement with $k$ replaced by 2 is false, since the polynomials $P(x)=T(x)-T(x-1)$ and $Q(x)=T(x-1)-T(x)$ are block-similar in this case, due to the fact that $P(2 i-1)=-P(2 i)=Q(2 i)=-Q(2 i-1)=T(2 i-1)$ for all $i=1,2, \ldots, n$. Thus, every complete solution should use the relation $k>2$.  One may easily see that the condition $n \geqslant 2$ is also substantial, since the polynomials $x$ and $k+1-x$ become block-similar if we set $n=1$.  It is easily seen from the solution that the result still holds if we assume that the polynomials have degree at most $n$.


Solution: We provide an alternative argument for part (b). Assume again that there exist two distinct block-similar polynomials $P(x)$ and $Q(x)$ of degree $n$. Let $R(x)=P(x)-Q(x)$ and $S(x)=P(x)+Q(x)$. For brevity, we also denote the segment $[(i-1) k+1, i k]$ by $I_{i}$, and the set $\{(i-1) k+1,(i-1) k+2, \ldots, i k\}$ of all integer points in $I_{i}$ by $Z_{i}$. Step 1. We prove that $R(x)$ has exactly one root in each segment $I_{i}, i=1,2, \ldots, n$, and all these roots are simple.  Indeed, take any $i \in\{1,2, \ldots, n\}$ and choose some points $p^{-}, p^{+} \in Z_{i}$ so that  $$ P\left(p^{-}\right)=\min _{x \in Z_{i}} P(x) \quad \text { and } \quad P\left(p^{+}\right)=\max _{x \in Z_{i}} P(x) $$  Since the sequences of values of $P$ and $Q$ in $Z_{i}$ are permutations of each other, we have $R\left(p^{-}\right)=P\left(p^{-}\right)-Q\left(p^{-}\right) \leqslant 0$ and $R\left(p^{+}\right)=P\left(p^{+}\right)-Q\left(p^{+}\right) \geqslant 0$. Since $R(x)$ is continuous, there exists at least one root of $R(x)$ between $p^{-}$and $p^{+}$- thus in $I_{i}$.  So, $R(x)$ has at least one root in each of the $n$ disjoint segments $I_{i}$ with $i=1,2, \ldots, n$. Since $R(x)$ is nonzero and its degree does not exceed $n$, it should have exactly one root in each of these segments, and all these roots are simple, as required.


Let $\mathcal{V}$ be a finite set of points in the plane. We say that $\mathcal{V}$ is balanced if for any two distinct points $A, B \in \mathcal{V}$, there exists a point $C \in \mathcal{V}$ such that $A C=B C$. We say that $\mathcal{V}$ is center-free if for any distinct points $A, B, C \in \mathcal{V}$, there does not exist a point $P \in \mathcal{V}$ such that $P A=P B=P C$. (a) Show that for all $n \geqslant 3$, there exists a balanced set consisting of $n$ points. (b) For which $n \geqslant 3$ does there exist a balanced, center-free set consisting of $n$ points? (Netherlands) Answer for part (b). All odd integers $n \geqslant 3$.

Solution: Part ( $\boldsymbol{a}$ ). Assume that $n$ is odd. Consider a regular $n$-gon. Label the vertices of the $n$-gon as $A_{1}, A_{2}, \ldots, A_{n}$ in counter-clockwise order, and set $\mathcal{V}=\left\{A_{1}, \ldots, A_{n}\right\}$. We check that $\mathcal{V}$ is balanced. For any two distinct vertices $A_{i}$ and $A_{j}$, let $k \in\{1,2, \ldots, n\}$ be the solution of $2 k \equiv i+j(\bmod n)$. Then, since $k-i \equiv j-k(\bmod n)$, we have $A_{i} A_{k}=A_{j} A_{k}$, as required.  Now assume that $n$ is even. Consider a regular $(3 n-6)$-gon, and let $O$ be its circumcenter. Again, label its vertices as $A_{1}, \ldots, A_{3 n-6}$ in counter-clockwise order, and choose $\mathcal{V}=$ $\left\{O, A_{1}, A_{2}, \ldots, A_{n-1}\right\}$. We check that $\mathcal{V}$ is balanced. For any two distinct vertices $A_{i}$ and $A_{j}$, we always have $O A_{i}=O A_{j}$. We now consider the vertices $O$ and $A_{i}$. First note that the triangle $O A_{i} A_{n / 2-1+i}$ is equilateral for all $i \leqslant \frac{n}{2}$. Hence, if $i \leqslant \frac{n}{2}$, then we have $O A_{n / 2-1+i}=A_{i} A_{n / 2-1+i}$; otherwise, if $i>\frac{n}{2}$, then we have $O A_{i-n / 2+1}=A_{i} A_{i-n / 2+1}$. This completes the proof.  An example of such a construction when $n=10$ is shown in Figure 1. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-28.jpg?height=507&width=804&top_left_y=1574&top_left_x=272)  Figure 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-28.jpg?height=600&width=617&top_left_y=1479&top_left_x=1185)  Figure 2  Comment (a). There are many ways to construct an example by placing equilateral triangles in a circle. Here we present one general method.  Let $O$ be the center of a circle and let $A_{1}, B_{1}, \ldots, A_{k}, B_{k}$ be distinct points on the circle such that the triangle $O A_{i} B_{i}$ is equilateral for each $i$. Then $\mathcal{V}=\left\{O, A_{1}, B_{1}, \ldots, A_{k}, B_{k}\right\}$ is balanced. To construct a set of even cardinality, put extra points $C, D, E$ on the circle such that triangles $O C D$ and $O D E$ are equilateral (see Figure 2). Then $\mathcal{V}=\left\{O, A_{1}, B_{1}, \ldots, A_{k}, B_{k}, C, D, E\right\}$ is balanced.  Part (b). We now show that there exists a balanced, center-free set containing $n$ points for all odd $n \geqslant 3$, and that one does not exist for any even $n \geqslant 3$.  If $n$ is odd, then let $\mathcal{V}$ be the set of vertices of a regular $n$-gon. We have shown in part ( $a$ ) that $\mathcal{V}$ is balanced. We claim that $\mathcal{V}$ is also center-free. Indeed, if $P$ is a point such that $P A=P B=P C$ for some three distinct vertices $A, B$ and $C$, then $P$ is the circumcenter of the $n$-gon, which is not contained in $\mathcal{V}$.  Now suppose that $\mathcal{V}$ is a balanced, center-free set of even cardinality $n$. We will derive a contradiction. For a pair of distinct points $A, B \in \mathcal{V}$, we say that a point $C \in \mathcal{V}$ is associated with the pair $\{A, B\}$ if $A C=B C$. Since there are $\frac{n(n-1)}{2}$ pairs of points, there exists a point $P \in \mathcal{V}$ which is associated with at least $\left\lceil\frac{n(n-1)}{2} / n\right\rceil=\frac{n}{2}$ pairs. Note that none of these $\frac{n}{2}$ pairs can contain $P$, so that the union of these $\frac{n}{2}$ pairs consists of at most $n-1$ points. Hence there exist two such pairs that share a point. Let these two pairs be $\{A, B\}$ and $\{A, C\}$. Then $P A=P B=P C$, which is a contradiction.  Comment (b). We can rephrase the argument in graph theoretic terms as follows. Let $\mathcal{V}$ be a balanced, center-free set consisting of $n$ points. For any pair of distinct vertices $A, B \in \mathcal{V}$ and for any $C \in \mathcal{V}$ such that $A C=B C$, draw directed edges $A \rightarrow C$ and $B \rightarrow C$. Then all pairs of vertices generate altogether at least $n(n-1)$ directed edges; since the set is center-free, these edges are distinct. So we must obtain a graph in which any two vertices are connected in both directions. Now, each vertex has exactly $n-1$ incoming edges, which means that $n-1$ is even. Hence $n$ is odd.


For a finite set $A$ of positive integers, we call a partition of $A$ into two disjoint nonempty subsets $A_{1}$ and $A_{2}$ good if the least common multiple of the elements in $A_{1}$ is equal to the greatest common divisor of the elements in $A_{2}$. Determine the minimum value of $n$ such that there exists a set of $n$ positive integers with exactly 2015 good partitions. (Ukraine) Answer. 3024.

Solution: Let $A=\left\{a_{1}, a_{2}, \ldots, a_{n}\right\}$, where $a_{1}<a_{2}<\cdots<a_{n}$. For a finite nonempty set $B$ of positive integers, denote by $\operatorname{lcm} B$ and $\operatorname{gcd} B$ the least common multiple and the greatest common divisor of the elements in $B$, respectively.  Consider any good partition $\left(A_{1}, A_{2}\right)$ of $A$. By definition, $\operatorname{lcm} A_{1}=d=\operatorname{gcd} A_{2}$ for some positive integer $d$. For any $a_{i} \in A_{1}$ and $a_{j} \in A_{2}$, we have $a_{i} \leqslant d \leqslant a_{j}$. Therefore, we have $A_{1}=\left\{a_{1}, a_{2}, \ldots, a_{k}\right\}$ and $A_{2}=\left\{a_{k+1}, a_{k+2}, \ldots, a_{n}\right\}$ for some $k$ with $1 \leqslant k<n$. Hence, each good partition is determined by an element $a_{k}$, where $1 \leqslant k<n$. We call such $a_{k}$ partitioning.  It is convenient now to define $\ell_{k}=\operatorname{lcm}\left(a_{1}, a_{2}, \ldots, a_{k}\right)$ and $g_{k}=\operatorname{gcd}\left(a_{k+1}, a_{k+2}, \ldots, a_{n}\right)$ for $1 \leqslant k \leqslant n-1$. So $a_{k}$ is partitioning exactly when $\ell_{k}=g_{k}$.  We proceed by proving some properties of partitioning elements, using the following claim. Claim. If $a_{k-1}$ and $a_{k}$ are partitioning where $2 \leqslant k \leqslant n-1$, then $g_{k-1}=g_{k}=a_{k}$. Proof. Assume that $a_{k-1}$ and $a_{k}$ are partitioning. Since $\ell_{k-1}=g_{k-1}$, we have $\ell_{k-1} \mid a_{k}$. Therefore, $g_{k}=\ell_{k}=\operatorname{lcm}\left(\ell_{k-1}, a_{k}\right)=a_{k}$, and $g_{k-1}=\operatorname{gcd}\left(a_{k}, g_{k}\right)=a_{k}$, as desired. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-30.jpg?height=67&width=1692&top_left_y=1274&top_left_x=185) Proof. Suppose, to the contrary, that all three numbers $a_{k-1}, a_{k}$, and $a_{k+1}$ are partitioning. The claim yields that $a_{k+1}=g_{k}=a_{k}$, a contradiction. Property 2. The elements $a_{1}$ and $a_{2}$ cannot be simultaneously partitioning. Also, $a_{n-2}$ and $\overline{a_{n-1} \text { cannot be simultaneously partitioning }}$ Proof. Assume that $a_{1}$ and $a_{2}$ are partitioning. By the claim, it follows that $a_{2}=g_{1}=\ell_{1}=$ $\operatorname{lcm}\left(a_{1}\right)=a_{1}$, a contradiction.  Similarly, assume that $a_{n-2}$ and $a_{n-1}$ are partitioning. The claim yields that $a_{n-1}=g_{n-1}=$ $\operatorname{gcd}\left(a_{n}\right)=a_{n}$, a contradiction.  Now let $A$ be an $n$-element set with exactly 2015 good partitions. Clearly, we have $n \geqslant 5$. Using Property 2, we find that there is at most one partitioning element in each of $\left\{a_{1}, a_{2}\right\}$ and $\left\{a_{n-2}, a_{n-1}\right\}$. By Property 1 , there are at least $\left\lfloor\frac{n-5}{3}\right\rfloor$ non-partitioning elements in $\left\{a_{3}, a_{4}, \ldots, a_{n-3}\right\}$. Therefore, there are at most $(n-1)-2-\left\lfloor\frac{n-5}{3}\right\rfloor=\left\lceil\frac{2(n-2)}{3}\right\rceil$ partitioning elements in $A$. Thus, $\left\lceil\frac{2(n-2)}{3}\right\rceil \geqslant 2015$, which implies that $n \geqslant 3024$.  Finally, we show that there exists a set of 3024 positive integers with exactly 2015 partitioning elements. Indeed, in the set $A=\left\{2 \cdot 6^{i}, 3 \cdot 6^{i}, 6^{i+1} \mid 0 \leqslant i \leqslant 1007\right\}$, each element of the form $3 \cdot 6^{i}$ or $6^{i}$, except $6^{1008}$, is partitioning.  Therefore, the minimum possible value of $n$ is 3024 . Comment. Here we will work out the general case when 2015 is replaced by an arbitrary positive integer $m$. Note that the bound $\left\lceil\frac{2(n-2)}{3}\right\rceil \geqslant m$ obtained in the solution is, in fact, true for any positive integers $m$ and $n$. Using this bound, one can find that $n \geqslant\left\lceil\frac{3 m}{2}\right\rceil+1$.  To show that the bound is sharp, one constructs a set of $\left\lceil\frac{3 m}{2}\right\rceil+1$ elements with exactly $m$ good partitions. Indeed, the minimum is attained on the set $\left\{6^{i}, 2 \cdot 6^{i}, 3 \cdot 6^{i} \mid 0 \leqslant i \leqslant t-1\right\} \cup\left\{6^{t}\right\}$ for every even $m=2 t$, and $\left\{2 \cdot 6^{i}, 3 \cdot 6^{i}, 6^{i+1} \mid 0 \leqslant i \leqslant t-1\right\}$ for every odd $m=2 t-1$.


Let $n$ be a positive integer. Two players $A$ and $B$ play a game in which they take turns choosing positive integers $k \leqslant n$. The rules of the game are: (i) A player cannot choose a number that has been chosen by either player on any previous turn. (ii) A player cannot choose a number consecutive to any of those the player has already chosen on any previous turn. (iii) The game is a draw if all numbers have been chosen; otherwise the player who cannot choose a number anymore loses the game.  The player $A$ takes the first turn. Determine the outcome of the game, assuming that both players use optimal strategies. (Finland) Answer. The game ends in a draw when $n=1,2,4,6$; otherwise $B$ wins.

Solution: For brevity, we denote by $[n]$ the set $\{1,2, \ldots, n\}$. Firstly, we show that $B$ wins whenever $n \neq 1,2,4,6$. For this purpose, we provide a strategy which guarantees that $B$ can always make a move after $A$ 's move, and also guarantees that the game does not end in a draw.  We begin with an important observation. Lemma. Suppose that $B$ 's first pick is $n$ and that $A$ has made the $k^{\text {th }}$ move where $k \geqslant 2$. Then $B$ can also make the $k^{\text {th }}$ move. Proof. Let $\mathcal{S}$ be the set of the first $k$ numbers chosen by $A$. Since $\mathcal{S}$ does not contain consecutive integers, we see that the set $[n] \backslash \mathcal{S}$ consists of $k$ "contiguous components" if $1 \in \mathcal{S}$, and $k+1$ components otherwise. Since $B$ has chosen only $k-1$ numbers, there is at least one component of $[n] \backslash \mathcal{S}$ consisting of numbers not yet picked by $B$. Hence, $B$ can choose a number from this component.  We will now describe a winning strategy for $B$, when $n \neq 1,2,4,6$. By symmetry, we may assume that $A$ 's first choice is a number not exceeding $\frac{n+1}{2}$. So $B$ can pick the number $n$ in $B$ 's first turn. We now consider two cases. Case 1. $n$ is odd and $n \geqslant 3$. The only way the game ends in a draw is that $A$ eventually picks all the odd numbers from the set $[n]$. However, $B$ has already chosen $n$, so this cannot happen. Thus $B$ can continue to apply the lemma until $A$ cannot make a move.  Case 2. $n$ is even and $n \geqslant 8$. Since $B$ has picked $n$, the game is a draw only if $A$ can eventually choose all the odd numbers from the set $[n-1]$. So $B$ picks a number from the set $\{1,3,5, \ldots, n-3\}$ not already chosen by $A$, on $B$ 's second move. This is possible since the set consists of $\frac{n-2}{2} \geqslant 3$ numbers and $A$ has chosen only 2 numbers. Hereafter $B$ can apply the lemma until $A$ cannot make a move.  Hence, in both cases $A$ loses. We are left with the cases $n=1,2,4,6$. The game is trivially a draw when $n=1,2$. When $n=4, A$ has to first pick 1 to avoid losing. Similarly, $B$ has to choose 4 as well. It then follows that the game ends in a draw.  When $n=6, B$ gets at least a draw by the lemma or by using a mirror strategy. On the other hand, $A$ may also get at least a draw in the following way. In the first turn, $A$ chooses 1. After $B$ 's response by a number $b, A$ finds a neighbor $c$ of $b$ which differs from 1 and 2 , and reserves $c$ for $A$ 's third move. Now, clearly $A$ can make the second move by choosing a number different from $1,2, c-1, c, c+1$. Therefore $A$ will not lose.  Comment 1. We present some explicit winning strategies for $B$. We start with the case $n$ is odd and $n \geqslant 3 . B$ starts by picking $n$ in the first turn. On the $k^{\text {th }}$ move for $k \geqslant 2, B$ chooses the number exactly 1 less than $A$ 's $k^{\text {th }}$ pick. The only special case is when $A$ 's $k^{\text {th }}$ choice is 1 . In this situation, $A^{\prime}$ 's first pick was a number $a>1$ and $B$ can respond by choosing $a-1$ on the $k^{\text {th }}$ move instead.  We now give an alternative winning strategy in the case $n$ is even and $n \geqslant 8$. We first present a winning strategy for the case when $A$ 's first pick is 1 . We consider two cases depending on $A$ 's second move.  Case 1. A's second pick is 3 . Then $B$ chooses $n-3$ on the second move. On the $k^{\text {th }}$ move, $B$ chooses the number exactly 1 less than $A^{\prime}$ 's $k^{\text {th }}$ pick except that $B$ chooses 2 if $A$ 's $k^{\text {th }}$ pick is $n-2$ or $n-1$.  Case 2. A's second pick is $a>3$. Then $B$ chooses $a-2$ on the second move. Afterwards on the $k^{\text {th }}$ move, $B$ picks the number exactly 1 less than $A^{\text {'s }} k^{\text {th }}$ pick.  One may easily see that this strategy guarantees $B$ 's victory, when $A$ 's first pick is 1 . The following claim shows how to extend the strategy to the general case. Claim. Assume that $B$ has an explicit strategy leading to a victory after $A$ picks 1 on the first move. Then $B$ also has an explicit strategy leading to a victory after any first moves of $A$. Proof. Let $S$ be an optimal strategy of $B$ after $A$ picks 1 on the first move. Assume that $A$ picks some number $a>1$ on this move; we show how $B$ can make use of $S$ in order to win in this case.  In parallel to the real play, $B$ starts an imaginary play. The positions in these plays differ by flipping the segment $[1, a]$; so, if a player chooses some number $x$ in the real play, then the same player chooses a number $x$ or $a+1-x$ in the imaginary play, depending on whether $x>a$ or $x \leqslant a$. Thus $A$ 's first pick in the imaginary play is 1.  Clearly, a number is chosen in the real play exactly if the corresponding number is chosen in the imaginary one. Next, if an unchosen number is neighboring to one chosen by $A$ in the imaginary play, then the corresponding number also has this property in the real play, so $A$ also cannot choose it. One can easily see that a similar statement with real and imaginary plays interchanged holds for $B$ instead of $A$.  Thus, when $A$ makes some move in the real play, $B$ may imagine the corresponding legal move in the imaginary one. Then $B$ chooses the response according to $S$ in the imaginary game and makes the corresponding legal move in the real one. Acting so, $B$ wins the imaginary game, thus $B$ will also win the real one.  Hence, $B$ has a winning strategy for all even $n$ greater or equal to 8 . Notice that the claim can also be used to simplify the argument when $n$ is odd. Comment 2. One may also employ symmetry when $n$ is odd. In particular, $B$ could use a mirror strategy. However, additional ideas are required to modify the strategy after $A$ picks $\frac{n+1}{2}$.


Consider an infinite sequence $a_{1}, a_{2}, \ldots$ of positive integers with $a_{i} \leqslant 2015$ for all $i \geqslant 1$. Suppose that for any two distinct indices $i$ and $j$ we have $i+a_{i} \neq j+a_{j}$.  Prove that there exist two positive integers $b$ and $N$ such that  $$ \left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| \leqslant 1007^{2} $$  whenever $n>m \geqslant N$. (Australia)

Solution: We visualize the set of positive integers as a sequence of points. For each $n$ we draw an arrow emerging from $n$ that points to $n+a_{n}$; so the length of this arrow is $a_{n}$. Due to the condition that $m+a_{m} \neq n+a_{n}$ for $m \neq n$, each positive integer receives at most one arrow. There are some positive integers, such as 1 , that receive no arrows; these will be referred to as starting points in the sequel. When one starts at any of the starting points and keeps following the arrows, one is led to an infinite path, called its ray, that visits a strictly increasing sequence of positive integers. Since the length of any arrow is at most 2015, such a ray, say with starting point $s$, meets every interval of the form $[n, n+2014]$ with $n \geqslant s$ at least once.  Suppose for the sake of contradiction that there would be at least 2016 starting points. Then we could take an integer $n$ that is larger than the first 2016 starting points. But now the interval $[n, n+2014]$ must be met by at least 2016 rays in distinct points, which is absurd. We have thereby shown that the number $b$ of starting points satisfies $1 \leqslant b \leqslant 2015$. Let $N$ denote any integer that is larger than all starting points. We contend that $b$ and $N$ are as required.  To see this, let any two integers $m$ and $n$ with $n>m \geqslant N$ be given. The sum $\sum_{i=m+1}^{n} a_{i}$ gives the total length of the arrows emerging from $m+1, \ldots, n$. Taken together, these arrows form $b$ subpaths of our rays, some of which may be empty. Now on each ray we look at the first number that is larger than $m$; let $x_{1}, \ldots, x_{b}$ denote these numbers, and let $y_{1}, \ldots, y_{b}$ enumerate in corresponding order the numbers defined similarly with respect to $n$. Then the list of differences $y_{1}-x_{1}, \ldots, y_{b}-x_{b}$ consists of the lengths of these paths and possibly some zeros corresponding to empty paths. Consequently, we obtain  $$ \sum_{i=m+1}^{n} a_{i}=\sum_{j=1}^{b}\left(y_{j}-x_{j}\right) $$  whence  $$ \sum_{i=m+1}^{n}\left(a_{i}-b\right)=\sum_{j=1}^{b}\left(y_{j}-n\right)-\sum_{j=1}^{b}\left(x_{j}-m\right) . $$  Now each of the $b$ rays meets the interval $[m+1, m+2015]$ at some point and thus $x_{1}-$ $m, \ldots, x_{b}-m$ are $b$ distinct members of the set $\{1,2, \ldots, 2015\}$. Moreover, since $m+1$ is not a starting point, it must belong to some ray; so 1 has to appear among these numbers, wherefore  $$ 1+\sum_{j=1}^{b-1}(j+1) \leqslant \sum_{j=1}^{b}\left(x_{j}-m\right) \leqslant 1+\sum_{j=1}^{b-1}(2016-b+j) $$  The same argument applied to $n$ and $y_{1}, \ldots, y_{b}$ yields  $$ 1+\sum_{j=1}^{b-1}(j+1) \leqslant \sum_{j=1}^{b}\left(y_{j}-n\right) \leqslant 1+\sum_{j=1}^{b-1}(2016-b+j) $$  So altogether we get  $$ \begin{aligned} \left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| & \leqslant \sum_{j=1}^{b-1}((2016-b+j)-(j+1))=(b-1)(2015-b) \\ & \leqslant\left(\frac{(b-1)+(2015-b)}{2}\right)^{2}=1007^{2}, \end{aligned} $$  as desired.


Solution: Set $s_{n}=n+a_{n}$ for all positive integers $n$. By our assumptions, we have  $$ n+1 \leqslant s_{n} \leqslant n+2015 $$  for all $n \in \mathbb{Z}_{>0}$. The members of the sequence $s_{1}, s_{2}, \ldots$ are distinct. We shall investigate the set  $$ M=\mathbb{Z}_{>0} \backslash\left\{s_{1}, s_{2}, \ldots\right\} $$  Claim. At most 2015 numbers belong to $M$. Proof. Otherwise let $m_{1}<m_{2}<\cdots<m_{2016}$ be any 2016 distinct elements from $M$. For $n=m_{2016}$ we have  $$ \left\{s_{1}, \ldots, s_{n}\right\} \cup\left\{m_{1}, \ldots, m_{2016}\right\} \subseteq\{1,2, \ldots, n+2015\} $$  where on the left-hand side we have a disjoint union containing altogether $n+2016$ elements. But the set on the right-hand side has only $n+2015$ elements. This contradiction proves our claim.  Now we work towards proving that the positive integers $b=|M|$ and $N=\max (M)$ are as required. Recall that we have just shown $b \leqslant 2015$.  Let us consider any integer $r \geqslant N$. As in the proof of the above claim, we see that  $$ B_{r}=M \cup\left\{s_{1}, \ldots, s_{r}\right\} $$  is a subset of $[1, r+2015] \cap \mathbb{Z}$ with precisely $b+r$ elements. Due to the definitions of $M$ and $N$, we also know $[1, r+1] \cap \mathbb{Z} \subseteq B_{r}$. It follows that there is a set $C_{r} \subseteq\{1,2, \ldots, 2014\}$ with $\left|C_{r}\right|=b-1$ and  $$ B_{r}=([1, r+1] \cap \mathbb{Z}) \cup\left\{r+1+x \mid x \in C_{r}\right\} $$  For any finite set of integers $J$ we denote the sum of its elements by $\sum J$. Now the equations (1) and (2) give rise to two ways of computing $\sum B_{r}$ and the comparison of both methods leads to  $$ \sum M+\sum_{i=1}^{r} s_{i}=\sum_{i=1}^{r} i+b(r+1)+\sum C_{r} $$  or in other words to  $$ \sum M+\sum_{i=1}^{r}\left(a_{i}-b\right)=b+\sum C_{r} $$  After this preparation, we consider any two integers $m$ and $n$ with $n>m \geqslant N$. Plugging $r=n$ and $r=m$ into (3) and subtracting the estimates that result, we deduce  $$ \sum_{i=m+1}^{n}\left(a_{i}-b\right)=\sum C_{n}-\sum C_{m} $$  Since $C_{n}$ and $C_{m}$ are subsets of $\{1,2, \ldots, 2014\}$ with $\left|C_{n}\right|=\left|C_{m}\right|=b-1$, it is clear that the absolute value of the right-hand side of the above inequality attains its largest possible value if either $C_{m}=\{1,2, \ldots, b-1\}$ and $C_{n}=\{2016-b, \ldots, 2014\}$, or the other way around. In these two cases we have  $$ \left|\sum C_{n}-\sum C_{m}\right|=(b-1)(2015-b) $$  so in the general case we find  $$ \left|\sum_{i=m+1}^{n}\left(a_{i}-b\right)\right| \leqslant(b-1)(2015-b) \leqslant\left(\frac{(b-1)+(2015-b)}{2}\right)^{2}=1007^{2} $$  as desired.  Comment. The sets $C_{n}$ may be visualized by means of the following process: Start with an empty blackboard. For $n \geqslant 1$, the following happens during the $n^{\text {th }}$ step. The number $a_{n}$ gets written on the blackboard, then all numbers currently on the blackboard are decreased by 1 , and finally all zeros that have arisen get swept away.  It is not hard to see that the numbers present on the blackboard after $n$ steps are distinct and form the set $C_{n}$. Moreover, it is possible to complete a solution based on this idea.


In a company of people some pairs are enemies. A group of people is called unsociable if the number of members in the group is odd and at least 3, and it is possible to arrange all its members around a round table so that every two neighbors are enemies. Given that there are at most 2015 unsociable groups, prove that it is possible to partition the company into 11 parts so that no two enemies are in the same part. (Russia)

Solution: Let $G=(V, E)$ be a graph where $V$ is the set of people in the company and $E$ is the set of the enemy pairs - the edges of the graph. In this language, partitioning into 11 disjoint enemy-free subsets means properly coloring the vertices of this graph with 11 colors.  We will prove the following more general statement. Claim. Let $G$ be a graph with chromatic number $k \geqslant 3$. Then $G$ contains at least $2^{k-1}-k$ unsociable groups.  Recall that the chromatic number of $G$ is the least $k$ such that a proper coloring  $$ V=V_{1} \sqcup \cdots \sqcup V_{k} $$  exists. In view of $2^{11}-12>2015$, the claim implies the problem statement. Let $G$ be a graph with chromatic number $k$. We say that a proper coloring (1) of $G$ is leximinimal, if the $k$-tuple $\left(\left|V_{1}\right|,\left|V_{2}\right|, \ldots,\left|V_{k}\right|\right)$ is lexicographically minimal; in other words, the following conditions are satisfied: the number $n_{1}=\left|V_{1}\right|$ is minimal; the number $n_{2}=\left|V_{2}\right|$ is minimal, subject to the previously chosen value of $n_{1} ; \ldots$; the number $n_{k-1}=\left|V_{k-1}\right|$ is minimal, subject to the previously chosen values of $n_{1}, \ldots, n_{k-2}$.  The following lemma is the core of the proof. Lemma 1. Suppose that $G=(V, E)$ is a graph with odd chromatic number $k \geqslant 3$, and let (1) be one of its leximinimal colorings. Then $G$ contains an odd cycle which visits all color classes $V_{1}, V_{2}, \ldots, V_{k}$. Proof of Lemma 1. Let us call a cycle colorful if it visits all color classes. Due to the definition of the chromatic number, $V_{1}$ is nonempty. Choose an arbitrary vertex $v \in V_{1}$. We construct a colorful odd cycle that has only one vertex in $V_{1}$, and this vertex is $v$.  We draw a subgraph of $G$ as follows. Place $v$ in the center, and arrange the sets $V_{2}, V_{3}, \ldots, V_{k}$ in counterclockwise circular order around it. For convenience, let $V_{k+1}=V_{2}$. We will draw arrows to add direction to some edges of $G$, and mark the vertices these arrows point to. First we draw arrows from $v$ to all its neighbors in $V_{2}$, and mark all those neighbors. If some vertex $u \in V_{i}$ with $i \in\{2,3, \ldots, k\}$ is already marked, we draw arrows from $u$ to all its neighbors in $V_{i+1}$ which are not marked yet, and we mark all of them. We proceed doing this as long as it is possible. The process of marking is exemplified in Figure 1.  Notice that by the rules of our process, in the final state, marked vertices in $V_{i}$ cannot have unmarked neighbors in $V_{i+1}$. Moreover, $v$ is connected to all marked vertices by directed paths.  Now move each marked vertex to the next color class in circular order (see an example in Figure 3). In view of the arguments above, the obtained coloring $V_{1} \sqcup W_{2} \sqcup \cdots \sqcup W_{k}$ is proper. Notice that $v$ has a neighbor $w \in W_{2}$, because otherwise  $$ \left(V_{1} \backslash\{v\}\right) \sqcup\left(W_{2} \cup\{v\}\right) \sqcup W_{3} \sqcup \cdots \sqcup W_{k} $$  would be a proper coloring lexicographically smaller than (1). If $w$ was unmarked, i.e., $w$ was an element of $V_{2}$, then it would be marked at the beginning of the process and thus moved to $V_{3}$, which did not happen. Therefore, $w$ is marked and $w \in V_{k}$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-40.jpg?height=780&width=1658&top_left_y=181&top_left_x=219)  Figure 1 Figure 2 Since $w$ is marked, there exists a directed path from $v$ to $w$. This path moves through the sets $V_{2}, \ldots, V_{k}$ in circular order, so the number of edges in it is divisible by $k-1$ and thus even. Closing this path by the edge $w \rightarrow v$, we get a colorful odd cycle, as required.  Proof of the claim. Let us choose a leximinimal coloring (1) of $G$. For every set $C \subseteq\{1,2, \ldots, k\}$ such that $|C|$ is odd and greater than 1 , we will provide an odd cycle visiting exactly those color classes whose indices are listed in the set $C$. This property ensures that we have different cycles for different choices of $C$, and it proves the claim because there are $2^{k-1}-k$ choices for the set $C$.  Let $V_{C}=\bigcup_{c \in C} V_{c}$, and let $G_{C}$ be the induced subgraph of $G$ on the vertex set $V_{C}$. We also have the induced coloring of $V_{C}$ with $|C|$ colors; this coloring is of course proper. Notice further that the induced coloring is leximinimal: if we had a lexicographically smaller coloring $\left(W_{c}\right)_{c \in C}$ of $G_{C}$, then these classes, together the original color classes $V_{i}$ for $i \notin C$, would provide a proper coloring which is lexicographically smaller than (1). Hence Lemma 1, applied to the subgraph $G_{C}$ and its leximinimal coloring $\left(V_{c}\right)_{c \in C}$, provides an odd cycle that visits exactly those color classes that are listed in the set $C$.


Solution: We provide a different proof of the claim from the previous solution. We say that a graph is critical if deleting any vertex from the graph decreases the graph's chromatic number. Obviously every graph contains a critical induced subgraph with the same chromatic number. Lemma 2. Suppose that $G=(V, E)$ is a critical graph with chromatic number $k \geqslant 3$. Then every vertex $v$ of $G$ is contained in at least $2^{k-2}-1$ unsociable groups. Proof. For every set $X \subseteq V$, denote by $n(X)$ the number of neighbors of $v$ in the set $X$. Since $G$ is critical, there exists a proper coloring of $G \backslash\{v\}$ with $k-1$ colors, so there exists a proper coloring $V=V_{1} \sqcup V_{2} \sqcup \cdots \sqcup V_{k}$ of $G$ such that $V_{1}=\{v\}$. Among such colorings, take one for which the sequence $\left(n\left(V_{2}\right), n\left(V_{3}\right), \ldots, n\left(V_{k}\right)\right)$ is lexicographically minimal. Clearly, $n\left(V_{i}\right)>0$ for every $i=2,3, \ldots, k$; otherwise $V_{2} \sqcup \ldots \sqcup V_{i-1} \sqcup\left(V_{i} \cup V_{1}\right) \sqcup V_{i+1} \sqcup \ldots V_{k}$ would be a proper coloring of $G$ with $k-1$ colors.  We claim that for every $C \subseteq\{2,3, \ldots, k\}$ with $|C| \geqslant 2$ being even, $G$ contains an unsociable group so that the set of its members' colors is precisely $C \cup\{1\}$. Since the number of such sets $C$ is $2^{k-2}-1$, this proves the lemma. Denote the elements of $C$ by $c_{1}, \ldots, c_{2 \ell}$ in increasing order. For brevity, let $U_{i}=V_{c_{i}}$. Denote by $N_{i}$ the set of neighbors of $v$ in $U_{i}$.  We show that for every $i=1, \ldots, 2 \ell-1$ and $x \in N_{i}$, the subgraph induced by $U_{i} \cup U_{i+1}$ contains a path that connects $x$ with another point in $N_{i+1}$. For the sake of contradiction, suppose that no such path exists. Let $S$ be the set of vertices that lie in the connected component of $x$ in the subgraph induced by $U_{i} \cup U_{i+1}$, and let $P=U_{i} \cap S$, and $Q=U_{i+1} \cap S$ (see Figure 3). Since $x$ is separated from $N_{i+1}$, the sets $Q$ and $N_{i+1}$ are disjoint. So, if we re-color $G$ by replacing $U_{i}$ and $U_{i+1}$ by $\left(U_{i} \cup Q\right) \backslash P$ and $\left(U_{i+1} \cup P\right) \backslash Q$, respectively, we obtain a proper coloring such that $n\left(U_{i}\right)=n\left(V_{c_{i}}\right)$ is decreased and only $n\left(U_{i+1}\right)=n\left(V_{c_{i+1}}\right)$ is increased. That contradicts the lexicographical minimality of $\left(n\left(V_{2}\right), n\left(V_{3}\right), \ldots, n\left(V_{k}\right)\right)$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-41.jpg?height=438&width=851&top_left_y=632&top_left_x=611)  Figure 3 Next, we build a path through $U_{1}, U_{2}, \ldots, U_{2 \ell}$ as follows. Let the starting point of the path be an arbitrary vertex $v_{1}$ in the set $N_{1}$. For $i \leqslant 2 \ell-1$, if the vertex $v_{i} \in N_{i}$ is already defined, connect $v_{i}$ to some vertex in $N_{i+1}$ in the subgraph induced by $U_{i} \cup U_{i+1}$, and add these edges to the path. Denote the new endpoint of the path by $v_{i+1}$; by the construction we have $v_{i+1} \in N_{i+1}$ again, so the process can be continued. At the end we have a path that starts at $v_{1} \in N_{1}$ and ends at some $v_{2 \ell} \in N_{2 \ell}$. Moreover, all edges in this path connect vertices in neighboring classes: if a vertex of the path lies in $U_{i}$, then the next vertex lies in $U_{i+1}$ or $U_{i-1}$. Notice that the path is not necessary simple, so take a minimal subpath of it. The minimal subpath is simple and connects the same endpoints $v_{1}$ and $v_{2 \ell}$. The property that every edge steps to a neighboring color class (i.e., from $U_{i}$ to $U_{i+1}$ or $U_{i-1}$ ) is preserved. So the resulting path also visits all of $U_{1}, \ldots, U_{2 \ell}$, and its length must be odd. Closing the path with the edges $v v_{1}$ and $v_{2 \ell} v$ we obtain the desired odd cycle (see Figure 4). ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-41.jpg?height=518&width=1489&top_left_y=1803&top_left_x=286)  Figure 4 Now we prove the claim by induction on $k \geqslant 3$. The base case $k=3$ holds by applying Lemma 2 to a critical subgraph. For the induction step, let $G_{0}$ be a critical $k$-chromatic subgraph of $G$, and let $v$ be an arbitrary vertex of $G_{0}$. By Lemma 2, $G_{0}$ has at least $2^{k-2}-1$ unsociable groups containing $v$. On the other hand, the graph $G_{0} \backslash\{v\}$ has chromatic number $k-1$, so it contains at least $2^{k-2}-(k-1)$ unsociable groups by the induction hypothesis. Altogether, this gives $2^{k-2}-1+2^{k-2}-(k-1)=2^{k-1}-k$ distinct unsociable groups in $G_{0}$ (and thus in $G$ ).  Comment 1. The claim we proved is sharp. The complete graph with $k$ vertices has chromatic number $k$ and contains exactly $2^{k-1}-k$ unsociable groups.  Comment 2. The proof of Lemma 2 works for odd values of $|C| \geqslant 3$ as well. Hence, the second solution shows the analogous statement that the number of even sized unsociable groups is at least $2^{k}-1-\binom{k}{2}$.


Let $A B C$ be an acute triangle, and let $M$ be the midpoint of $A C$. A circle $\omega$ passing through $B$ and $M$ meets the sides $A B$ and $B C$ again at $P$ and $Q$, respectively. Let $T$ be the point such that the quadrilateral $B P T Q$ is a parallelogram. Suppose that $T$ lies on the circumcircle of the triangle $A B C$. Determine all possible values of $B T / B M$. (Russia) Answer. $\sqrt{2}$.

Solution: Let $S$ be the center of the parallelogram $B P T Q$, and let $B^{\prime} \neq B$ be the point on the ray $B M$ such that $B M=M B^{\prime}$ (see Figure 1). It follows that $A B C B^{\prime}$ is a parallelogram. Then, $\angle A B B^{\prime}=\angle P Q M$ and $\angle B B^{\prime} A=\angle B^{\prime} B C=\angle M P Q$, and so the triangles $A B B^{\prime}$ and $M Q P$ are similar. It follows that $A M$ and $M S$ are corresponding medians in these triangles. Hence,  $$ \angle S M P=\angle B^{\prime} A M=\angle B C A=\angle B T A . $$  Since $\angle A C T=\angle P B T$ and $\angle T A C=\angle T B C=\angle B T P$, the triangles $T C A$ and $P B T$ are similar. Again, as $T M$ and $P S$ are corresponding medians in these triangles, we have  $$ \angle M T A=\angle T P S=\angle B Q P=\angle B M P . $$  Now we deal separately with two cases. Case 1. $\quad S$ does not lie on $B M$. Since the configuration is symmetric between $A$ and $C$, we may assume that $S$ and $A$ lie on the same side with respect to the line $B M$.  Applying (1) and (2), we get  $$ \angle B M S=\angle B M P-\angle S M P=\angle M T A-\angle B T A=\angle M T B, $$  and so the triangles $B S M$ and $B M T$ are similar. We now have $B M^{2}=B S \cdot B T=B T^{2} / 2$, so $B T=\sqrt{2} B M$. Case 2. $\quad S$ lies on $B M$. It follows from (2) that $\angle B C A=\angle M T A=\angle B Q P=\angle B M P$ (see Figure 2). Thus, $P Q \| A C$ and $P M \| A T$. Hence, $B S / B M=B P / B A=B M / B T$, so $B T^{2}=2 B M^{2}$ and $B T=\sqrt{2} B M$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-49.jpg?height=960&width=730&top_left_y=1713&top_left_x=246)  Figure 1 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-49.jpg?height=749&width=729&top_left_y=1938&top_left_x=1092)  Figure 2  Comment 1. Here is another way to show that the triangles $B S M$ and $B M T$ are similar. Denote by $\Omega$ the circumcircle of the triangle $A B C$. Let $R$ be the second point of intersection of $\omega$ and $\Omega$, and let $\tau$ be the spiral similarity centered at $R$ mapping $\omega$ to $\Omega$. Then, one may show that $\tau$ maps each point $X$ on $\omega$ to a point $Y$ on $\Omega$ such that $B, X$, and $Y$ are collinear (see Figure 3). If we let $K$ and $L$ be the second points of intersection of $B M$ with $\Omega$ and of $B T$ with $\omega$, respectively, then it follows that the triangle $M K T$ is the image of $S M L$ under $\tau$. We now obtain $\angle B S M=\angle T M B$, which implies the desired result. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-50.jpg?height=758&width=757&top_left_y=752&top_left_x=204)  Figure 3 ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-50.jpg?height=954&width=846&top_left_y=551&top_left_x=1002)  Figure 4


Solution: Again, we denote by $\Omega$ the circumcircle of the triangle $A B C$. Choose the points $X$ and $Y$ on the rays $B A$ and $B C$ respectively, so that $\angle M X B=\angle M B C$ and $\angle B Y M=\angle A B M$ (see Figure 4). Then the triangles $B M X$ and $Y M B$ are similar. Since $\angle X P M=\angle B Q M$, the points $P$ and $Q$ correspond to each other in these triangles. So, if $\overrightarrow{B P}=\mu \cdot \overrightarrow{B X}$, then $\overrightarrow{B Q}=(1-\mu) \cdot \overrightarrow{B Y}$. Thus  $$ \overrightarrow{B T}=\overrightarrow{B P}+\overrightarrow{B Q}=\overrightarrow{B Y}+\mu \cdot(\overrightarrow{B X}-\overrightarrow{B Y})=\overrightarrow{B Y}+\mu \cdot \overrightarrow{Y X} $$  which means that $T$ lies on the line $X Y$. Let $B^{\prime} \neq B$ be the point on the ray $B M$ such that $B M=M B^{\prime}$. Then $\angle M B^{\prime} A=$ $\angle M B C=\angle M X B$ and $\angle C B^{\prime} M=\angle A B M=\angle B Y M$. This means that the triangles $B M X$, $B A B^{\prime}, Y M B$, and $B^{\prime} C B$ are all similar; hence $B A \cdot B X=B M \cdot B B^{\prime}=B C \cdot B Y$. Thus there exists an inversion centered at $B$ which swaps $A$ with $X, M$ with $B^{\prime}$, and $C$ with $Y$. This inversion then swaps $\Omega$ with the line $X Y$, and hence it preserves $T$. Therefore, we have $B T^{2}=B M \cdot B B^{\prime}=2 B M^{2}$, and $B T=\sqrt{2} B M$.


Solution: We begin with the following lemma. Lemma. Let $A B C T$ be a cyclic quadrilateral. Let $P$ and $Q$ be points on the sides $B A$ and $B C$ respectively, such that $B P T Q$ is a parallelogram. Then $B P \cdot B A+B Q \cdot B C=B T^{2}$. Proof. Let the circumcircle of the triangle $Q T C$ meet the line $B T$ again at $J$ (see Figure 5). The power of $B$ with respect to this circle yields  $$ B Q \cdot B C=B J \cdot B T $$  We also have $\angle T J Q=180^{\circ}-\angle Q C T=\angle T A B$ and $\angle Q T J=\angle A B T$, and so the triangles $T J Q$ and $B A T$ are similar. We now have $T J / T Q=B A / B T$. Therefore,  $$ T J \cdot B T=T Q \cdot B A=B P \cdot B A $$  Combining (3) and (4) now yields the desired result. Let $X$ and $Y$ be the midpoints of $B A$ and $B C$ respectively (see Figure 6). Applying the lemma to the cyclic quadrilaterals $P B Q M$ and $A B C T$, we obtain  $$ B X \cdot B P+B Y \cdot B Q=B M^{2} $$  and  $$ B P \cdot B A+B Q \cdot B C=B T^{2} $$  Since $B A=2 B X$ and $B C=2 B Y$, we have $B T^{2}=2 B M^{2}$, and so $B T=\sqrt{2} B M$. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-51.jpg?height=789&width=1464&top_left_y=933&top_left_x=296)  Comment 2. Here we give another proof of the lemma using Ptolemy's theorem. We readily have  $$ T C \cdot B A+T A \cdot B C=A C \cdot B T $$  The lemma now follows from  $$ \frac{B P}{T C}=\frac{B Q}{T A}=\frac{B T}{A C}=\frac{\sin \angle B C T}{\sin \angle A B C} $$


Determine all positive integers $M$ for which the sequence $a_{0}, a_{1}, a_{2}, \ldots$, defined by $a_{0}=\frac{2 M+1}{2}$ and $a_{k+1}=a_{k}\left\lfloor a_{k}\right\rfloor$ for $k=0,1,2, \ldots$, contains at least one integer term. (Luxembourg) Answer. All integers $M \geqslant 2$.

Solution: Define $b_{k}=2 a_{k}$ for all $k \geqslant 0$. Then  $$ b_{k+1}=2 a_{k+1}=2 a_{k}\left\lfloor a_{k}\right\rfloor=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor . $$  Since $b_{0}$ is an integer, it follows that $b_{k}$ is an integer for all $k \geqslant 0$. Suppose that the sequence $a_{0}, a_{1}, a_{2}, \ldots$ does not contain any integer term. Then $b_{k}$ must be an odd integer for all $k \geqslant 0$, so that  $$ b_{k+1}=b_{k}\left\lfloor\frac{b_{k}}{2}\right\rfloor=\frac{b_{k}\left(b_{k}-1\right)}{2} $$  Hence  $$ b_{k+1}-3=\frac{b_{k}\left(b_{k}-1\right)}{2}-3=\frac{\left(b_{k}-3\right)\left(b_{k}+2\right)}{2} $$  for all $k \geqslant 0$. Suppose that $b_{0}-3>0$. Then equation (2) yields $b_{k}-3>0$ for all $k \geqslant 0$. For each $k \geqslant 0$, define $c_{k}$ to be the highest power of 2 that divides $b_{k}-3$. Since $b_{k}-3$ is even for all $k \geqslant 0$, the number $c_{k}$ is positive for every $k \geqslant 0$.  Note that $b_{k}+2$ is an odd integer. Therefore, from equation (2), we have that $c_{k+1}=c_{k}-1$. Thus, the sequence $c_{0}, c_{1}, c_{2}, \ldots$ of positive integers is strictly decreasing, a contradiction. So, $b_{0}-3 \leqslant 0$, which implies $M=1$.  For $M=1$, we can check that the sequence is constant with $a_{k}=\frac{3}{2}$ for all $k \geqslant 0$. Therefore, the answer is $M \geqslant 2$.


Solution: We provide an alternative way to show $M=1$ once equation (1) has been reached. We claim that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$ and $m \geqslant 1$. If this is true, then we would have $b_{k}=3$ for all $k \geqslant 0$ and hence $M=1$.  To establish our claim, we proceed by induction on $m$. The base case $b_{k} \equiv 3(\bmod 2)$ is true for all $k \geqslant 0$ since $b_{k}$ is odd. Now suppose that $b_{k} \equiv 3\left(\bmod 2^{m}\right)$ for all $k \geqslant 0$. Hence $b_{k}=2^{m} d_{k}+3$ for some integer $d_{k}$. We have  $$ 3 \equiv b_{k+1} \equiv\left(2^{m} d_{k}+3\right)\left(2^{m-1} d_{k}+1\right) \equiv 3 \cdot 2^{m-1} d_{k}+3 \quad\left(\bmod 2^{m}\right) $$  so that $d_{k}$ must be even. This implies that $b_{k} \equiv 3\left(\bmod 2^{m+1}\right)$, as required. Comment. The reason the number 3 which appears in both solutions is important, is that it is a nontrivial fixed point of the recurrence relation for $b_{k}$.


Determine all triples $(a, b, c)$ of positive integers for which $a b-c, b c-a$, and $c a-b$ are powers of 2 .  Explanation: A power of 2 is an integer of the form $2^{n}$, where $n$ denotes some nonnegative integer. (Serbia) Answer. There are sixteen such triples, namely $(2,2,2)$, the three permutations of $(2,2,3)$, and the six permutations of each of $(2,6,11)$ and $(3,5,7)$.

Solution: It can easily be verified that these sixteen triples are as required. Now let ( $a, b, c$ ) be any triple with the desired property. If we would have $a=1$, then both $b-c$ and $c-b$ were powers of 2 , which is impossible since their sum is zero; because of symmetry, this argument shows $a, b, c \geqslant 2$.  Case 1. Among $a, b$, and $c$ there are at least two equal numbers. Without loss of generality we may suppose that $a=b$. Then $a^{2}-c$ and $a(c-1)$ are powers of 2 . The latter tells us that actually $a$ and $c-1$ are powers of 2 . So there are nonnegative integers $\alpha$ and $\gamma$ with $a=2^{\alpha}$ and $c=2^{\gamma}+1$. Since $a^{2}-c=2^{2 \alpha}-2^{\gamma}-1$ is a power of 2 and thus incongruent to -1 modulo 4 , we must have $\gamma \leqslant 1$. Moreover, each of the terms $2^{2 \alpha}-2$ and $2^{2 \alpha}-3$ can only be a power of 2 if $\alpha=1$. It follows that the triple $(a, b, c)$ is either $(2,2,2)$ or $(2,2,3)$.  Case 2. The numbers $a, b$, and $c$ are distinct. Due to symmetry we may suppose that  $$ 2 \leqslant a<b<c . $$  We are to prove that the triple $(a, b, c)$ is either $(2,6,11)$ or $(3,5,7)$. By our hypothesis, there exist three nonnegative integers $\alpha, \beta$, and $\gamma$ such that  $$ \begin{aligned} b c-a & =2^{\alpha}, \\ a c-b & =2^{\beta}, \\ \text { and } \quad a b-c & =2^{\gamma} . \end{aligned} $$  Evidently we have  $$ \alpha>\beta>\gamma . $$  Depending on how large $a$ is, we divide the argument into two further cases. Case 2.1. $\quad a=2$. We first prove that $\gamma=0$. Assume for the sake of contradiction that $\gamma>0$. Then $c$ is even by (4) and, similarly, $b$ is even by (5) and (3). So the left-hand side of (2) is congruent to 2 modulo 4 , which is only possible if $b c=4$. As this contradicts (1), we have thereby shown that $\gamma=0$, i.e., that $c=2 b-1$.  Now (3) yields $3 b-2=2^{\beta}$. Due to $b>2$ this is only possible if $\beta \geqslant 4$. If $\beta=4$, then we get $b=6$ and $c=2 \cdot 6-1=11$, which is a solution. It remains to deal with the case $\beta \geqslant 5$. Now (2) implies  $$ 9 \cdot 2^{\alpha}=9 b(2 b-1)-18=(3 b-2)(6 b+1)-16=2^{\beta}\left(2^{\beta+1}+5\right)-16 $$  and by $\beta \geqslant 5$ the right-hand side is not divisible by 32 . Thus $\alpha \leqslant 4$ and we get a contradiction to (5).  Case 2.2. $\quad a \geqslant 3$. Pick an integer $\vartheta \in\{-1,+1\}$ such that $c-\vartheta$ is not divisible by 4 . Now  $$ 2^{\alpha}+\vartheta \cdot 2^{\beta}=\left(b c-a \vartheta^{2}\right)+\vartheta(c a-b)=(b+a \vartheta)(c-\vartheta) $$  is divisible by $2^{\beta}$ and, consequently, $b+a \vartheta$ is divisible by $2^{\beta-1}$. On the other hand, $2^{\beta}=a c-b>$ $(a-1) c \geqslant 2 c$ implies in view of (1) that $a$ and $b$ are smaller than $2^{\beta-1}$. All this is only possible if $\vartheta=1$ and $a+b=2^{\beta-1}$. Now (3) yields  $$ a c-b=2(a+b) $$  whence $4 b>a+3 b=a(c-1) \geqslant a b$, which in turn yields $a=3$. So (6) simplifies to $c=b+2$ and (2) tells us that $b(b+2)-3=(b-1)(b+3)$ is a power of 2 . Consequently, the factors $b-1$ and $b+3$ are powers of 2 themselves. Since their difference is 4 , this is only possible if $b=5$ and thus $c=7$. Thereby the solution is complete.


Solution: As in the beginning of the first solution, we observe that $a, b, c \geqslant 2$. Depending on the parities of $a, b$, and $c$ we distinguish three cases.  Case 1. The numbers $a, b$, and $c$ are even. Let $2^{A}, 2^{B}$, and $2^{C}$ be the largest powers of 2 dividing $a, b$, and $c$ respectively. We may assume without loss of generality that $1 \leqslant A \leqslant B \leqslant C$. Now $2^{B}$ is the highest power of 2 dividing $a c-b$, whence $a c-b=2^{B} \leqslant b$. Similarly, we deduce $b c-a=2^{A} \leqslant a$. Adding both estimates we get $(a+b) c \leqslant 2(a+b)$, whence $c \leqslant 2$. So $c=2$ and thus $A=B=C=1$; moreover, we must have had equality throughout, i.e., $a=2^{A}=2$ and $b=2^{B}=2$. We have thereby found the solution $(a, b, c)=(2,2,2)$.  Case 2. The numbers $a, b$, and $c$ are odd. If any two of these numbers are equal, say $a=b$, then $a c-b=a(c-1)$ has a nontrivial odd divisor and cannot be a power of 2 . Hence $a, b$, and $c$ are distinct. So we may assume without loss of generality that $a<b<c$.  Let $\alpha$ and $\beta$ denote the nonnegative integers for which $b c-a=2^{\alpha}$ and $a c-b=2^{\beta}$ hold. Clearly, we have $\alpha>\beta$, and thus $2^{\beta}$ divides  $$ a \cdot 2^{\alpha}-b \cdot 2^{\beta}=a(b c-a)-b(a c-b)=b^{2}-a^{2}=(b+a)(b-a) $$  Since $a$ is odd, it is not possible that both factors $b+a$ and $b-a$ are divisible by 4 . Consequently, one of them has to be a multiple of $2^{\beta-1}$. Hence one of the numbers $2(b+a)$ and $2(b-a)$ is divisible by $2^{\beta}$ and in either case we have  $$ a c-b=2^{\beta} \leqslant 2(a+b) $$  This in turn yields $(a-1) b<a c-b<4 b$ and thus $a=3$ (recall that $a$ is odd and larger than 1). Substituting this back into (7) we learn $c \leqslant b+2$. But due to the parity $b<c$ entails that $b+2 \leqslant c$ holds as well. So we get $c=b+2$ and from $b c-a=(b-1)(b+3)$ being a power of 2 it follows that $b=5$ and $c=7$.  Case 3. Among $a, b$, and $c$ both parities occur. Without loss of generality, we suppose that $c$ is odd and that $a \leqslant b$. We are to show that $(a, b, c)$ is either $(2,2,3)$ or $(2,6,11)$. As at least one of $a$ and $b$ is even, the expression $a b-c$ is odd; since it is also a power of 2 , we obtain  $$ a b-c=1 $$  If $a=b$, then $c=a^{2}-1$, and from $a c-b=a\left(a^{2}-2\right)$ being a power of 2 it follows that both $a$ and $a^{2}-2$ are powers of 2 , whence $a=2$. This gives rise to the solution $(2,2,3)$.  We may suppose $a<b$ from now on. As usual, we let $\alpha>\beta$ denote the integers satisfying  $$ 2^{\alpha}=b c-a \quad \text { and } \quad 2^{\beta}=a c-b $$  If $\beta=0$ it would follow that $a c-b=a b-c=1$ and hence that $b=c=1$, which is absurd. So $\beta$ and $\alpha$ are positive and consequently $a$ and $b$ are even. Substituting $c=a b-1$ into (9) we obtain  $$ \begin{aligned} 2^{\alpha} & =a b^{2}-(a+b), \\ \text { and } \quad 2^{\beta} & =a^{2} b-(a+b) . \end{aligned} $$  The addition of both equation yields $2^{\alpha}+2^{\beta}=(a b-2)(a+b)$. Now $a b-2$ is even but not divisible by 4 , so the highest power of 2 dividing $a+b$ is $2^{\beta-1}$. For this reason, the equations (10) and (11) show that the highest powers of 2 dividing either of the numbers $a b^{2}$ and $a^{2} b$ is likewise $2^{\beta-1}$. Thus there is an integer $\tau \geqslant 1$ together with odd integers $A, B$, and $C$ such that $a=2^{\tau} A, b=2^{\tau} B, a+b=2^{3 \tau} C$, and $\beta=1+3 \tau$.  Notice that $A+B=2^{2 \tau} C \geqslant 4 C$. Moreover, (11) entails $A^{2} B-C=2$. Thus $8=$ $4 A^{2} B-4 C \geqslant 4 A^{2} B-A-B \geqslant A^{2}(3 B-1)$. Since $A$ and $B$ are odd with $A<B$, this is only possible if $A=1$ and $B=3$. Finally, one may conclude $C=1, \tau=1, a=2, b=6$, and $c=11$. We have thereby found the triple $(2,6,11)$. This completes the discussion of the third case, and hence the solution.  Comment. In both solutions, there are many alternative ways to proceed in each of its cases. Here we present a different treatment of the part " $a<b$ " of Case 3 in Solution 2, assuming that (8) and (9) have already been written down:  Put $d=\operatorname{gcd}(a, b)$ and define the integers $p$ and $q$ by $a=d p$ and $b=d q$; notice that $p<q$ and $\operatorname{gcd}(p, q)=1$. Now (8) implies $c=d^{2} p q-1$ and thus we have  $$ \begin{aligned} & 2^{\alpha} \\ & =d\left(d^{2} p q^{2}-p-q\right) \\ \text { and } \quad 2^{\beta} & =d\left(d^{2} p^{2} q-p-q\right) . \end{aligned} $$  Now $2^{\beta}$ divides $2^{\alpha}-2^{\beta}=d^{3} p q(q-p)$ and, as $p$ and $q$ are easily seen to be coprime to $d^{2} p^{2} q-p-q$, it follows that  $$ \left(d^{2} p^{2} q-p-q\right) \mid d^{2}(q-p) $$  In particular, we have $d^{2} p^{2} q-p-q \leqslant d^{2}(q-p)$, i.e., $d^{2}\left(p^{2} q+p-q\right) \leqslant p+q$. As $p^{2} q+p-q>0$, this may be weakened to $p^{2} q+p-q \leqslant p+q$. Hence $p^{2} q \leqslant 2 q$, which is only possible if $p=1$.  Going back to (13), we get  $$ \left(d^{2} q-q-1\right) \mid d^{2}(q-1) $$  Now $2\left(d^{2} q-q-1\right) \leqslant d^{2}(q-1)$ would entail $d^{2}(q+1) \leqslant 2(q+1)$ and thus $d=1$. But this would tell us that $a=d p=1$, which is absurd. This argument proves $2\left(d^{2} q-q-1\right)>d^{2}(q-1)$ and in the light of (14) it follows that $d^{2} q-q-1=d^{2}(q-1)$, i.e., $q=d^{2}-1$. Plugging this together with $p=1$ into (12) we infer $2^{\beta}=d^{3}\left(d^{2}-2\right)$. Hence $d$ and $d^{2}-2$ are powers of 2 . Consequently, $d=2, q=3$, $a=2, b=6$, and $c=11$, as desired.


Let $\mathbb{Z}_{>0}$ denote the set of positive integers. For any positive integer $k$, a function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$ is called $k$-good if $\operatorname{gcd}(f(m)+n, f(n)+m) \leqslant k$ for all $m \neq n$. Find all $k$ such that there exists a $k$-good function. (Canada) Answer. $k \geqslant 2$.

Solution: For any function $f: \mathbb{Z}_{>0} \rightarrow \mathbb{Z}_{>0}$, let $G_{f}(m, n)=\operatorname{gcd}(f(m)+n, f(n)+m)$. Note that a $k$-good function is also $(k+1)$-good for any positive integer $k$. Hence, it suffices to show that there does not exist a 1-good function and that there exists a 2-good function.  We first show that there is no 1 -good function. Suppose that there exists a function $f$ such that $G_{f}(m, n)=1$ for all $m \neq n$. Now, if there are two distinct even numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both even, then $2 \mid G_{f}(m, n)$, a contradiction. A similar argument holds if there are two distinct odd numbers $m$ and $n$ such that $f(m)$ and $f(n)$ are both odd. Hence we can choose an even $m$ and an odd $n$ such that $f(m)$ is odd and $f(n)$ is even. This also implies that $2 \mid G_{f}(m, n)$, a contradiction.  We now construct a 2-good function. Define $f(n)=2^{g(n)+1}-n-1$, where $g$ is defined recursively by $g(1)=1$ and $g(n+1)=\left(2^{g(n)+1}\right)!$.  For any positive integers $m>n$, set  $$ A=f(m)+n=2^{g(m)+1}-m+n-1, \quad B=f(n)+m=2^{g(n)+1}-n+m-1 $$  We need to show that $\operatorname{gcd}(A, B) \leqslant 2$. First, note that $A+B=2^{g(m)+1}+2^{g(n)+1}-2$ is not divisible by 4 , so that $4 \nmid \operatorname{gcd}(A, B)$. Now we suppose that there is an odd prime $p$ for which $p \mid \operatorname{gcd}(A, B)$ and derive a contradiction.  We first claim that $2^{g(m-1)+1} \geqslant B$. This is a rather weak bound; one way to prove it is as follows. Observe that $g(k+1)>g(k)$ and hence $2^{g(k+1)+1} \geqslant 2^{g(k)+1}+1$ for every positive integer $k$. By repeatedly applying this inequality, we obtain $2^{g(m-1)+1} \geqslant 2^{g(n)+1}+(m-1)-n=B$.  Now, since $p \mid B$, we have $p-1<B \leqslant 2^{g(m-1)+1}$, so that $p-1 \mid\left(2^{g(m-1)+1}\right)!=g(m)$. Hence $2^{g(m)} \equiv 1(\bmod p)$, which yields $A+B \equiv 2^{g(n)+1}(\bmod p)$. However, since $p \mid A+B$, this implies that $p=2$, a contradiction.


Solution: We provide an alternative construction of a 2 -good function $f$. Let $\mathcal{P}$ be the set consisting of 4 and all odd primes. For every $p \in \mathcal{P}$, we say that a number $a \in\{0,1, \ldots, p-1\}$ is $p$-useful if $a \not \equiv-a(\bmod p)$. Note that a residue modulo $p$ which is neither 0 nor 2 is $p$-useful (the latter is needed only when $p=4$ ).  We will construct $f$ recursively; in some steps, we will also define a $p$-useful number $a_{p}$. After the $m^{\text {th }}$ step, the construction will satisfy the following conditions: ( $i$ ) The values of $f(n)$ have already been defined for all $n \leqslant m$, and $p$-useful numbers $a_{p}$ have already been defined for all $p \leqslant m+2$; (ii) If $n \leqslant m$ and $p \leqslant m+2$, then $f(n)+n \not \equiv a_{p}(\bmod p)$; (iii) $\operatorname{gcd}\left(f\left(n_{1}\right)+n_{2}, f\left(n_{2}\right)+n_{1}\right) \leqslant 2$ for all $n_{1}<n_{2} \leqslant m$.  If these conditions are satisfied, then $f$ will be a 2 -good function. ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-77.jpg?height=63&width=1320&top_left_y=2547&top_left_x=185) ![](https://cdn.mathpix.com/cropped/2024_11_18_62dbd531c72d0ff8164cg-77.jpg?height=64&width=1551&top_left_y=2618&top_left_x=184) Defining $f(m)$. Let $X_{m}=\{p \in \mathcal{P}: p \mid f(n)+m$ for some $n<m\}$. We will determine $f(m) \bmod p$ for all $p \in X_{m}$ and then choose $f(m)$ using the Chinese Remainder Theorem.  Take any $p \in X_{m}$. If $p \leqslant m+1$, then we define $f(m) \equiv-a_{p}-m(\bmod p)$. Otherwise, if $p \geqslant m+2$, then we define $f(m) \equiv 0(\bmod p)$. Defining $a_{m+2}$. Now let $p=m+2$ and suppose that $p \in \mathcal{P}$. We choose $a_{p}$ to be a residue modulo $p$ that is not congruent to 0,2 , or $f(n)+n$ for any $n \leqslant m$. Since $f(1)+1=2$, there are at most $m+1<p$ residues to avoid, so we can always choose a remaining residue.  We first check that $(i i)$ is satisfied. We only need to check it if $p=m+2$ or $n=m$. In the former case, we have $f(n)+n \not \equiv a_{p}(\bmod p)$ by construction. In the latter case, if $n=m$ and $p \leqslant m+1$, then we have $f(m)+m \equiv-a_{p} \not \equiv a_{p}(\bmod p)$, where we make use of the fact that $a_{p}$ is $p$-useful.  Now we check that (iii) holds. Suppose, to the contrary, that $p \mid \operatorname{gcd}(f(n)+m, f(m)+n)$ for some $n<m$. Then $p \in X_{m}$ and $p \mid f(m)+n$. If $p \geqslant m+2$, then $0 \equiv f(m)+n \equiv n(\bmod p)$, which is impossible since $n<m<p$.  Otherwise, if $p \leqslant m+1$, then  $$ 0 \equiv(f(m)+n)+(f(n)+m) \equiv(f(n)+n)+(f(m)+m) \equiv(f(n)+n)-a_{p} \quad(\bmod p) $$  This implies that $f(n)+n \equiv a_{p}(\bmod p)$, a contradiction with $(i i)$. Comment 1. For any $p \in \mathcal{P}$, we may also define $a_{p}$ at step $m$ for an arbitrary $m \leqslant p-2$. The construction will work as long as we define a finite number of $a_{p}$ at each step.  Comment 2. When attempting to construct a 2 -good function $f$ recursively, the following way seems natural. Start with setting $f(1)=1$. Next, for each integer $m>1$, introduce the set $X_{m}$ like in Solution 2 and define $f(m)$ so as to satisfy  $$ \begin{array}{rll} f(m) \equiv f(m-p) & (\bmod p) & \text { for all } p \in X_{m} \text { with } p<m, \quad \text { and } \\ f(m) \equiv 0 & (\bmod p) & \text { for all } p \in X_{m} \text { with } p \geqslant m \end{array} $$  This construction might seem to work. Indeed, consider a fixed $p \in \mathcal{P}$, and suppose that $p$ divides $\operatorname{gcd}(f(n)+m, f(m)+n)$ for some $n<m$. Choose such $m$ and $n$ so that $\max (m, n)$ is minimal. Then $p \in X_{m}$. We can check that $p<m$, so that the construction implies that $p$ divides $\operatorname{gcd}(f(n)+(m-p), f(m-p)+n)$. Since $\max (n, m-p)<\max (m, n)$, this almost leads to a contradiction - the only trouble is the possibility that $n=m-p$. However, this flaw may happen to be not so easy to fix.  We will present one possible way to repair this argument in the next comment. Comment 3. There are many recursive constructions for a 2 -good function $f$. Here we sketch one general approach which may be specified in different ways. For convenience, we denote by $\mathbb{Z}_{p}$ the set of residues modulo $p$; all operations on elements of $\mathbb{Z}_{p}$ are also performed modulo $p$.  The general structure is the same as in Solution 2, i.e. using the Chinese Remainder Theorem to successively determine $f(m)$. But instead of designating a common "safe" residue $a_{p}$ for future steps, we act as follows.  For every $p \in \mathcal{P}$, in some step of the process we define $p$ subsets $B_{p}^{(1)}, B_{p}^{(2)}, \ldots, B_{p}^{(p)} \subset \mathbb{Z}_{p}$. The meaning of these sets is that $f(m)+m$ should be congruent to some element in $B_{p}^{(i)}$ whenever $m \equiv i(\bmod p)$ for $i \in \mathbb{Z}_{p}$. Moreover, in every such subset we specify a safe element $b_{p}^{(i)} \in B_{p}^{(i)}$. The meaning now is that in future steps, it is safe to set $f(m)+m \equiv b_{p}^{(i)}(\bmod p)$ whenever $m \equiv i(\bmod p)$. In view of $(1)$, this safety will follow from the condition that $p \nmid \operatorname{gcd}\left(b_{p}^{(i)}+(j-i), c^{(j)}-(j-i)\right)$ for all $j \in \mathbb{Z}_{p}$ and all $c^{(j)} \in B_{p}^{(j)}$. In turn, this condition can be rewritten as  $$ -b_{p}^{(i)} \notin B_{p}^{(j)}, \quad \text { where } \quad j \equiv i-b_{p}^{(i)} \quad(\bmod p) $$  The construction in Solution 2 is equivalent to setting $b_{p}^{(i)}=-a_{p}$ and $B_{p}^{(i)}=\mathbb{Z}_{p} \backslash\left\{a_{p}\right\}$ for all $i$. However, there are different, more technical specifications of our approach.  One may view the (incomplete) construction in Comment 2 as defining $B_{p}^{(i)}$ and $b_{p}^{(i)}$ at step $p-1$ by setting $B_{p}^{(0)}=\left\{b_{p}^{(0)}\right\}=\{0\}$ and $B_{p}^{(i)}=\left\{b_{p}^{(i)}\right\}=\{f(i)+i \bmod p\}$ for every $i=1,2, \ldots, p-1$. However, this construction violates (2) as soon as some number of the form $f(i)+i$ is divisible by some $p$ with $i+2 \leqslant p \in \mathcal{P}$, since then $-b_{p}^{(i)}=b_{p}^{(i)} \in B_{p}^{(i)}$.  Here is one possible way to repair this construction. For all $p \in \mathcal{P}$, we define the sets $B_{p}^{(i)}$ and the elements $b_{p}^{(i)}$ at step $(p-2)$ as follows. Set $B_{p}^{(1)}=\left\{b_{p}^{(1)}\right\}=\{2\}$ and $B_{p}^{(-1)}=B_{p}^{(0)}=\left\{b_{p}^{(-1)}\right\}=\left\{b_{p}^{(0)}\right\}=$ $\{-1\}$. Next, for all $i=2, \ldots, p-2$, define $B_{p}^{(i)}=\{i, f(i)+i \bmod p\}$ and $b_{p}^{(i)}=i$. One may see that these definitions agree with both (1) and (2).


For every positive integer $n$ with prime factorization $n=\prod_{i=1}^{k} p_{i}^{\alpha_{i}}$, define  $$ \mathcal{W}(n)=\sum_{i: p_{i}>10^{100}} \alpha_{i} . $$  That is, $\mho(n)$ is the number of prime factors of $n$ greater than $10^{100}$, counted with multiplicity. Find all strictly increasing functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ such that  $$ \mho(f(a)-f(b)) \leqslant \mho(a-b) \quad \text { for all integers } a \text { and } b \text { with } a>b . $$  (Brazil) Answer. $f(x)=a x+b$, where $b$ is an arbitrary integer, and $a$ is an arbitrary positive integer with $\mho(a)=0$.

Solution: A straightforward check shows that all the functions listed in the answer satisfy the problem condition. It remains to show the converse.  Assume that $f$ is a function satisfying the problem condition. Notice that the function $g(x)=f(x)-f(0)$ also satisfies this condition. Replacing $f$ by $g$, we assume from now on that $f(0)=0$; then $f(n)>0$ for any positive integer $n$. Thus, we aim to prove that there exists a positive integer $a$ with $\mho(a)=0$ such that $f(n)=a n$ for all $n \in \mathbb{Z}$.  We start by introducing some notation. Set $N=10^{100}$. We say that a prime $p$ is large if $p>N$, and $p$ is small otherwise; let $\mathcal{S}$ be the set of all small primes. Next, we say that a positive integer is large or small if all its prime factors are such (thus, the number 1 is the unique number which is both large and small). For a positive integer $k$, we denote the greatest large divisor of $k$ and the greatest small divisor of $k$ by $L(k)$ and $S(k)$, respectively; thus, $k=L(k) S(k)$.  We split the proof into three steps. Step 1. We prove that for every large $k$, we have $k|f(a)-f(b) \Longleftrightarrow k| a-b$. In other words, $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$.  We use induction on $k$. The base case $k=1$ is trivial. For the induction step, assume that $k_{0}$ is a large number, and that the statement holds for all large numbers $k$ with $k<k_{0}$. Claim 1. For any integers $x$ and $y$ with $0<x-y<k_{0}$, the number $k_{0}$ does not divide $f(x)-f(y)$. Proof. Assume, to the contrary, that $k_{0} \mid f(x)-f(y)$. Let $\ell=L(x-y)$; then $\ell \leqslant x-y<k_{0}$. By the induction hypothesis, $\ell \mid f(x)-f(y)$, and thus $\operatorname{lcm}\left(k_{0}, \ell\right) \mid f(x)-f(y)$. Notice that $\operatorname{lcm}\left(k_{0}, \ell\right)$ is large, and $\operatorname{lcm}\left(k_{0}, \ell\right) \geqslant k_{0}>\ell$. But then  $$ \mho(f(x)-f(y)) \geqslant \mho\left(\operatorname{lcm}\left(k_{0}, \ell\right)\right)>\mho(\ell)=\mho(x-y), $$  which is impossible. Now we complete the induction step. By Claim 1, for every integer $a$ each of the sequences  $$ f(a), f(a+1), \ldots, f\left(a+k_{0}-1\right) \quad \text { and } \quad f(a+1), f(a+2), \ldots, f\left(a+k_{0}\right) $$  forms a complete residue system modulo $k_{0}$. This yields $f(a) \equiv f\left(a+k_{0}\right)\left(\bmod k_{0}\right)$. Thus, $f(a) \equiv f(b)\left(\bmod k_{0}\right)$ whenever $a \equiv b\left(\bmod k_{0}\right)$.  Finally, if $a \not \equiv b\left(\bmod k_{0}\right)$ then there exists an integer $b^{\prime}$ such that $b^{\prime} \equiv b\left(\bmod k_{0}\right)$ and $\left|a-b^{\prime}\right|<k_{0}$. Then $f(b) \equiv f\left(b^{\prime}\right) \not f(a)\left(\bmod k_{0}\right)$. The induction step is proved. Step 2. We prove that for some small integer a there exist infinitely many integers $n$ such that $\overline{f(n)}=$ an. In other words, $f$ is linear on some infinite set.  We start with the following general statement.  Claim 2. There exists a constant $c$ such that $f(t)<c t$ for every positive integer $t>N$. Proof. Let $d$ be the product of all small primes, and let $\alpha$ be a positive integer such that $2^{\alpha}>f(N)$. Then, for every $p \in \mathcal{S}$ the numbers $f(0), f(1), \ldots, f(N)$ are distinct modulo $p^{\alpha}$. Set $P=d^{\alpha}$ and $c=P+f(N)$.  Choose any integer $t>N$. Due to the choice of $\alpha$, for every $p \in \mathcal{S}$ there exists at most one nonnegative integer $i \leqslant N$ with $p^{\alpha} \mid f(t)-f(i)$. Since $|\mathcal{S}|<N$, we can choose a nonnegative integer $j \leqslant N$ such that $p^{\alpha} \nmid f(t)-f(j)$ for all $p \in \mathcal{S}$. Therefore, $S(f(t)-f(j))<P$.  On the other hand, Step 1 shows that $L(f(t)-f(j))=L(t-j) \leqslant t-j$. Since $0 \leqslant j \leqslant N$, this yields  $$ f(t)=f(j)+L(f(t)-f(j)) \cdot S(f(t)-f(j))<f(N)+(t-j) P \leqslant(P+f(N)) t=c t . $$  Now let $\mathcal{T}$ be the set of large primes. For every $t \in \mathcal{T}$, Step 1 implies $L(f(t))=t$, so the ratio $f(t) / t$ is an integer. Now Claim 2 leaves us with only finitely many choices for this ratio, which means that there exists an infinite subset $\mathcal{T}^{\prime} \subseteq \mathcal{T}$ and a positive integer $a$ such that $f(t)=a t$ for all $t \in \mathcal{T}^{\prime}$, as required.  Since $L(t)=L(f(t))=L(a) L(t)$ for all $t \in \mathcal{T}^{\prime}$, we get $L(a)=1$, so the number $a$ is small. Step 3. We show that $f(x)=$ ax for all $x \in \mathbb{Z}$. Let $R_{i}=\{x \in \mathbb{Z}: x \equiv i(\bmod N!)\}$ denote the residue class of $i$ modulo $N!$. Claim 3. Assume that for some $r$, there are infinitely many $n \in R_{r}$ such that $f(n)=a n$. Then $f(x)=a x$ for all $x \in R_{r+1}$. Proof. Choose any $x \in R_{r+1}$. By our assumption, we can select $n \in R_{r}$ such that $f(n)=a n$ and $|n-x|>|f(x)-a x|$. Since $n-x \equiv r-(r+1)=-1(\bmod N!)$, the number $|n-x|$ is large. Therefore, by Step 1 we have $f(x) \equiv f(n)=a n \equiv a x(\bmod n-x)$, so $n-x \mid f(x)-a x$. Due to the choice of $n$, this yields $f(x)=a x$.  To complete Step 3, notice that the set $\mathcal{T}^{\prime}$ found in Step 2 contains infinitely many elements of some residue class $R_{i}$. Applying Claim 3, we successively obtain that $f(x)=a x$ for all $x \in R_{i+1}, R_{i+2}, \ldots, R_{i+N!}=R_{i}$. This finishes the solution.  Comment 1. As the proposer also mentions, one may also consider the version of the problem where the condition (1) is replaced by the condition that $L(f(a)-f(b))=L(a-b)$ for all integers $a$ and $b$ with $a>b$. This allows to remove of Step 1 from the solution.  Comment 2. Step 2 is the main step of the solution. We sketch several different approaches allowing to perform this step using statements which are weaker than Claim 2. Approach 1. Let us again denote the product of all small primes by $d$. We focus on the values $f\left(d^{i}\right)$, $i \geqslant 0$. In view of Step 1, we have $L\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)=L\left(d^{i}-d^{k}\right)=d^{i-k}-1$ for all $i>k \geqslant 0$.  Acting similarly to the beginning of the proof of Claim 2, one may choose a number $\alpha \geqslant 0$ such that the residues of the numbers $f\left(d^{i}\right), i=0,1, \ldots, N$, are distinct modulo $p^{\alpha}$ for each $p \in \mathcal{S}$. Then, for every $i>N$, there exists an exponent $k=k(i) \leqslant N$ such that $S\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)<P=d^{\alpha}$.  Since there are only finitely many options for $k(i)$, as well as for the corresponding numbers $S\left(f\left(d^{i}\right)-f\left(d^{k}\right)\right)$, there exists an infinite set $I$ of exponents $i>N$ such that $k(i)$ attains the same value $k_{0}$ for all $i \in I$, and such that, moreover, $S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)$ attains the same value $s_{0}$ for all $i \in I$. Therefore, for all such $i$ we have  $$ f\left(d^{i}\right)=f\left(d^{k_{0}}\right)+L\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right) \cdot S\left(f\left(d^{i}\right)-f\left(d^{k_{0}}\right)\right)=f\left(d^{k_{0}}\right)+\left(d^{i-k_{0}}-1\right) s_{0}, $$  which means that $f$ is linear on the infinite set $\left\{d^{i}: i \in I\right\}$ (although with rational coefficients). Finally, one may implement the relation $f\left(d^{i}\right) \equiv f(1)\left(\bmod d^{i}-1\right)$ in order to establish that in fact $f\left(d^{i}\right) / d^{i}$ is a (small and fixed) integer for all $i \in I$.  Approach 2. Alternatively, one may start with the following lemma. Lemma. There exists a positive constant $c$ such that  $$ L\left(\prod_{i=1}^{3 N}(f(k)-f(i))\right)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} $$  for all $k>3 N$. Proof. Let $k$ be an integer with $k>3 N$. Set $\Pi=\prod_{i=1}^{3 N}(f(k)-f(i))$. Notice that for every prime $p \in \mathcal{S}$, at most one of the numbers in the set  $$ \mathcal{H}=\{f(k)-f(i): 1 \leqslant i \leqslant 3 N\} $$  is divisible by a power of $p$ which is greater than $f(3 N)$; we say that such elements of $\mathcal{H}$ are bad. Now, for each element $h \in \mathcal{H}$ which is not bad we have $S(h) \leqslant f(3 N)^{N}$, while the bad elements do not exceed $f(k)$. Moreover, there are less than $N$ bad elements in $\mathcal{H}$. Therefore,  $$ S(\Pi)=\prod_{h \in \mathcal{H}} S(h) \leqslant(f(3 N))^{3 N^{2}} \cdot(f(k))^{N} . $$  This easily yields the lemma statement in view of the fact that $L(\Pi) S(\Pi)=\Pi \geqslant \mu(f(k))^{3 N}$ for some absolute constant $\mu$.  As a corollary of the lemma, one may get a weaker version of Claim 2 stating that there exists a positive constant $C$ such that $f(k) \leqslant C k^{3 / 2}$ for all $k>3 N$. Indeed, from Step 1 we have  $$ k^{3 N} \geqslant \prod_{i=1}^{3 N} L(k-i)=\prod_{i=1}^{3 N} L(f(k)-f(i)) \geqslant c(f(k))^{2 N} $$  so $f(k) \leqslant c^{-1 /(2 N)} k^{3 / 2}$. To complete Step 2 now, set $a=f(1)$. Due to the estimates above, we may choose a positive integer $n_{0}$ such that $|f(n)-a n|<\frac{n(n-1)}{2}$ for all $n \geqslant n_{0}$.  Take any $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$. Then $L(f(n)-f(0))=L(n)=n / 2$ and $L(f(n)-f(1))=$ $L(n-1)=n-1$; these relations yield $f(n) \equiv f(0)=0 \equiv a n(\bmod n / 2)$ and $f(n) \equiv f(1)=a \equiv a n$ $(\bmod n-1)$, respectively. Thus, $\left.\frac{n(n-1)}{2} \right\rvert\, f(n)-a n$, which shows that $f(n)=a n$ in view of the estimate above.  Comment 3. In order to perform Step 3, it suffices to establish the equality $f(n)=a n$ for any infinite set of values of $n$. However, if this set has some good structure, then one may find easier ways to complete this step.  For instance, after showing, as in Approach 2 , that $f(n)=$ an for all $n \geqslant n_{0}$ with $n \equiv 2(\bmod N!)$, one may proceed as follows. Pick an arbitrary integer $x$ and take any large prime $p$ which is greater than $|f(x)-a x|$. By the Chinese Remainder Theorem, there exists a positive integer $n>\max \left(x, n_{0}\right)$ such that $n \equiv 2(\bmod N!)$ and $n \equiv x(\bmod p)$. By Step 1 , we have $f(x) \equiv f(n)=a n \equiv a x(\bmod p)$. Due to the choice of $p$, this is possible only if $f(x)=a x$.