Skip to main content
OlympiadHQ

Browse · MathNet

Print

58th Ukrainian National Mathematical Olympiad

Ukraine number theory

Problem

There are numbers on the board. Each is written exactly once. Petryk and Ivasyk are playing in the following game (Petryk starts): each player erases one number from the board. If after player's turn the sum of all erased numbers (by both players) cannot be represented as a difference of squares of integers, the player loses. Who will win in this game if both players want to win?
Solution
Notice that cannot be represented as a difference of squares of integers iff . Indeed, if , then suppose . If are either both odd or both even, then , otherwise . If , then let , if , then let .

The strategy for Petryk is the following: he erases first, then if Ivasyk chooses , then Petryk erases . Since choice of number leads to loss, then Petryk wins, because if Ivasyk hasn't lost yet then Petryk has a number to erase that will not make him lose.
Final answer
Petryk

Techniques

Modular ArithmeticTechniques: modulo, size analysis, order analysis, inequalitiesGames / greedy algorithms