0

Question: If all $5*5*5*5*5*5*5*5=5^8=390625$ 8-digit numbers obtained by arranging (permuting) the five digits $2, 3, 6, 7$ & $9$ with their replacements are arranged in the correct increasing order as follows

$$\begin{align} 22222222\\22222223\\22222226\\22222227\\22222229\\22222232 \\ \cdot \!.........\\ \\67329973\\ \bbox[4pt, border: 1px solid red;]{67329976}\\673629977\\ \cdot.........\\ \\99999992\\99999993\\99999996\\99999997\\99999999 \end{align}$$

How to determine the rank in the same increasing order of any randomly selected number say 67329976 (as highlighted in the above arrangement)?

1 Answers1

0

Your numbers can be encoded in base 5 by renumbering $2\mapsto 0, 3\mapsto 1$ etc. (in increasing order). The list will then look like this:

00000000 <-> 22222222
00000001 <-> 22222223
00000002 <-> 22222226
00000003 <-> 22222227
00000004 <-> 22222229
00000010 <-> 22222232
...

(you forgot some of them in your list)

Now getting the "rank" is a matter of evaluating the base-5 expression. If the literals are labelled $a_7a_6\ldots a_1a_0$, the number's rank (with $0$ at the bottom and $5^8$ at the top) will be $$\sum_{i=0}^7 a_i 5^i$$

The number $67329976$ corresponds to $23104432$ in base $5$, wich is a rank of $206867$ in decimal or the $5^8 - 206867 = 183758$th greatest number in the list.

AlexR
  • 24,905