Originally posted by ^tamago^:
It's ok. This method is described in Wiki.
10^1 mod 7 = 3
10^2 mod 7 = 2
10^3 mod 7 = 6
10^4 mod 7 = 4
10^5 mod 7 = 5
10^6 mod 7 = 1
1. Reverse the order of the digits.
2. Multiply each digit successively by 1, 3, 2, 6, 4, 5.
3. Add the products.
4. The result should be divisible by 7 if the original number
is.
[b]1050 ---> 0501 (reverse) --->
0x1 + 5x3 + 0x2
+ 1x6 = 0 + 15 + 0 + 6 = 21. So,
1050 is divisible by 7.
1454978 ---> 8794541 (reverse) --->
8x1 + 7x3 + 9x2
+ 4x6 + 5x4+
4x5+ 1x1= 8 + 21 + 18 + 24 + 20 + 20 + 1 = 42. So,
1454978 is divisible by 7.[/b]
Thanks for putting the detail.
Another way or trick to test the divisibility of 7 similar to the
method above. I think of this method quite a while ago but no
concrete algebra proof to prove my theory is correct. I have tested
a couple of numbers and it seems to tally with my theory.
Instead of using 1, 3, 2, 6, 4, 5. Since, 1001 is a factor of 7,
10010 is also a factor of 7, 100100 is also a facotr of 7.
1. For the ones digit, it must be multiplied by 1 since an increase
in 1 will result in an increase in the value of the
remainder.
2. For the tens digit, follow the method above.
3. For the hundred digit, follow the method above.
4. For the thousand digit, follow the method above.
5. For the 10^4 digit, instead of using 6, notice that 1001 is
divisible by 7,
Using the method above,
1 x 1 + 0 x 3 + 0 x 2 + 1 x a = 0 (since remainder = 0)
1 + a = 0
a = -1
6. For the 10^5 digit, instead of using 5, notice that 10010 is
divisible by 7,
Using the method above and the answer above,
0 x 1 + 1 x 3 + 0 x 2 - 0 x 1 + 1 x b = 0
1 x 3 + 1 x b = 0
b = -3
7. So when u do it for the 10^6 digit, it will be -2.
Take note of the pattern, 1, 3, 2, -1, -3, -2. This method is not
only the divisibility test of 7, it is also the remainder test of
7.
Using some numbers as tests.
14 -> 4 x 1 + 1 x 3 = 7
58 -> 8 x 1 + 5 x 3 = 23 mod 7 = 2 (58 = 7 x 8 + 2 ) Therefore
remainder is 2.
237 -> 7 x 1 + 3 x 3 + 2 x 2 = 20 mod 7 = 6 (237 = 33 x 7 + 6)
Therefore remainder is 6.
Let try the bigger numbers.
123456 -> 6 x 1 + 5 x 3 + 4 x 2 - 3 x 1 - 2 x 3 - 1 x 2 = 18 mod
7 = 4
4680123 -> 3 x 1 + 2 x 3 + 1 x 2 - 0 x 1 - 8 x 3 - 6 x 2 + 4 x 1
= -21 mod 7 = 0
Try this.