Divisibility of a number in base-10?

58 Views Asked by At

I'm really stuck on this problem:

Let $n$ be a positive integer such that not all of digits in base-10 are the same and none of which are $0$. No matter how the digits are rearranged, it will be always be divisible by $k$. What is the largest possible value of $k$?

The answer choice is $4$, $36$, $63$, $72$, or $81$.

First, I figured that it is not divisible by $10$ as there is no $0$ in the digit.

Do I use modulus 9 perhaps?

1

There are 1 best solutions below

0
On BEST ANSWER

Assume $n$ has at least $2$ digits. Arrange the digits of $n$ such that the last two digits differ. This is possible since not all digits are the same. Let $\bar{ab}$ be the last two digits of $n$. Let $m$ be the result of swapping the last two digits of $n$. We have:

$k|m$ , $k|n\implies k|(n-m)\implies k| (\bar{ab} - \bar{ba})$
$\implies k| 9(a-b)$

Therefore $k$ has at most two digits. A maximal $k$ would be $9$ times the minimum difference of two distinct digits $a$ and $b$ of $n$. Additionally, for said maximum $k$, the difference between any two distinct digits $\{x,y\}$ of $n$ must be a multiple of $a-b$. This follows from $k| (\bar{xy} - \bar{yx})$.

Assume $k = 81$. Then $a-b = 9$ but no two non-zero digits have such a difference. Assume $k = 72$. Then the only possible values for $a$ and $b$ are $\{9,1\}$. We have $91-19 = 72$. But the digits are odd, so $n$ starting with either of them would not be divisible by $72$. Assume $k=63$. Then candidates for $\{a,b\}$ are $\{1,8\}$ and $\{2,9\}$. We find $63 | 181818$.

Any rearrangement of the digits of $181818$ can be done by a series of transpositions (swapping the places of consecutive distinct digits). The difference between two consecutive numbers in such a series of transpositions (such as $118818$ and $118188$ for example) will be of the form $\pm (81-18)10^p = 63*10^p$. Therefore divisibility by $63$ is preserved for any rearrangement of the digits of $181818$.

The answer is $k=63$.