[Math] Multiples of a number permute the digits; find such a number

elementary-number-theory

There is a $n$ digit number $N$ with all distinct digits and none of them being $0$. If we
multiply $N$ by $1,2,3,4 \cdots n$, we get a number which has a permutation of the digits of $N$. But if we multiply $N$ by $(n+1)$, we get all $9$'s. How to find this $N$?

The solution/hint given is :

we can find $n+1=7 \Rightarrow n=6$ so the number $N$ is $142857$.

Could anybody help me in understanding this?


This problem is actually very simmilar to this $PE-52$:

It can be seen that the number, $125874$, and its double, $251748$,
contain exactly the same digits, but in a different order.

Find the smallest positive integer, $x$, such that $2x, 3x, 4x, 5x,$ and
$6x,$ contain the same digits.

I don't remember solving this just by remembering the property of this particular number, I think I had devised some kind brute-force search which gave me the answer, anyways it seems like there is a perfectly mathematical approach to deduce this number?!

Best Answer

If $n+1$ was $3$ or $9$, $N$ would be all $3$s or all $1$s, but the digits of $N$ are different hence this ain't so. If $n+1$ was even, the result would end with an even digit but the result ends with a $9$ hence this ain't so. If $n+1$ was $5$, the result would end with a $0$ or a $5$ but the result ends with a $9$ hence this ain't so. Since $n$ is the number of digits of $N$ which has distinct nonzero digits, $1\leqslant n\leqslant9$. Hence $2\leqslant n+1\leqslant10$ and the only remaining possibility is $n+1=7$. Thus, $7\cdot N$ is $999,999$ or $9,999,999$ but only the former is a multiple of $7$ hence $N=999,999\div7=142,857$.

Related Question