International Mathematical Olympiad

July 17, 2009

These three problems from the International Mathematical Olympiad recently popped up on the web.

IMO 1960 Problem 01

Determine all three-digit numbers N having the property that N is divisible by 11, and N/11 is equal to the sum of the squares of the digits of N.

IMO 1962 Problem 01

Find the smallest natural number n which has the following properties:

(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits, the resulting number is four times as large as the original number n.

IMO 1963 Problem 06

Five students, A,B,C,D,E, took part in a contest. One prediction was that the contestants would finish in the order ABCDE. This prediction was very poor. In fact no contestant finished in the position predicted, and no two contestants predicted to finish consecutively actually did so. A second prediction had the contestants finishing in the order DAECB. This prediction was better. Exactly two of the contestants finished in the places predicted, and two disjoint pairs of students predicted to finish consecutively actually did so. Determine the order in which the contestants finished.

Your task is to solve the three problems. When you are finished, you are welcome to read or run a suggested solution, or to post your solution or discuss the exercise in the comments below.

B DA EC – wrong, none of them finished as it was predicted
DA B EC – B can’t be after A
DA EC B – all of them finished at it was predicted

2nd choice:
E DA CB – the correct answer!!! only C,B are at the right places
=========================================================
DA E CB – all of them finished at it was predicted
DA CB E – C is on the 3rd place – it can’t be because of the first prediction

3rd choice:
D AE CB – all of them finished at it was predicted
AE D CB – A is on the 1st place – it can’t be because of the first prediction
AE CB D – A is on the 1st place – it can’t be because of the first prediction

=begin
Determine all three-digit numbers N having the property that N is divisible by 11, and N/11 is equal to the sum of the squares of the digits of N.
=end
def problem_1
properties = []
properties << proc do |number|
number%11 == 0
end
properties << proc do |number|
number/11 == (number.to_s.chars.map {|digit| digit.to_i**2}.inject(:+))
end
collection = []
number = 100
until number > 999
number+=1
collection << number unless properties.map{|property| property[number]}.include?(false)
end
collection
end
=begin
Find the smallest natural number n which has the following properties:
(a) Its decimal representation has 6 as the last digit.
(b) If the last digit 6 is erased and placed in front of the remaining digits, the resulting number is four times as large as the original number n.
=end
def problem_2
properties = []
properties << proc do |number|
number.to_s.end_with? '6'
end
properties << proc do |number|
digits = number.to_s.chars
last_digit = digits.pop
digits.unshift(last_digit)
digits.join.to_i == number*4
end
index = 0
index += 1 while properties.map{|property| property[index]}.include?(false)
index
end
problem_1 #=> [550, 803]
problem_2 #=> 153846