The question is:
How many $7$-digits number can be formed by using $1$, $2$, $3$, $4$, $5$, $6$, $7$, $8$, $9$ such that it is divisible by $3$? Repetition is not allowed.
I have done a similar question which was something like this :
How many $7$-digits number can be formed by using $1$, $2$, $3$, $4$, $5$, $6$, $7$, $8$, $9$ such that it is divisible by $3$? Repetition is allowed.
For the second question , what I had done is that I had classified the sum of first $6$ digits as either of the form $3n$, $3n+1$ and $3n+2$ with the first 6 digits being filled in $9^6$ ways. And then we observe that for each of the form $3n$, $3n+1$ and $3n+2$ forms, the last digit can only be filled in $3$ ways. Therefore the total number of numbers will be $(9^6)\times3$
For example if the sum of the first $6$ digits is of the form $3n+1$, then the last digit can be filled with $2$ or $5$ or $8$. Similarly for other forms as well, the last digits will be filled in only $3$ ways.
However for the first question, repetition is not allowed... and it will become difficult to check for the last digit... So can anyone tell me how to do this?