Catalan words avoiding pairs of length three patterns

Catalan words are particular growth-restricted words counted by the eponymous integer sequence. In this article we consider Catalan words avoiding a pair of patterns of length 3, pursuing the recent initiating work of the first and last authors and of S. Kirgizov where (among other things) the enumeration of Catalan words avoiding a patterns of length 3 is completed. More precisely, we explore systematically the structural properties of the sets of words under consideration and give enumerating results by means of recursive decomposition, constructive bijections or bivariate generating functions with respect to the length and descent number. Some of the obtained enumerating sequences are known, and thus the corresponding results establish new combinatorial interpretations for them.


Introduction and notation
Catalan words are particular growth-restricted words and they represent still another combinatorial class counted by the Catalan numbers, see for instance [12, exercise 6.19.u, p. 222]. This paper contributes to a recent line of research on classical pattern avoidance on words subject to some growth restrictions (for instance, ascent sequences [2,6], inversion sequences [5,10,14], restricted growth functions [4,9]) by investigating connections between sequences on the On-line Encyclopedia of Integer Sequences [11] and Catalan words avoiding two patterns of length 3.
Through this paper we consider words over the set of non-negative integers and we denote such words by sequences (for instance w 1 w 2 . . . w n ) or by italicized boldface letter (for instance w and u). The word w = w 1 w 2 . . . w n is called a Catalan word if w 1 = 0 and 0 ≤ w i ≤ w i−1 + 1 for i = 2, 3, . . . , n.
Catalan words are in bijection with maybe the most celebrated combinatorial class having the same enumerating sequence: Dyck paths (i) . Indeed, in a length 2n Dyck path collecting for the up steps the ordinates of their starting points we obtain a length n Catalan word, and this construction is a bijection. See Figure 1 where this bijection is depicted for an example. We denote by C n the set of length n Catalan words and c n = |C n | is the nth Catalan number 1 n+1 2n n . A pattern is a word with the property that if i occurs in it, then so does j, for any j with 0 ≤ j < i. A pattern π = π 1 π 2 . . . π k is said to be contained in the word w = w 1 w 2 . . . w n , k ≤ n, if there is a sub-word of w, w i1 w i2 . . . w i k , order-isomorphic with π 1 π 2 . . . π k . If w does not contain π, we say that w avoids π, see for instance Kitaev's seminal book [7] on this topic.
For a pattern π, we denote by C n (π) the set of length n Catalan words avoiding π, and c n (π) = |C n (π)| is the cardinality of C n (π) and C(π) = ∪ n≥0 C n (π). For example, C n (101) is the set of length n Catalan words avoiding 101, that is, the set of words w in C n such that there are no i, j and k, 1 ≤ i < j < k ≤ n, with w i = w k > w j . So, C 4 (101) = {0000, 0001, 0010, 0011, 0012, 0100, 0110, 0111, 0112, 0120, 0121, 0122, 0123}. Likewise, if π is the set of patterns {α, β, . . . }, then C n (π) and C n (α, β, . . . ) denote both the set of length n Catalan words avoiding each pattern in π; and c n (π) = c n (α, β, . . . ) and C(π) = C(α, β, . . . ) have similar meaning as above. A descent in a word w = w 1 w 2 . . . w n is a position i, 1 ≤ i ≤ n − 1, with w i > w i+1 . The (ordinary) generating function of a set of pattern avoiding Catalan words C(π) is the formal power series C π (x) = n≥0 c n (π)x n = w∈C(π) x |w| , where |w| is the length of the word w. In our case of generating function approach for counting classes of pattern avoiding Catalan words we consider the descent number as an additional statistic obtaining 'for free' the bivariate generating function C π (x, y) = w∈C(π) x |w| y des(w) , where des(w) is the number of descents of w. With these notations, the coefficient of x n y k in C π (x, y) is the number of Catalan words of length n avoiding π and having k descents, and for a set S of Catalan words S(x) and S(x, y) have similar meaning. For a word w = w 1 w 2 . . . w n and an integer a, we denote by (w + a) the word obtained from w by increasing by a each of its entries, that is, the word (w 1 + a)(w 2 + a) · · · (w n + a). In our constructions we will often make use of two particular families of Catalan words: those avoiding 10 (i.e., with no descents) and we call these words weakly increasing (or w.i for short) Catalan words; and those avoiding 00 (and thus necessarily avoiding 10) and we call these words strictly increasing (or s.i for short) Catalan words. It is easy to see that for each length n ≥ 1 there are 2 n−1 w.i. Catalan words and one s.i. Catalan word.
The remaining of this paper is structured as follows. In the next section we characterize pattern avoiding ascent sequences which are Catalan words, establishing ties with some similar enumerative results for ascent sequences in [2]. In Section 3 we consider classes of Catalan words avoiding both a length two and a length three pattern. In the next sections we discuss Catalan words avoiding two patterns of length three, in increasing order of their complexity: obvious cases (Section 4), cases counted via recurrences (Section 5) and cases counted via generating functions (Section 6); these results are summarized in Table 2. We conclude with some remarks and further research directions. 2 Catalan words vs. ascent sequences An ascent in a word w = w 1 w 2 . . . w n is a position i, 1 ≤ i ≤ n − 1, with w i < w i+1 , and asc(w) denotes the number of ascents in w. Closely related to Catalan words are ascent sequences introduced in [3] and defined as: the word w = w 1 w 2 . . . w n is called an ascent sequence if w 1 = 0 and 0 ≤ w i ≤ asc(w 1 w 2 . . . w i−1 ) + 1 for i = 2, 3, . . . , n, and A n denotes the set of length n ascent sequences, and A = ∪ n≥0 A n . Similarly as for Catalan words, if π is a pattern, then A n (π) is the set of length n ascent sequences avoiding π, and A(π) = ∪ n≥0 A n (π). Clearly, C n = A n for n ≤ 3, and C n ⊂ A n for n ≥ 4, and this inclusion is strict, for instance 0102 ∈ A 4 \ C 4 . It turns out that, for particular patterns π, A n (π) collapses to C n (π) for any n, and this behaviour where the pattern 0102 plays a critical role is discussed below.
Proposition 1. If w ∈ A \ C, then w contains the pattern 0102.
Proof: If w = w 1 w 2 . . . w n is an ascent sequence which is not a Catalan word, then there is an i such that w i ≥ w i−1 + 2, and let k be the smallest such i. It follows that w i ≤ w i−1 + 1 for any i, 2 ≤ i ≤ k − 1, or equivalently w 1 w 2 . . . w k−1 is a Catalan word. Thus, if w i > 0, 2 ≤ i ≤ k − 1, then each symbol less than w i occurs in the prefix w 1 w 2 . . . w i−1 . We distinguish two cases: (i) w k−1 is not the maximal symbol of the prefix w 1 w 2 . . . w k−1 , and (ii) otherwise.
(i) In this case there exist i and j, 1 ≤ i < j < k − 1, such that w j = w k−1 + 1 and w i = w k−1 . It follows that w i w j w k−1 w k is an occurrence of 0102.
(ii) In this case the prefix w 1 w 2 . . . w k−1 has a descent (otherwise, since w is an ascent sequence, the maximal possible value for w k is w k−1 + 1), and let j be such a descent, that is w j > w j+1 , j + 1 < k − 1.
As noticed above, the symbol w j+1 already occurs in w 1 w 2 . . . w j−1 , say in position i. Thus, w i w j w j+1 w k is an occurrence of 0102.
Since the only patterns of length three of 0102 are 001, 010, 012 and 102, we have the following consequence of Proposition 2.
Pattern avoidance in ascent sequences was initiated in [6], and in [2] ascent sequences avoiding a pair of patterns of length three are considered and exact enumeration for several such pairs are given. In light of Corollary 1 it can happen that if a pattern of the avoided pair is one of the four specified in this corollary, then the resulting ascent sequences are Catalan words as well. The pairs of avoided patterns for which ascent sequences and Catalan words coincide, and for which the enumeration has already been considered in [2] are highlighted in the summarizing Table 2. In order to keep the present article self-contained we fully consider these cases, our proofs being alternative to those in [2].

