Not quite working version
Generate all permutations of a given number