[math-fun] Optimally sorting a cyclic group