Avoiding a length two and a length three pattern
There are three patterns of length two, namely 00, 01 and 10, and we have: Proposition 3. The number of Catalan words avoiding a pattern of length two and a pattern π of length three is given by: c n (00, π) = 0 if π = 012 and n ≥ 3, 1 elsewhere; c n (01, π) = 0 if π = 000 and n ≥ 3, 1 elsewhere; , 011, 012}, 2 n−1 elsewhere, where F n is the nth Fibonacci number defined by F 0 = F 1 = 1 and F n = F n−1 + F n−2 , n ≥ 2.
Finally, a Catalan word avoids 10 if and only if it avoids 010. It follows that c n (10, π) = c n (010, π), which falls in the case of avoidance of two length 3 patterns and the corresponding proofs are given in the next section, see also Table 2.

Superfluous patterns
If the pattern τ contains the pattern σ, then clearly C n (σ, τ ) = C n (σ); but this phenomenon can occur even when σ and τ are not related by containment and in this case, following [2], we say that τ is a superfluous pattern for σ. For example, any word in C n (012) is a binary word, and thus any pattern with at least three different symbols is a superfluous pattern for 012. In Table 1 are listed all pairs of superfluous patterns of length three. It is worth to mentioning that superfluousness is a transitive relation, for instance 201 is superfluous for 021 which in turn is superfluous for 011. So, a pattern can be superfluous for several other ones, for instance τ = 201 is superfluous for each of the patterns 001, 010, 011, 012, 021, 101, 120. Also it is easy to see that if τ is superfluous for σ, then τ is larger lexicographically than σ.

