$\mathit Exact \ question :$

How many 7-digit numbers (without repetition) can be formed from digits

$$1,2,3,4,5,6,7,8,9 $$ such that each of them are divisible by $ 18 $ ?

$\mathit My \ approach :$

First I checked for the divisibility of $9$, the numbers would be...

$$ 1236789, 1245789 ,1345689, 2345679 $$

In this, at last position either of $2,4,6,8 $ can come, that leaves us to the total possibility of only 3 digits appearing at last position.

And the total 7-digit numbers would be

$$\displaystyle 3 \times (6! \times 4) = 8640. $$ Is it correct ? Actually, I came up with this question myself.

  • $\begingroup$ It looks like you are asking for the number to be divisible by $18$, as opposed to not be divisible which seems to be what the question says. Which do you want? When you say none of $2,4,6,8$ can be in the last position, that leaves $5$ choices. $\endgroup$ Feb 27, 2020 at 16:44
  • $\begingroup$ Yup, sorry, I have corrected the problem. $\endgroup$ Feb 27, 2020 at 16:47
  • $\begingroup$ Once you have discarded two digits, there are only $3$ even digits left, so the answer should be $4\cdot3\cdot6!$ $\endgroup$
    – saulspatz
    Feb 27, 2020 at 16:50
  • $\begingroup$ I corrected, it.... sorry. This is the exact question... $\endgroup$ Feb 27, 2020 at 16:52
  • $\begingroup$ Thank you for helping. $\endgroup$ Feb 27, 2020 at 19:16

1 Answer 1


As saulspatz says, there are only three even digits in each set, so it should be $4$ (sets of numbers) $\cdot 3$ (choices for the ones digit in each set) $\cdot 6!$ (ways to arrange the rest of the digits.)

You can write it up more clearly. When you list the four numbers that are divisible by $9$ you should say that those are the sets of digits that can make up the number. When you talk of the last position you should not say "neither", it should be the last position can be one of $2,4,6,8$, but only three of these are available in each set. Finally, explaining the logic of your final expression is helpful. For combinatorics problems I often do it like I did in the first paragraph. You can also list the terms you will multiply and say where each comes from.

  • $\begingroup$ Thank you for assisstance :) But I didn'y understand- Why there would be 3 choices for one's digit. There must be 4 or not ? $\endgroup$ Feb 27, 2020 at 17:03
  • $\begingroup$ If you look in each of your sets of seven digits there are only three even number in each. If you use the first, you cannot have $4$ in the ones digit, for example, so there are only $3 \cdot 6!$ numbers that come from this one. $\endgroup$ Feb 27, 2020 at 17:05
  • $\begingroup$ In the first set, there is no 4, neither 4 can come because it will alter the sum of digits and it would be no more a multiple of nine. I corrected my question later from 'not divisible by 18' to " divisible by 9 but not by 2 ". $\endgroup$ Feb 27, 2020 at 17:14
  • $\begingroup$ @Aadi Please don't change the question after people have answered it. Ask a different question. $\endgroup$
    – saulspatz
    Feb 27, 2020 at 17:16
  • $\begingroup$ I am sorry for the inconvenience, but in the excitement of giving the question, I posted it wrong 2 times. This was my first question and I assure that it will never happen again. $\endgroup$ Feb 27, 2020 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .