mainbhidhruv wrote:@Brent In your Solution above you are considering 000 as a number when in question the range is 1 to 1000, why is it so- Please clarify .
Since, there are no three's in 1000, we could just ask "Among the integers from 1 to 999, how many have at least one 3?"
Likewise, there there are no three's in 000, we could just ask "
Among the integers from 000 to 999 inclusive, how many have at least one 3?"
This is what I did.
I recognized that there are 1000 integers from 000 to 999 inclusive
Then I calculated there are 729 integers with zero 3's
So, the other 271 must have at least one 3.
mainbhidhruv wrote:
When I calculate 3 digit numbers with no 3's
1 digit : 8 (1,2,4,5,6,7,8,9 )
2 digit : 8*9 = 72
3 digit : 8*9*9 = 648
8+72+648 = 728
Where am I missing 1 number, Please correct me.
You're almost there.
Since you don't seem to be including 1000 in your calculations, you are essentially answering the question, "Among the integers from 1to 999 inclusive, how many have at least one 3?"
Since there are 999 integers from 1 to 999 inclusive, we must subtract
728 from 999 to get 271
Same answer, different approach.
Cheers,
Brent