Maths Olympiad Prep

Library / /12 of 16

Number theory Difficulty 7.3 National olympiad, round 2 Prove it Argentina

Initially there is a positive integer NN written on the blackboard. The following operations are allowed:
* Replace the number by a positive multiple of itself.
* Replace the number by another which has the same digits in a different order (it is allowed for the new number to begin with 0). For example, if 20222022 is written on the blackboard, with this operation one can write any of the numbers 222222, 22022202 or 22202220.
Find all values of NN such that it is possible to obtain 11 after a sequence of operations.

Solution

First let us observe that rearranging digits does not change its sum, hence it does not change the remainder upon division by 33. It follows that if NN is divisible by 33 then we will only get numbers divisible by 33 and hence we will never get 11.

We claim that if NN is not divisible by 33 then it is possible to obtain 11 after a sequence of operations.

For the rest of the proof we will use that by multiplying by 1010 and reordering we can add or delete digits equal to 00 in any position. We proceed in steps. First, we can assume that NN ends with the digit 11. For this we initially multiply by 22 sufficiently many times until the result starts with 11 and then switch the first and the last digits.

Second, if the digit of NN in position mm from left to right is greater than 11, then we can subtract 11 from it and add a digit 11 at the beginning. Indeed, since our number is relatively prime to 1010, then by Fermat-Euler theorem there are infinitely many nn such that 10m+n10m+N10^{m+n} - 10^m + N is a multiple of NN and hence we can add and subtract 11 to the digits in position m+nm+n and mm respectively. If we do this for arbitrarily big nn and then rearrange digits we prove the claim.

Third, if we repeat the previous step as many times as possible we get a number with digits 00 and 11 only. After further rearrangement we can get a number with all of its digits equal to 11 which is not divisible by 33.

Let AnA_n be the number with nn digits and all of them equal to 11. The conclusion of the above is that we can get to AnA_n for some nn not divisible by 33.

We claim that we can go from AkA_k to Ak+9A_{k+9} and from A2kA_{2k} to AkA_k by a suitable combination of the operations. For the first claim we observe that 10k1(modAk)10^k \equiv 1 \pmod{A_k} and hence we are able to replace the number AkA_k by the following multiple: 1010k+109k++102k+10k+Ak1010^{10k} + 10^{9k} + \dots + 10^{2k} + 10^k + A_k - 10. Afterwards, we delete all digits 00 to get Ak+9A_{k+9}.

To prove the second claim we add digits equal to 00 to get a number composed of kk blocks 00000000000110000000000011 and then we do the following simultaneously in each block:
1181298192100000000000001. 11 \rightarrow 8129 \rightarrow 8192 \rightarrow 10000000000000 \rightarrow 1.
This way we get a number with kk blocks 0000000000000100000000000001. After deleting all zeroes, we are done.

To finish the solution we use the first claim in the previous paragraph to first replace AnA_n by An+9mA_{n+9m} for some natural number mm such that n+9mn+9m is a power of two and then we use the second claim to get to A1=1A_1 = 1 as desired.

The above is possible because the integer number nn is not divisible by 33 and powers of two are 1,2,4,8,7,5,1,2,4,1, 2, 4, 8, 7, 5, 1, 2, 4, \ldots modulo 99 so that infinitely many of them are in the arithmetic progression n,n+9,n+18,n, n+9, n+18, \ldots.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.