# Task 4. (12 points)

Consider the sequence of numbers $x_{1}, x_{2}, \ldots, x_{2015}$. In this case,

$$
x_{n}= \begin{cases}7, & \text { if } n \text { is divisible by } 9 \text { and } 32 ; \\ 9, & \text { if } n \text { is divisible by } 7 \text { and } 32 ; \\ 32, & \text { if } n \text { is divisible by } 7 \text { and } 9 ; \\ 0, & \text { in all other cases. }\end{cases}
$$

Find the sum of all terms of this sequence.
# Solution

Since $7 \cdot 9 \cdot 32=2016$, then

$$
x_{n}= \begin{cases}7, & \text { if } n=9 \cdot 32 \cdot k, \text { where } k=1, \ldots, 6 \\ 9, & \text { if } n=7 \cdot 32 \cdot k, \text { where } k=1, \ldots, 8 \\ 32, & \text { if } n=7 \cdot 9 \cdot k, \text { where } k=1, \ldots, 31 \\ & 0, \quad \text { in all other cases. }\end{cases}
$$

The desired sum is

$$
7 \cdot 6+9 \cdot 8+32 \cdot 31=1106
$$

Answer: 1106.