What is the smallest positive integer $n$, such that there exist positive integers $a$ and $b$, with $b$ obtained from $a$ by a rearrangement of its digits, so that $a – b = 11\dots 1$ (The number of '$1$'s equal to $n$)?

Is there any example that can satisfy the equation?


Hint 1. Since $b$ is obtained as a rearrangement of the digits of $a$, it follows that $a$ and $b$ have the same remainder when they are divided by $9$. Hence $a-b$ should be divisible by $9$.

Hint 2. Note that $$90-09=81,\ 190-019=171,\ 1290-0129=1161,\ 12390-01239=11151, \dots$$


Since $b = \text{DigitsRearranged}(a) \rightarrow$ $a$ and $b$ have the same remainder when divided by $9$ $\rightarrow$ $a-b$ is divisible by $9$ $\rightarrow$ $n \ge 9$

And this is sufficient, because there is a solution for this $n$: $$a = 812,345,709 \\ b = 701,234,598 \\ a-b = 111,111,111$$

So the smallest $n$ is: $n = 9$.

This took a fair bit a fiddling around to find, toguh.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.