9/13/17

number 3

Code: PU  
P=10 (k=7=1 (mod 3) ), P=4 (k=1)
Formulae:
Number N is divisible by 3 iff sum of digits is divisible by 3

Example:
P=10
Number N  =
9 8 7 6 5 4 3 2 1 0
0+2+1+0+2+1+0+2+1+0 = 3*3
is divisible by 3.

P=4
Number N =
1 0 2 0 2
1+0+2+0+2 = 3*1+2
isn't divisible by 3.



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

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

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