MathLabs

Problem 6

We call a positive integer alternating if every two consecutive digits in its decimal representation are of different parity. Find all positive integers nn which have an alternating multiple.
Step 2 of 5: Tail construction for powers of 22 and 55
∀ even w≥2: ∃ even alternating w-digit g(w),h(w) with2w+1∣g(w), 5w∣h(w)\forall\text{ even }w\ge2:\ \exists\text{ even alternating }w\text{-digit }g(w),h(w)\text{ \quad\text{with}\quad }2^{w+1}\mid g(w),\ 5^w\mid h(w)
Detailed analysis

For even w≥2w\ge 2, we construct by induction an even alternating ww-digit multiple g(w)g(w) of 2w+12^{w+1} and an even alternating ww-digit multiple h(w)h(w) of 5w5^w (both having odd leading digit since they have even length and end in an even digit). For the base w=2w=2, take g(2)=32g(2)=32 (divisible by 88) and h(2)=50h(2)=50 (divisible by 2525). To pass from ww to w+2w+2, prepend a two-digit block from the 2525-element set {10,12,…,18,30,32,…,98}\{10,12,\dots,18,30,32,\dots,98\}, i.e. add 10w(10a+b)10^w(10a+b) for a∈{1,3,5,7,9}a\in\{1,3,5,7,9\} odd and b∈{0,2,4,6,8}b\in\{0,2,4,6,8\} even: since 10w(10a+b)=2w+1⋅5w(5a+b/2)10^w(10a+b)=2^{w+1}\cdot 5^w(5a+b/2) is divisible by 2w+12^{w+1} and covers all four residues of 2w+12^{w+1} modulo 2w+32^{w+3} as a∈{1,3,5,7,9}a\in\{1,3,5,7,9\},b∈{0,2,4,6,8}b\in\{0,2,4,6,8\} vary, some choice extends g(w)g(w) to g(w+2)g(w+2) divisible by 2w+32^{w+3}; similarly, the 2525 choices of 10w(10a+b)10^w(10a+b) cover all 2525 multiples of 5w5^w modulo 5w+25^{w+2} (as gcd⁡(2w,25)=1\gcd(2^w,25)=1), so some choice extends h(w)h(w) to h(w+2)h(w+2) divisible by 5w+25^{w+2}.