di-zhang-fdu/OlympiadExtended huggingface dataset:
Subfield: Algebra


Question: A sequence $x_{1}, x_{2}, \ldots$ is defined by $x_{1}=1$ and $x_{2 k}=-x_{k}, x_{2 k-1}=(-1)^{k+1} x_{k}$ for all $k \geq 1$. Prove that $x_{1}+x_{2}+\cdots+x_{n} \geq 0$ for all $n \geq 1$.

Solution:
We start with some observations. First, from the definition of $x_{i}$ it follows that for each positive integer $k$ we have

$$
x_{4 k-3}=x_{2 k-1}=-x_{4 k-2} \quad \text { and } \quad x_{4 k-1}=x_{4 k}=-x_{2 k}=x_{k} \text {. }
\tag{1}
$$

Hence, denoting $S_{n}=\sum_{i=1}^{n} x_{i}$, we have

$$
S_{4 k}=\sum_{i=1}^{k}\left(\left(x_{4 k-3}+x_{4 k-2}\right)+\left(x_{4 k-1}+x_{4 k}\right)\right)=\sum_{i=1}^{k}\left(0+2 x_{k}\right)=2 S_{k}\tag{2}
$$
$$
S_{4 k+2}=S_{4 k}+\left(x_{4 k+1}+x_{4 k+2}\right)=S_{4 k}\tag{3}
$$

Observe also that $S_{n}=\sum_{i=1}^{n} x_{i} \equiv \sum_{i=1}^{n} 1=n(\bmod 2)$.

Now we prove by induction on $k$ that $S_{i} \geq 0$ for all $i \leq 4 k$. The base case is valid since $x_{1}=x_{3}=x_{4}=1, x_{2}=-1$. For the induction step, assume that $S_{i} \geq 0$ for all $i \leq 4 k$. Using the relations (1)-(3), we obtain

$$
S_{4 k+4}=2 S_{k+1} \geq 0, \quad S_{4 k+2}=S_{4 k} \geq 0, \quad S_{4 k+3}=S_{4 k+2}+x_{4 k+3}=\frac{S_{4 k+2}+S_{4 k+4}}{2} \geq 0
$$

So, we are left to prove that $S_{4 k+1} \geq 0$. If $k$ is odd, then $S_{4 k}=2 S_{k} \geq 0$; since $k$ is odd, $S_{k}$ is odd as well, so we have $S_{4 k} \geq 2$ and hence $S_{4 k+1}=S_{4 k}+x_{4 k+1} \geq 1$.

Conversely, if $k$ is even, then we have $x_{4 k+1}=x_{2 k+1}=x_{k+1}$, hence $S_{4 k+1}=S_{4 k}+x_{4 k+1}=$ $2 S_{k}+x_{k+1}=S_{k}+S_{k+1} \geq 0$. The step is proved.
We will use the notation of $S_{n}$ and the relations (1)-(3) from the previous solution.

Assume the contrary and consider the minimal $n$ such that $S_{n+1}<0$; surely $n \geq 1$, and from $S_{n} \geq 0$ we get $S_{n}=0, x_{n+1}=-1$. Hence, we are especially interested in the set $M=\left\{n: S_{n}=0\right\}$; our aim is to prove that $x_{n+1}=1$ whenever $n \in M$ thus coming to a contradiction.

For this purpose, we first describe the set $M$ inductively. We claim that (i) $M$ consists only of even numbers, (ii) $2 \in M$, and (iii) for every even $n \geq 4$ we have $n \in M \Longleftrightarrow[n / 4] \in M$. Actually, (i) holds since $S_{n} \equiv n(\bmod 2)$, (ii) is straightforward, while (iii) follows from the relations $S_{4 k+2}=S_{4 k}=2 S_{k}$.

Now, we are left to prove that $x_{n+1}=1$ if $n \in M$. We use the induction on $n$. The base case is $n=2$, that is, the minimal element of $M$; here we have $x_{3}=1$, as desired.

