How to find the number of $4$-digit numbers formed by $1,2,3,4,5,6,7$ with no figure being used more than once which is divisible by $3$? My question is how to find the number of $4$-digit numbers formed by $1,2,3,4,5,6,7$ with no figure being used more than once which is divisible by $3$?
My approach:
My method is going to find the sum of each digits which is divisible by $3$, such as $12,15,18,21$. I found that there are $11$ combinations to form these numbers which are divisible by $3$. And I think this method is correct. However, is this question has more proper way to do? It is because I think my method is very tedious.
 A: To get a better understanding of the only cases possible, the sum of the numbers is 28, which is 1 mod 3. Hence, to get a sum divisible by 3, I have to remove 3 numbers from those 7 numbers such that their sum is also 1 mod 3. The ONLY(Cases where each number appears once twice and zero times are included) possible cases for those three numbers are (3,3,1), (3,2,2), (1,1,2), where the numbers denote the remainder when divided by 3. So for the first case here, I have to remove 3, 6, and one of (1,4,7). Hence the number of required 4-digit numbers will be $\ \binom{3}{1} * 4! $. For case two, I have to remove 2, 5, and one of (3,6). Hence the number of required 4-digit numbers will be $\ \binom{2}{1} * 4!$. For the third case, I have to remove two of (1,4,7) and one of (3,6). Hence the number of required 4-digit numbers will be $\ \binom{3}{2} * \binom{2}{1} * 4!$. Hence the total number of required 4-digit numbers will be $$\ 4!(\binom{3}{1} +\binom{2}{1} + \binom{3}{2}*\binom{2}{1})$$ which in turn is equal to $\ 24*11=264$. Hope it helps!
A: The simplest way to solve this is to find no. of combinations of 4-digits divisible by 3 and rearrange them.
Now, knowing that all no. can either be of the form of $3n$, $3n+1$ or $3n+2$.
$S_{3n} = \{3,6\}$.
$S_{3n+1} = \{1,4,7\}$.
$S_{3n+2} = \{2,5\}$.
You can see that here the 4 digits can only be of the following form:
Let

*

*$N_1$ = No of groupings of form $(3n+1, 3n+1, 3n+2, 3n+2)$

*$N_2$ = No of groupings of form $(3n, 3n, 3n+1, 3n+2)$

*$N_3$ = No of groupings of form $(3n+1, 3n+1, 3n+1, 3n)$
$N_1 = \binom{3}{2}.\binom{2}{2}$;
$N_2 = \binom{2}{2}.\binom{3}{1}.\binom{2}{1}$;
$N_3 = \binom{3}{3}.\binom{2}{1}$
Then, the total ways to rearrange $= 4! = 24$.
So, total no = $24 .(N_1 + N_2 + N_3) = 264$
