Divisibility Rule for 7 using 315462 Years ago while playing around with numbers came up with a divisibility rule for 7 using the number 315,462; where effectively you take the 'dot product' of your number with 315462 (repeated when necessary), and repeat. 
Example: Is 298,427,052 divisible by 7?
We need to use 315462 repeated twice to match or exceed the number of digits, so 315,462,315,462 and multiply matching powers of ten while adding the products. In this case using our number (298427052) and (462315462)
$(2)(4) + (9)(6) + (8)(2) + (4)(3) + (2)(1) + (7)(5) + (0)(4) + (5)(6) + (2)(2) = 161$
Repeat procedure again
$(1)(4) + (6)(6) + (1)(2) = 42$
$(4)(6) + (2)(2) = 28$
$(2)(6) + (8)(2) = 28 $
(Cycles again, but 28 is divisible by 7)
The closest I could find online is someone else who also accidentally discovered it. His write-up might be more informative link; yet neither of us found a proof, both more heuristic testing. Is one available? 
 A: I would have chosen the number $$  546231 $$ because
$$ 1 \equiv 1 \pmod 7 $$
$$ 10 \equiv 3 \pmod 7 $$
$$ 100 \equiv 2 \pmod 7 $$
$$ 1000 \equiv 6 \equiv -1 \pmod 7 $$
$$ 10000 \equiv 4 \pmod 7 $$
$$ 100000 \equiv 5 \pmod 7 $$
Then
$$ 1000000 \equiv 1 \pmod 7 $$ and so on
The "dot product" with this number, repeated if necessary, with some target number $n,$ is equivalent to $n \pmod 7.$ That means that you can get your first "dot product," and if you are not yet sure, you can take this new number and do it again. After just a few tries this will be a number small enough to decide by sight. 
Very similar to adding up the digits of a decimal number  and repeating until the number is small, which tells you the remainder when dividing by $9.$
I see, yours is a cyclic shift,
$$  5462,31 \mapsto 315462   $$
A: You can find a similar divisibility rule for any number $n$ that is relatively prime to $10$, you get a number of length equal to the order of $10\bmod n$.
For $n=3$ and $9$ this order is $1$, which is why we only need to sum all coefficients. When $n=11$ the order is $-1$, which is why the digits at even positions are subtracted and the others added. 
In general, if $m$ is the order of $10\bmod n$, you are going to get $m$ coefficients, $a_1,a_2,\dots, a_m$ (where $a_i\equiv10^i\bmod n$).
To obtain the residue of a number $\bmod n$ you have to take the "iterated" dot product of the number, and the vector $a_m,a_{m-1},\dots,a_1$
