Generate permutations for a list of distinct numbers.