d, e and f each have nine digits when written in base 10. Each of the nine numbers formed from d by replacing one of its digits by the corresponding digit of e is divisible by 7. Similarly, each of the nine numbers formed from e by replacing one of its digits by the corresponding digit of f is divisible by 7. Show that each of the nine differences between corresponding digits of d and f is divisible by 7.

**Solution**

Let d = d_{1}d_{2}... d_{9} and similarly for e and f. We have are given that (d + e_{9} - d_{9}), (d + 10e_{8} - 10d_{8}), ... , (d + 10^{8}e_{1} - 10^{8}d_{1}) are all multiples of 7. Adding gives that (9d + e - d) is a multiple of 7 and hence also (d + e).

(d + e_{9} - d_{9}) and (e + f_{9} - e_{9}) are multiples of 7. So, adding, (d + e + f_{9} - d_{9}) is a multiple of 7 and hence also (f_{9} - d_{9}). Similarly, (d + 10e_{8} - 10d_{8}) + (d + 10f_{8} - 10e_{8}) - (d + e) = 10(f_{8} - d_{8}) is a multiple of 7, and hence also (f_{8} - d_{8}). Similarly, for the other terms.

© John Scholes

jscholes@kalva.demon.co.uk

12 Dec 1998