In the previous post I showed how common modulo tricks for 2, 3, 5, 9, 10, and 11 are the product of our chosen base-10 number system, and that the kinds of divisibility graphs that indicate these techniques appear in any base system for the numbers that are equal to the numerical base, one less than the base, and one more than the base, as well as for any factors of those numbers. Realizing, then, that base-10 only produces 6 numbers that can exploit this due to the few factors of 9, 10, and 11, it's natural to ask whether there are any base systems which produce more modulo tricks.

Here's a table listing the relevant factor counts up to base 10:

Base | Factors of base | Factors of base - 1 | Factors of base + 1 | Total |
---|---|---|---|---|

2 | 1 | 0 | 1 | 2 |

3 | 1 | 1 | 2 | 4 |

4 | 2 | 1 | 1 | 4 |

5 | 1 | 2 | 3 | 6 |

6 | 3 | 1 | 1 | 5 |

7 | 1 | 3 | 3 | 7 |

8 | 3 | 1 | 2 | 6 |

9 | 2 | 3 | 3 | 8 |

10 | 3 | 2 | 1 | 6 |

While it looks like base 9 gives us two more modulo tricks than base 10, it really only gives us one since 2 is counted twice, once as a factor of 8 and again as a factor of 10. Here's a tally of the *unique* factors:

Base | Factors of base | Factors of base - 1 | Factors of base + 1 | Unique |
---|---|---|---|---|

2 | 1 | 0 | 1 | 2 |

3 | 1 | 1 | 2 | 3 |

4 | 2 | 1 | 1 | 4 |

5 | 1 | 2 | 3 | 5 |

6 | 3 | 1 | 1 | 5 |

7 | 1 | 3 | 3 | 6 |

8 | 3 | 1 | 2 | 6 |

9 | 2 | 3 | 3 | 7 |

10 | 3 | 2 | 1 | 6 |

Base 9 gives us tricks for 4 and 8, but we lose the trick for 11.

What about bases higher than 10? Here are the top five contenders, up to base 20:

Base | Factors of base | Factors of base - 1 | Factors of base + 1 | Unique |
---|---|---|---|---|

19 | 1 | 5 | 5 | 10 |

15 | 3 | 3 | 4 | 9 |

17 | 1 | 4 | 5 | 9 |

20 | 5 | 1 | 3 | 9 |

11 | 1 | 3 | 5 | 8 |

Notice that while the number of unique factors with tricks has increased to 10 with base 19, the total fraction of numbers with tricks has decreased, down to almost 50% of the base. Measuring percent coverage weighs small bases more heavily:

Base | Factors of base | Factors of base - 1 | Factors of base + 1 | Unique | Percentage |
---|---|---|---|---|---|

2 | 1 | 0 | 1 | 2 | 100% |

3 | 1 | 1 | 2 | 3 | 100% |

4 | 2 | 1 | 1 | 4 | 100% |

5 | 1 | 2 | 3 | 5 | 100% |

7 | 1 | 3 | 3 | 6 | 85% |

We can also score bases by how easily different modulo techniques can be performed. The easiest tricks are those for the factors of the base itself, for which we only need to check the last digit. The next easiest are those for factors of one less than the base, for which we add up the digits. The least easy are those for factors of one more than the base, for which we have to alternate between adding and subtracting digits. Here are the weighted rankings:

Base | Factors of base (weight 3) | Factors of base - 1 (weight 2) | Factors of base + 1 (weight 1) | Score |
---|---|---|---|---|

20 | 5 | 1 | 3 | 20 |

16 | 4 | 3 | 1 | 19 |

12 | 5 | 1 | 1 | 18 |

15 | 3 | 3 | 4 | 18 |

18 | 5 | 1 | 1 | 18 |

19 | 1 | 5 | 5 | 17 |

13 | 1 | 5 | 3 | 15 |

17 | 1 | 4 | 5 | 15 |

9 | 2 | 3 | 3 | 14 |

10 | 3 | 2 | 1 | 14 |

14 | 3 | 1 | 3 | 14 |

8 | 3 | 1 | 2 | 13 |

11 | 1 | 3 | 5 | 13 |

6 | 3 | 1 | 1 | 12 |

7 | 1 | 3 | 3 | 11 |

4 | 2 | 1 | 1 | 9 |

5 | 1 | 2 | 3 | 9 |

3 | 1 | 1 | 2 | 6 |

2 | 1 | 0 | 1 | 4 |

While weighing like this bumps up some of the most common alternate base systems (20, 16, and 12), it also clearly favors large bases with many factors. We get even better scores from impractically large bases:

Base | Factors of base (weight 3) | Factors of base - 1 (weight 2) | Factors of base + 1 (weight 1) | Score |
---|---|---|---|---|

120 | 15 | 3 | 2 | 53 |

144 | 14 | 3 | 3 | 51 |

96 | 11 | 3 | 1 | 40 |

126 | 11 | 3 | 1 | 40 |

84 | 11 | 1 | 3 | 38 |

The question of best base for modulo tricks, then, involves more than just maximizing the number of modulo tricks. A ratio like percent coverage might be the right approach after all, as it penalizes larger bases. Eliminating bases smaller than 8, the next best coverage comes from base 9:

Base | Factors of base | Factors of base - 1 | Factors of base + 1 | Unique | Percentage |
---|---|---|---|---|---|

9 | 2 | 3 | 3 | 7 | 77% |

8 | 3 | 1 | 2 | 6 | 75% |

11 | 1 | 3 | 5 | 8 | 72% |

13 | 1 | 5 | 3 | 8 | 61% |

10 | 3 | 2 | 1 | 6 | 60% |

15 | 3 | 3 | 4 | 9 | 60% |

12 | 5 | 1 | 1 | 7 | 58% |

17 | 1 | 4 | 5 | 9 | 52% |

19 | 1 | 5 | 5 | 10 | 52% |

14 | 3 | 1 | 3 | 7 | 50% |

It seems there is no objectively "best" base for generating modulo tricks.

If you have suggestions for further analysis, please email me.