## Task A-4.2.

Let $S$ be the set of all natural numbers less than 1000 whose all digits in decimal notation are even. Let $\omega$ be a complex number such that $\omega^{2}+\omega+1=0$.

Calculate the sum $\sum_{k \in S} \omega^{k}$, i.e., the sum of the values $\omega^{k}$ for all $k$ in the set $S$.
## First Solution.

Let $Z$ be the desired sum. Multiplying the equation $\omega^{2}+\omega+1=0$ by $\omega-1$ we get $\omega^{3}=1$. In particular, the number $\omega^{n}$ is equal to the number $1, \omega$ or $\omega^{2}$ respectively if $n$ gives a remainder of 0, 1 or 2 when divided by 3.

Consider any three three-digit numbers of the form $\overline{4 a b}, \overline{6 a b}, \overline{8 a b}$, for some even digits $a$ and $b$. These three numbers give three different remainders when divided by 3, so we have

$$
\omega^{\overline{4 a b}}+\omega^{\overline{6 a b}}+\omega^{\overline{8 a b}}=1+\omega+\omega^{2}=0
$$

Using this identity for all such three-digit numbers, we conclude that in the desired sum, all terms with exponents $k$ whose hundreds digit is 4, 6, or 8 cancel out.

A similar argument shows that in the sum, all terms with $k$ whose tens digit is 4, 6, or 8 also cancel out, and then those whose units digit is 4, 6, or 8.

What remains is to calculate the sum of the numbers $\omega^{k}$ where $k$ are natural numbers less than 1000 whose digits are all 0 or 2. We have

$$
\begin{aligned}
Z & =\omega^{2}+\omega^{20}+\omega^{22}+\omega^{200}+\omega^{202}+\omega^{220}+\omega^{222} \\
& =1+3 \omega+3 \omega^{2}=1+3 \cdot(-1)=-2
\end{aligned}
$$