Browse · MathNet
PrintNational Math Olympiad
Slovenia number theory
Problem
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 , then Matej can act similarly. He should put the piece of paper with the digit 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 . 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 , , and . With these, Matej can form either the numbers and or the numbers and or the numbers and . All of these are divisible by . He can also form the numbers and , which are both divisible by .
The only remaining case is where the digits are , , and . With these, Matej can form either the numbers and or the numbers and or the numbers and . All of these are divisible by . He can also form the numbers and , which are both divisible by .
Techniques
Greatest common divisors (gcd)Prime numbers