A few nights ago I couldn't sleep and so started doing this:

I would take a number and add up all of its digits to get a new number and then add up all of those digits and so on until there was only one digit left.

For example, I would say $543\mapsto 12\mapsto 3$ or $94286\mapsto 29\mapsto 11\mapsto 2$.

I noticed a few patterns and then after explaining the rules of this game to some friends was able to impress them by adding up the digits of huge numbers in a couple seconds! The only pattern really worth mentioning is this:

Adding $9$ to a digit doesn't change the final answer (i.e. $12391234$ has the same final answer as $1231234$. Similarily, $158$ has the same final answer as $15899999999999$) So when adding, you can just ignore the $9$. This helped a lot in trying to impress my friends because instead of adding $136271845$ you can just recognize this as $19999$ which will sum up to $1$ since you can ignore $9$.

There are a couple other patterns I noticed (like what happens if you keep doubling a number), but I want to know why the above happens, or how to prove why this happens? I have some rough ideas of why it happens but was hoping someone out there would have a slick proof of this?

• The sum of the digits of any number is equivalent modulo 9 to the number itself. Jul 28 '14 at 17:04
• You are computing digital roots. Jul 28 '14 at 17:04
• Oh cool! I had never heard of digital roots. So one of the other patterns I noticed was that if you keep doubling numbers you get $2$ cycles. That is, $1\mapsto 2\mapsto 4\mapsto 8\mapsto 7\mapsto 5\mapsto 1$ and $3\mapsto 6\mapsto 9\mapsto 3$. After reading the article, I've noticed that the digital root of a prime always falls into the first cycle. I mean it's clear it can't be $9$, but why is it never $3$ or $6$? Jul 28 '14 at 17:22
• Very interesting, @vadim123. Your link has the result, stated here for the interest of readers, that the digital root of the positive integer $n$ is $$n-9\left\lfloor\frac{n-1}{9}\right\rfloor$$.
– MPW
Jul 28 '14 at 17:26
• @JonHerman: If it was 3 or 6, then the number would be divisible by 3 and so not prime. To confirm that, try testing it on a large composite number which isn't divisible by 2 or 3. Jul 28 '14 at 17:34