15th Mexico 2001 Problem A1 Find all 7-digit numbers which are multiples of 21 and which have each digit 3 or 7.
3373377, 7373373, 7733733, 3733737, 7337337, 3777333 Solution Considering the sum of the digits mod 3, we see that there must be seven 3s, four 3s and three 7s, or one 3 and six 7s. 7 does not divide 1111111, so the first case does not work. The last case can be written as 7777777 - 4·10 k for k = 0, 2, ... , 6. So if this is a multiple of 7, then so is 4·10 k . But it obviously is not. In the middle case we must have 10 a + 10 b + 10 c + 10 d = 0 mod 7 for some distinct a, b, c, d in {0, 1, 2, 3, 4, 5, 6}. We have 10 a = 1, 3, 2, 6, 4, 5, 1 mod 7 for a = 0, 1, 2, 3, 4, 5, 6. So we have 14 = 6 + 5 + 2 + 1 = 6 + 4 + 3 + 1 = 5 + 4 + 3 + 2, 7 = 3 + 2 + 1 + 1, and hence the possible {a,b,c,d} are {2,3,5,6}, {0,2,3,5}, {0,1,3,4}, {1,3,4,6}, {1,2,4,5}, {0,1,2,6}. Thanks to Suat Namli 15th Mexican 2001 © John Scholes jscholes@kalva.demon.co.uk 6 March 2004 Last corrected/updated 7 Mar 04