how many integers between 100 and 400 contain the digit 2
Between 100 and 400 means from 101 to 399. Think of different intervals: 101 to 199 200 to 300 301 to 399
The easy interval is from 200 to 300 in which all integers from 200 to 299 have a 2. That is 100 integers with a 2. Now think of the interval 101 to 199. From 120 to 129, every integer has a 2. That is 10 2's. Also, in every group of 10, there is one 2. 100 to 119, there is one 2 120 to 129 there are 10 2's 130 to 140 there is one 2 etc. Then the interval 301 to 399 is the same as the interval 101 to 199.
I counted to be 138. not sure though. This problem is a little bit tougher than I originally thought
I got 136.
I got the same thing 136 and I did it the long way
is there an easy way to do it?
shouldn't there be 19 numbers from 100-199 containing the digit 2? same thing from 300-399? and from 200-299 obviously has 100 so 19 + 19 + 100 = 138?
102, 112, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 132, 142, 152, 162, 172, 182, 192
100 + 2(1*1*10) - 1 + 2(1*1*10) - 1 = 138
I see where I missed counting one in the 101-199 counting, which then turned to two less when including the 300-399. Yes, 138 makes sense. Thanks.
Join our real-time social learning platform and learn together with your friends!