Add nthperm(p::Vector) such that nthperm(nthperm(p,k)) == k.
nthperm(p): add tests
nthperm(p): hand-optimized version.