TITLE: What's the smallest number that we can multiply with a given one to get the result only zeros and ones?
QUESTION [17 upvotes]: I have the following set of numbers,
$$4, 198, 4356, 10296, 14454, 25542, 31779, 51252, 53946, 99999$$
Let's take $3,4$ as an examples:
The smallest number to multiply with $4$ to get the result only $1$s and $0$s is
$$100 = 4 * 25$$
so the result is $25$ for input $4$.
Also
$$111 = 3 * 37$$
so the result is $37$ for input $3$.
Hint:
As you may notice that the rest of the numbers can be divided by $9$ or $99$ or $999$ and the smallest number to multiply with $9$ is $12345679$, this might be the trick!
$$111111111 = 9 * 12345679$$
And one last thing: This is not a binary conversion as most people think by looking at the 4 example.

REPLY [3 votes]: Let S be the set of number written with 0 and 1.
Let n be a natural number.
You look for the minimal positive natural number k such  $k \times n \in S$
I will look further to S
Let $s \in S$.
There is a finite subset $J \subset \mathbb{N}$ such:
$s = \sum_{i \ in J} 10^i$
We got:
$k \times n = \sum_{i \ in J} 10^i$
Using mod $n$:
$\sum_{i \ in J} 10^i \equiv 0 \pmod n$
Your problem is now to find $J$
Let $T = \left\{10^i\mod n, i \in \mathbb{N}\right\}$
You now look for a subset of $T$ where the sum of the element is a multiple of $n$.
A greedy algorithm look good here.