Introduction
I've been solving a problem, which says which number is the smallest multiple of $x$ which only has digits with value 1.
For example: $minOnes(3) = 3 -> 111$;
$minOnes(7) = 6 -> 111111$
$minOnes(11) = 2 -> 11$;
$minOnes(2601) = 2448$.
I have been playing with numbers, and have reached to a formula. If $x$ is our number to solve.
Formula
$minOnes(x) = minOnes( mcm(minOnes(divisors[x])) * ( divisor[x]$ ^ ($times$_$appeared$-$1$) for each $divisor$ in $divisors$) )
divisors are all the divisors of $x$. For example, 21 has 3 and 7 as divisors.
times_appeared is the number of times the divisor divides $x$. For example, 3 divides 3 times 27.
mcm(..) is the minimum common multiple of the minOnes() of its divisors.
Example
$63 = 3 \times 3 \times 7$
$minOnes(3) = 3$; $ minOnes(7) = 6$;
$minOnes(63) = mcm(6, 3)\times 3^1 \times 7^0 = 6\times 3 = 18$
Counter-example
Well... I have tried this formula to lot of numbers, and everything went correct. Except one: 3249 = $(3^2)(19^2)$. $minOnes(3249) = 342$, but with my formula, $minOnes(3249) = 1026 = (342)(3)$. There are maybe more numbers that don't follow this rule, but this surprises me because the formula works with almost each number.
I wanted to let it be known, if someone knows the answer or hasinterest in this :)
Note: numbers with divisors 2 and 5 are excluyed (they get a digit with 0).
Edit
I have tried with more numbers, and indeed there are more numbers which do not follow the rule. They are a few, and obey some pattern:
$171 = 3^2 \times 19$;
$513 = 3^3 \times 19$; $981 = 3^2 \times 109$;
$1197 = 3^2 \times 7 \times 19$;
$1421 = 7^2 \times 29$;
$1467 = 3^2 \times 163$;
$1539= 3^4 \times 19$;
$1629 = 3^2 \times 181$;
$1791 = 3^2 \times 199$;
$... 1881$ $2107$ $2223$ $2763$ $2783$ $2907$ $2943$ $3249$ $3411$ $3479$ $3573$
So strange...