exupero's blog

# 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:

The same happens for numbers that are factors of 10:

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

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

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:

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

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

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.