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 which have an alternating multiple.
Step 2 of 5: Tail construction for powers of and
Detailed analysis
For even , we construct by induction an even alternating -digit multiple of and an even alternating -digit multiple of (both having odd leading digit since they have even length and end in an even digit). For the base , take (divisible by ) and (divisible by ). To pass from to , prepend a two-digit block from the -element set , i.e. add for odd and even: since is divisible by and covers all four residues of modulo as , vary, some choice extends to divisible by ; similarly, the choices of cover all multiples of modulo (as ), so some choice extends to divisible by .