Buying House Numbers

In a new housing project, the owners need to buy new house numbers from the only hardware store in their area. The houses are numbered 1 , 2 , 3 , 4 , 5 , 1, 2, 3, 4, 5, \ldots , and the owners purchase the digits for their house numbers in numerical order ( i.e. 1 , 2 , 3 , 1, 2, 3, \ldots ). If the store has exactly 100 100 of each digit, what is the address of the first home owner who is unable to purchase their house number?

Details and assumptions

The store has exactly 100 of each digit 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 . 10 10 is not considered a digit.


The answer is 163.

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.

10 solutions

We can calculate the following (a)there are 20 of each digit 1 to 9 used in forming numbers from 1 to99
(b)there are 20 of each digit 2 to 9 used in numbers from 100 to199
(c)there are 120 ones used in numbers from 100 to199. All the 100 numbers have 1 in the 100th place(100)+(number of ones in units place+ number of ones in tens place is) (20) (d) there are 29 zero used from numbers 1 to199

Therefore the address of the first house owner who is unable to purchase his house number is a 3 digit number starting with 1, and the digit he is unable to purchase is 1{from(c)}. 20 1's have been purchased from 1 to 99, Therefore the number containing the 81th one from 100 onwards cannot be sold. We can calculate that this is 163.

You have to explain why the digit 1 must be the first to run out.

Simply calculating that 100 1's are used from 1 to 162 does not explain why we would not use up more 2's or 0's before then.

Calvin Lin Staff - 7 years ago
Kavish Gandhi
May 20, 2014

First, note that in each 100 (e.g. 100-199), each digit appears 10 times in the units place and ten in the tens place. This is obvious, because each digit appears the same amount of times.

Second, note that the first digit to run out should be 100, because it is the first digit to be in the hundreds place. Thus, we will proceed by finding the 101th 1.

Because of our first point, there are 20 ones in the first 100.

For a number x > 100, the number of 1's that have already been shown is equal to 20 (the first 100) + x - 99 (the number that have appeared in the 100's place) + 10 (the number in the tens place (110-119)) + the floor of ((x-91)/10) (the number of 1's that have appeared in the 1's place). The first number that satisfies x - 69 + the floor of (x-91)/10 = 101 is \boxed{163}, our answer.

Where did we get all of those numbers from? The 20 is just the first 1-99. The x-99 derives from the fact that 1 has appeared in 100 - x, which is x - 100 + 1 = x-99 numbers. The 10 derives from the fact that the only place where 1 is in the tens place is 110-119, 10 numbers. Finally, the floor of (x-91)/10 derives from the fact that every time you hit 1i1, you get another in the units place; this occurs ever 10 and starts at 101, so you need to subtract 91 and take the floor of that, since it will not always be an integer.

The basic trick to solve the problem is hidden in the question itself. The question says “what is the address of the first home owner who is unable to purchase their house number?” So, here we are actually looking for the smallest number which cannot be used in the consecutive sequence from 1, 2, 3 … etc i.e. look for the smallest possible number where one of its digits has exhausted the (100 digit) count of occurrence.

We will figure out the answer using patterns that occur in numbers.

  1. As there are 100 2-digit numbers(considering 01,02,03,...,10 as 2 digits) so a total of 2*100 = 200 digits. Thus each digit appears the same amount of times i.e. each digit appears 200 / 10 = 20 times.

  2. Notice that from 100 on wards "1" occurs in all the digits i.e. from 100-200, the digit 1 appears 100 times at least. Thus 1 is the digit which is going to be exhausted first.

We break up the numbers into smaller groups, to make it easier to solve:

  1. 1-100

  2. 101-150 on wards (if necessary).

1) We'll start by looking at the ones (units) positions only.

We should see that the number of "1” digits in the units position will repeat, for each group of ten.For example, from 1 to 10 (and looking only at the ones position), there will be only one "1" digit. This will repeat the same way, for pages 11-20, 21-30, 31-40,… and 91-100.So counting all of the "1" digits in the range of 1-100 (looking only in the units position) gives us 10 total. This same pattern repeats for the ranges 101-150.Each range has ten "1" digits in the units position.

2) Next, we'll look at the 10s positions only.

For the range 1-100, the digit "1" occurs at the 10s position only for numbers 10 through 19, a total of ten times. Similarly for range 101-150, it occurs ten times in the 10s position (for 110-119).

3) Next we look at the 100s position only.

We see the digit "1" will occur in the 100s position in only one position in the first and all in the second group. In the first group, it will occur once only, for number 100. In the second group, it will occur 50 times, for each of the numbers 101 to 150.

TOTAL number of "1" digits in numbers 1 to 150 = 86

We are getting close to our solution. Now from 150 to 162, the digit “1” appears 12 times in the 100s position and 1 time in both the 10s and 1s position, bringing the total count to 100 (86+12+1+1).Thus, we finally arrive at the solution. The first house owner who is unable purchase their house number has a house number of: 163.

