Why does casting out $9$ and $11$ work to compute remainders? I found two examples that I'd like to understand:
Example 1: Find $112358132134 \mod 9$.
Solution is:
$1+1+2+3+5+8+1+3+2+1+3+4 \mod 9 = 7 \mod 9 = 7$
Example 2: Find $62831853 \mod 11$.
Solution is:
$(-6)+2+(-8)+3+(-1)+8+(-5)+3 \mod 11 = -4 \mod 11 = 7$
My question is: Based on what property we sum the digits of the number ( as Example 1) or subtract (as Example 2)?
 A: Usually, we cannot compute the remainder of a number mod $n$ by summing the digits (example 1), or by subtracting alternately (example 2). This is a special trick that works for mod $9$ and $11$. It also works for mod $3$.


*

*To compute the remainder of a number mod $3$ or mod $9$, you may sum the digits and then compute the remainder of that result.
Why it works: we write numbers in base $10$, and $10 \equiv 1$ mod $3$ or mod $9$, so multiplying by $10$ is really multiplying by $1$.

*To compute the remainder of a number mod $11$, you may alternately add and subtract the digits and then compute the remainder of that result.
Why it works: we write numbers in base $10$, and $10 \equiv -1$ mod $11$, so multiplying by $10$ is really multiplying by $-1$ (changing the sign).
You can read more about these divisibility rules and others at this Wikipedia page.
A: Hint:
$$1\bmod9=10\bmod9=100\bmod9=1000\bmod9=\cdots 1,$$
$$1\bmod11=100\bmod11=\cdots 1,$$
$$10\bmod11=1000\bmod11=\cdots-1.$$
See the decimal expansion as a linear combination.
A: Radix notation has $\color{#c00}P\!$$\textit{olynomial form}$ $\, n = \color{#c00}{P}(10) = d_k 10^k +\cdots + d_2\cdot 10^2 + d_1\cdot 10 + d_0\, $
so $\, {\rm mod}\ 9\!:\, \color{#0a0}{10\equiv 1}\,\Rightarrow\, P(\color{#0a0}{10})\,\equiv\, P(\color{#0a0}1)\,\equiv\, d_k+\cdots + d_1 + d_0 = $ sum of digits $\,d_i,\ $ and 
$ {\rm mod}\ 11\!:\, \color{#90f}{10\equiv -1}\,\Rightarrow\, P(\color{#90f}{10})\equiv P(\color{#90f}{-1})\equiv (-1)^k d_k+\cdots - d_1 + d_0 = $ alternating digit sum. 
In both cases we employed the  the $ $ Polynomial Congruence Rule, $ $ i.e. $\,a\equiv b\,\Rightarrow\,P(a)\equiv P(b),\ $ for any polynomial $\,P(x)\,$ with integer coefficients, and any integers $\,a,b.$

Remark $\ $ These tests are special cases $\,(x = 10)\,$ of results true for any polynomial, namely
$ {\rm mod}\ x\!-\!1\!:\,\ \color{#0a0}{x\ \equiv\ 1}\ \Rightarrow\  P(\color{#0a0}{x})\,\equiv\, P(\color{#0a0}1)\,\equiv\, d_k+\cdots + d_1 + d_0 = $ sum of coef's $\,d_i,\ $ and 
$ {\rm mod}\ x\!+\!1\!:\,\ \color{#90f}{x\equiv -1}\,\Rightarrow\, P(\color{#90f}{x})\equiv P(\color{#90f}{-1})\equiv (-1)^k d_k+\cdots - d_1 + d_0 = $ alternating coef sum. 
Thus if the coef sum $\,P(1) = 0\,$ then $\,P(x)\equiv P(1)\equiv 0\,\pmod{x\!-\!1}\,\ $ so $\,\ x\!-\!1\mid P(x),$
and, similarly, if  $\ P(-1) = 0\,$ then $\,P(x)\equiv P(-1)\equiv 0\pmod{x\!+\!1}\,\ $ so $\,\ x\!+\!1\mid P(x).$
Both are special case of the well-known $ $ Factor Theorem $\,\ x\!-\!a\,\mid\, P(x)-P(a).$
In particular, for $\,x = b = \,$ radix, we get the base $b$ analog of casting out $9$ and $11$ in radix $10$
A: Remainder after division by $11$
The OP's question asked for the properties that 'force' the technique. They should be aware that there are often several ways to tackle math problems.
Working in $\Bbb N = \{0,1,2,3,\dots\}$ with numbers presented in their base ten representation.
Problem: For any $m$ find the remainder $r$ after division by $11$: $\;m = 11q + r$.
Without using modular arithmetic and negative numbers, you can employ symbolic homotopy rules to transform $m$ down to $r$. Since this is recreational math, we leave it to the reader to formalize these rules; here we only give some examples.
This method is useful for an organized approach where you can carefully check each step for errors.
Example 1: If $m \lt 11$ then $m \sim [m]$
Example 2: $20]. \sim [9]$
Example 3: $30]. \sim [8]$
Example 4: $90]. \sim [2]$
Example 5: $55] \sim [0]$
Example 6: $58] \sim [3]$
Example 7: $85] \sim 30]. \sim [8]$
Example 8: Find the remainder $r$ for $\frac{62831853}{11}$:
$\quad 62]831853 \sim 408]31853 \sim 12]31853 \sim 13]1853 \sim 21]853 \sim 108]53 \sim 95]3 \sim 403] \sim [7]$
Example 9: $29]0 \sim 70]. \sim [4]$
Example 10: $100]0000 \sim 100]00] \sim 100] \sim [1]$
Example 11: $11]11111 \sim 11]111 \sim 11]1 \sim [1]$
