【Question 29】
How many five-digit numbers are divisible by 3 and have at least one digit as '3'?
【Analysis and Solution】
Counting, Exclusion Method, Multiplication Principle.
First, we consider the opposite of "at least one digit is 3," which is "no digit is 3";
Thus, the ten-thousands place has 8 choices (cannot choose $0, 3$), and the thousands, hundreds, and tens places each have 9 choices (cannot choose 3). We know that if a number is a multiple of 3, then the sum of its digits is also a multiple of 3; to ensure the sum is a multiple of 3:
(1) If the sum of the first four digits $\div 3$ has a remainder of 0, then the units place can be $0, 6, 9$, with 3 choices;
(2) If the sum of the first four digits $\div 3$ has a remainder of 1, then the units place can be $2, 5, 8$, with 3 choices;
(3) If the sum of the first four digits $\div 3$ has a remainder of 2, then the units place can be $1, 4, 7$, with 3 choices; that is, regardless of what the first four digits are, the units place always has 3 choices;
Thus, the number of five-digit numbers that do not contain the digit 3 and are multiples of 3 is $8 \times 9 \times 9 \times 9 \times 3=17496$; in the range $10000 \sim 99999$, every 3 consecutive numbers include one multiple of 3;
Therefore, the number of five-digit multiples of 3 is $90000 \div 3=30000$;
Thus, there are $30000-17496=12504$ five-digit numbers that are multiples of 3 and contain at least one digit 3.