## Task B-4.3.

The sum of all 1002-digit numbers that in their representation have a thousand zeros and two ones is $S$. Determine the remainder obtained when the number $S$ is divided by 3.
## First solution.

The number 1 must be in the first position, from which it follows that there are 1001 numbers with the described property.

We can add these numbers by writing one below the other:

$$
\begin{array}{r}
1100000 \ldots 00 \\
1010000 \ldots 00 \\
1001000 \ldots 00 \\
1000100 \ldots 00 \\
\ldots \ldots . \ldots . . \\
1000000 \ldots 10 \\
+1000000 \ldots 01 \\
\hline
\end{array}
$$

Then,

$$
S=1001 \cdot 10^{1001}+\underbrace{111 \ldots 11}_{1001 \text { ones }}=100 \underbrace{1111 \ldots 11}_{1002 \text { ones }}.
$$

The number $S$ has 1003 ones, so the sum of all its digits is 1003.

The number $S$ has the same remainder when divided by 3 as the sum of its digits, the number 1003, which is 1.