I ran across this question this morning.
Basically that question is about data which has to create permutations for 6 values; each one ranging from 1 to 38.
So,
It works exactly like a change of base (binar, octal or hex). The first one question simply: 1*38^6 + 2*38^5 + 3*38^4 + 4*38^3 +...+6*38^0 The second one reversed: 102382 mod 38... recursively UPDATE Let us assume we want change 10 to base 2:
10/2=5 remainder(modulus) **0**
5/2=2 remainder **1**
2/2=1 remainder **0**
1/2=0 remainder **1**
backwards is 1010 general gave a M to change in base B, just divide M by B , and the remainder are going to be the digit in the new base