Tokarev S.i.

A natural number \$N\$ is divisible by 2020. In its decimal representation, all digits are distinct, and if any two of them are swapped, the resulting number is not divisible by 2020. For how many digits in the decimal representation of \$N\$ is this possible?
If the seventh digit from the right in a number is $\$ 2 \$$, and the third from the right is $\$ \mathrm{~b} \$$, then by swapping them, we change the number by \$b|cdot10^6-alcdot10^6+a|cdot10^2-blcdot10^2=(b-a)\} \backslash \operatorname { c d o t } ( 1 0 \wedge 4 - 1 ) \backslash \operatorname { c d o t } 1 0 0 \$ . Therefore, with such a swap, 
the divisibility by \$2020 = 20\cdot101\$ will not be affected, since \$10^4 - 1\$ is divisible by 101, and 100 is divisible by 20.

Thus, the number $\$ N \$$ cannot have more than 6 digits.

Six digits are possible. For example, the number 351480 works (0 must remain at the end, swapping 3 and 8 would ruin divisibility by 4, and swapping adjacent digits or digits separated by one or two positions would ruin divisibility by 101, since the numbers $\$ 10-1 \$, \$ 10 \wedge 2$ - 1 $\$$ and $\$ 10 \wedge 3$ - 1 are not divisible by 101). There are other examples, such as 531260. A five- or four-digit number divisible by 2020 is obtained by multiplying 2020 by a number $\$ 10 a+b \$$ less than 50. In the number $\$ 2020 b \$$, the second and fourth digits are equal, and in the number $\$ 20200$ a they are zero, so in the sum these digits are equal, which is not what we want.

## Answer

with 6 digits.

Submit a comment