<s>[INST] Determine the number of three-digit numbers that are divisible by 3 Determine the number of three-digit numbers that are divisible by 3 and that you can form with 3 different numbers among 1, 2, 3, 5, 6, 8
I found 5 numbers or 5 different ways with a sum that is divisible by 3. And each of them has 6 combinations because 3* 2* 1=6 so the total number should be 5*3=30 three-digit numbers that are divisible by 3. But I'm not sure if it's right or if there's a better solution.
 [/INST] $$\begin{align}2,5,8&\equiv -1\pmod 3\\3,6&\equiv 0\pmod 3\\1&\equiv 1\pmod 3\end{align}$$
There are $3\times 2\times 1=6$ ways to select one number from each group and $1$ way to select three numbers from a single group, for a total of $7$ combinations.
There are $3!=6$ permutations of each combination, giving a total of $7\times 6=42$ three-digit numbers.
</s>