![](https://cdn.mathpix.com/cropped/2024_06_05_ded7ed172ed094285367g-01.jpg?height=875&width=827&top_left_y=365&top_left_x=627) # Contest Solutions $4^{\text {th }}$ MEMO, Strečno, Slovakia 9 to 15 September 2010 Problem I-1. Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all $x, y \in \mathbb{R}$, we have $$ f(x+y)+f(x) f(y)=f(x y)+(y+1) f(x)+(x+1) f(y) $$ Solution. Setting $y=0$ yields $$ 0=f(0)(f(x)-x-2) $$ It is easy to check that $f(x)=x+2$ is not a solution, so $f(0)=0$. Setting $x=1, y=-1$, we obtain $$ 0=f(-1)(f(1)-3) $$ so $f(-1)=0$ or $f(1)=3$. Let us assume $f(-1)=0$. Putting $x=2, y=-1$ in the original functional equation, we get $f(-2)=f(1)$. On the other hand, setting $x=-2, y=1$ gives $f(-2) f(1)=3 f(-2)-f(1)$ which together with $f(-2)=f(1)$ gives $f(1) \in\{0,2\}$. So we have $f(1)=a \in\{0,2,3\}$. Setting $y=1$ yields $$ f(x+1)=(3-a) f(x)+a(x+1) $$ for all real $x$. Now we set $y=1+1 / x$ for arbitrary $x \neq 0$, we obtain $$ f\left(x+\frac{1}{x}+1\right)+f(x) f\left(\frac{1}{x}+1\right)=f(x+1)+\left(\frac{1}{x}+2\right) f(x)+f\left(\frac{1}{x}+1\right)(x+1) $$ Applying (1) yields $$ (3-a)\left(f\left(x+\frac{1}{x}\right)+f(x) f\left(\frac{1}{x}\right)-(x+1) f\left(\frac{1}{x}\right)\right)=f(x)\left(5-2 a-(a-1) \frac{1}{x}\right)+2 a+a x $$ From this and the original functional equation with $y=1 / x$ we have $$ (3-a)\left(a+f(x)\left(1+\frac{1}{x}\right)\right)=f(x)\left(5-2 a-(a-1) \cdot \frac{1}{x}\right)+2 a+a x $$ which is equivalent to $$ f(x)\left(-2+a+\frac{2}{x}\right)=a^{2}+a x-a $$ Using $a \in\{0,2,3\}$ we get $f(x)=0, f(x)=x^{2}+x, f(x)=3 x$ for all real $x$ (with some exceptions when $-2+a+\frac{2}{x}=0$, but this cases can be handled easily for example by using (1)). We can also easily check that the functions $f(x)=0, f(x)=x^{2}+x, f(x)=3 x$ are solutions of the original functional equation. Solution 2. As in the first solution we obtain $f(0)=0, f(1)=a \in\{0,2,3\}$ and $$ f(x+1)=(3-a) f(x)+a(x+1) \quad \text { for } x \in \mathbb{R} $$ If $a=3$, then (2) implies that $f(x+1)=3(x+1)$ for all $x \in \mathbb{R}$ (and therefore $f(x)=3 x$ for all $x$ ). It is easy to verify that this is a solution of the functional equation. In the sequel we will assume that $a \in\{0,2\}$ and therefore $f(-1)=0$. We will compute $f(x y z)$ in two different ways. Setting $y z$ for $y$ into the original functional equation we obtain $$ \begin{aligned} f(x y z)= & f(x+y z)+f(x) f(y z)-(y z+1) f(x)-(x+1) f(y z)= \\ = & f(x+y z)+f(x) f(y+z)+f(x) f(y) f(z)-(z+1) f(x) f(y)- \\ & -(y+1) f(x) f(z)-(y z+1) f(x)-(x+1) f(y+z)-(x+1) f(y) f(z)+ \\ & +(x+1)(z+1) f(y)+(x+1)(y+1) f(z) \end{aligned} $$ On the other hand, setting $x y$ for $x$ and $z$ for $y$ into the original functional equation we obtain $$ \begin{aligned} f(x y z)= & f(x y+z)+f(x y) f(z)-(z+1) f(x y)-(x y+1) f(z)= \\ = & f(x y+z)+f(x+y) f(z)+f(x) f(y) f(z)-(y+1) f(x) f(z)- \\ & -(x+1) f(y) f(z)-(z+1) f(x+y)-(z+1) f(x) f(y)+(y+1)(z+1) f(x)+ \\ & +(x+1)(z+1) f(y)-(x y+1) f(z) . \end{aligned} $$ Therefore $$ \begin{aligned} & f(x+y z)+f(x) f(y+z)-(y z+1) f(x)-(x+1) f(y+z)+(x+1)(y+1) f(z)= \\ & =f(x y+z)+f(x+y) f(z)-(z+1) f(x+y)+(y+1)(z+1) f(x)-(x y+1) f(z) \end{aligned} $$ In particular, for $x=-1$ and $y=z$ we obtain $$ f\left(z^{2}-1\right)=f(z-1) f(z)-(z+1) f(z-1)+(z-1) f(z) $$ On the other hand, setting $x=z+1$ and $y=z-1$ into the original equation we obtain $$ f(2 z)+f(z+1) f(z-1)=f\left(z^{2}-1\right)+(z+2) f(z-1)+z f(z+1) $$ Therefore $$ f(2 z)+f(z+1) f(z-1)=f(z-1) f(z)+f(z-1)+(z-1) f(z)+z f(z+1) $$ Since (2) implies that $f(2)=5 a-a^{2}$ and since for $x=2$ and $y=z$ the original functional equation implies $$ f(z+2)+f(2) f(z)=f(2 z)+(z+1) f(2)+3 f(z) $$ it follows that $$ \begin{gathered} f(z+2)+\left(5 a-a^{2}\right) f(z)+f(z+1) f(z-1)= \\ =f(z-1) f(z)+f(z-1)+(z+2) f(z)+z f(z+1)+\left(5 a-a^{2}\right)(z+1) \end{gathered} $$ The equation (2) implies that $$ \begin{aligned} f(z) & =(3-a) f(z-1)+a z \\ f(z+1) & =(3-a)^{2} f(z-1)+\left(4 a-a^{2}\right) z+a \end{aligned} $$ and $$ f(z+2)=(3-a)^{3} f(z-1)+\left(a^{3}-7 a^{2}+13 a\right) z+5 a-a^{2} $$ From the last four equations we obtain that $$ \begin{aligned} (3-a)(2-a) f(z-1)^{2}- & 2(a-3)(a-2) z f(z-1)+\left(a^{2}-9 a+20\right) f(z-1)= \\ & =\left(5 a-a^{2}\right) z^{2}+\left(a^{2}-5 a\right) z \end{aligned} $$ For $a=2$ we get $6 f(z-1)=6 z^{2}-6 z$, therefore $f(z)=z^{2}+z$ and it is easy to verify that this is a solution of the functional equation. For $a=0$ we get $6 f(z-1)^{2}-12 z f(z-1)+20 f(z-1)=0$, which implies that for each $z \in \mathbb{R}$ one of the equalities $f(z)=0$ and $f(z)=2 z-\frac{4}{3}$ is satisfied. Assume that $f(z)=2 z-\frac{4}{3}$ for some $z \in \mathbb{R}$. Then the original functional equation for $x=1$ and $y=z$ implies that $f(z+1)=3 f(z)=6 z-4$. Therefore either $6 z-4=0$ or $6 z-4=2(z+1)-\frac{4}{3}$. The first equation implies that $z=\frac{2}{3}$ and $f(z)=2 z-\frac{4}{3}=0$, and the second equation implies that $z=\frac{7}{6}$ and therefore $f(z)=2 z-\frac{4}{3}=1, f(z+1)=3 z=3=2(z+1)-\frac{4}{3}$ and $f(z+2)=3 f(z+1)=9 \neq 5=2(z+2)-\frac{4}{3}$. The contradiction shows that $f(z)=0$ for each $z \in \mathbb{R}$. Problem I-2. All positive divisors of a positive integer $N$ are written on a blackboard. Two players $A$ and $B$ play the following game taking alternate moves. In the first move, the player A erases $N$. If the last erased number is $d$, then the next player erases either a divisor of $d$ or a multiple of $d$. The player who cannot make a move loses. Determine all numbers $N$ for which $A$ can win independently of the moves of $B$. Solution. Let $N=p_{1}^{a_{1}} p_{2}^{a_{2}} \ldots p_{k}^{a_{k}}$ be the prime factorization of $N$. In an arbitrary move the players writes down a divisor of $N$, which we can represent as a sequence $\left(b_{1}, b_{2}, \ldots, b_{k}\right)$, where $b_{i} \leq a_{i}$ (such a sequence represents the number $p_{1}^{b_{1}} p_{2}^{b_{2}} \ldots p_{k}^{b_{k}}$ ). The rules of the game say that the sequence $\left(b_{1}, b_{2}, \ldots, b_{k}\right)$ can be followed by a sequence $\left(c_{1}, c_{2}, \ldots, c_{k}\right)$ with either $c_{i} \leq b_{i}$ for each $i$, or $a_{i} \geq c_{i} \geq b_{i}$ for each $i$ (obviously, if such a sequence is not on the sheet). If one of the numbers $a_{i}$ is odd, then the player $B$ posses the winning strategy. Indeed, let for simplicity $a_{1}$ be odd. Then the response for the move $\left(b_{1}, b_{2}, \ldots, b_{k}\right)$ should be $$ \left(a_{1}-b_{1}, b_{2}, \ldots, b_{k}\right) $$ One can easily check that this is a winning strategy for $B$ : All the legal sequences split up into pairs and when $A$ writes down one sequence from a pair, player $B$ responds with the second one from the same pair ( $a_{1}-b_{1} \neq b_{1}$ because of $a_{1}$ is odd). If all $a_{i}$ are even, then the player $A$ has a winning strategy. Let the move of player $B$ be $\left(b_{1}, b_{2}, \ldots, b_{k}\right)$, where one of $b_{i}$ is strictly less than $a_{i}\left(\left(b_{1}, b_{2}, \ldots, b_{k}\right) \neq\left(a_{1}, a_{2}, \ldots, a_{k}\right)\right.$, as it was the first move of $A$ ). Let $j$ be the smallest index such that $b_{j}a>b>1$, thus the condition is trivially satisfied. Otherwise, for some integers $k$ and $\ell, n=\ell \cdot k$ with $\ell>k>1$. Then $\ell-k$ also divides $n=\ell \cdot k$. If $\ell$ and $k$ are coprime, $\ell-k$ is coprime to $\ell$ and $k$, thus $\ell-k=1$. Hence $n=k(k+1)$. Let $p$ be a prime divisor of $k$. Since $k+1-p$ is coprime to $p(k+1)$, the condition implies that $k+1-p$ divides $k$. But $$ k+1-p=(p-1)\left(\frac{k}{p}-1\right)+\frac{k}{p} $$ divides $k$ if and only if $(p-1)(k / p-1)=0$; thus $k=p$ and $n=p(p+1)$. Clearly $p=2$ gives a solution $n=6$. Otherwise $p+1=q \cdot r$ for some prime $q$ and integer $r$ greater than 1 . Since $$ p-q=q r-1-q=(q-1)(r-1)-2+r $$ is a divisor of $r$, we have $(q-1)(r-1) \leq 2$. This gives only three possibilities: $q=r=2$ or $q=2, r=3$ or $q=3, r=2$. The first one yields a solution $n=12$, while the other two give $n=30$, which fails to satisfy the conditions: $6-2 \nmid 30$. It remains to consider the case when $n$ cannot be written as a product of two coprime numbers greater than 1 . Then $n=p^{a}$, where $a \geq 3$ (for $a \leq 2$, we obtain the solutions we have already described). This implies that $p$ and $p^{2}$ are proper divisors of $n$, hence $p^{2}-p=p(p-1)$ divides $n=p^{a}$. Since $p$ and $p-1$ are coprime, this is only possible when $p-1=1$; thus $p=2$. However, $2^{3}-2=6$ is not a divisor of $2^{a}$; hence there are no solutions for $a \geq 4$. Only the number 8 satisfies the condition in this case. Solution 3. Clearly $1, p, p^{2}$ are solutions. For the other prime powers, $n=p^{k}$ is possible only for $p=2$ and $k<4$ ( $p^{2}-p$ is even for odd $p, 8-2=6$ does not divide 16). Now, $n$ is not a prime power, then it has two (or more) prime factors $p, q$. Then $q-p \mid n$. If $p, q$ are both odd, then $2 \mid n$. (Otherwise also $2 \mid n$.) Therefore, if $n$ is not a prime power, one of its factors is 2 . Let $p$ be the smallest divisor of $n$ larger than $2 ; 1<21$. Then $1<3<3 a<6 a=n$, therefore $$ \begin{gathered} (3 a-3)=3(a-1) \mid n=6 a \\ a-1 \mid 2 a . \end{gathered} $$ Since $\operatorname{gcd}(a, a-1)=1$, we have $a-1 \mid 2$, hence $a-1=1$ or $a-1=2$, which yields $n=12$ or $n=18$. It is easy to check that $n=12$ is a solution, and $n=18$ is not (e.g., $7=9-2$ is not a divisor of 18). ## Problem T-1. Three strictly increasing sequences $$ a_{1}, a_{2}, a_{3}, \ldots, \quad b_{1}, b_{2}, b_{3}, \ldots, \quad c_{1}, c_{2}, c_{3}, \ldots $$ of positive integers are given. Every positive integer belongs to exactly one of the three sequences. For every positive integer $n$, the following conditions hold: (i) $c_{a_{n}}=b_{n}+1$; (ii) $a_{n+1}>b_{n}$; (iii) the number $c_{n+1} c_{n}-(n+1) c_{n+1}-n c_{n}$ is even. Find $a_{2010}, b_{2010}$, and $c_{2010}$. Solution. Since $\left\{c_{n}\right\}$ is a strictly increasing sequence of positive integers, it is clear that $c_{n} \geq n, n \in \mathbb{N}$. Hence, $c_{a_{n}} \geq a_{n}, n \in \mathbb{N}$. However, the given sequences do not contain equal terms, so $c_{a_{n}}>a_{n}$ and $b_{n}=c_{a_{n}}-1>a_{n}, n \in \mathbb{N}$. Similarly, from (ii) and (iii), $a_{n+1}>b_{n}+1=c_{a_{n}}, n \in \mathbb{N}$. It is also easy to see that $b_{n}1$ then $c_{1}=1$ or $b_{1}=1$. The latter case is impossible because $b_{1}>a_{1}$. Then we must have $c_{1}=1$, and either $c_{2}=2$, or $a_{1}=2$ and $c_{a_{1}}=c_{2}=a_{1}+2=4$. In both cases we obtain a contradiction by setting $n=1$ in (iv). This proves that $a_{1}=1$, and, together with (2), defines a unique sequence $\left\{a_{n}\right\}$ : $a_{n}=a_{n-1}+(2 n-1)=a_{n-2}+(2 n-3)+(2 n-1)=\cdots=a_{1}+3+5+\ldots+(2 n-1)=n^{2}, \quad n \in \mathbb{N}$. Hence, $$ \begin{aligned} a_{2010} & =2010^{2} \\ b_{2010} & =c_{a_{2010}}-1=a_{2010}+2 \cdot 2010-1=2011^{2}-2 \\ c_{1936} & =c_{44^{2}}=c_{a_{44}}=a_{44}+2 \cdot 44=44^{2}+88=2024 \\ a_{45} & =45^{2}=2025 \end{aligned} $$ and all the integers between $a_{45}$ and $b_{45}=c_{a_{45}}-1=a_{45}+2 \cdot 45-1=a_{45}+89$ belong to the sequence $\left\{c_{n}\right\}$. Hence, these integers have the form $$ c_{1936+k}=a_{45}+k, \quad k=1,2, \ldots, 88 $$ and $c_{2010}=c_{1936+74}=a_{45}+74=2099$. Answer. $a_{2010}=2010^{2}, b_{2010}=2011^{2}-2, c_{2010}=2099$. Solution 2. Denote by $(*)$ the trivial fact $a_{n}b_{1}$, which is impossible. If $c_{1}=2$, then by (ii) we have $2=c_{1}=c_{a_{1}}=b_{1}+1$, hence $b_{1}=1$ which is also impossible. So the only way is to put $b_{2}=2$. Then by (ii) $c_{1}=c_{a_{1}}=b_{1}+1=3$. | $n$ | 1 | 2 | 3 | 4 | 5 | $\ldots$ | | :---: | :--- | :--- | :--- | :--- | :--- | :--- | | $a_{n}$ | 1 | | | | | | | $b_{n}$ | 2 | | | | | | | $c_{n}$ | 3 | | | | | | Now, because of (iv), we have $c_{2} \neq 4$. Also, $b_{2} \neq 4$, because otherwise by (*) and (ii) $a_{2}1 $$ The numbers 1 and 2 are powers of two, hence we may assume that $n \geq 3$. Since $n$ is not a power of two, it has an odd divisor greater than one; therefore, according to our lemma, ${ }^{3}$ there are coprime numbers $a$ and $b$ such that $$ 10^{n}+1=a b $$ Our task is to prove that there are numbers $t$ and $s$ such that $$ m=\left(10^{n}+1\right) t=a b t=s(s-1) $$ First, we show that there is a positive integer $s$ divisible by $a$ which satisfies $s \equiv 1$ $($ mod $b$ ). Consider the numbers $0, a, 2 a, \ldots,(b-1) a$. These numbers give mutually different remainders modulo $b$ since $a$ and $b$ are coprime. Therefore, one of them gives remainder 1 and we take $s$ to be this number. Similarly we can pick a number $s^{\prime}$ divisible by $b$ which satisfies $s^{\prime} \equiv 1(\bmod a)$. The numbers $s$ and $s^{\prime}$ are positive and smaller than $10^{n}$. Therefore, $s(s-1)$ and $s^{\prime}\left(s^{\prime}-1\right)$ are both divisible by $a b$ and smaller than $10^{2 n}$. Moreover, $s+s^{\prime} \equiv 1(\bmod a b)$. The number $s+s^{\prime}$ is greater than 1 and smaller than $2 \cdot 10^{n}$. Hence $s+s^{\prime}=a b+1$. Therefore, one of the numbers $s$ and $s^{\prime}$ is greater than $5 \cdot 10^{n-1}$. Then one of the numbers $s(s-1)$ or $s^{\prime}\left(s^{\prime}-1\right)$ is greater than $25 \cdot 10^{2 n-2}$, thus it has $2 n$ digits. This number has all the required properties. Comment. Instead od using congruences we can also look at Diophantine equations $a x=$ $b y+1$ and $a x=b y-1$. Both have solutions with $010^{n-1}$ for one of them.[^2] [^0]: ${ }^{1}$ Slope of the line with the equation $z+t \bar{z}=s$ is $t$. [^1]: ${ }^{2}$ Another way to look at $a_{n} / 3$ modulo 4 is to note that it always ends with 67 . [^2]: ${ }^{3}$ We can avoid using the lemma by exploiting the Mihailescu's theorem, first known as Catalan's Conjecture; it was proved in 2002. It says that the only solution of the equation $x^{a}-y^{b}=1$ in positive integers greater than one is $3^{2}-2^{3}$. This implies that if $10^{n}+1$ is a power of a prime then it is a prime. This cannot happen since $n$ has an odd divisor.