Add algorithm for coding/decoding permutation to number