an integer n is divisible by 3 if and only if the sum of digits of n is divisible by 3. In other words, if n= a0+ 10 a1 +102 a2 +…+ 10k ak, then n is divisible by 3 if and only if a0+a1+a2+…+ak is divisible by 3. Example: 12765312 is divisible by 3 because 1+2+7+6+5+3+1+2=27 is divisible by 3; indeed, 12765312/3 = 4255104.