TITLE: A family of words counted by the Catalan numbers
QUESTION [37 upvotes]: In recent work with Michael Albert and Nik Ruškuc, a family of words has arisen which is counted by the Catalan numbers. I've looked at Richard Stanley's Catalan exercises in EC2 and his Catalan addendum, but I don't see anything that looks to be clearly equivalent, and a bijection to Dyck paths isn't jumping out at me. So I have two questions:


Has anyone seen these words, or some equivalent objects, before?
Do you see a nice bijection between these words and any family of "classic" Catalan objects such as Dyck paths or noncrossing partitions?


Let $w$ be a word of length $n$ over the natural numbers (including $0$). Then $w$ lies in our family if it satisfies two rules:

For all $k\le n-1$, $w_{k+1}\ge w_k-1$.
If $w$ contains an $i\ge 1$, then the first $i$ lies between two $i-1$s.

(The word "between" does not imply contiguity, so rule 2 means that when we read $w$ from left to right, we should see an $i-1$ before we see the first $i$, and then at some point after that we should see another $i-1$.)
The number of words of length $n$ that satisfy these conditions is equal to the $n-1$st Catalan number.
For example, the only word of length $2$ that satisfies these rules is $00$, for length $3$ there are two such words, $000$ and $010$, for length $4$ there are five,
$$
0000, 0010, 0100, 0101, 0110,
$$
and for length $5$ there are $14$,
$$
00000, 00010, 00100, 00101, 00110, 01000, 01001,
$$
$$
01010, 01011, 01021, 01100, 01101, 01110, 01210.
$$

REPLY [3 votes]: This answer summarizes partial progress which was interesting enough to lead to its own question.
Consider sequences which only obey your first condition. Call these $L$-words. ($L$ stands for Lukasiwiecz, because they are more or less the partial sums of the sequences studied by Lukaswiecz.)
There are Catalan many $L$-words. Given an $L$-word, let $p$ be the number of pairs $(i,i+1)$ for which your second rule is violated. So we want to count pairs with $p=0$. Also, let $q+1$ be the number of occurrences of $0$ in the $L$-word. Here is a table:
$$\begin{matrix}
L-\mbox{word} & p & q \\
000 & 0 & 2 \\
010 & 0 & 1 \\
001 & 1 & 1 \\
011 & 1 & 0 \\
012 & 2 & 0 \\
\end{matrix}$$
It appears that the number of $L$-words of length $n$ with given values of $p$ and $q$ only depends on $(p+q, n)$! See my question for more.