Let $ p,q,n$ be three positive integers with $ p + q < n$. Let $ (x_{0},x_{1},\cdots ,x_{n})$ be an $ (n + 1)$-tuple of integers satisfying the following conditions : (a) $ x_{0} = x_{n} = 0$, and (b) For each $ i$ with $ 1\leq i\leq n$, either $ x_{i} - x_{i - 1} = p$ or $ x_{i} - x_{i - 1} = - q$. Show that there exist indices $ i < j$ with $ (i,j)\neq (0,n)$, such that $ x_{i} = x_{j}$.
Problem
Source: IMO 1996, Problem 6, IMO Shortlist 1996, C5
Tags: algebra, combinatorics, Integer sequence, invariant, IMO, IMO 1996, IMO Shortlist
18.09.2005 14:31
Yes, it's nice, but my solution is not that clever, I'm afraid (I hope the one you gave a link to is nicer; I did not and will not read it ). Since we can divide everything by $(p,q)$, we may as well assume that $(p,q)=1$. This means that we must have $kq$ steps of length $p$ and $kp$ steps of length $-q$ (a "step" is a difference of the form $x_{m+1}-x_m$), or, in other words, $n=k(p+q)$ for some $k\ge 2$. A very cool observation: the sum of any $p+q$ steps is a multiple of $p+q$, so, in particular, the sum of any $p+q$ consecutive steps is a multiple of $p+q$. Now divide the $k(p+q)$ steps into $k$ disjoint groups of $p+q$ consecutive steps. The sum of all these groups is zero, which means that there is a group whose sum is a non-negative multiple of $p+q$, and another group which is a non-positive multiple of $p+q$. Now, since for any $a>b$ we have $(x_{a+1}-x_{b+1})-(x_a-x_b)\in\{0,\pm(p+q)\}$, advancing from the positive multiple of $p+q$ to the negative multiple of $p+q$ through steps of length $0,\pm(p+q)$ we must reach some group (not necessarily among the $k$-disjoint ones) of $p+q$ consecutive steps with sum $0$, and we're done. Sorry if it's a bit unclear.
10.02.2008 07:29
Here's a combinatorial way of looking at the problem: Consider the numbers $ x_{1} - x_{0}, x_{2} - x_{1}, ... x_{n} - x_{n-1}$. Suppose among these, there are $ p$ occurs $ k$ times, and $ -q$ occurs $ l$ times - then clearly $ kp = ql$. Since multiplying $ p$ and $ q$ by a constant changes nothing, we can assume that $ (p,q) = 1$. In view of the equation $ kp=ql$, this means that $ k=qc, l=pc$ for some $ c>1$. Now for each $ x_{i}$, assign it a pair of numbers $ (a_{i}, b_{i})$, where $ a_{i}$ is the number of $ p$-s that have occurred so far in the sequence $ x_{1} - x_{0}, x_{2} - x_{1}..., x_{i} - x_{i-1}$, and $ b_{i}$ is the number of $ -q$-s that have occurred so far in the sequence $ x_{1} - x_{0} ... x_{i} - x_{i-1}$. Now clearly $ a_{i} + b_{i} = i$, and $ x_{i} = p a_{i} - q b_{i}$. Thus $ x_{i} = x_{j}$ iff $ p a_{i} - q b_{i} = p a_{j} - q b_{j}$, or $ \frac {b_{i} - b_{j}}{a_{i} - a_{j}} = \frac {p}{q}$. Also, since each $ x_{i+1} - x_{i}$ is either $ p$ or $ -q$, the pair $ (a_{i+1}, b_{i+1})$ is either $ (a_{i} + 1, b_{i})$ or $ (a_{i}, b_{i} + 1)$. Finally, $ (a_{n}, b_{n})$ is just $ (k,l)$, or $ (qc, pc)$. This motivates us to consider a coordinate system, and plot the $ n$ points $ (a_{i}, b_{i})$. These $ c(p+q)$ points form a pathway from $ (0,0)$ to $ (qc, pc)$ (where you are allowed to go either right or up at each step). We wish to find two points $ A, (a_{i}, a_{j})$ and $ B, (b_{i}, b_{j})$ so that $ \frac {b_{i} - b_{j}}{a_{i} - a_{j}} = \frac {p}{q}$, but this is equivalent to $ AB$ being parallel to the main diagonal. In other words, it suffices to prove that: Given a $ ca$ by $ cb$ rectangle, where $ (a,b)=1$ and $ c>1$, and a pathway from the point $ X (0,0)$ to $ Y (ca, cb)$ where one may move either right or up, there are two points $ A, B$ on the pathway, such that $ AB$ is parallel to the main diagonal $ XY$. Assume to the contrary. Now let's consider the $ c+1$ points: $ K_{i}: (ai, bi)$ for $ i=0,1, ... c$. Clearly there is a point on our pathway $ (a,t)$ where $ t$ is some integer. Call this point $ Q$. Let's break up the pathway into two parts: $ P_{1}$, the part from $ (0,0)$ to $ Q$, and $ P_{2}$, the part from $ Q$ to $ (ca, cb)$. Consider our pathway, and for each point $ K_{i}$ with $ i \geq 1, i \leq n-1$, consider the transformation taking $ K_{0}$ to $ K_{i}$ (i.e. moving each point $ ai$ units to the right, and $ bi$ units up). For such a transformation, consider the path $ P'_{i}$ for $ i = 1,2 ... n$ - which is the image of our path under the transformation. Suppose some path $ P'_{i}$ intersects the path $ P_{2}$ at some point $ L$. Consider the point $ L'$ - where $ L$ was before our transformation taking $ K_{0}$ to $ K_{i}$. Since $ L$ is a point in the pathway $ P'_{i}$, $ L'$ must have been a point in our original pathway. Now consider the two points $ L$ and $ L'$ on our pathway - $ L$ is obtained by moving $ L'$ $ ai$ units to the right, and $ bi$ units up - so $ LL'$ is parallel to $ XY$, as required - Contradiction. So now suppose none of the paths $ P'_{i}$ intersects the path $ P_{2}$. $ P_{2}$ is a path from $ Q$ to $ Y$, and $ P'_{i}$ is a path from $ (ai, bi)$ to some point with $ x$-coordinate $ a(i+1)$. For each of these pathways, consider the rectangle enclosing that pathway. By considering two cases - when $ Q$ is above the point $ (a, b)$, and when $ Q$ is below that point, and looking at all the rectangles enclosing those pathways, by looking at the diagram, we can see that some pathway $ P'_{i}$ and $ P_{2}$ must intersect from some $ i$. But looking at the previous paragraph, this is also a contradiction, as required.
24.12.2014 20:16
I am not sure, but I thought of an argument that basically uses continuity, is that possible? (My solution can be condensed into 3 lines).
07.06.2015 09:02
Write a circular sequence of $n$ numbers, each of which is either $p$ or $q$, depending on $|x_{i+1}-x_i|$. Take a block of $p+q$ consecutive numbers in this sequence, and for such a block let $(X,Y)$ be the number of $p$'s and $q$'s in the block, respectively. Notice that when we slide the block by 1 distance, then $(X,Y)$ changes to $(X,Y),(X-1,Y+1)$, or $(X+1,Y-1)$. Also notice that, averaging over all $n$ possible blocks, $(\text{average }X, \text{average }Y)=(q,p)$, since $x_0=x_n=0$. Therefore, $(X,Y)$ must attain exactly this value somewhere (otherwise, it would always be below or above it), that is, there exists $i,j$ with $j=i+p+q$ (taken mod $n$, so that it is possible that $j<i$. Note also that $p+q<n \Rightarrow i \neq j$), such that $x_j=x_i+qp-qp=x_i$, so we are done.
26.06.2018 10:36
We are allowed to perform the move $x_i =x_{i-1}+p$ or $x_i=x_{i-1}-q$. Call these a p-move and q-move respectively. Without loss of generality, $q \ge p$. Let $gcd(p,q)=d$ and let $p=dk$ and $q=dl$, and so $gcd(k,l)=1$ and $l \ge k$. Note that the entire proof is illustrated with an example below. ================================================================================================================= Proof Lemma: $k+l|n$, and, by the hypothesis, $n$ is at least twice of $k+l$ (as $n>p+q$)
Now, write the moves as chains of $p$s and $q$s (basically differences of consecutive terms). Call this chain as the move chain to distinguish it from the question's chain. Claim: The move chain has $(k+l)$ consecutive integers which have exactly $k$ $q$s, i.e. $q$ being repeated exactly $k$ times. Call this chain $C$.
Now, choose elements $x,y$ from the problem's chain such that $C$ starts after $x$ and ends at $y$. Note that $y-x=\text{total change produced after performing the moves}=p \times [(k+l)-k]-q \times k=(dk)(l)-(dl)(k)=0$, implying that $x=y$, as desired. $\blacksquare$ ================================================================================================================= Illustration (just for clarity) For instance, choose $p=3, q=4, n=14$. Then $k=3, l=4$. Also, consider the following chain of $x_i$: $$0, 3, -1, -5, -2, 1, -3, -7, -4, -8, -12, -9, -6, -3, 0$$It has the move chain $$[3, 4, 4, 3, 3, 4, 4] [3, 4, 4, 3, 3, 3, 3]$$here, $k+l=3+4|n=14$. Also, $u=\frac{14}{3+4}=2$, and $C_1,C_2$ are marked by brackets above. Now, we want the desired chain $C$ to have $3$ $q$s. Following the method to obtain $C$, we start moving from $C_1$ to $C_2$ as: $$[3, 4, 4, 3, 3, 4, 4] 3, 4, 4, 3, 3, 3, 3 \mapsto 3, [4, 4, 3, 3, 4, 4, 3] 4, 4, 3, 3, 3, 3 \mapsto \cdots 3, 4, 4, 3, 3, 4, \underbrace{[4, 3, 4, 4, 3, 3, 3]}_{C} 3$$Hence, we get that these two equal numbers in the problem's chain: $$0, 3, -1, -5, -2, 1, \boxed{-3}, -7, -4, -8, -12, -9, -6, \boxed{-3}, 0$$ Edit: My first IMO combinatorics P6 Also my 798-th post
15.04.2019 05:32
Boring problem. Why is this a C5 or an IMO 6? Assume $(p,q) = 1$ so that we move by $p$ $mq$ times, and $-q$ $mp$ times, where $m > 1$. Now, let $n(i)$ be the number of $i \leq j < i+p+q$ such that $x_{i+1}-x_i = p$. We just need to find some $i$ such that $n(i) = q$, and then the pair $(i, i+p+q)$ would work. Let $n(i)-q = \chi(i)$. Now note that $\chi(0) + \chi(p+q) + \cdots + \chi((m-1)(p+q)) = 0$, since there are $mq$ $+p$ moves in total. So, there exists some $i < j$ so that $\chi(i(p+q))$ and $\chi(j(p+q))$ are of opposite sign. Furthermore, $|\chi(i) - \chi(i+1)|\leq 1$, so by discrete continuity we can find $\chi(i) = 0$ indeed.
13.06.2021 22:36
Easiest IMO 6 I've ever seen WLOG let $(p,q)=1$. Call an index $i$ for which $x_i-x_{i-1}=p$ "falling" and other indices "rising". There must be $kq$ falling indices and $kp$ rising indices in total for some positive integer $k>1$. Now, define $f(i)$ for an index $0\le i\le (k-1)(p+q)$ as the number of falling indices in the range $[i+1,i+p+q]$. Since $\sum_{j=0}^{k}f(jp+jq)=kq$, there are two indices $j_1,j_2$ for which $f(j_1 p+j_1 q)\ge q$ and $f(j_2 p+j_2 q)\le q$. Continuity gives that there is an index $i$ in $[j_1 p+j_1 q, j_2 p+j_2 q]$ for which $f(i)=q$ as desired.
06.01.2022 22:10
22.02.2023 01:41
We may assume that $p,q$ are coprime. Then we see that $n$ has to be a multiple of $p+q$; write $n=k(p+q)$ for some $k>1.$ Instead of looking at the sequence $(x_i)$ directly, we consider the sequence of differences $(x_{i}-x_{i-1}).$ We see that this contains $kq$ times the number $p$ and $kp$ times the number $q.$ It is now enough to find $p+q$ consecutive elements of this sequence which sum to $0$, or equivalently, which contain $q$ times the number $p.$ Consider the blocks formed by the first $p+q$ numbers, the $p+q+1$-th to $2(p+q)$-th number and so one. If one of these contains $p$ $q$-times, we are done. Otherwise we find two blocks such that one contains $<q$ and the other $>q$ times $p.$ Then we use discrete continuity (i.e. the fact that the number of $p$'s can only change by $-1,0$ or $1$ if we move from one block to the next) to find a block in between these blocks where $p$ apperars $q$ times, as desired.