Example 1-24 Find the number of 5-digit numbers that contain at least one 6 and are divisible by 3. For a $k$-digit number $a_{k-1} a_{k-2} \cdots a_{1} a_{0}$ $\equiv a_{k} \times 10^{k-1}+a_{k-2} \times 10^{k-2}+\cdots+a_{1} \times 10+a_{0}$, since $10 \equiv 1 \bmod 3,10^{2} \equiv 1 \bmod 3, \cdots$, $10^{k} \equiv 1 \bmod 3$. Therefore, the necessary condition for $a_{k-1} a_{k-2} \cdots a_{1} a_{0}$ to be divisible by 3 is
$$
a_{k-1}+a_{k-2}+\cdots+a_{1}+a_{0} \equiv 0 \bmod 3
$$
Method 1: There are 90,000 numbers from 10000 to 99999, of which 30,000 are divisible by 3. Among these 30,000 numbers, the first digit does not appear as 6, and there are 8 possibilities: 1, 2, 3, 4, 5, 7, 8, 9. The 2nd, 3rd, and 4th digits, which do not appear as 6, have 9 possibilities, including 0. However, to ensure divisibility by 3, the 5th digit (i.e., the units digit) has only 3 choices. If the sum of the first four digits is divisible by 3, the units digit can only be 0, 3, or 9. If the sum of the first four digits leaves a remainder of 1 when divided by 3, the units digit can only be 2, 5, or 8. If the sum of the first four digits leaves a remainder of 2 when divided by 3, the units digit can only be 1, 4, or 7, all of which have 3 choices.

The 5-digit numbers that do not contain 6 and are divisible by 3, according to the multiplication rule, are:
$$
8 \times 9^{3} \times 3 = 17496
$$
The 5-digit numbers that are divisible by 3, minus those that do not contain any 6, result in $30000 - 17496 = 12504$ numbers that contain at least one 6.

Method 2: Let the 5-digit number be $a_{4} a_{3} a_{2} a_{1} a_{0}$,
(1) If $a_{0} = 6$, then $a_{1}, a_{2}, a_{3}$ have 10 choices, i.e., they can be 0, 1, 2, ..., 9. However, $a_{4}$ has only 3 choices to ensure that $a_{4} + a_{3} + a_{2} + a_{1} + a_{0} \equiv 0 \bmod 3$. $a_{1}$ cannot be 0, i.e., when $a_{3} + a_{2} + a_{1} + a_{0} \equiv 0 \bmod 3$, $a_{4}$ can take 3, 6, or 9. Therefore, the number of valid schemes is $3 \times 10^{3} = 3000$.
(2) If $a_{0} \neq 6$ and $a_{1} = 6$, then $a_{0}$ has 9 choices, but $a_{2}$ and $a_{3}$ have 10 choices. Similarly, $a_{4}$ has 3 choices. So, when $a_{0} \neq 6$ and the first 6 from right to left appears at $a_{1}$, there are $3 \times 10^{2} \times 9 = 2700$ schemes.
(3) If the first 6 from right to left appears at $a_{2}$, then $a_{1}$ and $a_{0}$ have 9 choices, $a_{3}$ has 10 choices, and $a_{4}$ has only 3 choices. Therefore, the number of valid numbers is $3 \times 10 \times 9^{2} = 2430$.
(4) If the first 6 from right to left appears at $a_{3} = 6$, then $a_{4}$, $a_{1}$, and $a_{2}$ have 9 choices each, and $a_{4}$ has only 3 choices. Therefore, the number of valid numbers is $3 \times 9^{3} = 2187$.
(5) If $a_{4} = 6$, i.e., $a_{3}$, $a_{2}$, $a_{1}$, and $a_{0}$ are not 6, the number of valid schemes is $3 \times 9^{3} = 2187$. Here, $a_{0} \neq 6$.

According to the addition rule, the number of 5-digit numbers that contain at least one 6 and are divisible by 3 is:
$$
3000 + 2700 + 2430 + 2187 + 2187 = 12504
$$

These two methods are quite representative. One directly seeks the number of valid cases, like the latter. The other directly seeks the number of invalid cases and subtracts it from the total. Both methods are commonly used in counting, depending on which is more convenient.