# Peeter Joot's (OLD) Blog.

• ## Archives

 Adam C Scott on avoiding gdb signal noise… Ken on Scotiabank iTrade RESP …… Alan Ball on Oops. Fixing a drill hole in P… Peeter Joot's B… on Stokes theorem in Geometric… Exploring Stokes The… on Stokes theorem in Geometric…

• 320,511

## A condition for divisibility by three

Posted by peeterjoot on November 26, 2012

# Motivation

My daughter told me that any number that any number who’s digits add up to a multiple of three are divisible by three. I’d never heard of such a thing, and was suprised by it. In the spirit of a true geek dad, I had to figure out why it works.

# Guts

Let’s represent our number by a sum of digits

\begin{aligned}n = \sum_{k = 0}^N a_k 10^k,\end{aligned} \hspace{\stretch{1}}(1.2.1)

and the condition for digits adding up to a multiple of three (say $m$ times $3$) is

\begin{aligned}\sum_{k = 0}^N a_k = 3 m.\end{aligned} \hspace{\stretch{1}}(1.2.2)

We can pull that out of the sum, and sure enough, the remainder (in base 10) is divisible by three

\begin{aligned}\begin{aligned}n&= \sum_{k = 0}^N a_k +\sum_{k = 1}^N a_k (10^k - 1) \\ &=3m +9 a_1 + 99 a_2 + 999 a_3 + \cdots \\ &= 3 ( m + 3 a_1 + 33 a_2 + 333 a_3 + \cdots )\end{aligned}\end{aligned} \hspace{\stretch{1}}(1.2.3)

Aurora also mentioned that this works for $9$ too, which we can see by inspection. Pretty cool (just like my daughter).