Problem 12034
(American Mathematical Monthly, Vol.125, April 2018) Proposed by G. Galperin and Y. J. Ionin (USA).
LetN be any natural number that is not a multiple of 10. Prove that there is a multiple of N each of whose digits in base10 is 1, 2, 3, 4, or 5.
Solution proposed by Roberto Tauraso, Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, via della Ricerca Scientifica, 00133 Roma, Italy.
Solution. We first show three claims.
i) 2d has a multiple m2(d) of d digits containing only digits 1 or 2.
Let m2(1) = 2 and
m2(d + 1) =
(2 · 10d+ m2(d) if m2(d)/2d≡ 0 (mod 2), 1 · 10d+ m2(d) if m2(d)/2d≡ 1 (mod 2).
Hence if m2(d)/2d≡ r (mod 2) then
m2(d + 1) = (2 − r)10d+ m2(d) = (2 − r)10d+ (2k + r)2d = 2d+1
(5d+ k) −(5d− 1)
2 r
and, since 2 divides 5d− 1, it follows that 2d+1 divides m2(d + 1).
ii) 5d has a multiple m5(d) of d digits containing only digits 1, 2, 3, 4, or 5.
Let m5(1) = 5 and
m5(d + 1) =
5 · 10d+ m5(d) if 3dm5(d)/5d≡ 0 (mod 5), 4 · 10d+ m5(d) if 3dm5(d)/5d≡ 1 (mod 5), 3 · 10d+ m5(d) if 3dm5(d)/5d≡ 2 (mod 5), 2 · 10d+ m5(d) if 3dm5(d)/5d≡ 3 (mod 5), 1 · 10d+ m5(d) if 3dm5(d)/5d≡ 4 (mod 5).
Hence if 3dm5(d)/5d≡ r (mod 5) then
3dm5(d + 1) = 3d(5 − r)10d+ 3dm5(d) = (5 − r)30d+ (5k + r)5d= 5d+1
(6d+ k) −(6d− 1)
5 r
and, since 5 divides 6d− 1, it follows that 5d+1 divides m5(d + 1).
iii) Let a be a positive integer such that gcd(a, 10) = 1. Then for any d ≥ 1 there is a positive integer n such that
Rn(d) :=
n−1
X
k=0
10kd=
n digits 1
z }| {
1 00 . . . 01
| {z }
d
. . . 00 . . . 01
| {z }
d
00 . . . 01
| {z }
d
is a multiple a.
Since the sequence {Rn(d)}n is infinite, there are two distinct positive integers n1< n2 such that Rn2(d) ≡ Rn1(d) (mod a)
which implies that a divides
Rn2(d) − Rn1(d) = 10n1dRn2−n1(d).
Since gcd(a, 10) = 1 it follows that a divides Rn2−n1(d).
Finally, let N be a positive integer which is not a multiple of 10. Then N can be written as 2d· a or 5d· a with d ≥ 0 and gcd(a, 10) = 1. If d = 0 then, by iii), Rn(1) is a multiple of N which contains only the digit 1. If d ≥ 1 and N = 2d· a then, by i) and ii), Rn(d)m2(d) is a multiple of N which contains only the digits 1 or 2. If d ≥ 1 and N = 5d· a then, by i) and iii), Rn(d)m5(d) is a multiple
of N which contains only the digits 1, 2, 3, 4, or 5.