numperm function

Get the nth Permutation Vector by Periodic Placement