For the induction step, consider some $4 \leq n \in M$ and let $m=[n / 4] \in M$; then $m$ is even, and $x_{m+1}=1$ by the induction hypothesis. We prove that $x_{n+1}=x_{m+1}=1$. If $n=4 m$ then we have $x_{n+1}=x_{2 m+1}=x_{m+1}$ since $m$ is even; otherwise, $n=4 m+2$, and $x_{n+1}=-x_{2 m+2}=x_{m+1}$, as desired. The proof is complete.
Subfield: Algebra


Question: Denote by $\mathbb{Q}^{+}$the set of all positive rational numbers. Determine all functions $f: \mathbb{Q}^{+} \rightarrow \mathbb{Q}^{+}$ which satisfy the following equation for all $x, y \in \mathbb{Q}^{+}$:

$$
f\left(f(x)^{2} y\right)=x^{3} f(x y)
\tag{1}
$$

Solution:
By substituting $y=1$, we get

$$
f\left(f(x)^{2}\right)=x^{3} f(x)\tag{2}
$$

Then, whenever $f(x)=f(y)$, we have

$$
x^{3}=\frac{f\left(f(x)^{2}\right)}{f(x)}=\frac{f\left(f(y)^{2}\right)}{f(y)}=y^{3}
$$

which implies $x=y$, so the function $f$ is injective.

Now replace $x$ by $x y$ in (2), and apply (1) twice, second time to $\left(y, f(x)^{2}\right)$ instead of $(x, y)$ :

$$
f\left(f(x y)^{2}\right)=(x y)^{3} f(x y)=y^{3} f\left(f(x)^{2} y\right)=f\left(f(x)^{2} f(y)^{2}\right)
$$

Since $f$ is injective, we get

$$
\begin{aligned}
f(x y)^{2} & =f(x)^{2} f(y)^{2} \\
f(x y) & =f(x) f(y) .
\end{aligned}
$$

Therefore, $f$ is multiplicative. This also implies $f(1)=1$ and $f\left(x^{n}\right)=f(x)^{n}$ for all integers $n$.

Then the function equation (1) can be re-written as

$$
\begin{aligned}
f(f(x))^{2} f(y) & =x^{3} f(x) f(y), \\
f(f(x)) & =\sqrt{x^{3} f(x)} .
\end{aligned}
\tag{3}
$$

Let $g(x)=x f(x)$. Then, by (3), we have

$$
\begin{aligned}
g(g(x)) & =g(x f(x))=x f(x) \cdot f(x f(x))=x f(x)^{2} f(f(x))= \\
& =x f(x)^{2} \sqrt{x^{3} f(x)}=(x f(x))^{5 / 2}=(g(x))^{5 / 2},
\end{aligned}
$$

and, by induction,

$$
\underbrace{g(g(\ldots g}_{n+1}(x) \ldots))=(g(x))^{(5 / 2)^{n}}
\tag{4}
$$

for every positive integer $n$.

Consider (4) for a fixed $x$. The left-hand side is always rational, so $(g(x))^{(5 / 2)^{n}}$ must be rational for every $n$. We show that this is possible only if $g(x)=1$. Suppose that $g(x) \neq 1$, and let the prime factorization of $g(x)$ be $g(x)=p_{1}^{\alpha_{1}} \ldots p_{k}^{\alpha_{k}}$ where $p_{1}, \ldots, p_{k}$ are distinct primes and $\alpha_{1}, \ldots, \alpha_{k}$ are nonzero integers. Then the unique prime factorization of (4) is

$$
\underbrace{g(g(\ldots g}_{n+1}(x) \ldots))=(g(x))^{(5 / 2)^{n}}=p_{1}^{(5 / 2)^{n} \alpha_{1}} \ldots p_{k}^{(5 / 2)^{n} \alpha_{k}}
$$



where the exponents should be integers. But this is not true for large values of $n$, for example $\left(\frac{5}{2}\right)^{n} \alpha_{1}$ cannot be a integer number when $2^{n} \nmid \alpha_{1}$. Therefore, $g(x) \neq 1$ is impossible.

Hence, $g(x)=1$ and thus $f(x)=\frac{1}{x}$ for all $x$.

The function $f(x)=\frac{1}{x}$ satisfies the equation (1):

