Updated permation algorithm and cleaned up unneeded include

Permutation algorithm was updated to allow for repeated characters
n times, and to allow exclusion of numbers with no repeated characters