9/13/17

number 5

Code: SN
P=10
10b+a = 5*2b+a = a (mod 5)
Formulae:
Number N is divisible by 5 iff least significant digit is divisible by 5

Example:
N = 9876543210 is divisible by 5.
N = 2345678901 isn't divisible by 5. 


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

Example:
P=4
Number N =
 1 1 2 0 0 1 2 3
-1+1-2+0-0+1-2+3 = 0 
is divisible by 5.

Number N =
1 0 1 3 2 0 0
1-0+1-3+2-0+0 = 1
isn't divisible by 5.



Code: CR
multiply P by k=1/2 from decimal system
Formulae:
Number N is divisible by 5 iff least significant digit is 0
Example:
After conversion this is ordinary case where base is a divisor P=D. See first rule above.
It is mentioned, because this method allows get quotient N/5 as multiplication N by 2: 
(b*10)/5 = 2*b