$$
f\left(f(x)^{2} y\right)=\frac{1}{f(x)^{2} y}=\frac{1}{\left(\frac{1}{x}\right)^{2} y}=\frac{x^{3}}{x y}=x^{3} f(x y)
$$

Final answer: $f(x)=\frac{1}{x}$
Subfield: Number Theory


Question: Find the least positive integer $n$ for which there exists a set $\left\{s_{1}, s_{2}, \ldots, s_{n}\right\}$ consisting of $n$ distinct positive integers such that

$$
\left(1-\frac{1}{s_{1}}\right)\left(1-\frac{1}{s_{2}}\right) \ldots\left(1-\frac{1}{s_{n}}\right)=\frac{51}{2010}
$$

Solution:
Suppose that for some $n$ there exist the desired numbers; we may assume that $s_{1}<s_{2}<\cdots<s_{n}$. Surely $s_{1}>1$ since otherwise $1-\frac{1}{s_{1}}=0$. So we have $2 \leq s_{1} \leq s_{2}-1 \leq \cdots \leq s_{n}-(n-1)$, hence $s_{i} \geq i+1$ for each $i=1, \ldots, n$. Therefore

$$
\begin{aligned}
\frac{51}{2010} & =\left(1-\frac{1}{s_{1}}\right)\left(1-\frac{1}{s_{2}}\right) \ldots\left(1-\frac{1}{s_{n}}\right) \\
& \geq\left(1-\frac{1}{2}\right)\left(1-\frac{1}{3}\right) \ldots\left(1-\frac{1}{n+1}\right)=\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{n}{n+1}=\frac{1}{n+1}
\end{aligned}
$$

which implies

$$
n+1 \geq \frac{2010}{51}=\frac{670}{17}>39
$$

so $n \geq 39$.

Now we are left to show that $n=39$ fits. Consider the set $\{2,3, \ldots, 33,35,36, \ldots, 40,67\}$ which contains exactly 39 numbers. We have

$$
\frac{1}{2} \cdot \frac{2}{3} \cdots \frac{32}{33} \cdot \frac{34}{35} \cdots \frac{39}{40} \cdot \frac{66}{67}=\frac{1}{33} \cdot \frac{34}{40} \cdot \frac{66}{67}=\frac{17}{670}=\frac{51}{2010}
\tag{1}
$$

hence for $n=39$ there exists a desired example.

Final answer: 39
Subfield: Number Theory


Question: Find all pairs $(m, n)$ of nonnegative integers for which

$$
m^{2}+2 \cdot 3^{n}=m\left(2^{n+1}-1\right)
\tag{1}
$$

Solution:
For fixed values of $n$, the equation (1) is a simple quadratic equation in $m$. For $n \leq 5$ the solutions are listed in the following table.

| case | equation | discriminant | integer roots |
| :--- | :--- | :--- | :--- |
| $n=0$ | $m^{2}-m+2=0$ | -7 | none |
| $n=1$ | $m^{2}-3 m+6=0$ | -15 | none |
| $n=2$ | $m^{2}-7 m+18=0$ | -23 | none |
| $n=3$ | $m^{2}-15 m+54=0$ | 9 | $m=6$ and $m=9$ |
| $n=4$ | $m^{2}-31 m+162=0$ | 313 | none |
| $n=5$ | $m^{2}-63 m+486=0$ | $2025=45^{2}$ | $m=9$ and $m=54$ |

We prove that there is no solution for $n \geq 6$.

Suppose that $(m, n)$ satisfies (1) and $n \geq 6$. Since $m \mid 2 \cdot 3^{n}=m\left(2^{n+1}-1\right)-m^{2}$, we have $m=3^{p}$ with some $0 \leq p \leq n$ or $m=2 \cdot 3^{q}$ with some $0 \leq q \leq n$.

In the first case, let $q=n-p$; then

$$
2^{n+1}-1=m+\frac{2 \cdot 3^{n}}{m}=3^{p}+2 \cdot 3^{q}
$$

In the second case let $p=n-q$. Then

$$
2^{n+1}-1=m+\frac{2 \cdot 3^{n}}{m}=2 \cdot 3^{q}+3^{p}
$$

