IMO 1977 LL GBR19

Given any integer m > 1 prove that there exist infinitely

IMO 1977 LL GBR19

Origin: GBR

Problem

Given any integer m > 1 prove that there exist infinitely many positive integers n such that the last m digits of 5n are a sequence am, am−1, . . . , a1 = 5 (0 \leqaj < 10) in which each digit except the last is of opposite parity to its successor (i.e., if ai is even, then ai−1 is odd, and if ai is odd, then ai−1 is even).

Solution

We shall prove the statement by induction on m. For m = 2 it is trivial, since each power of 5 greater than 5 ends in 25. Suppose that the statement is true for some m \geq2, and that the last m digits of 5n alternate in parity. It can be shown by induction that the maximum power of 2 that divides 52m−2 −1 is 2m, and consequently the difference 5n+2m−2 −5n is divisible by 10m but not by 2\cdot10m. It follows that the last m digits of the numbers 5n+2m−2 and 5n coincide, but the digits at the position m+1 have opposite parity. Hence the last m+1 digits of one of these two powers of 5 alternate in parity. The inductive proof is completed.