Let 'a' and 'b' be distinct positive integers. The following process takes place on an initially empty board. (i) 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'. (ii) If no such pair exists, we write down 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. ------------------------ So, if a=1, b=2: 0 0 1 2 0 0 1 2 1 1 2 2 1 1 3 4 2 3 3 4 2 4 4 5 2 5 5 6 2 6 6 7 ... OK, now it will be just k k k+1 -> k+1 k+1 k+2 a=1, b=3 0 0 1 3 0 0 1 3 1 1 3 3 2 4 4 6 2 5 6 7 0 0 2 5 6 7 1 2 3 5 6 7 0 0 1 2 3 4 5 6 7 1 1 2 3 3 4 5 6 7 1 1 2 4 4 5 6 6 7 1 1 2 4 4 5 7 7 9 1 1 2 5 5 7 7 7 9 1 1 2 5 5 7 8 9 10 1 1 2 6 7 8 8 9 10 1 1 2 6 7 9 9 10 11 1 1 2 6 7 10 10 11 12 1 1 2 6 7 11 11 12 13 ah, and now I am at k k k+1 k+2 -> k+1 k+1 k+2 k+3 Let's assume that I will always pick the biggest pair of equal numbers to make it deterministic (I hope the general case will not be much more difficult) Or not, other variant, simply find a sequence leading to unlimited number of actions (ii) with arbitrary choices of applying the actions (i) and (ii) to arbitrary pairs. So if a,b = 1,n, the repetitive pattern I can get is probably: * k k k+1 k+2 ... k+n And when I can choose the actions, I can actually start with enough zeroes, and raise them to this pattern by one. Actually, for any a,b, any large enough number divisible by gcd(a,b) can be achieved (that is a relatively well known number-theory theorem) by adding 'a' or 'b'. And I can WLOG assume gcd(a,b) = 1 because otherwise I just divide all the numbers (a, b, and all the numbers on the board) by gcd(a,b) Apparently, the arbitrary addition of 'a', or 'b' to a number k can be emulating by creating a duplicate of k by the same process, and then getting k+a, k+b, and taking from it what I need. So to prove that a finite number of actions (i) are sufficient, it suffices to find a repetitive pattern for arbitrary a,b. a,b = 2,3 0 0 1 1 2 3 -> 2 3 1 1 2 3 = 1 1 2 2 3 3 almost, without the last 3: 0 0 1 1 2 -> 2 3 1 1 2 = 1 1 2 2 3 Yes, this is a repetitive pattern for a,b = 2,3. So in general, it could be (assume a < b): each of the numbers 0..(a-1) twice, each of the numbers a..(b-1) once. By applying action (ii) to the pair 0,0, we get each of the numbers 1..a twice, each of the numbers (a+1)..b once, so the entire pattern was just raised by one. Subproblem Solved! Great, only finite number of operations (i) can be achieved through deliberate choices, now I need to prove that the choices actually do not influence the outcome. First, if two different actions can be performed at a time, it does not matter which of the actions is performed first and which one later. The plan would be to convert any sequence of choices to the designed sequence of choices that I already know requires only finite number of choices (i). So, assume there is a sequence of choices, in this sequence, * the choices (i) were used only if necessary (so it corresponds to the problem statement) * More choices (i) were made than in our designed infinite sequence with infinite number of choices (ii). So we have two sequences of choices, the designed one D, and the given one S. Let's assume S is finite, ending after applying the same number of (i)-choices as D, and without any possible choice (ii). Now, I start reordering the sequence S, to align it with the beginning of D. At a given moment, there is a beginning of S and D aligned (identical), and I want to align the next choice in the step number s. If there is a choice (i) at D[s], but not at S[s], we find any s' such that S[s'] is (i)-choice. This action (i) can be moved to backward to the step number s without affecting the process in any way. (the zeroes will just stay there for longer) Now assume that there is an action (ii) at D[s], taking a pair (k,k) of equal numbers. Since the initial segments of S and D are aligned, the same equal numbers are available for S at this moment. However, they are not available at the end of S, since there is no pair of equal numbers at the end of S. Therefore, there is a first s' >= s such that S[s'] == D[s] == (ii)(k,k). This pair of equal numbers was not touched between s and s' by S, so we can move the action S[s'] backward to the position s. This way, we align the entire S with an initial segment of D. In the end we reach a contradiction since D can continue but we have supposed that D cannot continue without the step (i) at the end. Problem Solved!