## Task B-2.2.

Kate and Mare often competed in solving math problems. The professor got tired of their competition and gave them a task that they had to solve together. Kate wrote down 2016 numbers on the board, with each number being either $\sqrt{2}-1$ or $\sqrt{2}+1$. Mare then multiplied the first and second number, then the third and fourth, and so on until the last two numbers, and then added all these products and wrote down the result. If the sum was not an integer, Kate erased it. They had to repeat the process until all possible integers that Mare's sum could take were written on the board. How many such sums were left on the board?
## Solution.

Let $S=x_{1} \cdot x_{2}+x_{3} \cdot x_{4}+\cdots x_{2015} x_{2016}$, where all numbers $x_{1}, x_{2}, \ldots, x_{2015}, x_{2016}$ are equal to $\sqrt{2}-1$ or $\sqrt{2}+1$. In the given sum, only three types of addends, or three types of products of consecutive numbers, can appear. These are:

$$
\begin{aligned}
& A=(\sqrt{2}-1)(\sqrt{2}-1)=3-2 \sqrt{2} \\
& B=(\sqrt{2}+1)(\sqrt{2}+1)=3+2 \sqrt{2} \\
& C=(\sqrt{2}-1)(\sqrt{2}+1)=1
\end{aligned}
$$

For the sum $S$ to be an integer, it is clear that the number of addends of type $A$ and type $B$ must be equal in the given sum.

Let there be $n$ addends of type $A$ and $n$ addends of type $B$ in the given sum. Then we have $1008-2 n$ addends of type $C$.

$$
S=n(3-2 \sqrt{2})+n(3+2 \sqrt{2})+(1008-2 n) \cdot 1=1008+4 n
$$

There are as many such integers as there are possible choices of the number $n$. Since $n$ can be any number from the set $\{0,1,2,3, \ldots, 504\}$, the sum $S$ can take 505 different integer values.

We conclude that 505 sums are left recorded on the board.