exupero's blog
RSSApps

Modulo tricks in other bases

In the previous post we used divisibility graphs to see why some common modulo tricks work, specifically for 3, 5, 9, 10, and 11. Why those particular numbers behave unusually isn't happenstance but because of the number's relationship to the chosen base.

In base 10, the divisibility graph for 10 has white edges that send all numbers back to zero:

0123456789

The same happens for numbers that are factors of 10:

01
01234

Nine behaves differently because it's one less than the base, and 3 does the same because it's a factor of 9:

012345678
012

Eleven behaves as it does because it's one more than the base:

012345678910

We can check this intuition by drawing divisibility graphs for similar numbers in other bases. In base 16, for example, white edges should go to zero for 2, 4, 8, and 16:

01
0123
01234567
0123456789101112131415

All nodes should loop back to themselves for 3, 5, and 15:

012
01234
01234567891011121314

And white edges should mirror to the opposite side for 17:

012345678910111213141516

Play around with other bases and email me if you find anything interesting.

What to do with this information we'll explore in the next post.