Count of 6-digit numbers divisible by 6 but not by 9

1.4k Views Asked by At

Suppose that 6-digit numbers are formed using each of the digits 1,2,3,7,8,9 exactly once. I want the count of such 6-digit numbers that are divisible by 6 but not divisible by 9. I understand that the formed number should contain atleast one 2 and atmost one 3 in its prime factorization but don't know how to find count of such numbers. Any hint in this direction or other solution method will be very helpful.

3

There are 3 best solutions below

0
On BEST ANSWER

Firstly, we know that any number of the combination of digits 1,2,3,7,8,9 with each number used exactly once is not divisible by 9, since $ 1 + 2 + 3 + 7 + 8 + 9 = 30 $ which is not divisible by 9.

Secondly, to let the number be divisible by 6, the last digit must be even. Therefore the last digit can only be 2 or 8.

Since there is no repeating digit, no repetition will need to be considered and the answer is $ 2 \times 5! = 240 $ .

0
On

Its a trick question. The sum of digits of every occuring number is $1+2+3+7+8+9=30$ which is not divisible by $9$. Thus, the condition to be not divisible by $9$ is vacuous (recall that a number is divisible by $9$ if and only if its sum of digits is divisible by $9$). Also, since $30$ is divisible by $3$, every occuring number is divisible by $3$. The only restriction to the number is that $2$ or $8$ has to be the last digit to fulfill the divisible-by-$2$-condition. There are $2\cdot 5!=240$ possibilities for this.

0
On

So, $a=n_\text{max}=10^7-1$ and $b+1=n_\text{min }=10^6$

As $(6,9)=18$

The result should be

$$\lfloor a/6\rfloor-\lfloor a/18\rfloor$$

$$-(\lfloor b/6\rfloor-\lfloor b/18\rfloor)$$