Hence, in both cases we need to find the nonnegative integer solutions of

$$
3^{p}+2 \cdot 3^{q}=2^{n+1}-1, \quad p+q=n .
\tag{2}
$$

Next, we prove bounds for $p, q$. From (2) we get

$$
3^{p}<2^{n+1}=8^{\frac{n+1}{3}}<9^{\frac{n+1}{3}}=3^{\frac{2(n+1)}{3}}
$$

and

$$
2 \cdot 3^{q}<2^{n+1}=2 \cdot 8^{\frac{n}{3}}<2 \cdot 9^{\frac{n}{3}}=2 \cdot 3^{\frac{2 n}{3}}<2 \cdot 3^{\frac{2(n+1)}{3}}
$$

so $p, q<\frac{2(n+1)}{3}$. Combining these inequalities with $p+q=n$, we obtain

$$
\frac{n-2}{3}<p, q<\frac{2(n+1)}{3}
\tag{3}
$$

Now let $h=\min (p, q)$. By (3) we have $h>\frac{n-2}{3}$; in particular, we have $h>1$. On the left-hand side of (2), both terms are divisible by $3^{h}$, therefore $9\left|3^{h}\right| 2^{n+1}-1$. It is easy check that $\operatorname{ord}_{9}(2)=6$, so $9 \mid 2^{n+1}-1$ if and only if $6 \mid n+1$. Therefore, $n+1=6 r$ for some positive integer $r$, and we can write

$$
2^{n+1}-1=4^{3 r}-1=\left(4^{2 r}+4^{r}+1\right)\left(2^{r}-1\right)\left(2^{r}+1\right)
\tag{4}
$$



Notice that the factor $4^{2 r}+4^{r}+1=\left(4^{r}-1\right)^{2}+3 \cdot 4^{r}$ is divisible by 3 , but it is never divisible by 9 . The other two factors in (4), $2^{r}-1$ and $2^{r}+1$ are coprime: both are odd and their difference is 2 . Since the whole product is divisible by $3^{h}$, we have either $3^{h-1} \mid 2^{r}-1$ or $3^{h-1} \mid 2^{r}+1$. In any case, we have $3^{h-1} \leq 2^{r}+1$. Then

$$
\begin{gathered}
3^{h-1} \leq 2^{r}+1 \leq 3^{r}=3^{\frac{n+1}{6}} \\
\frac{n-2}{3}-1<h-1 \leq \frac{n+1}{6} \\
n<11 .
\end{gathered}
$$

But this is impossible since we assumed $n \geq 6$, and we proved $6 \mid n+1$.

Final answer: $(6,3),(9,3),(9,5),(54,5)$
Subfield: Number Theory


Question: Find the smallest number $n$ such that there exist polynomials $f_{1}, f_{2}, \ldots, f_{n}$ with rational coefficients satisfying

$$
x^{2}+7=f_{1}(x)^{2}+f_{2}(x)^{2}+\cdots+f_{n}(x)^{2} .
$$

Solution:
The equality $x^{2}+7=x^{2}+2^{2}+1^{2}+1^{2}+1^{2}$ shows that $n \leq 5$. It remains to show that $x^{2}+7$ is not a sum of four (or less) squares of polynomials with rational coefficients.

Suppose by way of contradiction that $x^{2}+7=f_{1}(x)^{2}+f_{2}(x)^{2}+f_{3}(x)^{2}+f_{4}(x)^{2}$, where the coefficients of polynomials $f_{1}, f_{2}, f_{3}$ and $f_{4}$ are rational (some of these polynomials may be zero).

Clearly, the degrees of $f_{1}, f_{2}, f_{3}$ and $f_{4}$ are at most 1 . Thus $f_{i}(x)=a_{i} x+b_{i}$ for $i=1,2,3,4$ and some rationals $a_{1}, b_{1}, a_{2}, b_{2}, a_{3}, b_{3}, a_{4}, b_{4}$. It follows that $x^{2}+7=\sum_{i=1}^{4}\left(a_{i} x+b_{i}\right)^{2}$ and hence

