We are to calculate the number of 1-digit to 6-digit numbers (i.e. numbers less than one million) that have at least one 1. Let's divide this into six cases by the number of digits in the number.
For one digit numbers, the only number is 1 - 1 such number.
For two digit numbers, we can find the number which do not contain a 1 more easily. There are 8 possible digits for the tens place (0 and 1 are not allowed), and 9 digits for the ones place (1 is not allowed). Thus we have 8 * 9 = 72 which do not work. There are 90 two digit numbers, so 90 - 72 = 18 such numbers.
For three digit numbers, we will proceed in the same manner. There are 900 total 3 digit numbers, of which 8 * 9 * 9 = 648 numbers which do not contain a 1. The remaining 900 - 648 = 252 numbers contain at least 1 one - 252.
For four digit numbers, continuing in the same manner we have 8 * 9 * 9 * 9 = 5832 which are not good out of the 9000 total. So, 9000 - 5832 = 3168.
For five digit numbers, we have 8 * 9 * 9 * 9 * 9 = 52488. The remaining 90000 - 52488 = 37512 are good.
For six digit numbers, we have 8 * 9 * 9 * 9 * 9 * 9 = 472392. The reamining 900000 - 472392 = 427608 are good.
Finally, adding all of the totals, we have 1 + 18 + 252 + 3168 + 37512 + 427608 = 468,559 numbers between 1 and 999999 which contain at least 1 one.
There are 45 integers between 11 and 999999 which consist of only one digit being repeated. There are 831430 integers that contain at least one repeated digit.
-999999
The largest six digit number period is 999999. The largest number meeting your criteria is 998949.
271 of the first 1000 natural numbers contain at least one digit 5. That is 27.1 % of them.
All the numbers from 100,000 to 111,111 contain a zero, so that is 11,111 numbers already. The question is then how many numbers between 1,111 and 2,000 contain at least one zero. There are 19 numbers every hundred digits from 1,200 onwards that meet this requirement (10 which have a 0 in the tens and ten which have a 0 in the units, not counting 00 twice) and thus we have 19x8 = 152 additional numbers. Add this to the amount from before, and 1 for the end value of 112,000: 11,111+152+1 = 11,264 numbers.
There are 45 integers between 11 and 999999 which consist of only one digit being repeated. There are 831430 integers that contain at least one repeated digit.
at least 999999 others.
-999999
The largest six digit number period is 999999. The largest number meeting your criteria is 998949.
271 of the first 1000 natural numbers contain at least one digit 5. That is 27.1 % of them.
Equation
252
The range is the difference between the greatest and least numbers.
All the numbers from 100,000 to 111,111 contain a zero, so that is 11,111 numbers already. The question is then how many numbers between 1,111 and 2,000 contain at least one zero. There are 19 numbers every hundred digits from 1,200 onwards that meet this requirement (10 which have a 0 in the tens and ten which have a 0 in the units, not counting 00 twice) and thus we have 19x8 = 152 additional numbers. Add this to the amount from before, and 1 for the end value of 112,000: 11,111+152+1 = 11,264 numbers.
It is the range.
27: 077,177,277,377,477,577,677,877,977,717,727,737,747,757,767,777,787,797
The difference between the greatest and least numbers in a set of data is called the range.