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 4 of 5: Classify nn not divisible by 2020
In plain words

Classify nn not divisible by 2020

n=2u5vm,gcd⁡(m,10)=1,20∤n  ⟹  {n∣2k+1m(v=0),n∣5km(u=0),n∣2⋅5km(u=1,v≥1),k≥2 evenn=2^u5^vm,\quad\gcd(m,10)=1,\quad20\nmid n\implies\begin{cases}n\mid2^{k+1}m& (v=0),\\ n\mid5^km&(u=0),\\ n\mid2\cdot5^km&(u=1,v\ge1),\end{cases}\quad k\ge2\text{ even}
Detailed analysis

Write n=2u5vmn=2^u5^vm with gcd⁡(m,10)=1\gcd(m,10)=1. Since 20∤n20\nmid n, either v=0v=0, or u=0u=0, or u=1u=1 and v≥1v\ge1. Choose an even k≥2k\ge2 large enough. In the three cases, respectively, nn divides 2k+1m2^{k+1}m, 5km5^km, or 2⋅5km2\cdot5^km.