$$
\sum_{i=1}^{4} a_{i}^{2}=1, \quad \sum_{i=1}^{4} a_{i} b_{i}=0, \quad \sum_{i=1}^{4} b_{i}^{2}=7
\tag{1}
$$

Let $p_{i}=a_{i}+b_{i}$ and $q_{i}=a_{i}-b_{i}$ for $i=1,2,3,4$. Then

$$
\begin{aligned}
\sum_{i=1}^{4} p_{i}^{2} & =\sum_{i=1}^{4} a_{i}^{2}+2 \sum_{i=1}^{4} a_{i} b_{i}+\sum_{i=1}^{4} b_{i}^{2}=8, \\
\sum_{i=1}^{4} q_{i}^{2} & =\sum_{i=1}^{4} a_{i}^{2}-2 \sum_{i=1}^{4} a_{i} b_{i}+\sum_{i=1}^{4} b_{i}^{2}=8 \\
\text { and } \sum_{i=1}^{4} p_{i} q_{i} & =\sum_{i=1}^{4} a_{i}^{2}-\sum_{i=1}^{4} b_{i}^{2}=-6,
\end{aligned}
$$

which means that there exist a solution in integers $x_{1}, y_{1}, x_{2}, y_{2}, x_{3}, y_{3}, x_{4}, y_{4}$ and $m>0$ of the system of equations
(i) $\sum_{i=1}^{4} x_{i}^{2}=8 m^{2}$
(ii) $\sum_{i=1}^{4} y_{i}^{2}=8 m^{2}$
(iii) $\sum_{i=1}^{4} x_{i} y_{i}=-6 m^{2}$.

We will show that such a solution does not exist.

Assume the contrary and consider a solution with minimal $m$. Note that if an integer $x$ is odd then $x^{2} \equiv 1(\bmod 8)$. Otherwise (i.e., if $x$ is even) we have $x^{2} \equiv 0(\bmod 8)$ or $x^{2} \equiv 4$ $(\bmod 8)$. Hence, by $(\mathrm{i})$, we get that $x_{1}, x_{2}, x_{3}$ and $x_{4}$ are even. Similarly, by (ii), we get that $y_{1}, y_{2}, y_{3}$ and $y_{4}$ are even. Thus the LHS of (iii) is divisible by 4 and $m$ is also even. It follows that $\left(\frac{x_{1}}{2}, \frac{y_{1}}{2}, \frac{x_{2}}{2}, \frac{y_{2}}{2}, \frac{x_{3}}{2}, \frac{y_{3}}{2}, \frac{x_{4}}{2}, \frac{y_{4}}{2}, \frac{m}{2}\right)$ is a solution of the system of equations (i), (ii) and (iii), which contradicts the minimality of $m$.

Final answer: 5
Subfield: Number Theory


Question: Let $a, b$ be integers, and let $P(x)=a x^{3}+b x$. For any positive integer $n$ we say that the pair $(a, b)$ is $n$-good if $n \mid P(m)-P(k)$ implies $n \mid m-k$ for all integers $m, k$. We say that $(a, b)$ is very good if $(a, b)$ is $n$-good for infinitely many positive integers $n$.
Show that all 2010-good pairs are very good.

Solution:
We will show that if a pair $(a, b)$ is $2010-\operatorname{good}$ then $(a, b)$ is $67^{i}$-good for all positive integer $i$.

Claim 1. If $(a, b)$ is $2010-\operatorname{good}$ then $(a, b)$ is 67 -good.

Proof. Assume that $P(m)=P(k)(\bmod 67)$. Since 67 and 30 are coprime, there exist integers $m^{\prime}$ and $k^{\prime}$ such that $k^{\prime} \equiv k(\bmod 67), k^{\prime} \equiv 0(\bmod 30)$, and $m^{\prime} \equiv m(\bmod 67), m^{\prime} \equiv 0$ $(\bmod 30)$. Then we have $P\left(m^{\prime}\right) \equiv P(0) \equiv P\left(k^{\prime}\right)(\bmod 30)$ and $P\left(m^{\prime}\right) \equiv P(m) \equiv P(k) \equiv P\left(k^{\prime}\right)$ $(\bmod 67)$, hence $P\left(m^{\prime}\right) \equiv P\left(k^{\prime}\right)(\bmod 2010)$. This implies $m^{\prime} \equiv k^{\prime}(\bmod 2010)$ as $(a, b)$ is 2010 -good. It follows that $m \equiv m^{\prime} \equiv k^{\prime} \equiv k(\bmod 67)$. Therefore, $(a, b)$ is 67 -good.

