Among the six-digit numbers of the form $\overline{a b a b a b}$,

a) how many are divisible by 217;

b) how many are divisible by 218?
Solution. Let's write the six-digit number in the decimal system:

$$
\begin{aligned}
\overline{a b a b a b} & =10^{5} a+10^{4} b+10^{3} a+10^{2} b+10 a+b= \\
& =10 a\left(10^{4}+10^{2}+1\right)+b\left(10^{4}+10^{2}+1\right)=(10 a+b) \cdot 10101= \\
& =(10 a+b) \cdot 3 \cdot 7 \cdot 13 \cdot 37
\end{aligned}
$$

Since $217=7 \cdot 31$, the numbers that are divisible by 217 are those whose prime factorization includes 7 and 31. This implies that the six-digit number will be divisible by 217 if $10 a+b$ is divisible by 31.

Given $10 a+b=k \cdot 31<100$, it follows that $k=1,2$ or 3. If $k=1$, then $a=3, b=1$; if $k=2$, then $a=6, b=2$; and if $k=3$, then $a=9, b=3$. The corresponding six-digit numbers are: 313131, 626262, and 939393.

For part b) of the problem, the answer is: there is no such six-digit number, because the larger prime factor of 218, which is 109, does not appear in the factorization of the six-digit number, since $10 a+b$ is not divisible by 109.