Skip to main content
OlympiadHQ

Browse · MathNet

Print

XXIX Rioplatense Mathematical Olympiad

Argentina number theory

Problem

Initially there is a positive integer 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 is written on the blackboard, with this operation one can write any of the numbers , or . Find all values of such that it is possible to obtain 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 . It follows that if is divisible by then we will only get numbers divisible by and hence we will never get .

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

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

Second, if the digit of in position from left to right is greater than , then we can subtract from it and add a digit at the beginning. Indeed, since our number is relatively prime to , then by Fermat-Euler theorem there are infinitely many such that is a multiple of and hence we can add and subtract to the digits in position and respectively. If we do this for arbitrarily big 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 and only. After further rearrangement we can get a number with all of its digits equal to which is not divisible by .

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

We claim that we can go from to and from to by a suitable combination of the operations. For the first claim we observe that and hence we are able to replace the number by the following multiple: . Afterwards, we delete all digits to get .

To prove the second claim we add digits equal to to get a number composed of blocks and then we do the following simultaneously in each block: This way we get a number with blocks . After deleting all zeroes, we are done.

To finish the solution we use the first claim in the previous paragraph to first replace by for some natural number such that is a power of two and then we use the second claim to get to as desired.

The above is possible because the integer number is not divisible by and powers of two are modulo so that infinitely many of them are in the arithmetic progression .
Final answer
All positive integers not divisible by 3

Techniques

Fermat / Euler / Wilson theoremsGreatest common divisors (gcd)Multiplicative order