nthperm(p) rather than nthperm(v)

n = nthperm(p) is the opposite of p = nthperm([1:k], n)