9/14/17

number 7

Source of some of these methods: Michał Szurek: Opowieści matematyczne, PWN Warszawa 1987

Code: SN in decimal P=10
Number N less than 1001=7*11*13 or remainder from division by this
c*100+b*10+a = (2*7^2+2)c+(7+3)*b+a = 2*c+3*b+a (mod 7)
Formulae:
Number N=cba is divisible by 7 iff 2c+3b+a is divisible by 7  (rule IV)

Example:
Number N = 455
2*4+3*5+5 = 28 = 4*7
is divisible by 7. 

Number N= 942
2*9+3*4+2 = 32 = 4*7+4
isn't divisible by 7.
Division by 1001 as division by 7


Code: SN in decimal P=10
Number N=cba less than 1000.
100c+10b+a = (7*13+7+3-1)c+10b+a = 10(c+b)+(a-c)  (mod 7)
Formulae:
Number N=cba is divisible by 7 iff (c+b)#(a-c) is divisible by 7.  (rule III)
Sign '#' split digits into one two-digit number. Operations are modulo 7.

Example:
Number N =679
(6+7)#(9-6) = 63
is divisible by 7. 

Number N= 391
(3+9)#(1-3) = 55
isn't divisible by 7.



Code: PD in P=1000 (k=1 special)
Division by 1001 each decimal digit separately greatly damp number N. Then use other method.
1000d+a = -d+a, the same with 1000e+b and 1000f+c
Formulae:
Number N is divisible by 7 iff number created by alternate sum every third digit is divisible by 7. (rule II)

Example:
Number N = 32 673 981 207
   6-9+2 = -1 = 6 (mod 7)
-3+7-8+0 = -4 = 3 (mod 7)
-2+3-1+7 =  7 = 0 (mod 7)
If number 630 is divisible by 7, number N is divisible, too.

This allow get another rule:
Number 10^n+a is divisible by 7 iff number 10^(n+3)-a is divisible by 7. (rule VII)
Hint. Sum 10^n+a+10^(n+3)-a = 1001*10^n is divisible by 7.



Code: PD (k=1) CR P=100 (k=1/2)
f*10^(10)+e*10^8+d*10^6+c*10^4+b*100+a = 32f+16e+(7+1)d+4c+(2*49+2)b+a = 4(f+c)+2(e+b)+(d+a)
Formulae:
Number N is divisible by 7 iff 4(c)+2(b)+(a) reduced to number divisible by 7. (it is like rule IX, but it has other end)

Example:
Number N  =
2 35 94 06 17 88 36 =
2  0  3  6  3  4  1   (mod 7)
(c) = 0+3 = 3 (mod 7)
(b) = 3+4 = 7 = 0 (mod 7)
(a) = 2+6+1 = 9 = 2 (mod 7)
4*(c)+2*(b)+(a) = 4*3+2*0+2 = 14 = 2*7, number N is divisible by 7.
The difference from original example is, that from 302 number 30 was reduced by 7 to 2 and this number was substract from 2 at end.



Code: PS, PU
P=10 (k=3)
10b+a = 3b+a (mod 7)
Formulae:
Number N is divisible by 7 iff 3b+a is divisible by 7. (rules VIII, X, V)

Example:
Number N = 25711
3(   2571)+1 =
3(3(  257+1)+1 =
3(3(3( 25+7)+1)+1 =
3(3(3(3*2+5)+7)+1)+1 =
3(3(3*  4+7)+1)+1 =
3(3*    5+1)+1
3*      2+1 = 0 (mod 7)
is divisible by 7.

There is so many rules in the source, because one of method is like presented don't using modulo operations (better for quotient), second changes powers of 10 into powers of 3 in positional system, and last is an determinant
|   3  1 |
|10-a b+1 |
equal 3b+a-7.



Code: PS
P=100
4*(100b+a) = 4*2b+4a = b+4a (mod 7)
Formulae:
Number N is divisible by 7 iff b+4a is divisible by 7. (rule I)

Example:
Number N = 138264 
1382 + 4*64 = 1638
  16 + 4*38 = 168
and use other method for 168.

We can use modulo operation to upgrade this method.



Code: PS, SF-
P=10, for SF- 2*10-3*7=-1 gets -b+2a
10b+a = 3b+a = 3b-6a = 3(b-2a) (mod 7)
Formulae Żbikowski theorem:
Number N is divisible by 7 iff b-2a is divisible by 7. (rule VI)

Example:
Number N = 646786  
64678 -2*6 = 64666
 6466 -2*6 = 6454
  645 -2*4 = 637
    63 -2*7 = 49
is divisible by 7.



Code: SF 
P=10, 5*10-7*7=1
5(10b+a) = b+5a (mod 7)
Formulae:
Number N is divisible by 7 iff b+5a is divisible by 7.

Example:
Number N = 646786  
64678 +5*6 = 64708
 6470 +5*8 = 6510
  651 +5*0 = 651
  65 +5*1 = 70
is divisible by 7.



Code: PD
P=8, (k=1)
Formulae:
Number N is divisible by 7 iff sum of digits is divisible by 7

Example:
Number N =
 7 6 5 4 3 2 4 0
7+6+5+4+3+2+4+0 = 3 (mod 7)
isn't divisible by 7.