Let $r>1$ be a rational number. Alice plays a solitaire game on a number line. Initially there is a red bead at $0$ and a blue bead at $1$. In a move, Alice chooses one of the beads and an integer $k \in \mathbb{Z}$. If the chosen bead is at $x$, and the other bead is at $y$, then the bead at $x$ is moved to the point $x'$ satisfying $x'-y=r^k(x-y)$. Find all $r$ for which Alice can move the red bead to $1$ in at most $2021$ moves.
Problem
Source: ISL 2021 N4
Tags: number theory, combinatorics, construction
12.07.2022 15:58
The answer is $r = 1 + \frac1n$ for $n = 1, 2, \dots, 1010$. Write $r = \frac mn$ with $m > n$ and $\gcd(m,n) = 1$. Claim: Alice cannot win if $m-n > 1$. Proof. Otherwise, take everything modulo $m-n$, so that $r \equiv 1 \pmod{m-n}$. The positions of the beads never change modulo $m-n$. $\blacksquare$ Claim: If $r = 1 + \frac 1n$, then Alice takes at least $2n$ moves to win. Proof. This time, take everything modulo $2n+1$, so $r \equiv -1 \pmod{n}$. Thus, each move either does nothing, or reflects one bead about the other bead. Hence, the possible positions of the two beads are given by \[ \cdots \leftrightarrow (-2,-3) \leftrightarrow (-2,-1) \leftrightarrow (0,-1) \leftrightarrow \boxed{(0,1)} \leftrightarrow (2,1) \leftrightarrow (2,3) \leftrightarrow (4,3) \leftrightarrow \cdots \]The red bead thus takes at least $2n$ moves to reach $2n+2 \equiv 1 \pmod{2n+1}$. $\blacksquare$ Finally the construction for $r = 1 + \frac 1n$ for $n \le 1010$ is given by \[ (0,1) \to \left( 0, 1 + \frac 1n \right) \to \left( \frac 1n, 1 + \frac 1n \right) \to \left( \frac 1n, 1 + \frac 2n \right) \to \left( \frac 2n, 1 + \frac 2n \right) \to \dots \to \left( 1, 2 \right). \]
12.07.2022 16:03
This is also Thailand TST Day 2 P1, yes it is p1 not p2.
12.07.2022 16:05
The answer is $r \in \{2/1,3/2,\ldots,1011/1010 \}$. Throughout the game, let $(x,y)$ be a pair in which $x$ denotes the position the blue bead is in, and $y$ the position the red bead is in. Suppose that initially the blue bead is at $0$, and the red one at $t$. Assume WLOG that $t>0$. We will say that we are at position $(x,y)$ if, after some move, the blue bead is in $x$ and the red bead is in $y$. Note that, according to the game rules, if we are at position $(x,y)$ we can either reach position $x,x+(y-x)r^k$ or position $y-(y-x)r^k,y)$, depending on whether we will move the red or the blue bead, respectively. Claim 1: We may assume that we move the beads alternatively. Proof: Indeed, note that if, for example, we move $2$ consecutive times the red bead, we would have $(x,y) \rightarrow (x,x+(y-x)r^{k_1}) \rightarrow (x,x+(y-x)r^{k_1+k_2}),$ where $k_1,k_2$ are the $k$'s we pick throughout the moves. Note however that what we did in $2$ moves could be done in just $1$ move by taking $k_1+k_2$ as our $k$. Similar arguments work for the case we move $2$ consecutive times the blue bead. Hence we may assume that we move the beads alternatively $\blacksquare$ Let's assume that we firstly move the blue bead, and let $(k_i)$ be the sequence of $k$'s we pick throughout. Then, starting from $(0,t)$, we must perform and odd number of moves since in odd-numbered moves we move the red bead. We basically want at the end $tr^{k_1}-tr^{k_1+k_2}+\ldots+tr^{k_1+\ldots k_{2s+1}}=0$. Let $k_1+\ldots+k_i=m_i$. Since $t >0$, we have that $r^{m_1}+r^{m_3}+\ldots+r^{m_{2s+1}}=r^{m_2}+r^{m_4}+\ldots+r^{m_{2s}}$ Note that the $m_i$ are not necessarily positive, but we may assume they are if we just multiply both sides with $r^\delta$ where $\delta>\max(-m_i)$. Moreover, we know what $2s+1 \leq 2021$, i.e. $s \leq 1010$, and we may delete same powers of $r$ that are in different sides. To sum up, we have at the end an equation of the form $a_nr^n+a_{n-1}r^{n-1}+\ldots+a_1r^1+a_0=0,$ where $a_i$ are integers, and $a_i \leq s+1$ (since powers of $a^i$ will appear in at most one of the sides of the initial equation) for all $i$. Moreover, if $P(x)=a_nx^n+\ldots+a_1x+a_0$, then we have $P(r)=0$ and $P(1)=1$ too, since if we let $r=1$ in the initial equation the left side is $s+1$ while the right side is $s$. Thus, $a_n+\ldots+a_1+a_0=1$. Now, let $r=u/v$ where $u,v$ are coprime and $u,v>0$. We obtain that $a_nu^n+a_{n-1}u^{n-1}v+\ldots+a_0v^n=0$ Working $\pmod {u-v}$, we have that $(a_n+\ldots+a_1+a_0)v^n \equiv 0$, and so $(u-v) \mid v^n$. However, $(u-v,v)=(u,v)=1,$ and so $u-v=1$. Thus, $r=1+1/v$. In addition, $\pmod u$ we have $u \mid a_0v^n$, and so $u \mid a_0$, hence $v+1=u \leq a_0 \leq s+1 \leq 1010+1=1011$. Thus, $r \in \{2/1,3/2,\ldots, 1011/1010 \}$. Now, we must check that these all work. (this construction is due to Prod55) Let $s=v$, and $m_i=0$ for odd $i$ and $1$ for even $i$. Then, $2s+1=2v+1 \leq 2021$ and $r^{m_1}+\ldots+r^{m_{2s+1}}=v+1=s \cdot r=r^{m_2}+\ldots+r^{m_{2s}},$ as desired.
12.07.2022 16:11
Let $r=\frac mn$. We have $r\equiv1\pmod{m-n}$ so the equation becomes $x'-y\equiv x-y\pmod{m-n}$ so $x'-x\equiv0\pmod{m-n}$. If this is possible, then we must have $1-0\equiv0\pmod{m-n}$, which implies $1=m-n$. Now, let $r=\frac{a+1}a$. Taking mod $2a+1$ gives $x'-y\equiv(-1)^k(x-y)\pmod{2a+1}$, so $x'\equiv x\pmod{2a+1}$ or $x'+x\equiv2y\pmod{2a+1}$. The last number of moves required to get the red bead to $1$ is at least the least number of moves required to make the red bead equivalent to $1$ mod $2a+1$. The shortest sequence of moves making the red bead $1$ mod $2a+1$ only involves replacing $x$ with $2y-x$. Doing this move twice on the same bead has no effect. This means that the optimal sequence is alternating the selected bead. Choosing bead $x$ then $y$ turns $x$ into $2y-x$ and $y$ into $2(2y-x)-y=3y-2x$. Since $y'-x'=3y-2x-(2y-x)=y-x$, this means that $y'-x'$ is constant, so it must always equal $c=1$ or $-1$. Therefore, $x'=x+2(y-x)=x+2c$ and $y'=y+2(y-x)=y+2c$. If $c=1$, then $x$ is the red bead and $y$ is the blue bead. This means that $x\equiv-1\pmod{2a+1}$ after $2a$ steps, so $x\equiv1\pmod{2a+1}$ after $2a+1$ steps. This means that $a\leq1010$ if $c=1$ and the task is possible in $2021$ moves. If $c=-1$, then $x$ is the blue bead and $y$ is the red bead. This means that $y\equiv3\pmod{2a+1}$ after $2(a-1)$ steps, so $y\equiv1\pmod{2a+1}$ after $2a$ steps. This also implies $a\leq1010$. Therefore, $r=\frac{a+1}a$ for $a\leq1010$. Now, we will show this works. If Alice has the red bead at $p$ and the blue bead at $p+1$, then doing the move on both beads in order with $k=1$ then $k=-1$ turns the blue bead into $p+\frac{a+1}a(p+1-p)=p+1+\frac1a$ and turns the red bead into $p+1+\frac1a-\frac a{a+1}\left(\frac{a+1}a\right)=p+\frac1a$. Therefore, $p=0$ can be turned into $p=1$ after $2a$ moves, which works for $a\leq1010$. Therefore, the task is possible if and only if $\boxed{r=\frac{a+1}a,a\leq1010}$.
12.07.2022 16:43
12.07.2022 22:37
Remark: This solution was given 0.5 style points at MOP
14.07.2022 15:25
My problem! I will give a sketch of my original proof here. If we allow $r$ to be complex, we can even work with the beads rotating and dilating in the 2D plane instead of just the number line. The main claim is the following: Lemma: If $r$ is any complex number, then Alice can get the red bead to $1$ in finitely many moves iff there is an integer polynomial $S$ such that $S(1)=1$ and $S(r)=0$. Further, the minimum number of moves needed is the minimum value of $h(T)-1$ over all integer polynomials $T$ satisfying $T(1)=1$ and $T(r)=0$ (where $h(T)$ is sum of absolute values of coefficients of $T$). Proof: Note that we can track the position of both the beads as polynomials in $r$ and $\frac{1}{r}$: let's say $1-P_i(r)$ and $1-Q_i(r)$ are the positions of the red and blue beads respectively after the $i^{th}$ move. We choose $P_0=1$ and $Q_0=0$ to be constant. Then $P_i$ and $Q_i$ transform like: $$P_i=P_{i-1} \text{ and } Q_i=x^k \cdot (Q_{i-1}-P_{i-1})+P_{i-1}$$if Alice chose the blue bead and integer $k$, or $$P_i=x^k \cdot (P_{i-1}-Q_{i-1})+Q_{i-1} \text{ and } Q_i=Q_{i-1}$$if Alice chose the red bead and integer $k$. Now we can check that $P_i(1)=1$ and $Q_i(1)=0$ for all $i$. Also, if Alice wins after $m$ moves, we must have $P_m(r)=0$. We can choose $S=x^n P_m$ for some appropriate integer $n$ which makes $S$ a polynomial. Now for the bound. It is enough to prove that $m \geq h(S)-1$. Let $a_i=\max\{h(P_i),h(Q_i)\}$. It's not hard to prove that $a_{i+1} \leq a_i+1$ at each step (in particular we use the fact that $P_i-Q_i$ is a monomial with coefficient $1$ for each $i$). Also $a_0=1$. Now that instantly gives $h(S)=h(P_m) \leq m+1$, as required. Conversely, suppose there exists such an $S$. Choose a non-negative integer $n$ such that the constant term in $\frac{S(x)}{x^n}$ is positive. Then since $S(1)=1$, there exists an even positive integer $m$ and a sequence of integers $a_0,a_1, \dots a_m$ with $a_0=0$ such that $$\frac{S(x)}{x^n}= \sum_{i=0}^{m} (-1)^i x^{a_i}$$Note that $m=h(S)-1$ here. Basically, we split each coefficient into sums of $1$s and $(-1)$s and arrange them in an alternating fashion. The winning strategy for Alice is to choose read and blue beads alternately, starting with the red bead, and to choose $k=a_i-a_{i-1}$ at the $i^{th}$ step. It is not hard to see that the red bead will end up at $1$ after the $m^{th}$ move. This also provides an equality case for the number of moves. $\blacksquare$ This lemma demolishes the problem: If $r=\frac{a}{b}>1$ is rational, then the minimal polynomial $bx-a \mid S$, so by Gauss's lemma this division is true even in $\mathbb{Z}[x]$. Therefore $b-a \mid S(1)=1$ and $-a-b \mid S(-1)$. The first gives us $a-b=1$. $S(-1) \neq 0$ because otherwise $x+1 \mid S$ $\implies$ $2 \mid S(1)=1$, which is impossible. Hence we must have $|a+b| \leq S(-1) \leq h(S)$. Since Alice wins in at most $2021$ moves, we must have $h(S) \leq 2022$ for some $S$, which gives $2b+1=a+b \leq 2022$, or $b \leq 1010$. Therefore the solutions are $$r=\frac{d+1}{d} \text{ for } d=1,2, \dots 1010$$For the construction, just the polynomial $S(x)=d+1-dx$ satisfies the conditions of the lemma, so Alice can win in $h(S)-1=2d < 2021$ moves.
14.07.2022 15:40
Supercali wrote: My problem! This is a nice problem. Sadly, the main idea of the modulo solution has appeared on USAMO 2019 P5, and I realize the similarly quickly when trying this problem.
18.07.2022 22:03
The answer is $r = \frac{p+1}{p}$, where $1\leq p\leq 1010$ is an integer. In the first move, if $y = 0$ and $x = 1$, then we have $x' = r^k$, so the blue bead at $1$ moves to $r^k$. So we want the red bead to reach $1$, where the red bead is at $0$ and the blue bead is at $r^k$. However, since $x' - y = r(x-y)$ is homogenous in $x', y, x$ (i.e. replacing them with $cx', kcy, cx$ for some nonzero constant $k$ gives the same equation), we can scale down the interval by $k$. Picking $c = \frac{1}{r^k}$, we obtain that this is equivalent to wanting the red bead to move to $\frac{1}{r^k}$, where the red bead is at $0$ and the blue bead is at $1$. In other words, the target (where we want the red bead to go) $t = 1$ moved to $t = \frac{1}{r^k}$. If we chose $y = 1$ instead (so $x = 0$), then we have $x' = 1-r^k$. Since $x'-y = r(x-y)$ is shift-invariant (not sure if this is an actual term), i.e. replacing $x', y, x$ with $x'+c, y+c, r+c$ for some constant $c$ gives the same equation, we can shift the beads by and the target at $t = 1$ by $r^k-1$ such that the red bead is positioned at $x = 0$, the target is positioned at $t = r^k$, and the blue bead is positioned at $r^k$. As discussed earlier, $x'-y = r(x-y)$ is homogenous, so we can scale by $\frac{1}{r^k}$ to get that this is equivalent (for our purposes) to the red bead being positioned at $0$, the blue bead being positioned at $1$, and the target being positioned at $t = 1$. More generally, we can say that if the target is at $t$ (for some arbitrary real number $t$), the red bead is at $0$, and the blue bead is at $1$, then choosing $y = 0$ and $x = 1$, we get $x' = r^k$, and scaling down by $\frac{1}{r^k}$ gives the same positions of the beads but it moves the target to $\frac{t}{r^k}$. If we chose $y = 1$ and $x = 0$, we get $x' = 1 - r^k$. Shifting by $r^k - 1$ gives the red bead at $0$, the target at $t + (r^k-1)$, and the blue bead at $r^k$. Scaling down by $\frac{1}{r^k}$ puts the red and blue beads in their original positions, and moves the target to $\frac{t + (r^k-1)}{r^k}$. Thus, if the target is at $t$, then after one move, the target is either at $\frac{t}{r^k}$ or $\frac{t + (r^k-1)}{r^k}$. Letting $s = \frac{1}{r}$, this means that after one move the target is either at $ts^k$ or $(t-1)s^k + 1$, for some integer $k$. If we apply $t \rightarrow ts^k$ twice, with $k$ being $a$ the first time and $b$ the second time we get $t\rightarrow ts^{a+b}$. However, this could have just been done in one move. Thus, applying this same move twice is redundant and only increases the number of moves, so if we could get to $t = 0$ (which is our goal since we want the red bead to coincide with the target) in at most $2021$ moves by applying this move twice, we could do even less moves (but the point is, still at most $2021$ moves) by just applying it once, and if we could not get at most $2021$ moves by applying this move once, then we cannot get at most $2021$ moves if we applied it twice in a row (contrapositive of the first statement). Similarly, if we apply $t\rightarrow (t-1)s^k + 1$ twice, with $k$ being $a$ the first time and $b$ the second time, then we get $$t\rightarrow (((t-1)s^a + 1)-1)s^b + 1 = (t-1)s^{a+b} + 1,$$which we could have just gotten by applying the move once. Thus, by the same logic as above, applying the same move twice is redundant, and so it suffices to focus on sequences of target changes that do not have two of the same move in a row. Since $t$ is initially placed at $1$, after one move it is either at $s^a$ or just back at $1$. By the same redundancy argument, we can ignore the case where it is back at $1$. So, on the first move, we have $1\rightarrow s^a$ for some integer $a$. Since we are only focusing on sequences of moves that do not have the same move twice, in the next move we have $s^a\rightarrow (s^a-1)s^b + 1 = s^{a+b} - s^b + 1$ for some integer $b$. In the next move, we have $s^{a+b} - s^b + 1 \rightarrow s^{a+b+c} - s^{b+c} + s^c$ for some integer $c$, and in the next move we have $s^{a+b+c} - s^{b+c} + s^c \rightarrow s^{a+b+c+d} - s^{b+c+d} + s^{c+d} - s^d + 1$. We can write $a+b+c+d, b+c+d, c+d, d$ as $x, y, z, w$ for arbitrary integers $x, y, z, w$ for some choice of $a, b, c, d$ since we can write $a = x-y, b = y-z, c = z-w, d = w$, i.e. $(a+b+c+d, b+c+d, c+d, d)$ can be any $4$-tuple of integers. We can analogously do this for the rest of the terms to get $$1 \rightarrow s^{x_1} \rightarrow s^{y_2} - s^{y_1} + 1 \rightarrow s^{z_3} - s^{z_2} + s^{z_1} \rightarrow s^{p_4} - s^{p_3} + s^{p_2} - s^{p_1} + 1,$$for integers $x_i, y_i, z_i, p_i$. In general, the $2k$th term is of the form $$s^{a_{2k}} - s^{a_{2k-1}} + s^{a_{2k-2}} - \cdots - s^{a_1} + 1,$$for integers $a_i$ (we can make the $a_i$'s be any integer with the right choices of the $k$'s in each move, as discussed before). The $2k+1$th term is the $2k$th term multiplied by a $s^k$. Now, assume $s$ works, i.e. there exists a choice of $k$s in each move such that you can achieve $0$ in at most $2021$ moves. Let $2\leq \ell \leq 2021$ ($\ell = 1$ clearly does not work) be the first zero term encountered in this sequence. $\ell$ cannot be even, since the $\ell-1$th term would be the $\ell$th term divided by some $s^k$, which would also be zero, contradicting the minimality of $\ell$. Then, writing $\ell = 2m$ for some $m\leq 1010$ (if $m > 1010$, then $\ell = 2m \geq 2022 > 2021$), we have $$s^{a_{2m}} - s^{a_{2m-1}} + s^{a_{2m-2}} - \cdots - s^{a_1} + 1 = 0$$for some integers $a_i$ for $1\leq i\leq 2m$. Now, let $s = \frac{p}{q}$ for positive integers $p, q$ such that $\gcd(p, q) = 1$ and $p < q$ (since $\frac{1}{r} = s < 1$ as $r > 1$). Claim: $q-p = 1$. Proof: Assume the contrary. Then, $q-p > 1$, and $\gcd(q, q-p) = \gcd(p, q) = 1$, so $\frac{p}{q}$ exists modulo $q-p$ and in fact $$\frac{p}{q} \equiv \frac{p + (q-p)}{q} \equiv \frac{q}{q}\equiv 1\pmod{q-p},$$so $$0\equiv s^{a_{2m}} - s^{a_{2m-1}} + s^{a_{2m-2}} - \cdots - s^{a_1} + 1 \equiv 1 - 1 + 1 - \cdots - 1 + 1 \equiv 1\pmod{q-p},$$implying $q-p \mid 1$, absurd. Thus, $s = \frac{p}{q} = \frac{p}{p+1}$ for some positive integer $p$, so $r = \frac{p+1}{p}$. Now, we will show that if $p > 1010$, then we cannot have $m \leq 1010$. Assume $p > 1010$. Consider $R(x) = x^{a_{2m}} - x^{a_{2m-1}} + x^{a_{2m-2}} - \cdots - x^{a_1} + 1$. Multiply $R(x)$ by $x^t$ where $t$ is sufficiently large (say $t = -\min\{a_i\}$) so that $x^tR(x)$ is a polynomial. Then, since the minimal polynomial of $s$ in $\mathbb{Z}[x]$ is $(p+1)x - p$, it follows that $P(x) = [(p+1)x - p]Q(x)$ for some polynomial $Q$. Since $P(x), (p+1)x-p\in \mathbb{Z}[x]$, it follows that $Q(x)\in \mathbb{Z}[x]$ (it's well known that if $ab = c$. Thus, the leading coefficient of $P$ has absolute value at least $p+1$, since the leading coefficient of $Q$ has absolute value at least $1$. Considering $R(x)$, note that the minimum possible value of a term in $R(x)$ is $0-1+0-1 + \cdots + 0-1 + 1 = -(m-1)$ and the maximum possible value of a term in $R(x)$ is $1 + 0 + 1 + 0 + \cdots + 1 + 0 + 1 = (m+1)$, so the absolute value of a term in $R(x)$ is at most $m+1$. Since $P(x) = x^tR(x)$, the same is true for $P(x)$, so $m+1\geq p+1\iff m \geq p > 1010$, a contradiction. So it remains to show that if $1\leq p\leq 1010$, we can make $$s^{a_{2m}} - s^{a_{2m-1}} + s^{a_{2m-2}} - \cdots - s^{a_1} +1 = 0,$$where $s = \frac{p}{p+1}$ for some $m \leq 1010$ and integers $a_i$. For each $1\leq p\leq 1010$, choose $m = p$, let $a_{2i} = 0$ for all $1\leq i \leq p$, let $a_{2i-1} = -1$ for $1\leq i\leq p$. Then, the expression becomes $$(p+1) - \frac{p}{s} = \frac{s(p+1) - p}{s} = 0,$$as desired. Thus, we're done.
10.08.2022 23:32
24.05.2023 03:14
The red bead is always to the left of the blue bead. If there is a sequence of moves such that there are two consecutive moves on the same bead, then there is a shorter sequence of moves that merge the two consecutive moves into one. Thus, we might as well force Alice to alternative between the two beads. Additionally, note that the distance between the beads is always an integer power of $r$. Now, note that if we start with the blue bead then our last move will be on the blue bead, which means that in reality we only get $2009$ moves that matter. Thus, we might as well force Alice to move the red bead first, even if this move is the empty move. Finally, if there are less than $2021$ moves we can always just do empty moves to make it length $2021$. Thus, we might as well force Alice to make exactly $2021$ moves. If $r=\tfrac{k+1}{k}$ where $1\le k\le 1010$ is a positive integer then consider the following sequence of moves: move the red bead so that the distance from it to the blue bead is $r^{-1}$. Then, move the blue bead so that the distance from it to the red bead is $1$. Since the red bead moved forward a distance of $1-r^{-1}$, this sequence of moves moves both beads $1-r^{-1}=\tfrac1{k+1}$, we can get the red bead to $1$ in just $2k+1\le 2021$ moves. We'll show these to be the only solutions. We can now denote each sequence of moves instead as a sequence of integers $(a_0,a_1,\dots,a_{2021})$ in which $a_k=\log_r(d_k)$ where $d_k$ is the distances between the two beads after $k$ moves. Note that $a_0=\log_r(d_0)=0$ because the beads haven't moved yet. For example, our previous construction uses the sequence \[(0,-1,0,-1,0,\dots,-1,0,0,0,\dots,0)\]where the $-1$ appears $k$ times. The position of the red bead after all the moves will be \[r^{a_0}-r^{a_1}+r^{a_2}-r^{a_3}+\dots - r^{a_{2021}}\]where $a_i$ can be any integer at all for $1\le i\le 2021$, and $a_0=0$. Thus, we want to find all rational $r>1$ such that there exist $a_1,a_2,\dots,a_{2021}$ for which \[r^{a_2}+r^{a_4}+\dots+r^{a_{2020}} = r^{a_1}+r^{a_3}+r^{a_5}+\dots + r^{a_{2021}}\]We can write $a_2\le a_4\le \dots \le a_{2020}$ and $a_1\le a_3\le \dots \le a_{2021}$ since order does not matter anymore. Furthermore, we can always just add the same number $d$ to each $a_i$ so that both sides of the equation are multiplied by $r^d$, so we can assume all $a_i$s are nonnegative, but either $a_1$ or $a_2$ is zero. Note that the left side has $1010$ terms while the right has $1011$. Let $r=\tfrac{p}q$ such that $p$ and $q$ are coprime positive integers. We have \begin{align*} \sum_{k=1}^{1010}{\frac{p^{a_{2k}}}{q^{a_{2k}}}} &= \sum_{k=1}^{1011}{\frac{p^{a_{2k-1}}}{q^{a_{2k-1}}}} \\ \frac{\sum_{k=1}^{1010}{(p^{a_{2k}}q^{a_{2020}-a_{2k}})}}{q^{a_{2020}}} &= \frac{\sum_{k=1}^{1011}{(p^{a_{2k-1}}q^{a_{2021}-a_{2k-1}})}}{q^{a_{2021}}} \end{align*}Taking $\pmod {p-q}$, we get $1010\equiv 1011\pmod {p-q}$ which implies that $p-q$ must be $1$, since $p>q$. Taking $\pmod {p+q}$, we get \[\sum_{k=1}^{1010}{\pm 1} \equiv \sum_{k=1}^{1011}{\pm 1} \pmod {p+q}\]which means that \[p+q\le \left|\sum_{k=1}^{1010}{\pm 1}-\sum_{k=1}^{1011}{\pm 1}\right| \le 2021\]so $p\le 1011$, as desired.
15.06.2023 23:06
Let $ k_n $ be the value of $ k $ used in the $ n $-th move. Clearly the distance between the beads right before the $ n $-th move is $ r^{k_1+...+k_{n-1}} $, so the red bead moves by either $ 0 $ or $ (r^k-1)r^{k_1+...+k_{n-1}} = r^{k_1+...+k_{n}}-r^{k_1+...+k_{n-1}} $. Setting $ l_n = k_1+...+k_n $, we wish to find solutions to $$\sum_{i \in S} (r^{l_i}-r^{l_{i-1}}) = 1$$where $ S $ is some subset of $ \{1, 2, ..., 2021\} $. Notice the bijection between $ (l_1, ..., l_{2021}) $ and $ (k_1, ..., k_{2021}) $, so there are no additional constraints on $ (l_1, ..., l_{2021}) $. Letting $ r = \frac{p}{q} $ with $p > q$ and $ \gcd(p, q) = 1 $, we have $r \equiv 1 \pmod{p - q}$. The condition then becomes $0 \equiv 1 \pmod{p - q}$, so we must have $p = q + 1$. Now we also have $r = -1 \pmod{2q + 1}$, so the condition becomes $$\sum_{i \in S} ((-1)^{l_i}-(-1)^{l_{i-1}}) \equiv 1 \pmod{2q+1}$$Writing $S$ as the (smallest possible) disjoint union of sets of consecutive integers $ \{a_1, a_1+1, ..., a_1+i_1\}, ..., \{a_m, a_m+1, ..., a_m+i_m\}$ with $m \leq 1011$, we rewrite the LHS as $$\sum_{j = 1}^{m} ((-1)^{l_{i_{a_1+i_1}}}-(-1)^{l_{i_{a_1-1}}}) \equiv 1 \pmod{2q+1}$$(the nesting indices are getting out of hand. ) Each summed term in the LHS is equal to $ 0 $ or $ \pm2 $, so we must have $m \geq q$ for the equation to hold. This produces the desired bound $q \leq m \leq 1011$ and the solutions $r = \frac{q+1}{q} = 1 + \frac 1q$ for $q = 1, ..., 1010$ (The case for $q = 1011$ does not hold because $S = \{1, 3, ..., 2021\}$ implies that the second term of the LHS for $j = 1$ is $ 1 $, so the summed terms in the LHS cannot all be $ -2 $). A construction is $S = \{2, 4, ..., 2q\}$ and $(l_1, l_2, ...l_{2q}) = (0, 1, 0, 1, ..., 1)$ for all $ n $.
06.09.2023 18:20
Solution done with zero nuance. Note that the length between the two beads is always a power of $r$. As such, we can WLOG assume that the beads moved alternate. Consider the move of shifting both beeds by $r^k$ and maintaining the length as $1$. We can mimic any of the original moves by shifting onto the bead that is moved, and conversely. This follows as the last move must always be the red move. Let $R$ be the set of powers of $r$. Then this is equivalent to either \begin{align*} -(r_1 - 1) + (r_2 - 1) - (r_3 - 1) + (r_4 - 1) + \dots - (r_{2k+1} - 1) &= 1 \\ (r_1 - 1) - (r_2 - 1) + (r_3 - 1) - (r_4 - 1) + \dots - (r_{2k+2} - 1) &= 1 \\ \end{align*}where $r_i$ are powers of $r$, and maintaining indices at most $2021$. This simplifies as \begin{align*} -r_1 + r_2 - r_3 + r_4 + \dots - r_{2k+1} &= 0 \\ r_1 - r_2 + r_3 - r_4 + \dots - r_{2k+2} &= 1 \\ \end{align*}In the second case, we can arbitrarily pad $r_{2k+3} = 1$ and simplify it to the first case. As such, it remains to consider when \[ r_2 + r_4 + \dots r_{2k} = r_1 + r_3 + \dots + r_{2k+1} \]where $k \le 1010$. Claim: This is only possible if $r = \frac{t + 1}{t}$ Proof. Suppose that $r = \frac{p}{q}$ for $p - q \ne 1$. Then let $m$ be a prime divisors of $p - q$ such that $r \equiv 1 \pmod{m}$. The equation then simplifies as $k = k + 1$ and thus can't be satisfied. $\blacksquare$ Claim: This is possible if and only if $r = \frac{t+1}{t}$, $t \le 1010$. Proof. For $t \le 1010$, we can take the construction $r_{2i} = \frac{t+1}{t}, r_{2i+1} = 1$. Now, suppose FTSOC that it holds for $t > 1010$. Prune equal $r_{2i}$ and $r_{2i+1}$ until they have distinct multisets. Let $r = \frac{t+1}{t}$ when simplified. The denominators of powers of $r$ are too large to simplify in all cases except for $\frac{1012}{1011}$, which still remains impossible. $\blacksquare$
19.11.2023 07:48
Basically the same as Evan's solution but whatever. Same idea in 2019 USAMO/5 but used to obtain residues of $\pm 1$ under two distinct moduli, as opposed to just $-1$ under one modulus. Let $r = \tfrac{m}{n}$, where $m$ and $n$ are relatively prime positive integers. Claim: If Alice wins, then $m-n=1$. Proof. Work $\bmod{\ m-n}$. Then \[ r = \frac{m}{n} \equiv 1 \pmod{m-n}, \]so it follows that the position of the bead is invariant $\bmod{\ m-n}$, which is possible only when $m-n=1$. Assume $m=n+1$ henceforth, so that $r = 1 + \tfrac{1}{n}$. It suffices to bound $m$. Now conduct a $\bmod{/ 2n+1}$ analysis, so that \[ r \equiv 1 + n^{-1} \equiv 1 + (-2) = -1 \pmod{2n+1}. \]Then the equation $x'-y=r^k(x-y)$ rewrites as \[ x' \equiv (-1)^k \cdot x + (1-(-1)^k) \cdot y \pmod{2n+1}. \]Parity-wise, this means that when $k$ is even, $x$ is invariant, and when $k$ is odd, $x$ moves to $-x+2y$. Now let Alice greedily minimize the number of moves needed, so that $k$ alternates between even and odd and that the chosen bead alternates between red and blue; eventually the bead is moved to $2n+2 \equiv 1 \pmod{2n+1}$, with one of the beads changing its position at a time. This induces $2n$ moves, so the total number of moves is at least $2n$. In particular, $n \le 1010$. Now we show that each $r=\tfrac{n+1}{n}$ works for each $1 \le n \le 1010$. By alternating between $k=0$ and $k=1$ and alternating between the color of the chosen bead, we can (after exactly $2n$ moves) move the pair $(0, 1)$ to $(1, r)$, and we are done.
19.02.2024 19:07
The answer is $1 + \frac 1n$ for any positive integer $n\le 1010$. The construction is \[(0,1) \to (0,r) \to \left( r - 1 ,r \right) \to (r-1, 2r - 1) \to (2r - 2, 2r-1) \to \cdots \to (nr - n, nr - (n-1)) = (1,2),\]where we take $k$ to alternate between $1$ and $-1$, starting from $1$, which clearly takes $2n$ moves. If $r\equiv 1\pmod p$ for some prime $p$, then clearly the residues stay the same modulo $p$, which means the red bead can't be $1$. Hence $r = 1 + \frac 1n$ for some positive integer $n$. We claim that at least $2n$ moves must be made for the red bead to be $1$. Now, if $y$ was the unchosen bead for two consecutive turns, we have $x' - y = r^k (x-y)$ and then $x'' -y= r^(k + m)(x-y)$, which means that we could have chosen $x''$ in one move rather than two. As we are trying to minimize the number of moves made, assume that the chosen bead alternates in color each turn. Now note that $r\equiv -1\pmod{2n+1}$, so $x' - y \equiv x - y \implies x' \equiv x$ or $x' - y \equiv y-x \implies x' \equiv 2y - x$. To minimize the number of moves made for the red bead to become $1\pmod{2n+1}$, we can make sure that no pair of (red, blue) is repeated mod $2n+1$ until we hit $1\pmod{2n+1}$. There are two ways to do this, one being \[ (0,1) \to (0,-1) \to (-2, -1) \to (-2, -3) \to (-4,-3 )\to \cdots \to (-(2n-2), -(2n - 1)) \to (-2n, -(2n-1)) \]and the other being \[ (0,1) \to (2,1) \to (2,3) \to (4,3) \to \cdots \to (2n-2, 2n-1) \to (2n, 2n-1),\]with each taking at least $2n$ moves. Hence we must take at least $2n$ moves to get the red bead to $1$, as desired.
08.04.2024 17:29
The answer is $\boxed{r=\frac21,\frac32,\frac43,\dots,\frac{1011}{1010}}$. For the construction of $\frac{n+1}{n}$, we may alternate $k=-1$ and red, and $k=1$ and blue, where red goes first. This will finish in $2n+1$ moves. Note that the distance between the two beads will always be a power of $r$, and the red bead will always be left of the blue bead. Therefore, if the red bead moves, it moves by \[r^m-r^n\]for some integers $m,n$. If $r=\frac ab$ when reduced(possibly $b=1$), if $a-b>1$, then what it moves by would be $0$ mod $a-b$, impossible since it needs to move by a total of $1$. Therefore, $a-b=1$. Now for $\nu_p$ reasons, the red bead needs to move at least $b$ times(counting moving multiple times without the blue bead moving as once), so there needs to be at least $2b-1$ moves available. Thus $2b-1\le 2021$, so $b\le 1011$. Therefore, we just needs to prove that $r=\frac{1012}{1011}$ does not work. Note that the only way for the $\nu_p$ equality case to work out is if we take the same red movement $1011$ times, meaning that it moved by $\frac{1}{1011}$ each time. Thus implies that $m=1$ and $n=0$, impossible as that goes the wrong way on the first move. $\blacksquare$