[math-fun] recognizing an even permutation