Let $a,b$ be arbitrary co-prime natural numbers. Alice writes the natural number $t < b$ on a blackboard. Every second she replaces the number on the blackboard, say $x$, with the smallest natural number in $\{x \pm a, x \pm b \}$ that she has not yet ever written. She keeps doing this as long as possible. Prove that this process goes on indefinitely and that Alice will write down every natural number. ~Pranjal Srivastava and Rohan Goyal
Problem
Source: India EGMO 2022 TST P2
Tags: wet, india, combinatorics
21.11.2021 15:05
WLOG $a < b$ We will prove that we first cover all numbers in $[1, a+b]$ before moving to a number between $a+b$ and $a+2b$. Create a graph over $\{1, 2, \dots, a+b\}$, where $(x,y)$ is an edge if $(|x-y| - a)(|x-y| - b) = 0$. We prove that the graph is connected. Pick arbitrary $k$. Since $a, b$ are coprime, we can pick $ai - bj = a+b-k$ for some $i, j \in \mathbb{N}_0$. Start from $a+b$, you can always subtract $a$ or add $b$. Always perform one of the above. When you have subtracted $a$ $i$ times, stop. Observe that this is either $k$ or $k \pm b$. This means $k, a+b$ are connected. Thus the graph is connected. Since every vertex has degree $2$, the graph must be a cycle. Observe that the first $a+b-1$ operations all lie within the cycle, as it is never to profitable to leave the cycle, and there is always a unique way to stay within. Since the first operation is $t \mapsto t \pm a$, after $a+b-1$ operations, we will end up at $t+b$ or $t+a$, and after $a+b$ operations at $t+a+b$. Now the problem reduces to itself so we're done. $\square$ @below, fixed
21.11.2021 22:07
Perfect p2
22.11.2021 12:52
Cute problem which highlights the importance of looking at small cases and making claims. Consider an infinite grid with $b$ rows and infinite columns. On the $k$th row, we write the numbers $n$ such that $n \equiv ka \pmod b$, in ascending order. Draw a blue arrow from $x$ to $x+b$ and a purple arrow from $x$ to $x+a$. Further, for rows containing a number $\le a$, color it pink. I will show that this operation writes every number until $a+b$ in some order, then moves on. So showing every number $\le a+b$ is written finishes since then we just shift by $a+b$ and repeat the same thing. The operation is now the following, go backwards in a blue arrow, if not, go back a purple arrow, if not, go forwards a purple arrow and if not, go forward a blue arrow. Observe that if a row is pink, then the incoming purple arrows shift one to the right, and if not, then the purple arrows from the previous row point directly to it. The claim is equivalent to showing that if we start in the first column, then we will go through the first number of every row as well as the second number of pink rows, before moving on. Since we move from one row to another and don't return until we cycle back, it suffices to show these are the only things touched when we reach their row. So start with $t$ and for now assume the next number is $t+a$, if the next row is not pink, then the claim is just true, and if it is pink, then note that we go to the second number and then back to the first one. Starting with $t-a$ is also the same but we go backwards through the cycle of arrows. Also if $t$ was in a pink row, then we end up going to $t+b$ at the end, so that's fine too, so we are done. $\blacksquare$
24.11.2021 21:40
My sol:- We'll prove that the first a+b natural numbers will be written after a+b-1 seconds. Assume a<b (the other case can be dealt similarly). In the first second, Alice can't add b since t+a is a smaller no. than t+b which is not yet covered , also she can't subtract b since t<b.So she subtracts a if x>a & adds a if x≤a. Assume x≤a (the other case can be dealt similarly). After the first second she continues to add a until she gets until gets a no., say x+ka>b (since subtracting a gives the previous no.& subtracting b gives a non-positive no.) , at this point she writes x+ka-b (this no. is not yet covered since x+ka-b=x+(k+1)a (mod a+b) implies our sequence is congruent to x, x+a,...., x+(k+1)a (mod a+b) all of which gives distinct remainders mod a+b since (a, a+b)=1) , also x+(k-1)a≤b implies x+ka≤a+b so all these no.s are from the set {1,..., a+b}.Alice continues this process of adding a's and subtracting b whenever the no. exceeds b and all these no. are bounded above by a+b and distinct modulo a+b until a+b-1 seconds so every no. from {1,...., a+b} will be written after a+b-1 seconds. Now the last no. covered can be x-a or x+b but since x≤a, the no. written after a+b-1 seconds is x+b.Now the same arguments imply that the next a+b no.s will be covered and so on. Thus every natural no. will be covered.
31.05.2022 11:50
Well I'm confused when reading all above sols claiming that "we can achieve all the first a+b natural numbers after a+b-1 sec". The problem statement should be "positive integers", in case one consider 0.