Question: Prove the divisibility test by $7,11,13$ for numbers more than six digits

---

**Attempt:**

We know that $7\cdot 11 \cdot 13 = 1001$. The for a six-digit number, for example, $120544$, we write it as
$$ 120544 = 120120 + 424 = 120\cdot1001 + 424 $$
thus we just check the divisibility of $424$ by $7,11,13$.

Know for a number with more than six digits, for example: $270060340$,

$$270060340 = 270270270 - 209930$$
$$ = 270 \cdot (1001001) - 209930 $$
$$ = 270 \cdot (1001000) + (270 - 209930) =270 \cdot (1001000) - 209660$$

so we check the divisibility of $209660 = 209209 + 451$, or just $451$.

But the test states that: for $270060340$, we group three digits from the right:
$$ 270, 60, 340$$
then check divisibility of $340+270 - (60)$.

How to prove this?

Answer: 
It's the [radix$+1$ divisibility test](https://math.stackexchange.com/a/16015/242) for radix $10^3,\,$ i.e. the analog of casting out $11's$ in radix $10,\,$ viz.

$\!\!\!\begin{align}\bmod 10^{\large 3}\!+\!1\!:\,\ \color{#0a0}{10^{\large 3}}\equiv \color{#c00}{\bf -1}\, \ \Rightarrow\!\!\!\! &\ \ \ \ \ \ \overbrace{d\_0 + d\_1 \ \color{#0a0}{10^{\large 3}} +\, d\_2(\color{#0a0}{10^{\large 3}})^{\large 2}\! + d\_3(\color{#0a0}{10^{\large 3}})^{\large 3}+\,\cdots }^{\!\!\!\!\!\!\!\textstyle\text{integer in radix $\color{#0a0}{10^{\large 3}}$ with digits $\,d\_i$}} \\[.3em] 
&\equiv\, d\_0\!+d\_1(\color{#c00}{\bf -1})\!+d\_2(\color{#c00}{\bf -1})^{\large 2}\! + d\_3(\color{#c00}{\bf -1})^{\large 3} +\,\cdots \\[.3em]
&\equiv\, d\_0\ \ \color{#c00}{\bf -}\ \ d\_1\ \ +\ \ d\_2\ \ \color{#c00}{\bf -}\ \ d\_3\ +\, \cdots\\[.2em] 
&\equiv\, \color{#c00}{\text {alternating}}\text{ digit sum}\end{align}$

where we employed the [Congruence Sum & Product Rules (or Polynomial Rule)](https://math.stackexchange.com/a/879262/242)

$\!\begin{align}\text{E.g. in your 2nd example: }\ \ \ \ \ \ \ &\overbrace{270\,,\,060\,,\,340}^{\textstyle d\_2,\ \ d\_1,\ \ d\_0}\\[.2em] 
\equiv\ &270\! -\! 060\! +\! 340\, \equiv\, 550\!\pmod{\!1001}\end{align}$
For 9-digit number: $abcdefghi$, 

$$ abcdefghi = abc000000 + defghi = abc000000 + def \cdot 1001 - def + ghi $$
so we check divisibility of 
$$ abc000000 - def + ghi = abc \cdot 1001000 - abc000 - def + ghi$$
so we cehck divisibility of 
$$ -abc000 - def + ghi = -(abc \cdot 1001 - abc) - def + ghi$$
in the end we only check $abc + ghi - def$.

If 12-digit number:
$$ a\_{1} a\_{2} ... a\_{11}a\_{12} = a\_{1} a\_{2} a\_{3} 000000000 + \underbrace{a\_{4} ... a\_{12}}\_{9-digit}$$

so we check the divisibility of 
$$ a\_{1} a\_{2} a\_{3} 000000000 + ( a\_{10}a\_{11}a\_{12} + a\_{4} a\_{5}a\_{6} - a\_{7}a\_{8}a\_{9}) $$
or just 
$$ = (a\_{10}a\_{11}a\_{12} + a\_{4} a\_{5}a\_{6} - a\_{7}a\_{8}a\_{9} - a{1} a\_{2} a\_{3}) $$