Question 1158401
<br>
Edwin's solution is good, as usual.<br>
Here is another approach, to show you there is almost always more than one way to analyze a problem.<br>
The sum of the five given digits is 18, which is divisible by 3.  Since all 5-digit numbers are greater than 5000, every 5-digit number that can be formed with these digits satisfies the requirements.<br>
The first digit can't be 0; so we can choose...
the first digit 4 ways;
the second digit 4 ways;
the third digit 3 ways;
the fourth digit 2 ways; and
the fifth digit 1 way.<br>
Number of 5-digit numbers we can make: 4*4*3*2*1 = 96.<br>
For 4-digit numbers, the first digit must be either 5 or 6 if the number is going to be greater than 5000.<br>
4-digit numbers with first digit 6....<br>
With first digit 6, for the sum of the digits to be divisible by 3, the digits 4 and 5 must both be used.  So we must use both of those digits and choose one of the remaining two digits; then those last three digits can be arranged in 3!=6 different ways.<br>
Number of 4-digit numbers with leading digit 6: 2*6 = 12.<br>
4-digit numbers with first digit 5....<br>
With first digit 5, for the sum of the digits to be divisible by 3, the digit 4 must also be used.  So we use the 4, and we choose 2 of the remaining 3 digits.  We can choose 2 of the remaining three digits is C(3,2)=3 ways; then those last three digits can be arranged in 3!=6 different ways.<br>
Number of 4-digit numbers with leading digit 6: 3*6 = 18.<br>
Total number of numbers we can form: 96+12+18 = 126.<br>