Implement generating permutation for P(n, k).