<s>[INST] How to prove this property of congruences? Prove that for each $n \in \mathbb{N}, s \in \mathbb{N}$ the following is true
(i) $n \equiv Q_s(n) \left(\bmod\ 10^s - 1\right)$
(ii) $n \equiv Q'_s(n)\left(\bmod\ 10^s + 1\right)$
where
$$Q_s(n) = \sum_{i=0}^{\infty}(a_{is+s-1}\dots a_{is+1}a_{is})$$
for example 
$$Q_3 (6154328103) = 103 + 328 + 154 + 006 = 591$$
and
$$Q'_s(n) = \sum_{i=0}^{\infty}(-1^i)(a_{is+s-1}\dots a_{is+1}a_{is})$$
for example 
$$Q'_3 (6154328103) = 103 - 328 + 154 - 006 = -77$$
Also $n$ can be expressed as
$$n = \sum_{i=0}^{\infty}(a_{is+s-1}\dots a_{is+1}a_{is}) \cdot 10^{is}$$
for example
$$6154328103 = 103 \cdot 10^{0 \cdot 3} + 328 \cdot 10^{1 \cdot 3} + 154 \cdot 10^{2 \cdot 3} + 6 \cdot 10^{3 \cdot 3}$$
Any ideas?
 [/INST] Hint: mod $10^s -1$ we have $10^s\equiv 1$, and mod $10^s + 1$ we have $10^s\equiv -1$. Use these congruences as rewrite rules to replace powers of $10^s$ by powers of $\pm 1$ in radix $10^s$ representation.
This leads to simple universal divisibility tests: evaluate a radix polynomial in nested Horner form, using modular arithmetic. For example, consider evaluating a $3$ digit radix $10$ number modulo $7$. In Horner form $\rm\ d_2\: d_1\:d_0 \ $ is $\rm\: (d_2\cdot 10 + d_1)\ 10 + d_0\ \equiv\ (d_2\cdot 3 + d_1)\ 3 + d_0\ (mod\ 7)\ $ since $\rm\ 10\equiv 3\ (mod\ 7)\:.\:$ So we compute the remainder $\rm\ (mod\ 7)\ $ as follows. Start with the leading digit then repeatedly apply the operation: multiply by $3$ then add the next digit, doing all of the arithmetic $\rm\:(mod\ 7)\:.\:$  
For example, let's use this algorithm to reduce $\rm\ 43211\ \:(mod\ 7)\:.\:$ The algorithm consists of repeatedly replacing the first two leading digits $\rm\ d_n\: d_{n-1}\ $ by $\rm\ d_n\cdot 3 + d_{n-1}\:\ (mod\ 7),\:$ namely
$\rm\qquad\phantom{\equiv} \color{red}{4\ 3}\ 2\ 1\ 1$
$\rm\qquad\equiv\phantom{4} \color{green}{1\ 2}\ 1\ 1\quad $ by $\rm\quad \color{red}4\cdot 3 + \color{red}3\ \equiv\ \color{green}1 $
$\rm\qquad\equiv\phantom{4\ 3} \color{royalblue}{5\ 1}\ 1\quad $ by $\rm\quad \color{green}1\cdot 3 + \color{green}2\ \equiv\ \color{royalblue}5 $
$\rm\qquad\equiv\phantom{4\ 3\ 5} \color{brown}{2\ 1}\quad $ by $\rm\quad \color{royalblue}5\cdot 3 + \color{royalblue}1\ \equiv\ \color{brown}2 $
$\rm\qquad\equiv\phantom{4\ 3\ 5\ 2} 0\quad $ by $\rm\quad \color{brown}2\cdot 3 + \color{brown}1\ \equiv\ 0 $
Hence $\rm\ 43211\equiv 0\:\ (mod\ 7)\:,\:$ indeed $\rm\ 43211 = 7\cdot 6173\:.\:$ Notice that for modulus $11$ or $9\:$ the above  method reduces  to the well-known divisibility tests by $11$ or $9\:$ (a.k.a. "casting out nines" for modulus $9$). Your examples are analogous: casting out $11\cdots1$ or  $99\cdots9$.
</s>