Claim 2. If $(a, b)$ is 67 -good then $67 \mid a$.

Proof. Suppose that $67 \nmid a$. Consider the sets $\left\{a t^{2}(\bmod 67): 0 \leq t \leq 33\right\}$ and $\left\{-3 a s^{2}-b\right.$ $\bmod 67: 0 \leq s \leq 33\}$. Since $a \not \equiv 0(\bmod 67)$, each of these sets has 34 elements. Hence they have at least one element in common. If $a t^{2} \equiv-3 a s^{2}-b(\bmod 67)$ then for $m=t \pm s, k=\mp 2 s$ we have

$$
\begin{aligned}
P(m)-P(k)=a\left(m^{3}-k^{3}\right)+b(m-k) & =(m-k)\left(a\left(m^{2}+m k+k^{2}\right)+b\right) \\
& =(t \pm 3 s)\left(a t^{2}+3 a s^{2}+b\right) \equiv 0 \quad(\bmod 67)
\end{aligned}
$$

Since $(a, b)$ is 67 -good, we must have $m \equiv k(\bmod 67)$ in both cases, that is, $t \equiv 3 s(\bmod 67)$ and $t \equiv-3 s(\bmod 67)$. This means $t \equiv s \equiv 0(\bmod 67)$ and $b \equiv-3 a s^{2}-a t^{2} \equiv 0(\bmod 67)$. But then $67 \mid P(7)-P(2)=67 \cdot 5 a+5 b$ and $67 / 17-2$, contradicting that $(a, b)$ is 67 -good.

Claim 3. If $(a, b)$ is $2010-\operatorname{good}$ then $(a, b)$ is $67^{i}-\operatorname{good}$ all $i \geq 1$.

Proof. By Claim 2 , we have $67 \mid a$. If $67 \mid b$, then $P(x) \equiv P(0)(\bmod 67)$ for all $x$, contradicting that $(a, b)$ is 67 -good. Hence, $67 /\langle b$.

Suppose that $67^{i} \mid P(m)-P(k)=(m-k)\left(a\left(m^{2}+m k+k^{2}\right)+b\right)$. Since $67 \mid a$ and $67 \not \nmid b$, the second factor $a\left(m^{2}+m k+k^{2}\right)+b$ is coprime to 67 and hence $67^{i} \mid m-k$. Therefore, $(a, b)$ is $67^{i}$-good.
Subfield: Number Theory


Question: Let $\mathbb{N}$ be the set of all positive integers. Find all functions $f: \mathbb{N} \rightarrow \mathbb{N}$ such that the number $(f(m)+n)(m+f(n))$ is a square for all $m, n \in \mathbb{N}$.

Solution:
First, it is clear that all functions of the form $f(n)=n+c$ with a constant nonnegative integer $c$ satisfy the problem conditions since $(f(m)+n)(f(n)+m)=(n+m+c)^{2}$ is a square.

We are left to prove that there are no other functions. We start with the following Lemma. Suppose that $p \mid f(k)-f(\ell)$ for some prime $p$ and positive integers $k, \ell$. Then $p \mid k-\ell$. Proof. Suppose first that $p^{2} \mid f(k)-f(\ell)$, so $f(\ell)=f(k)+p^{2} a$ for some integer $a$. Take some positive integer $D>\max \{f(k), f(\ell)\}$ which is not divisible by $p$ and set $n=p D-f(k)$. Then the positive numbers $n+f(k)=p D$ and $n+f(\ell)=p D+(f(\ell)-f(k))=p(D+p a)$ are both divisible by $p$ but not by $p^{2}$. Now, applying the problem conditions, we get that both the numbers $(f(k)+n)(f(n)+k)$ and $(f(\ell)+n)(f(n)+\ell)$ are squares divisible by $p$ (and thus by $p^{2}$ ); this means that the multipliers $f(n)+k$ and $f(n)+\ell$ are also divisible by $p$, therefore $p \mid(f(n)+k)-(f(n)+\ell)=k-\ell$ as well.

