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 3 of 5: Head construction modulo with
Detailed analysis
Suppose , and fix any residue modulo . For any divisible by , Euler's theorem gives , so the alternating number consisting of copies of satisfies . Moreover, for any integer with , adding to flips one of the odd-positioned digits to (preserving the alternating odd-even pattern) while shifting the residue modulo by since . Choosing large enough and flipping such digits at distinct exponents gives an even alternating number with .