Answer: 12
===========================================================
Step-by-step explanation:
We have four values to pick from {1,3,5,9} and we want to form a three-digit number.
Kick one of those values out, let's say we kick out "9" at the end to get the subset {1,3,5}.
The sum of these remaining values is 1+3+5 = 9 which is a multiple of 3. Therefore three-digit numbers that have any order of 1,3,and 5 will be a multiple of 3.
Eg: 135/3 = 45 exactly.
There are 3*2*1 = 6 such numbers as shown at the very bottom of this solution post.
This is a permutation since the order matters.
Let A = 6 so we can use it later.
----------------
Go back to {1,3,5,9}
Now let's say we kicked "5" out this time.
We go from {1,3,5,9} to {1,3,9}
The digits sum to 1+3+9 = 13 which is not a multiple of 3
No matter how we arrange these digits, we won't get a multiple of 3.
Eg: 139/3 = 46.33 approximately
----------------
Let's go back to {1,3,5,9}. This time we'll kick out "3" from the group.
{1,3,5,9} shrinks to {1,5,9}
Add the values: 1+5+9 = 15 which is a multiple of 3.
Therefore, we get 6 more permutations (refer to the first section for similar steps). Let B = 6 so we can use it later.
Example: 159/3 = 53 exactly
-----------------
Return back to {1,3,5,9} once more. We have one final value to kick out.
Let's remove the "1" to end up with {3,5,9}
Add the values: 3+5+9 = 17 which isn't a multiple of 3, so we ignore this sub-case. It's similar to the 2nd section shown above.
-------------------
Each previous section had us remove exactly one value to have 3 digits leftover. This is a methodical way to guarantee we have looked through all possible cases.
The first case had us kick out 9 so that a permutation of {1,3,5} led to some multiple of 3. There were A = 6 cases for that section.
The third section had {1,5,9} which led to B = 6 more cases.
In total, there are A+B = 6+6 = 12 different three-digit numbers possible if we are only allowed to use {1,3,5,9} without repeats allowed. In other words, all three digits must be different.
-------------------
Check:
Here are the first 6 cases involving 1,3,5
- number = 135
- number = 153
- number = 315
- number = 351
- number = 513
- number = 531
Here are the other 6 cases involving 1,5,9
- number = 159
- number = 195
- number = 519
- number = 591
- number = 915
- number = 951