>>46
Example for finding a multiple of 999 that fits the using only 0, 1, and 2 for digits criterion.
999 factors to 3
3 × 37.
999 can be checked for divisibility by both 27 and 37 by summing the digits into blocks of 3 and checking their divisibility.
Because 999 is the LCM of 37 and 27, the lowest sum we are aiming for is 999.
{0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102, 110, 111, 112, 120, 121, 122, 200, 201, 202, 210, 211, 212, 220, 221, 222}
So we get there using the fewest amount of digits and trying to aim for the smallest number possible using what we have above.
111 + 222 + 222 + 222 + 222 = 999
111,222,222,222,222 is the resulting number.