On the other hand, if $f(k)-f(\ell)$ is divisible by $p$ but not by $p^{2}$, then choose the same number $D$ and set $n=p^{3} D-f(k)$. Then the positive numbers $f(k)+n=p^{3} D$ and $f(\ell)+n=$ $p^{3} D+(f(\ell)-f(k))$ are respectively divisible by $p^{3}$ (but not by $p^{4}$ ) and by $p$ (but not by $p^{2}$ ). Hence in analogous way we obtain that the numbers $f(n)+k$ and $f(n)+\ell$ are divisible by $p$, therefore $p \mid(f(n)+k)-(f(n)+\ell)=k-\ell$.

We turn to the problem. First, suppose that $f(k)=f(\ell)$ for some $k, \ell \in \mathbb{N}$. Then by Lemma we have that $k-\ell$ is divisible by every prime number, so $k-\ell=0$, or $k=\ell$. Therefore, the function $f$ is injective.

Next, consider the numbers $f(k)$ and $f(k+1)$. Since the number $(k+1)-k=1$ has no prime divisors, by Lemma the same holds for $f(k+1)-f(k)$; thus $|f(k+1)-f(k)|=1$.

Now, let $f(2)-f(1)=q,|q|=1$. Then we prove by induction that $f(n)=f(1)+q(n-1)$. The base for $n=1,2$ holds by the definition of $q$. For the step, if $n>1$ we have $f(n+1)=$ $f(n) \pm q=f(1)+q(n-1) \pm q$. Since $f(n) \neq f(n-2)=f(1)+q(n-2)$, we get $f(n)=f(1)+q n$, as desired.

Finally, we have $f(n)=f(1)+q(n-1)$. Then $q$ cannot be -1 since otherwise for $n \geq f(1)+1$ we have $f(n) \leq 0$ which is impossible. Hence $q=1$ and $f(n)=(f(1)-1)+n$ for each $n \in \mathbb{N}$, and $f(1)-1 \geq 0$, as desired.

Final answer: All functions of the form $f(n)=n+c$, where $c \in \mathbb{N} \cup\{0\}$
Subfield: Algebra


Question: A sequence of real numbers $a_{0}, a_{1}, a_{2}, \ldots$ is defined by the formula

$$
a_{i+1}=\left\lfloor a_{i}\right\rfloor \cdot\left\langle a_{i}\right\rangle \quad \text { for } \quad i \geq 0
$$

here $a_{0}$ is an arbitrary real number, $\left\lfloor a_{i}\right\rfloor$ denotes the greatest integer not exceeding $a_{i}$, and $\left\langle a_{i}\right\rangle=a_{i}-\left\lfloor a_{i}\right\rfloor$. Prove that $a_{i}=a_{i+2}$ for $i$ sufficiently large.

Solution:
First note that if $a_{0} \geq 0$, then all $a_{i} \geq 0$. For $a_{i} \geq 1$ we have (in view of $\left\langle a_{i}\right\rangle<1$ and $\left\lfloor a_{i}\right\rfloor>0$ )

$$
\left\lfloor a_{i+1}\right\rfloor \leq a_{i+1}=\left\lfloor a_{i}\right\rfloor \cdot\left\langle a_{i}\right\rangle<\left\lfloor a_{i}\right\rfloor
$$

the sequence $\left\lfloor a_{i}\right\rfloor$ is strictly decreasing as long as its terms are in $[1, \infty)$. Eventually there appears a number from the interval $[0,1)$ and all subsequent terms are 0 .

Now pass to the more interesting situation where $a_{0}<0$; then all $a_{i} \leq 0$. Suppose the sequence never hits 0 . Then we have $\left\lfloor a_{i}\right\rfloor \leq-1$ for all $i$, and so

$$
1+\left\lfloor a_{i+1}\right\rfloor>a_{i+1}=\left\lfloor a_{i}\right\rfloor \cdot\left\langle a_{i}\right\rangle>\left\lfloor a_{i}\right\rfloor ;
$$

