Problem 24

Perl 6

1say (0..9).permutations[999999]
Ruby
1puts (0..9).to_a.permutation.to_a[999999]