I get another training problem, for a Romanian 6th grader competition, for which I have no answer. Find the smallest $n \ge 1000$ such the sum $ 1+11+111+⋯+11⋯11 (n digits)$ it is divisible by 101. I am familiar with the sum, I know how to compute it, but I can see how I can reason about the divisibility by $101$.
I did a numeric analysis on it, and it looks that the solution is $n=1121$, while the first numbers for which the sum is divisible by 101 are $110,313, 403, 404, 514, 717, 807,808, 918$ . Also I did notice that $1111$ is divisible by $101$, and I also seen that the pattern $123456790$ keeps repeating on the sum.
If you consider the remainders upon dividing every term by $101$ we obtain the following sequence:
$$1 \equiv 1 \pmod {101}$$ $$11 \equiv 11 \pmod {101}$$ $$111 \equiv 10 \pmod {101}$$ $$1111 \equiv 0 \pmod {101}$$ $$11111 \equiv 1 \pmod {101}$$ $$ \cdots$$
It is not hard to conclude that the the remainders repeat each $4$ terms. Also note that any sum of $4$ consequtive terms will have remainder $1+11+10+0 = 22$ upon division by $101$. Thus:
$$\sum_{i=1}^{1000} a_n \equiv 22\cdot 250 \equiv 46 \pmod{101}$$
where $a_n = 11 \cdots 1 (n$ digits ). Now you want to solve the following equations:
$$46 + 22k_1 \equiv 100 \pmod{101}$$ $$46 + 22k_2 \equiv 89 \pmod {101}$$ $$46 + 22k_3 \equiv 0 \pmod {101}$$
The first one comes from adding $k_1$ blocks of $4$ terms and adding just one more afterwards to bring the remainder to $0$. The second one comes from ading $k_2$ blocks of $4$ terms and adding the next two afterwards. The last equation arises as one of the ways to reach remainder $0$ is to keep adding $k_3$ blocks of $4$ terms and the next three afterwards.
Let $k_1,k_2,k_3$ be the least nonegative solutions to the congruence relations. Then we have $n_1 = (250+k_1)\cdot 4 + 1$, $n_2 = (250+k_2)\cdot 4 + 2$, $n_3 = (250+k_3)\cdot 4 + 3$. The smallest integer out of $n_1,n_2,n_3$ is the wanted $n$.