It is known that every natural number which is coprime to $10$ has a multiple in the form that each digit is $1$.
For example, we can see $$111=3\times 37, 111111=7\times 15873, 111111111=9\times 12345679, $$$$11=11\times 1, 111111=13\times 8547,\cdots$$
To prove the above fact is easy if we use Pigeonhole principle.
Then, here is my question.
Question : How can we get the minimum digit (let this be $N(m)$) of multiples of $m$ in the above form for any $m\in\mathbb N$ which is coprime to $10$?
(I think the best answer would be to represent $N(m)$ by $m$ if it is possible.)
For example, though we get $111111111111=13\times 8547008547$, we know that $N(13)=6.$
Motivation : The above fact got me interested in this question.