Ultimately constant sequences
It can happen that the number of Catalan words avoiding a pair of length 3 patterns is constant for enough long words. The only two such cases are given below. Proof: If n ≥ 3, then C n (000, 011) = {0x, x0, x(n − 1)} where x is the word 01 · · · (n − 2), and the first point follows. If a Catalan word avoids 012, then it is a binary word. In addition if its length is larger than 4 it necessarily contains three identical entries, and so C n (000, 012) = ∅ for n ≥ 5. Considering the initial values of c n (000, 012) the second point follows.
Counting sequence n Proof: The proof is based on the easy to understand description given below for the corresponding sets of Catalan words:
Proof: If π = {011, 100} and w ∈ C n (π), n ≥ 2, then either − w = 0 k u, 0 ≤ k ≤ n − 1, with u a s.i. Catalan word (of length at least one), or with u a s.i. Catalan word (of length at least two). In the first case there are n possibilities for w and n − 2 possibilities in the second case, and the result holds. If π = {011, 120} and w ∈ C n (π), n ≥ 2, then either and as previously the result holds.
Proof: If a Catalan word avoids 101, then it is unimodal (that is, it can be written not necessarily in a unique way as uv with u a weakly decreasing and v weakly decreasing word). In addition, if the word avoids 000, then its maximal value occurs at most twice, and when it occurs twice this happens in consecutive positions. We denote by D n the subset of words in C n (π) where the maximal entry occurs once and by E n that where it occurs twice, d n = |D n |, e n = |E n |, and c n (π) = d n + e n . Any word w = w 1 · · · mm · · · w n−1 ∈ E n−1 with its maximal value m occurring twice can be extended into a word in D n by one of the transformations: w → w 1 · · · m(m + 1)m · · · w n−1 , and w → w 1 · · · mm(m + 1) · · · w n−1 , and any word w = w 1 · · · m · · · w n−1 ∈ D n−1 with its maximal value m occurring once can be extended into a word in D n by: Conversely, any word in D n , n ≥ 2, can uniquely be obtained from a word in D n−1 or in E n−1 by reversing one of the transformations above, so d n = 2 · e n−1 + d n−1 , Reasoning in a similar way we have e n = 2 · e n−2 + d n−2 , Thus, for n ≥ 3, e n = d n−1 , and finally and with the initial conditions c 1 (π) = 1 and c 2 (π) = 2, the result follows.
The number of words in each of the first two cases is c n−1 (π). The number of length k w.i. Catalan words is 2 k−1 , so the number of words in the last case is Thus, c n (π) = 2c n−1 (π) + 2 n−2 − 1, and after calculation the result holds.
In the first case the number of words w is 2 n−1 and in the second case the number of words w is 2 n−2 − 1.
In last case the number of words w is Combining these cases and considering the initial values of c n (π) the result holds.
If π = {101, 110} and w ∈ C n (π), n ≥ 3, then either The number of words w in each of the first two cases is c n−1 (π). For the last case, for each k there is exactly one word w, so their number is (n − 2) in this case. So c n (π) = 2c n−1 (π) + n − 2 and after calculation the result holds.
Proof: If w ∈ C n (π), n ≥ 4, then either − w = 0u0 with u a length (n − 2) binary word, or − w = 0(u + 1) with u a length (n − 1) w.i. Catalan word, or − w = 0u0(v + 1) with u a binary word and v w.i. Catalan word. The number of words in each of the first two cases is 2 n−2 and the number of words in the last case is and so c n (π) = 2 n−1 + (n − 2)2 n−3 , which gives the desired result.
If a Catalan word avoids both 102 and 110, then it has at most one descent. In the second part of the proof of the next proposition we need the following technical lemma which gives the number of Catalan words in C n (102, 110) with one descent and avoiding the pattern 00 before the descent (note that in this case avoiding 00 is equivalent to avoiding equal consecutive entries). The set of these words is empty for n ≤ 2, it is the single word set {010} for n = 3, and {0100, 0101, 0120, 0121} for n = 4. Lemma 1. Let D n be the set of words in C n (102, 110) having one descent and avoiding 00 before the descent. Then |D n | = n 6 (n − 1)(n − 2).
Proof: A word belongs to D n , n ≥ 3, if and only if it can be written as and after calculation the statement holds.
Proof: If π = {021, 102} and w ∈ C n (π), n ≥ 3, then either − w = 0u with u a length (n − 1) binary word, or − w = 0 · · · 0(u + 1)0 · · · 0 with u a length k, 2 ≤ k ≤ n − 1, w.i. Catalan word other than 00 · · · 0 and w beginning by at least one 0. The number of words in the first case is 2 n−1 and the number of those in the second case is and combining the two cases the result holds.
If π = {102, 110} and w ∈ C n (π), then either − w is a w.i. Catalan word, the number of such words is and v is a word belonging to D n−k . Indeed, the first case corresponds to words with no descents, the second one to those with a descent and no occurrences of 00 before the descent, and the third one to those with both descent and occurrences of 00 before the descent (the rightmost such occurrence is in positions k and k + 1). By Lemma 1, the number of words in the third case is Finally, combining the three previous cases the desired result holds.