this means that the sequence $\left\lfloor a_{i}\right\rfloor$ is nondecreasing. And since all its terms are integers from $(-\infty,-1]$, this sequence must be constant from some term on:

$$
\left\lfloor a_{i}\right\rfloor=c \quad \text { for } \quad i \geq i_{0} ; \quad c \text { a negative integer. }
$$

The defining formula becomes

$$
a_{i+1}=c \cdot\left\langle a_{i}\right\rangle=c\left(a_{i}-c\right)=c a_{i}-c^{2}
$$

Consider the sequence

$$
b_{i}=a_{i}-\frac{c^{2}}{c-1} \tag{1}
$$

It satisfies the recursion rule

$$
b_{i+1}=a_{i+1}-\frac{c^{2}}{c-1}=c a_{i}-c^{2}-\frac{c^{2}}{c-1}=c b_{i} 
$$

implying

$$
b_{i}=c^{i-i_{0}} b_{i_{0}} \quad \text { for } \quad i \geq i_{0} \tag{2}
$$

Since all the numbers $a_{i}$ (for $i \geq i_{0}$ ) lie in $\left[c, c+1\right.$ ), the sequence $\left(b_{i}\right)$ is bounded. The equation (2) can be satisfied only if either $b_{i_{0}}=0$ or $|c|=1$, i.e., $c=-1$.



In the first case, $b_{i}=0$ for all $i \geq i_{0}$, so that

$$
a_{i}=\frac{c^{2}}{c-1} \quad \text { for } \quad i \geq i_{0}
$$

In the second case, $c=-1$, equations (1) and (2) say that

$$
a_{i}=-\frac{1}{2}+(-1)^{i-i_{0}} b_{i_{0}}= \begin{cases}a_{i_{0}} & \text { for } i=i_{0}, i_{0}+2, i_{0}+4, \ldots \\ 1-a_{i_{0}} & \text { for } i=i_{0}+1, i_{0}+3, i_{0}+5, \ldots\end{cases}
$$

Summarising, we see that (from some point on) the sequence $\left(a_{i}\right)$ either is constant or takes alternately two values from the interval $(-1,0)$. The result follows.
Subfield: Algebra


Question: The sequence of real numbers $a_{0}, a_{1}, a_{2}, \ldots$ is defined recursively by

$$
a_{0}=-1, \quad \sum_{k=0}^{n} \frac{a_{n-k}}{k+1}=0 \quad \text { for } \quad n \geq 1
$$

Show that $a_{n}>0$ for $n \geq 1$.

Solution:
The proof goes by induction. For $n=1$ the formula yields $a_{1}=1 / 2$. Take $n \geq 1$, assume $a_{1}, \ldots, a_{n}>0$ and write the recurrence formula for $n$ and $n+1$, respectively as

$$
\sum_{k=0}^{n} \frac{a_{k}}{n-k+1}=0 \quad \text { and } \quad \sum_{k=0}^{n+1} \frac{a_{k}}{n-k+2}=0
$$

Subtraction yields

$$
\begin{aligned}
0=(n+2) \sum_{k=0}^{n+1} \frac{a_{k}}{n-k+2}-(n+1) \sum_{k=0}^{n} \frac{a_{k}}{n-k+1} \\
=(n+2) a_{n+1}+\sum_{k=0}^{n}\left(\frac{n+2}{n-k+2}-\frac{n+1}{n-k+1}\right) a_{k} .
\end{aligned}
$$

The coefficient of $a_{0}$ vanishes, so

$$
a_{n+1}=\frac{1}{n+2} \sum_{k=1}^{n}\left(\frac{n+1}{n-k+1}-\frac{n+2}{n-k+2}\right) a_{k}=\frac{1}{n+2} \sum_{k=1}^{n} \frac{k}{(n-k+1)(n-k+2)} a_{k} .
$$

The coefficients of $a_{1}, \ldots, a_{n}$ are all positive. Therefore, $a_{1}, \ldots, a_{n}>0$ implies $a_{n+1}>0$.