Problem

Source: IMO Shortlist 2018 C6

Tags: IMO Shortlist, combinatorics, IMO shortlist 2018



Let $a$ and $b$ be distinct positive integers. The following infinite process takes place on an initially empty board. If there is at least a pair of equal numbers on the board, we choose such a pair and increase one of its components by $a$ and the other by $b$. If no such pair exists, we write two times the number $0$. Prove that, no matter how we make the choices in $(i)$, operation $(ii)$ will be performed only finitely many times. Proposed by Serbia.