3. [5] How many six-digit multiples of 27 have only 3,6 , or 9 as their digits?
Answer: 51
Solution: Divide by 3 . We now want to count the number of six-digit multiples of 9 that only have 1 , 2 , or 3 as their digits. Due to the divisibility rule for 9 , we only need to consider when the digit sum is a multiple of 9 . Note that $3 \cdot 6=18$ is the maximum digit sum.
If the sum is 18 , the only case is 333333 .
Otherwise, the digit sum is 9 . The possibilities here, up to ordering of the digits, are 111222 and 111123. The first has $\binom{6}{3}=20$ cases, while the second has $6 \cdot 5=30$. Thus the final answer is $1+20+30=51$