Let $X$ denote the set of positive integers whose decimal representation consists of distinct digits. If $n \in X$, then let $A_{n}$ denote the set of numbers obtained by rearranging the digits of $n$, and let $d_{n}$ denote the greatest common divisor of the elements of $A_{n}$. What is the largest possible value of $d_{n}$?
Solution. The problem statement did not make it clear whether the numbers could start with 0. If they cannot, then for example, every 10th power greater than 1 forms a separate set with one element. For these sets $H_{n}=\left\{10^{n}\right\}$, $d_{n}=10^{n}$, and these $d_{n}$ values do not have a maximum value.

We therefore assume that the numbers can start with 0.

In every set, there are two numbers that differ only in the two least significant digits, because every permutation of the original number appears in the set, and not all digits are the same. Assuming $a>b$, the difference between these numbers is: $\overline{\ldots a b}-\overline{\ldots b a}=\overline{a b}-\overline{b a}=10 a+b-(10 b+a)=9(a-b)$. Clearly, $0 \leq a-b \leq 9$, so the maximum possible value of the difference—and thus the greatest common divisor—is 81, when $a=9, b=0$.

We will show that there is a number $n$ that is divisible by 81, and all of its permutations are also divisible by 81. We only need to ensure that $\frac{n}{9}$ is still divisible by 9. If $n$ consists of nine 9s and some 0s, then every permutation of it will satisfy this condition.