9/15/17

number 8

Code: SN
P=1000
1000b+a = 8*125b+a = a (mod 8)
Formulae:
Number N is divisible by 8 iff least significant digit is divisible by 8

Example:
N = 3 459 637 480 is divisible by 8 due 480=8*60.
N = 123 459 071 isn't divisible by 8. 



Code: PU 
P=10, (k=2)
10b+a = 2b+a
Formulae:
Number N is divisible by 8 iff 2b+a is divisible by 8.

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