Let $ R_1,R_2, \ldots$ be the family of finite sequences of positive integers defined by the following rules: $ R_1 = (1),$ and if $ R_{n - 1} = (x_1, \ldots, x_s),$ then \[ R_n = (1, 2, \ldots, x_1, 1, 2, \ldots, x_2, \ldots, 1, 2, \ldots, x_s, n).\] For example, $ R_2 = (1, 2),$ $ R_3 = (1, 1, 2, 3),$ $ R_4 = (1, 1, 1, 2, 1, 2, 3, 4).$ Prove that if $ n > 1,$ then the $ k$th term from the left in $ R_n$ is equal to 1 if and only if the $ k$th term from the right in $ R_n$ is different from 1.
Problem
Source: IMO Shortlist 1997, Q2
Tags: algebra, combinatorics, Sequence, invariant, IMO Shortlist
math154
19.07.2014 11:09
Some links, for convenience. Thread with discussion: http://www.artofproblemsolving.com/Forum/viewtopic.php?f=41&t=108138 OEIS: https://oeis.org/A004073 I think this is similar in flavor to the Russia 2003 Ana/Bora problem, although that one might be a little trickier?
randomusername
23.07.2014 21:42
Define the companion family of finite sequences $\{Q_{ni}\}$ such that $Q_{n1}=(1)$, $Q_{nn}=(n)$ and $Q_{ni}=Q_{(n-1)(i-1)}Q_{(n-1)i}$ whenever $1<i<n$.
Claim 1. $Q_{ni}$ has length $\binom {n-1}{i-1}$.
Proof. This is clear for $i=1$ and $i=n$. Using induction, we find that $Q_{(n+1)(i+1)}=Q_{ni}Q_{n(i+1)}$ has length
\[\binom{n-1}{i-1}+\binom{n-1}i=\binom ni,\]
as needed. $\blacksquare$
Now define for any finite sequence $A=(x_1,x_2,\dots, x_n)$ (where all the $x_i$ are positive integers) the following operation:
\[\hat{A}=(1,2,\dots,x_1,1,2,\dots,x_2,\dots,1,2,\dots,x_n).\]
Then of course we have $\hat{A}\hat{B}=\hat{AB}$.
Claim 2. $Q_{ni}=\hat{Q_{(n-1)i}}$ for $n\ge 2$ and $1\le i\le n-1$.
Proof. We use induction on $n$. This is trivial for $i=1$ because $Q_{n1}=Q_{(n-1)i}=(1)$. This also implies the truth of the claim for $n=2$. For $n>2$, $1<i<n$, we find by the induction hypothesis
\[Q_{ni}=Q_{(n-1)(i-1)}Q_{(n-1)i}=\hat{Q_{(n-2)(i-1)}}\hat{Q_{(n-2)i}}=\hat{Q_{(n-1)i}}.\blacksquare\]
Claim 3. The $j$-th term from the left in $Q_{ni}$ is a $1$ if and only if the $j$-th term from the right in $Q_{n(n+1-i)}$ is not a $1$ ($n\ge 2$).
Proof. Inducting on $n$, starting from the trivial $n=2$, we note that either $i=1$ or $i=n$, in which case we are done based on the definition, or else we have $Q_{ni}=Q_{(n-1)(i-1)}Q_{(n-1)i}$ and $Q_{n(n+1-i)}=Q_{(n-1)(n-i)}Q_{(n-1)(n+1-i)}$. In the latter case, the $j$-th term from the left in $Q_{ni}$ is either in the part $Q_{(n-1)(i-1)}$, or it is in $Q_{(n-1)i}$. Because of Claim 1, we notice that $Q_{(n-1)(n+1-i)}$ is just as long as $Q_{(n-1)(i-1)}$, so the $j$-th term from the left in $Q_{ni}$ and the $j$-th term from the right in $Q_{n(n+1-i)}$ coincide with either the $j$-th term from the left in $Q_{(n-1)(i-1)}$ and from the right in $Q_{(n-1)(n+i-1)}$, or the $j^*$-th term (for some $j^*$) from the left in $Q_{(n-1)i}$ and from the right in $Q_{(n-1)(n-i)}$. In both cases, we are done because of the induction hypothesis. $\blacksquare$
Claim 4. $R_n=Q_{n1}Q_{n2}\dots Q_{nn}$.
Proof. This is trivial for $n=1$. Proceeding by induction and using the definition of $R_n$ and also Claim 2, we see that
\[R_n=\hat{R_{n-1}}Q_{nn}=\hat{Q_{(n-1)1}}\hat{Q_{(n-1)2}}\dots\hat{Q_{(n-1)(n-1)}}Q_{nn}=\]
\[=Q_{n1}Q_{n2}\dots Q_{n(n-1)}Q_{nn}.\blacksquare\]
Now take the $k$-th term from the right in $R_n$. Using the identity of Claim 4, we see that this is inside some sequence $Q_{ni}$, at place number $j$ (from the left). Because of Claim 1, this implies
\[k=\binom {n-1}0+\binom{n-1}1+\dots+\binom{n-1}{i-2}+j=\]
\[=\binom{n-1}{n-1}+\binom{n-1}{n-2}+\dots+\binom{n-1}{n+1-i}+j.\]
Hence, using Claim 1 again, we find that the $k$-th term from the right in $R_n$ is none other than the $j$-th term from the right in $Q_{n(n+1-i)}$. By Claim 3, this implies the statement of the problem.