[math-fun] Similar permutations problem