9/27/17

number 21

Code: PU, PD   
P=100 (k=79=16 (mod 21) )
PD: 105 = 5*21 = 100+5
Formulae:
Number N is divisible by 21 iff 16*b+a = -5*b+a is divisible by 21

Example:
Number N = 98 76 54 32 01 = 14 13 12 11 1 =
-5(14 13 12 11)+1 =
-5(-5(14 13 12+11)+1 =
-5(-5(-5(14 13+12)+11)+1 =
-5(-5(-5(-5*14+13)+12)+11)+1 =
-5(-5(-5*    6+12)+11)+1 =
-5(-5*       3+11)+1 =
-5*         17+1 = 0 (mod 21)
is divisible by 21.



Code: SF  19*10-9*21=1
19(10b+a) = b+19a = b-2a (mod 21) 
Formulae:
Number N is divisible by 21 iff b-2a is divisible by 21

Example:
Number N = 68932
6893-2*2 = 6889
 688-2*9 = 670
  67-2*0 = 67
   6-2*7 = 19
isn't divisible by 21



Code: SF-  2*10-1*19=-1
2(10b+a) = -b+2a = -(b-2a) (mod 21)
It is the same as above