Let be the set of positive integers from 1 up and including .
Find such that consists of 2016 numbers with at least one repeating digit.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We claim that n = 4 4 9 0 is the answer. Let f ( n ) denote the number of numbers with at least one repeating digit in S . A natural way to find f ( n ) is to count the number of numbers with no repeating digits in S , then subtract that number from n .
We first compute f ( 3 9 9 9 ) = 3 9 9 9 − ( 9 + 9 2 + 9 2 ⋅ 8 + 3 ⋅ 9 ⋅ 8 ⋅ 7 ) = 1 7 4 9 . (There are 9 one-digit numbers with distinct digits, 9 2 two-digit numbers with distinct digits, so on.)
Next we find f ( 4 3 9 9 ) , which is just 1 7 4 9 plus the number of repeating digit numbers in [ 4 0 0 0 , 4 3 9 9 ] . Note that 4 cannot be used for the last three digits, therefore this range contains 4 0 0 − 4 ⋅ 8 ⋅ 7 = 1 7 6 of those numbers. (There are 4 choices for the third digit- 0 , 1 , 2 , 3 , 8 choices for the second digit, so on.) Thus f ( 4 3 9 9 ) = 1 7 4 9 + 1 7 6 = 1 9 2 5 .
Since all numbers in [ 4 4 0 0 , 4 4 9 9 ] contain two 4 's, f ( 4 3 9 9 + n ) = 1 9 2 5 + n . Hence f ( 4 4 9 0 ) = f ( 4 3 9 9 + 9 1 ) = 1 9 2 5 + 9 1 = 2 0 1 6 .