Consider all $5$-digit numbers formed using distinct digits from the set $\{1, 2, 3, 4, 5, 6\}$. If these numbers are arranged in ascending order, what is the rank of the number $42513$ among those that are divisible by $3$?
A
Step-by-Step Solution
Key idea: This is a lexicographical ranking problem with a divisibility constraint. We must first identify which subsets of $5$ digits yield a sum divisible by $3$, then count how many valid numbers precede $42513$.
Step 1: Identify valid $5$-digit subsets.
The sum of all $6$ digits is $1+2+3+4+5+6 = 21$.
A $5$-digit number is formed by omitting one digit $x$. The sum of its digits is $21 - x$.
For the sum to be divisible by $3$, $21 - x$ must be a multiple of $3$, which means $x$ must be a multiple of $3$.
Thus, $x \in \{3, 6\}$.
Case 1: Omit $3$. Digits used: $\{1, 2, 4, 5, 6\}$.
Case 2: Omit $6$. Digits used: $\{1, 2, 3, 4, 5\}$.
Step 2: Count valid numbers strictly less than $42513$.
The target $42513$ uses digits $\{1, 2, 3, 4, 5\}$, so it belongs to Case 2.
- Numbers starting with $1$: Can be from Case 1 or Case 2. Each has $4! = 24$ permutations. Total = $48$.
- Numbers starting with $2$: Similarly, $24 + 24 = 48$.
- Numbers starting with $3$: Case 1 doesn't contain $3$. Case 2 has $4! = 24$. Total = $24$.
- Numbers starting with $4$ and less than $42513$:
- From Case 1 ($\{1, 2, 4, 5, 6\}$):
- $41xxx$: $3! = 6$.
- $421xx$: $2! = 2$.
- $425xx$: Remaining digits $\{1, 6\}$. Numbers are $42516, 42561$. Both are $> 42513$. So $0$.
Total Case 1 = $6 + 2 = 8$.
- From Case 2 ($\{1, 2, 3, 4, 5\}$):
- $41xxx$: $3! = 6$.
- $421xx$: $2! = 2$.
- $423xx$: $2! = 2$.
- $425xx$: Remaining digits $\{1, 3\}$. Numbers are $42513, 42531$. Strictly less is $0$.
Total Case 2 = $6 + 2 + 2 = 10$.
Step 3: Calculate the rank.
Total numbers before $42513 = 48 + 48 + 24 + 8 + 10 = 138$.
Rank = $138 + 1 = 139$.
Answer: 139