Sequences involving binomial coefficients
In this part we use the notation ab · · · cd ↑ i e · · · f to denote that the entry d is in position i in the word ab · · · cde · · · f . Proposition 12. If π = {001, 210}, then c n (π) = n 3 + n for n ≥ 3 (A000125 in [11]).
Proof: If w ∈ C n (π), then it has at most one descent. If w has no descents, then it has the form w = 01 · · · (m − 1)m · · · m and there are n such words. If w has one descent, then it has the form w = 01 · · · (m − 1)m · · · mk · · · k with 0 ≤ k < m < n − 1. It follows that there is a bijection between the family of 3-element subsets of {0, 1, . . . , n − 1} and the words in C n (π) with one descent: Combining the two cases we have c n (π) = n 3 + n. Proof: In any of the six cases for π, the set C n (π) is in bijection with the family S of subsets of {2, . . . , n} with at most two elements. We give below explicit definitions for such bijections, where the empty set is mapped to 0 · · · 0 ∈ C n (π) by each of them.

Sequences involving Fibonacci(-like) numbers
As in Proposition 3, we consider the sequence of Fibonacci numbers (F n ) n≥0 defined as F 0 = 1, F 1 = 1 and F n = F n−1 + F n−2 for n ≥ 2.
Proof: For π = {000, 001} the proof is up to a certain point similar to that of Proposition 7. A word belonging to C n (π) is unimodal and its maximal entry occurs once or twice in consecutive positions. Let D n denote the subset of words in C n (π) where the maximal entry occurs once and E n denote that where it occurs twice. If w ∈ C n (π) has its maximal entry m, then the insertion of (m + 1) after the leftmost occurrence of m in w produces a word in D n+1 , and the insertion of (m + 1)(m + 1) produces a word in E n+2 . It is easy to see that these transformations induce a bijection between C n (π) and D n+1 , and between C n (π) and E n+2 , and thus between C n−2 (π) ∪ C n−1 (π) and C n (π). It follows that c n (π) satisfies a Fibonacci-like recurrence, and by considering the initial values for c n (π) the result holds.
For π = {000, 010}, a word w ∈ C n (π) is characterized by: w is w.i. and w does not have three consecutive equal entries. So w can be represented by the binary word b 1 b 2 . . . b n−1 with no two consecutive 1s This representation is a bijection between C n (π) and the set of binary words of length (n − 1) without two consecutive 1s, which cardinality is the Fibonacci number, see for instance [13].
Proof: If w ∈ C n (π), n ≥ 2, then either − w = 0u with u ∈ C n−1 (π), or − w = 0(u + 1) with u ∈ C n−1 (π), or − w = 0(u + 1)0 with u ∈ C n−2 (π). In both of the first two cases the numbers of words w is c n−1 (π) and it is c n−2 (π) in the last case. So, c n (π) satisfies Pell numbers recurrence and considering its initial values the statement holds.

