[Permutation] Calculate kth permutation sequence.