Maths Olympiad Prep

Library / /34 of 35

Number theory Difficulty 6.8 National olympiad Prove it Slovenia

A teacher gives Matej four pieces of paper, each containing a non-zero digit. Matej arranges them in a line thus forming a four-digit number. He then exchanges two of the pieces (without flipping or rotating them in the process) to form another four-digit number. Can he always do this in such a way that the two numbers he obtains are not relatively prime regardless of the digits that were written on the pieces of paper?

Solution

The answer is yes. If one of the digits is even, then Matej can form two even numbers by putting the piece of paper with the even digit in the place of units and exchanging two of the other three pieces of paper. If one of the four digits is equal to 55, then Matej can act similarly. He should put the piece of paper with the digit 55 in the place of units and again exchange two of the other three pieces of paper. The resulting two numbers are not relatively prime since they are both divisible by 55. If two of the digits are the same, then Matej can make an arbitrary number and then simply exchange the two pieces with the same digits to get the same number.

The only remaining case is where the digits are 11, 33, 77 and 99. With these, Matej can form either the numbers 13971397 and 17931793 or the numbers 13971397 and 93179317 or the numbers 93179317 and 97139713. All of these are divisible by 1111. He can also form the numbers 17391739 and 97319731, which are both divisible by 3737.

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.