Non-repeating-digit integers of a given length and of a given base.

120 Views Asked by At

I am writing a program for a special purpose which needs non-repeating alphanumeric digit sequence of a given base and of a given length. For example, if the given base is 28 so digits are 0-9A-R, and the sequence length given is 11 so the first non-repeating-digit sequence is 0123456789A. I have coded 2 {not so intelligent i guess} algorithms in python and c, they works but will need several months to complete the calculations and i have no access to any high performance scientific computing rig. First method is by repeatedly incrementing long long unsigned int base 10 variable and calculating the base 28 then filtering out the any resulting base 28 number with repeated digits. Another method is using addition in base 28, repeatedly adding 1 and then filtering out the any resulting base 28 number with repeated digits.

Are there special existing ways/algorithms in math to do it? Or peoples have already completed it and have a list of non-repeating-digit integers?

What is the mathematical way to get all the non-repeating-digit Integers of given length and a given base?

And please understand that I am not a math student, so please write back in a way that I can understand.

Regards.