# Question on Modular Arithmetic proof

From my textbook

I am really confused. The only numbers this works for are multiples of 10, and 11.

10 mod 3 is 1, yes, but 12 mod 3 is 0!

Any idea on how to answer this question? It makes no sense to me.

• It is a special case of Casting out nines. Note $\,n\equiv k\pmod 9\,\Rightarrow\, n\equiv k\pmod 3\,$ by $\,3\mid 9\mid n-k\$ – Bill Dubuque Feb 7 '15 at 20:52

Yes $12\equiv 0\pmod 3$ and so is $1+2$ the sum of the digits of twelve. Suppose $$n=\sum_{k=0}^m a_k10^k,\quad 0\le a_k\le 9\text{ for }1\le k\le m$$.
Since $10^k\equiv 1\pmod 3$ for any $k$, $$n\equiv\sum_{k=1}^ma_k\pmod 3.$$