The C programmer in me can’t help noticing that, instead of using an [if], you can do [int]->[- 1]->[% 16]->[+ 1] (assuming you only use positive integers, i.e., neither zero nor any negatives… the modulo operator is a bit idiosyncratic with negative input, but that’s a different story).
In a compiled language the addition and subtraction are generally cheaper than a conditional. In Max, it probably doesn’t make any difference.
I’m also not sure the OP was entirely clear regarding the number 16.. If 5=5, 17=1 and 32=2, then what about 16? Does 16=1, 0 or 16? If 1, then 16=17. If 0, then there is an inconsistency with 32=2. So in terms of simplicity, his criteria kinda forces the hand of if.