Find a test for divisibility

The task is to find a test for divisibility by 6. Does it suffice to say that since 6=2*3, the test for divisibility by 6 must satisfy the tests for divisibility by both 2 and 3. So the resulting rule should be that for a number a in the form a=a_n***a_1 (where the notation means that each a_i is a digit, not that the a_i's should be multiplied) to be divisible by 6, 2 must divide a_1 and 3 must divide the sum of the digits of a [i.e. 3|a_n+. . .+a_1].

Sorry that I do not know how to use the special functions on the site to format the questions more neatly.

• more generally, $a$ divides $n$ and $b$ divides $n$ implies $lcm(a,b)$ divides $n$ – Tim Seguine Feb 13 '14 at 20:13
Yes, $\,6\mid n\!\iff\! 2,3\mid n.\,$ $\,2\mid a\!+\!10k\!\iff\! 2\mid a,\,$ $\,3\mid \sum a_i \color{#c00}{10}^i\!\iff\! 3\mid \sum a_i,\,$ by $\,\color{#c00}{10}\equiv 1\pmod 3$.
Further, we can compute the remainder mod $6$. Suppose $\,n\,$ has least significant decimal digit $\,a$ and decimal digit sum $= b.\,$ Using CRT to solve $\,n \equiv a\pmod 2,\,\ n\equiv b\pmod 3\$ we obtain $\, {\rm mod}\ 6\!:\ n\equiv 3a-2b\equiv 3a+4b.\,$ Note $\, 2,3\mid 3a-2b\iff 2\mid a,\, 3\mid b,\,$ i.e. the divisibility test.