9/21/17

number 16

Code: PS P=10.000
b10000+a = 16*625b+a = a
Formulae:
Number N is divisible by 16 iff least significant digit a is divisible by 16

Example:
Number N = 9876 5430 9856 
9856 = 16*616
Number N is divisible by 16



Code: PU 
P=100 (k=84=4 (mod 16) )
Formulae:
Number N is divisible by 16 iff 4*b+a is divisible by 16

Example:
Number N = 98 76 54 32 00 = 2 12 6 0 0 =
4(2 12 6 0)+0 =
4(4(2 12 6+0)+0 =
4(4(4(2 12+6)+0)+0 =
4(4(4(4* 2+12)+6)+0)+0 =
4(4(4*   4+12)+0)+0 =
4(4*    12+0)+0 =
4*      24+0 = 0 (mod 16)
is divisible by 16.



Code: PD
P=10, (k=6)
Formulae:
Number N is divisible by 16 iff -6b+a is divisible by 16

Example:
Number N = 54392
-6(      5439)+2 =
-6(-6(    543+9)+2 =
-6(-6(-6(  54+3)+9)+2 =
-6(-6(-6(-6*5+4)+3)+9)+2 =
-6(-6(-6*   6+3)+9)+2 =
-6(-6*     15+9)+2
-6*        15+2 = 8 (mod 16)
isn't divisible by 16.



Code: CR 
P=400 (k=100*4)
Formulae:
Number N is divisible by 16 iff remainder from division by 400 is divisible by 16

Example:
Number N = 84 56 21 34
Conversion to P=100*4
[84, 56, 21 | 34] = [84, 56, 20] | 134 = 4*[21, 14, 5] | 134
[21, 14 | 5] = [20, 112] | 205 = 4*[5, 28] | 205
[5 | 28] = [4] | 128 = 4*[1] | 128
[1] = 1
Take least significant digit from number N = 1 128 205 134, and 134 = 8*16+6, so N isn't divisible by 16.
The first step of conversion is enough to check using this method of conversion.