MathDB
How to Play a Infinite Writing-Number Game

Source: 2018 China Team Selection Test 2 Problem 3

January 8, 2018
combinatoricsTSTChina TST

Problem Statement

Two positive integers p,q∈Z+p,q \in \mathbf{Z}^{+} are given. There is a blackboard with nn positive integers written on it. A operation is to choose two same number a,aa,a written on the blackboard, and replace them with a+p,a+qa+p,a+q. Determine the smallest nn so that such operation can go on infinitely.