Of all the positive integers that contain all ten digits (no leading zeros), arranged in ascending order, what is the millionth number on the list?
Computer solutions are welcome, but an analytic solution is even better.
Okay, numbers starting with 1 are obviously going to be the smallest numbers, and there are 9! = 362880 of those. Then there are 9! numbers that start with 2.
So:
1 _ _ _ _ _ _ _ _ _ = 362880
2 _ _ _ _ _ _ _ _ _ = 362880
That's 725,760 of the smallest numbers accounted for, so now I just go to the next digit, with similar logic.
30 _ _ _ _ _ _ _ _ = 8! numbers
31 _ _ _ _ _ _ _ _ = 8! numbers, etc., etc.
So, carrying this thing out and counting as I went, and hopefully not getting off by one error, which I hate, I got:
3,782,915,460
I think that's right.