[Math] All the 7-digit numbers containing each of the digits 1, 2, 3, 4, 5, 6, 7 exactly once, and not divisible by 5

combinatorics

All the 7-digit numbers containing each of the digits 1, 2, 3, 4, 5, 6, 7 exactly once, and not
divisible by 5, are arranged in the increasing order. Find the 2000-th number in this list.

My try:

The number of 7-digit numbers with 1 in the left most place and containing
each of the digits 1, 2, 3, 4, 5, 6, 7 exactly once is 6! = 720.The number of 7-digit numbers with 1 in the left most place and containing
each of the digits 1, 2, 3, 4, 5, 6, 7 exactly once is 6! = 720.

Best Answer

Observe the following:

  • There are $6!-5!=600$ numbers starting with $1$
  • There are $6!-5!=600$ numbers starting with $2$
  • There are $6!-5!=600$ numbers starting with $3$
  • There are $6!-5!=600$ numbers starting with $4$

So your number is the $200$th number which starts with $4$:

  • There are $5!-4!=96$ numbers starting with $41$
  • There are $5!-4!=96$ numbers starting with $42$
  • There are $5!-4!=96$ numbers starting with $43$

So your number is the $8$th number which starts with $43$:

  • There are $4!-3!=18$ numbers starting with $431$

So your number is the $8$th number which starts with $431$:

  • There are $3!-2!=4$ number starting with $4312$
  • There are $3!-2!=4$ number starting with $4315$

So your number is the last number which starts with $4315$.

Therefore your number is $4315762$.