Kartik Goel
May 20, 2014

Total no. of 1's till 162 are 100 and other digits will be less than this because 1 is coming at hundredth place that's why the no. of 1's will be maximum out of others till 162. Hence, 163 contains 101th 1. So, 163 is the answer

Vincent Zhuang
May 20, 2014

The 1s will clearly run out first as they will be used up rapidly in the 100s. For numbers less than 100, 20 1s are used up. For numbers 100-120, an additional 21+10+2 are used up (in hundreds, tens, and ones digits respectively). From here on, every 10 numbers will use up 11s, so 160 will use up the 97th 1, 161 the 99th, 162 the 100th, and at 163 we run out of 1s.

As 1 is the primary and smallest positive integer there will be a larger demand for it and it will be sold over first

Numbers of houses

1 - 10 = Two 1's

11 - 20 = Ten 1's

21 -100 = Nine 1's

101 - 110 =Twelve 1's

111 - 120=Twenty 1's

121 - 130 =Eleven 1's

131 - 140 = Eleven 1's

141 - 150 =Eleven 1's

151 - 160 = Eleven 1's

161 - 162 = Three 1's

Thus after 162, Hundred 1's gets over .

So person belonging to163rd house don't get his house number

Ankit Akash
May 20, 2014

First of all it can be clearly guessed that the first digit we are going to lack would be d i g i t 1 digit 1 . Now let us denote the last possible house number as a b c \overline{abc} and f ( a b c f(\overline{abc} as number of 1's in a b c \overline{abc} .

Then if a<1 then we have used only (10+10) 1 s 1's and if a>1 then we have used more than 100 1's (as f ( a b c ) > f ( 1 x y > 100 ) f(\overline{abc})>f(\overline{1xy}>100) ) Hench a = 1 a=1 \Rightarrow number are of the form 1 b c \overline{1bc} .

Now, 1 come's in units digit 1 b + 1 \overline{1b+1} times. and 1 come's in hundreds digit b c + 1 \overline{bc+1} times. About tens place : if b>1 then 1 comes in tens digit 2 × 10 2 \times 10 . Hence f ( 1 b c = 1 b + b c + 20 f(\overline{1bc} = \overline{1b} + \overline{bc} + 20 but f ( 1 b c = 10 f(\overline{1bc}=10 10 + b + 1 + 10 b + c + 1 + 20 = 100 \Rightarrow 10+b+1+10*b+c+1+20=100 11 b + c + 32 = 100 \Rightarrow 11*b+c+32=100 11 b + c = 68 \Rightarrow 11*b+c=68 but [ 0 \leq c \leq 9 ) \Ritghtarrow b = 6 \Ritghtarrow b=6 and c=2 so a b c \overline{abc} = 162.

Calvin Lin Staff
May 13, 2014

The addresses from 1 1 to 99 99 use up 20 20 of each non-zero digit, and 9 9 zeros. From 100 100 to 199 199 , we clearly require 1 1 the most number of times. From 100 100 to 109 109 , we will use up 11 11 ones. From 110 110 to 119 119 , we use up 21 21 ones. For each subsequent group of ten numbers (up to 199), we will use up 11 11 ones. After k k groups, we have 20 + 11 + 21 + 11 k 20 + 11 +21 + 11k ones. For k = 4 k=4 , we will use up 96 96 ones. Addresses 160 160 , 161 161 and 162 162 , will use up a further 4 4 ones. Hence, 163 163 will be the first address that cannot be purchased.

Yash Farooqui
May 20, 2014

Intuition tells us that 1 ought to run out first (0 is only used at the end of a number so 1 is the lowest digit that appears at the beginning of a number)

Drawing a table, we see that in the first 99 numbers, the digit 1 is used exactly 19 times. We can see this by noting that the first digit is 1 for 10 number and the second digit is 1 for 10 numbers with exactly 1 overlapping number (11), giving exactly 10+10-1=19 uses of 1 below 100.

At this point, we can note that this analysis works for all digits except 0 and note that between 100 and 199 inclusive, there will be 19 uses of each non-1 digit. However, between 100 and 199, there will be 100+19=119 uses of the digit 1, thus confirming our intuition that 1 will run out sooner than any other digit.

Once 100 is reached, exactly 100-19=81 ones are remaining. We can then systematically count for every group of 10 numbers:

100-109: 11 ones (10 times as leading digit, once as final digit) 110-119: 21 ones (10 times as leading digit, 10 times as middle digit, once as final digit) 120-129: 11 ones 130-139: 11 ones 140-149: 11 ones 150-159: 11 ones

By the time 160 is reached, 11*5+21+19=95 ones have been used. It is thus clear that the number where the digit one will run out lies between 160 and 169 inclusive. Writing the numbers 160-169 and counting ones, we find an answer of 163.

Hero Zero
May 20, 2014

163

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...