## Task A-3.5.

Let $n$ be a natural number. A sequence of $2 n$ real numbers is good if for every natural number $1 \leqslant m \leqslant 2 n$, the sum of the first $m$ or the sum of the last $m$ terms of the sequence is an integer. Determine the smallest possible number of integers in a good sequence.
## Solution.

We claim that for every $n$, the smallest possible number of integers is 2.

Let $x_{1}, x_{2}, \ldots, x_{2 n}$ be a good sequence of real numbers. If $n=1$, then $x_{1}$ and $x_{2}$ must be integers. Now let $n>1$.

Due to the condition for $m=1$, either $x_{1}$ or $x_{2 n}$ must be an integer.

Since $x_{1}+\cdots+x_{n}$ or $x_{n+1}+\cdots+x_{2 n}$ is an integer, and their sum is also an integer, we see that both of these numbers must be integers.

Furthermore, $x_{1}+\cdots+x_{n-1}$ or $x_{n+2}+\cdots+x_{2 n}$ must be an integer. If $x_{1}+\cdots+x_{n-1}$ is an integer, since $x_{1}+\cdots+x_{n}$ is an integer, we conclude that $x_{n}$ is an integer. Similarly, if $x_{n+2}+\cdots+x_{2 n}$ is an integer, we see that $x_{n+1}$ must be an integer. Therefore, either $x_{n}$ or $x_{n+1}$ must be an integer.

This shows that at least two terms of a good sequence must be integers.

Now we prove that for every natural number $n$, there exists a good sequence of real numbers with exactly two integers.

1. If $n$ is odd, we define $x_{1}=x_{n+1}=1$ and $x_{k}=\frac{1}{2}$ for all other $k \in\{1, \ldots, 2 n\}$. 1 point

Let $1 \leqslant m \leqslant n$. For odd $m$, the sum of the first $m$ terms is $1+(m-1) \cdot \frac{1}{2}$, which is an integer. For even $m$, the sum of the last $m$ terms is $m \cdot \frac{1}{2}$, which is an integer in this case.

If $m>n$, then by the proven fact, the sum of the first or last $m-n$ terms is an integer, and since $x_{1}+\cdots+x_{2 n}$ is an integer, we see that the sum of the first or last $m$ terms must also be an integer.

2. If $n$ is even, we define the sequence $x_{1}=x_{n}=1$ and $x_{k}=\frac{1}{2}$ for all other $k \in\{1, \ldots, 2 n\}$. For $m<n$. In this case, for odd $m$, the sum of the first $m$ terms is $1+(m-1) \cdot \frac{1}{2}$, and for even $m$, the sum of the last $m$ terms is $m \cdot \frac{1}{2}$, so we see that the given sequence is good.

## COUNTY COMPETITION IN MATHEMATICS

## 4th grade - high school - A variant

## February 28, 2018.

## IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE PROBLEM, THE COMMITTEE IS OBLIGED TO GRADE AND EVALUATE THAT APPROACH APPROPRIATELY.