Love those arbitrary restricted range

How many positive integers less than 500 exist with their units digit a 0, 2 or 9?

Try more combinatorics problems.
120 150 179 149

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.

3 solutions

Discussions for this problem are now closed

Sandeep Bhardwaj
Sep 18, 2014

Numbers that can be used at unit digit's place= 3 (i.e. 0,2 and 9 )

Numbers that can be used at ten's digit place= 10

Numbers that can be used at hundred's digit place=5 (i.e. 0,1,2,3,4 )

So total numbers = 3 × 10 × 5 = 3 \times 10 \times 5 =150

But 000 is also included in those numbers, but not being a positive integer, it must be excluded.

So required positive integers = 149 =\boxed{149}

Yep you should be careful in removing that 000

Anand Raj - 6 years, 6 months ago

I noticed that at the last minute and saved myself from an epic failure. :P

Sudeshna Pontula - 6 years, 3 months ago

500 x 3/10 = 150 // only 3/10 out of 500 integers (000-499) fulfill the requirement.

150 - 1 =149 // 000 is not included.

BK Lim - 6 years, 3 months ago
Ahmed Hussein
Oct 21, 2014

simply, every 100 numbers there is 10 numbers whereas their units are 0,2 or 9 , but the confusion is that the number 500 is not included in the interval mentioned in the problem, so that 500 cannot be considered as a number where its units is 0,Because of the condition that the numbers must be LESS THAN 500.

Brock Brown
Dec 27, 2014
1
2
3
4
5
6
7
count = 0
for i in xrange(1,500):
    for digit in '029':
        if str(i).endswith(digit):
            count += 1
            break
print count

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...