Counting via generating function
Here we give bivariate generating functions C π (x, y) where the coefficient of x n y k is the number of Catalan words of length n having k descents and avoiding π, for each of the remaining pairs π of patterns of length 3. Plugging y = 1 in C π (x, y) we obtain C π (x) = C π (x, 1) where the coefficient of x n is the number of Catalan words of length n avoiding π. All the obtained enumerating sequences are not yet recorded in [11], except that for: π = {100, 120} and for π = {110, 120} (see Corollary 3) and presumably for π = {100, 210} (see Corollary 15). In almost all the proofs of the next propositions the desired generating function is the solution of a functional equation satisfied by it.
Proposition 19. If π = {100, 120}, then Proof: A word w ∈ C(π) is in one of the following cases: − w is a w.i. Catalan word, − w = u(m − 1)(v + m) where u is a w.i. Catalan word other than 00 · · · 0, m is the largest (last) entry of u and v ∈ C(π). The generating function for the words of the first form is 1−x 1−2x and the generating function for the words of the second form is Combining these cases we deduce the functional equation below which solution gives the desired result: Proposition 20. If π = {110, 120}, then Proof: A word w ∈ C(π) is in one of the following cases: − w is a w.i. Catalan word, − w = u(m + 1)v where u is a non-empty w.i. Catalan word, m is the largest (last) entry of u and v is a word of the form mm · · · m(x + m + 1) with at least one m in its prefix and x ∈ C(π). The generating function for the words of the first form is 1−x 1−2x . For the second form, the generating function for the words u is 1−x 1−2x − 1 = x 1−2x , and the generating function for the words mm · · · m(x + m + 1) is x 1−x · C π (x, y). Thus, the generating function for the words of the second form is Combining these cases we deduce the functional equation The functional equations in the proofs of Propositions 19 and 20 are different but the resulting bivariate generating functions are the same. Instantiating y by 1 in C π (x, y) of these propositions we have the next corollary.
and c n (π) is the sequence A034943 in [11].
Proposition 21. If π = {021, 110}, then Proof: A non-empty word w ∈ C(π) is in one of the following cases: − w = 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − w = 0(u + 1) where u is a non-empty w.i. Catalan word; the generating function for these words is x · x 1−2x , − w = 01u where u is a non-empty w.i. Catalan word; the generating function for these words is where u is a s.i. Catalan word of length at least three and w ending by at least one 0; the generating function for these words is y · x 4 (1−x) 2 . Combining these cases and considering the empty word which contributes with 1 to C π (x, y), we deduce the functional equation Corollary 4. If π = {021, 110}, then Proposition 22. If π = {110, 201}, then .
Proof: A non-empty word w ∈ C(π) is in one of the following cases: − w = 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − w = 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − w = u0 · · · 0 where u is a s.i. Catalan word of length at least 2 and w ending by at least one 0; the generating function for these words is y · x 3 (1−x) 2 , − w = 010 · · · 0(u + 1) where u is a non-empty word in C(π) and w beginning by 010; the generating function for these words is y · x 3 · 1 1−x · (C π (x) − 1). Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Proposition 23. If π = {102, 201}, then Proof: A non-empty word w ∈ C(π) is in one of the following cases: − w = 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − w = 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − w = 0(v + 1)0 · · · 0 where u is a non-empty word in C(π) and w ending by at least one 0; the generating function for these words is y · x 2 · 1 1−x · (C π (x, y) − 1), − w = 01 · · · 1u where u is a binary word beginning by a 0 and different from 0 · · · 0, or equivalently, u a word in C(012) other than 0 · · · 0; the generating function for these words is . Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Corollary 6. If π = {102, 201}, then Proposition 24. If π = {100, 110}, then .
Proof: A non-empty word in C(π) has one of the following forms: − 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − u(m + 1)(m + 2)v where u and v are non-empty s.i. Catalan words, m is the largest entry of u and the length of v is less than or equal to that of u; the generating function for these words is where u is a non-empty s.i. Catalan word, m is the largest entry of u and v ∈ C(π); the generating function for these words is y · x 3 · 1 1−x 2 · C π (x, y). Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Proposition 25. If π = {000, 110}, then .
Proof: A non-empty word in C(π) has one of the following forms: − 0(u + 1) where u ∈ C(π); the generating function for these words is x · C π (x, y), − uu(v + m + 1) where u is a non-empty s.i. Catalan word, m is the largest (last) entry of u and v ∈ C(π); the generating function for these words is y · x 2 1−x 2 · C π (x, y), − u(m + 1)v where u and m are as above, and v is a non-empty s.i. Catalan word of length less than that of u; the generating function for these words is y · x 3 · (1 + x) · 1 (1−x 2 ) 2 . Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Proposition 26. If π = {000, 102} or π = {000, 201}, then Proof: If π = {000, 102}, then a non-empty word in C(π) has one of the following forms: − 0(u + 1) where u ∈ C(π); the generating function for these words is x · C π (x, y), − 00(u + 1) where u ∈ C(π); the generating function for these words is x 2 · C π (x, y), − 0(u + 1)0 where u is a non-empty word in C(π); the generating function for these words is y · x 2 · (C π (x, y) − 1), − 01(u + 2)01 where u ∈ C(π); the generating function for these words is y · x 4 · C π (x, y).
Proposition 27. If π = {000, 120}, then Proof: A non-empty word in C(π) has one of the following forms: − 0(u + 1) where u ∈ C(π); the generating function for these words is x · C π (x, y), − 00(u + 1) where u ∈ C(π); the generating function for these words is x 2 · C π (x, y), − 0101(u + 2) where u ∈ C(π); the generating function for these words is y · x 4 · C π (x, y). Apart from these general cases, there are two other fixed length ones: − 010; the corresponding generating function is y · x 3 , − 0110; the corresponding generating function is y · x 4 . Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation C π (x, y) = 1 + x · C π (x, y) + x 2 · C π (x, y) + y · x 4 · C π (x, y) + y · x 3 + y · x 4 . Corollary 10. If π = {000, 120}, then Proposition 28. If π = {201, 210}, then Proof: A non-empty word w in C(π) has one of the following forms: − 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − 01 · · · 1u where u is a non-empty word in C(π) and 01 is a prefix of w; the generating function for these words is y · x 2 1−x · (C π (x, y) − 1), − 0(u + 1)0 . . . 0 where u is a w.i. Catalan word other than 0 · · · 0 and w ending by a 0; the generating function for these words is y · . Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation C π (x, y) = 1+x·C π (x, y)+x·(C π (x, y)−1)+y · Corollary 11. If π = {201, 210}, then Proposition 29. If π = {102, 210}, then Proof: A non-empty word w in C(π) has one of the following forms: − 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − 01 · · · 1u where u is a non-empty word in C(012), and w begins by 01; the generating function for these words is y · for the generating function of C 012 (x, y)), − 0(u + 1)v where u is a w.i. Catalan word of length at least 2 different from 0 · · · 0 and v is a nonempty word in C(010, 012) (see Proposition 5); the generating function for these words is . Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Corollary 12. If π = {102, 210}, then Proposition 30. If π = {100, 102}, then Proof: A non-empty word in C(π) has one of the following forms: − 0u where u ∈ C(π); the generating function for these words is x · C π (x, y), − 0(u + 1) where u is a non-empty word in C(π); the generating function for these words is x · (C π (x, y) − 1), − 0(u + 1)0 where u is as above; the generating function for these words is y · x 2 · (C π (x, y) − 1), − 011 · · · 1(u + 2)01 where u is as above; the generating function for these words is y · x 4 1−x (C π (x, y) − 1), − uv where u and v are binary words of length at least 2 of the form 011 · · · 1; the generating function for these words is y · x 4 (1−x) 2 .
Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation C π (x, y) = 1+x·C π (x, y)+x·(C π (x, y)−1)+y·x 2 ·(C π (x, y)−1)+y· Corollary 13. If π = {100, 102}, then In the proof of the next proposition we need the following lemma where the generating functions for some particular subsets of C(000, 210) are given.
Lemma 2. The bivariate generating function corresponding to 1. the set A of words uu with u a non-empty s.i. Catalan word is A(x, y) = x 2 + yx 2 · x 2 1−x 2 and A(x) = x 2 1−x 2 ; 2. the set B of words uv with u and v non-empty s.i. Catalan words and the length of v is less than or equal to that of u is B(x, y) = y · x 2 1−x 2 · 1 1−x ; 3. the set D of words uv with u and v non-empty s.i. Catalan words and the length of v is less than that of u is D(x, y) = y · x 2 1−x 2 · x 1−x . Proof: 1. For any even n there is exactly one word of this form, so the monovariate corresponding generating function is x 2 1−x 2 ; and only words of length larger than two have one descent. 2. The transformation (uu, x) → uxu where uu ∈ A and x is a s.i. Catalan word defines a bijection between pairs of such words and B, and thus B(x, y) = y · A(x) · 1 1−x . 3. Similarly as point 2.
Proof: A non-empty word in C(000, 210) has one of the following forms: u with u ∈ D and D as in Lemma 2; the generating function for these words is D(x, y) = y · x 2 1−x 2 · x 1−x , u(m + 1)(m + 1)(x+ m + 2)v with u and v non-empty s.i. Catalan words and the length of v is less than or equal to that of u, m is the largest entry of u, and x ∈ C(000, 010); the generating function for these words is see Lemma 2 and Proposition  14), -0(u + 1) where u ∈ C(π); the generating function for these words is x · C π (x, y), uu(v + m + 1) where u is a non-empty s.i. Catalan word, m the largest entry of u and v ∈ C(π); the generating function for these words is A(x, y) · C π (x, y). Combining these cases and adding 1 corresponding to the empty word we deduce the functional equation Corollary 14. If π = {000, 210}, then In the proof of the next proposition we need the following lemma where the generating functions for two subsets of C(100, 210) are given.
1. The generating function corresponding to the set E of words uv with u a w.i. Catalan word, v a non-empty s.i. Catalan word and the largest entry of v is equal to that of u minus 1 is The generating function corresponding to the set F of words uv with u a w.i. Catalan word, v a nonempty s.i. Catalan word and the largest entry of v is less than that of u minus 1 is Proof: 1. If E n is the set of words of length n in E, then E n = ∅ for 0 ≤ i ≤ 2, E 3 = {010} and E 4 = {0010, 0110}. With u and v as above, for any n ≥ 3, the transformation uv → uav, with a the maximal entry of u, transforms a word in E n into one in E n+1 where the maximal entry occurs at least twice, uv → u(a + 1)v(b + 1), with a and b the maximal entries of u and of v respectively, transforms a word in E n into one in E n+2 where the maximal entry occurs once. Any word in E n , n ≥ 5, except 0 · · · 010, can be obtained in a unique way from either a word in E n−1 or in E n−2 by one of these transformations. This yields the recurrence |E n | = 1 + |E n−1 | + |E n−2 | for n ≥ 5, and the desired generating function is precisely that of the sequence (|E n |) n≥0 . 2. Any pair of words (w, x) with w = uv ∈ E (with u and v as above) and x a non-empty w.i. Catalan word can be transformed into the word uxv ∈ F , and (w, x) → uxv is a bijection, so the generating function for F is that for E multiplied by x 1−2x .
Proof: First we consider only words in C(π) having at least one descent, and we denote by G(x, y) the corresponding generating function, and clearly C π (x, y) = 1−x 1−2x + G(x, y). A word in C(π) with at least one descent has one of the following forms: − u(α + s + 1)(v + s + t + 1) where u and v are both w.i. Catalan words, α belongs to the set E defined in Lemma 3, and s is the largest symbol of u (and for convenience −1 if u is empty) and t that of α; the generating function for these words is y · − u(α + s + 1) where u and s are as above, and α belongs to the set F defined in Lemma 3; the generating function for these words is y · 1−x 1−2x · x 3 (x−1)(x 2 +x−1) · x 1−2x , − u(α + s + 1)(v + s + t + 1) where u and s are as above, α belongs to E, v is a word in C(π) with at least one descent, and t is the largest symbol of α; the generating function for these words is y · 1−x 1−2x · x 3 (x−1)(x 2 +x−1) · G(x, y). It follows that G(x, y) satisfies the functional equation · G(x, y).
Finally, solving it and adding the generating function for the Catalan words with no descents (that is, w.i. Catalan words) the statement holds.

Final remarks
Catalan words are in bijection with Dyck paths (see Figure 1) and thus pattern avoiding Catalan words correspond to restricted Dyck paths. For instance, a Catalan word avoiding 012 corresponds to a Dyck path of height at most two. In this context, it can be of interest to investigate how our results on pattern avoiding Catalan words translate to corresponding restricted Dyck paths. Even if in this article we restrict ourselves to the avoidance of two patterns of length 3, some classes considered here can be trivially extended to larger length patterns, for instance C(102, 201) = C(01012, 01201). In this light, it can be of interest to explore Catalan words avoiding patterns of length 4 or more, triples of patterns or generalized patterns.