Find the smallest number such that is divisible by 23, is divisible by 29, and both and contain only the digits '1' and '2'.
Solution
Probably the best way to go at this is to generate the list of all five-digit numbers whose digits are either 1's or 2's. There are 32 such numbers (why?). The smallest is 11111 and the largest is 22222. Once you have the list, perhaps on a spreadsheet, start dividing each by 23 and by 29, and hunt for the numbers that are one apart.
The answer is , and .