Write n = a_k*10^k + a_k-1*10^(k-1) + ... + a_0. Then use the homomorphism phi from Z to Z/3Z:

phi(n) = phi(a_k*10^k + a_k-1*10^(k-1) + ... + a_0) = phi(10^k)*phi(a_k) + phi(10^(k-1))*phi(a_k-1) + ... + phi(a_0) = phi(a_k) + phi(a_k-1) + ... + phi(a_0) = phi(a_k + a_k-1 + ... + a_0) since 10 = 1 mod 3

So, n mod 3 = a_k + a_k-1 + ... + a_0. This means that 3 divides n only if 3 divides the sum of the digits of n.

Alumni Liaison

BSEE 2004, current Ph.D. student researching signal and image processing.

Landis Huffman