This is a problem from the Regional Mathematics Olympiad, RMO 2015 Mumbai Region based on the Number of Three-digit numbers. Try to solve it.
Problem: Number of Three-digit numbers
Determine the number of 3 digit numbers in base 10 having at least one 5 and at most one 3.
(Suggested by Shuborno Das in class)
From 100 to 999 let us count the number of numbers without the digit 5. We have 8 choices for first digit (can't use 0 or 5), and 9 choices each for second and third spot (skipping the digit 5 in each case). Hence three digit numbers have at least one 5.
From these 252 numbers, we must delete the numbers which have more than one 3. Since the number already has at least one 5, it may have at most two 3's. The possible numbers that can be constructed by one 5 and two 3's are .
Hence the numbers with at least one 5 and at most one 3 are 252 - 3 = 249.