On partially ordered patterns of length 4 and 5 in permutations

Partially ordered patterns (POPs) generalize the notion of classical patterns studied widely in the literature in the context of permutations, words, compositions and partitions. In an occurrence of a POP, the relative order of some of the elements is not important. Thus, any POP of length $k$ is defined by a partially ordered set on $k$ elements, and classical patterns correspond to $k$-element chains. The notion of a POP provides a convenient language to deal with larger sets of permutation patterns. This paper contributes to a long line of research on classical permutation patterns of length 4 and 5, and beyond, by conducting a systematic search of connections between sequences in the Online Encyclopedia of Integer Sequences (OEIS) and permutations avoiding POPs of length 4 and 5. As the result, we (i) obtain 13 new enumerative results for classical patterns of length 4 and 5, and a number of results for patterns of arbitrary length, (ii) collect under one roof many sporadic results in the literature related to avoidance of patterns of length 4 and 5, and (iii) conjecture 6 connections to the OEIS. Among the most intriguing bijective questions we state, 7 are related to explaining Wilf-equivalence of various sets of patterns, e.g.\ 5 or 8 patterns of length 4, and 2 or 6 patterns of length~5.


Introduction
An occurrence of a (classical) permutation pattern p = p 1 · · · p k in a permutation π = π 1 · · · π n is a subsequence π i 1 · · · π i k , where 1 ≤ i 1 < · · · < i k ≤ n, such that π i j < π im if and only if p j < p m . For example, the permutation 31425 has three occurrences of the pattern 123, namely, the subsequences 345, 145, and 125. Permutation patterns are the subject of lots of interest in the literature (e.g. see [20] and references therein).
A partially ordered pattern (POP) p of length k is defined by a k-element partially ordered set (poset) P labeled by the elements in {1, . . . , k}. An occurrence of such a POP p in a permutation π = π 1 · · · π n is a subsequence π i 1 · · · π i k , where 1 ≤ i 1 < · · · < i k ≤ n, such that π i j < π im if and only if j < m in P . Thus, a classical pattern of length k corresponds to a kelement chain. For example, the POP p = 3 2 1 occurs five times in the permutation 41523, namely, as the subsequences 412, 413, 452, 453, and 523. Clearly, avoiding p is the same as avoiding the patterns 312, 321 and 231 at the same time. POPs can also be defined using one-line notation by providing the minimal set of relations defining the respective poset. For example, the POP in the example above can be defined by {1 > 3}, while the POP in Theorem 3. 16 can be defined by {1 > 3, 1 > 2, 4 > 2}.
POPs were introduced in [16], and they were studied in the context of permutations, words and compositions in [15,17,18,19,21,22]. The notion of a POP provides a uniform notation for several combinatorial structures such as peaks, valleys, modified maxima and minima, p-descents in permutations, and many others [19]. Moreover, POPs provide a convenient language to deal with larger sets of permutation patterns. Thus, by noticing connections to POPs, in this paper we collect under one roof many sporadic results in the literature related to the avoidance of patterns of length 4 and 5. For example, the simultaneous avoidance of the patterns 3214, 3124, 2134, and 2143 considered, up to trivial bijections, in [12] is nothing else but the avoidance of the POP  In any case, the starting point in our project was utilization of the software produced by Stephen Gardiner in 2018 as part of his MSc studies at the University of Strathclyde. The software is able to go exhaustively through all POPs of length 4 and 5 (length 3 POPs are rather trivial in our context and were omitted) and detect any connections to the Online Encyclopedia of Integer Sequences (OEIS) [28]. So, our original goal was to explore the variety of objects in the OEIS that are equinumerous to length 4, 5 POPavoiding permutations, and to justify any observations, which often required non-trivial enumeration or a bijection, but sometimes were given "for free" via exactly the same pattern avoidance studied previously. Some of our results for length 4, 5 POP-avoiding permutations follow from more general theorems we prove.
We ended up with observing connections to 38 sequences in the OEIS, out of which 18 sequences have no known interpretation in terms of pattern avoidance. We justified all but 6 connections all related to POPs of length 5. Also, in our studies, we obtain 13 new enumerations for pattern avoiding permutations for patterns of length 4 and 5, in particular, contributing to a long line of enumerative results on length 4 patterns, e.g. with enumeration of triples of such patterns being concluded in [11].
Our results can be found in Tables 1-4, and our conjectures in Table 5. Also, in Section 2 we give a number of general results. Note that all these results can give new results for many more patterns/POPs using Theorem 2.1, which discusses equivalence modulo the complement of poset labels, or reflecting a poset with respect to a horizontal line. However, we would like to stress that the goal of this paper is not in achieving any classifications (which is an interesting direction, of course), instead considering just a single POP corresponding to a sequence in the OEIS.
Permutations of length n are called n-permutations in this paper, and S n denotes the set of all n-permutations. For an n-permutation π, the complement c(π) of π is obtained from π by replacing each element x by n + 1 − x. The same operation is well-defined on labels {1, 2, . . . , n} of an n-element poset. Also, the reverse r(π) of π is obtained by writing the elements of π in the reverse order. The complement, reverse, and usual group theoretical inverse are known as trivial bijections from S n to S n .
We let S n (p) be the set of n-permutations avoiding p. Patterns p 1 and p 2 are Wilf-equivalent if for n ≥ 0, |S n (p 1 )| = |S n (p 2 )|. The definition of Wilf-equivalence can be naturally extended to the simultaneous avoidance of sets of patterns. For example, Remark 3.22 discusses three non-trivially Wilf-equivalent to each other triples of patterns. For the highlighted OEIS sequences no interpretation in terms of permutation patterns was known until this work. The connections to permutation patterns in A129952, A025192, A006012, A000984 are via [8], [4], [5], [12], respectively.

POP
Throughout this paper, we let a(n) denote the number of n-permutations avoiding a pattern p in question, that is, a(n) = |S n (p)|. Occasionally, we introduce other sequences of numbers like b(n), but their meaning is defined explicitly in the context. We also let g.f. stand for "generating function". Finally, in this paper, we let F (n) denote the n-th Fibonacci number defined by F (0) = F (1) = 1 and F (n) = F (n − 1) + F (n − 2) for n ≥ 2.
This paper is organized as follows. In Section 2 we provide a number of general results on certain posets of arbitrary length used by us to explain 12 connections to the OEIS. In Sections 3 and 4 we explain connections for POPs of length 4 and 5, respectively. Finally, in Section 5 we provide some concluding remarks and state a number of directions of further research.  Table 2: POPs of length 4 with longest chain of size 2. For the highlighted OEIS sequences no interpretation in terms of permutation patterns was known until this work. Connections to A111281, A002605, A111282, A111277 are via [1], [13], [1], [1], respectively.

General results
We begin with the following theorem that allows to obtain results for many more POPs based on already obtained results.
Theorem 2.1. Let p be a POP of size k. Also, let p ′ be the POP obtained from p by applying the complement operation on its labels, that is, by replacing a label x by k +1−x. Moreover, let p ′′ be the POP obtained from p by flipping the poset with respect to a horizontal line. Then, |S n (p)| = |S n (p ′ )| = |S n (p ′′ )| for any n ≥ 0.
Proof. Note that an n-permutation π avoids p if and only if the reverse r(π) POP Sequence (beginning with n = 1) OEIS Ref  Table 3: POPs of length 4 with longest chain of size 3. Avoiding the POPs in this table is trivially equivalent to avoiding the patterns in the sequences. The enumerations for A049124, A257561, A111279, A106228, A033321, A006318 are coming from [12], [2], [9], [10], [6], [24], respectively. Also, A053617 and A165546 appear in [2] and [25], respectively. avoids p ′ . Also, π avoids p if and only if the complement c(π) avoids p ′′ . The reverse and complement operations give trivial bijections from S n to S n completing our proof.    Table 4: POPs of length 5. For the highlighted OEIS sequences no interpretation in terms of permutation patterns was known until this work. Connection to A128088 is via [7,14]. Note that the a(0) = a(1) = a(2) = 0 in A007531, but the rest is exactly our sequence.
and k ≥ 1. Then, Proof. The base case is straightforward to see, because p cannot occur in such permutations. Now, suppose that n ≥ k. Note that the element n can only be in one of the  Table 5: Conjectured connections for POPs of length 5. For the highlighted OEIS sequences no interpretation in terms of permutation patterns was known until this work. Enumeration for A054872 comes from [3]. Also, A212198 comes from [23,26]. A224295 was obtained using the methods developed in [27].
or else p will occur. Thus, we have k − 1 possibilities to place n. Clearly, for any valid placement of n, we have a(n − 1) such n-permutations. So, a(n) = (k − 1)a(n − 1) giving the desired recursion since a(k − 1) = (k − 1)!.
The g.f. is straightforward to derive. is two independent elements). Then, Proof. The base case is easy to see. Let n ≥ k, K = {1, 2, . . . , k − 2} and π = π 1 π 2 · · · π n is a p-avoiding n-permutation. Note that {π 1 , π n } ∩ K = ∅ or else the elements in {π 1 , π n } ∪ K will form an occurrence of p in π. If x ∈ K and π 1 = x then we have a(n − 1) such permutations because x cannot be involved in an occurrence of p in π. The same holds true if π n = x. Thus, where we subtract the number of permutations beginning and ending with an element in K because they are counted twice by the term 2(k − 2) · a(n − 1).
The g.f. can now be easily derived from the recurrence relation.
Theorem 2.4. Let p be a POP of size k ≥ 1, and the set of labels of isolated (i.e. not comparable to any other elements) nodes include Also, let p 1 be the POP obtained from P by removing the elements corresponding to the labels in I. Finally, let a(n) (resp., b(n)) be the number of n-permutations avoiding p (resp., p 1 ). Then, Proof. The base case is obvious, so assume n ≥ k. Let A, C and B denote the parts of an n-permutation π formed by the first i elements, the last s − i elements, and the remaining elements, respectively. If p occurs in π then it induces an occurrence of p 1 , which cannot begin in A (there are insufficiently many elements to the left of it) or end in C (there are insufficiently many elements to the right of it). Thus, π is p-avoiding if and only if B is p 1avoiding. Since there are no restrictions on the elements in A and C, we can choose them in n s ways and then order in s! ways. Independently, we can order the elements of B in b(n − s) ways, which completes our proof. Theorem 3.2 below is an immediate corollary of the next theorem.
Theorem 2.5. Let p be the POP in Figure 3, where k ≥ 3. Then, Proof. The case of n < k is trivial, so let n ≥ 3. The first n − k + 3 elements of any p-avoiding n-permutation π must avoid the POP p 1 = 3 2 1 which is equivalent to avoiding the patterns 231, 312 and 321, simultaneously, and is given by the (n − k + 4)-th Fibonacci number (see [20,  ways and ordered in (k − 3)! ways, which complete our proof. Alternatively, we can use Theorem 2.4 for p and p 1 in our theorem to obtain the desired result. Theorem 2.6. Let p be the POP in Figure 4, Theorem 2.7. Let p be the POP in Figure 5, where k ≥ 3. Then, p-avoiding n-permutations are in one-to-one correspondence with n-permutations such that for each cycle c the smallest integer interval containing all elements of c has at most k − 1 elements.
Proof. We use a standard bijection ϕ from the cyclic structure of a permutation to one-line notation as follows: arrange all cycles in canonical form, where the largest element inside a cycle is written first, and the cycles are ordered in increasing order of their maximal elements from left-toright. Erase the parentheses, and observe that the maximal elements become the left-to-right maxima in the obtained permutation. For example, ϕ((163)(7)(82)(45)) = 54631782. Suppose π is an n-permutation satisfying the condition on its cycles and x i and x j , i < j, are two left-to-right maxima following each other in ϕ(π) = x 1 · · · x n . The condition on π implies that in ϕ(π) the difference between any two elements in {x i , x i+1 , . . . , x j−1 } is no more than k − 2. The same is true for the set {x ℓ , x ℓ+1 , . . . , x n }, where x ℓ is the largest left-to-right maximum. Let σ = σ 1 · · · σ n be the inverse of ϕ(π). We claim that σ avoids p.
Indeed, suppose that σ contains a subsequence σ i 1 · · · σ i k , 1 ≤ i 1 < · · · < i k ≤ n, which is an occurrence of p. But then, in ϕ(π), we have the element i k to the left of the element i 1 , and i k − i 1 > k − 2. If there are no element z > i k between i k and i 1 in ϕ(π), i 1 and i k must be in the same cycle in π, and we obtain a contradiction. On the other hand, if there is z > i k between i k and i 1 in ϕ(π), consider such a z closest to i 1 . Then, this z and i 1 are in the same cycle in π, and z − i 1 > k − 1, which is a contradiction. So, σ indeed avoids p.
Conversely, consider a cycle in π with a maximum element i k and an element i 1 such that i k − i 1 > k − 2. Then, in σ, we have the elements in positions i 1 < i k forming the pattern 21, and these elements are part of an occurrence of p. This completes our proof.

POPs of length 4 3.1 Results coming from our general theorems
The next theorem gives a new enumerative result on permutations avoiding simultaneously 12 patterns of length 4 in which the first element is larger than the second one. we have This is the sequence A103505 in [28].
Proof. This is an immediate corollary of Theorem 2.4, or Theorem 2.6, with k = 4, s = 2 and b(n) = 1 for n ≥ 0 because only increasing permutations avoid the pattern p 1 = 2 1 . The g.f. can now be easily derived from the recurrence relation.
The next theorem gives a new enumerative result on permutations avoiding simultaneously 12 patterns of length 4 in which the first element is larger than the third one. we have This is essentially the sequence A045925 in [28] (a(0) = 0 in A045925).
Proof. This is an immediate corollary of Theorem 2.5, with k = 4. The g.f.
is not difficult to derive using The p-avoiding n-permutations in the next theorem are equinumerous with S 2 (1, n) in [8] corresponding to a POP whose poset has the same shape as p, but the patterns in question are vincular. we have a(0) = a(1) = 1 and This is the sequence A129952 in [28]. Also, this is essentially the sequence A057711 in [28] (a(0) = 0 in A057711).
Proof. This is an immediate corollary of Theorem 2.4 with k = 4, s = 1 because p 1 -avoiding n-permutations are precisely npermutations avoiding the patterns 312 and 321, simultaneously, and their number is given by 2 n−1 (by applying the complement to the patterns 123 and 132 in [20,  we have This is the sequence A025192 in [28].
Proof. This is an immediate corollary of Theorem 2.2.
This is the sequence A006012 in [28].
Proof. This is an immediate corollary of Theorem 2.3. This is the sequence A000984 in [28].
Proof. This is an immediate corollary of Theorem 2.4 because the number of 213-avoiding n-permutations is well-known to be given by the Catalan numbers 1 n+1 2n n (e.g. see [20]). Alternatively, note that p-avoiding permutations can be obtained from the permutations enumerated in [12, Cor 5.1] by applying reverse, then complement, and then inverse.

POPs of length 4 with longest chain of size 2
The next theorem gives a new enumerative result on permutations avoiding simultaneously 12 patterns of length 4 in which the first element is larger than the last one. we have a(0) = a(1) = 1, a(2) = 2, This is the sequence A214663 in [28]. Also, this is essentially the sequence A232164 in [28] (a(0) = 0 in A232164, and a(n) is a(n−1) in our sequence).
Proof. We will derive the g.f. A(x) from which it is straightforward to check the recurrence relation for a(n). We think of generating all p-avoiding npermutations by inserting n in p-avoiding (n − 1)-permutations. Note that n in such a permutation π = π 1 π 2 · · · π n can only be in positions n − 2, n − 1 or n (otherwise, we would have an occurrence of p involving n).Thus, we have three cases to consider. Case 1. If π n = n then we clearly have a(n − 1) such permutations.
Case 2. If π n−1 = n then π may contain p involving π n . This happens when π ends with xynz where x > z. Indeed, there cannot be any other elements between x and z other than n and y, because otherwise before inserting n, we would have at least two elements between x and z, which contradicts us starting with a p-avoiding (n − 1)-permutation.
Letting b(n) be the number of p-avoiding n-permutations with the element in position n − 2 larger than the element in position n, we see that in Case 2 we have a(n − 1) − b(n − 1) p-avoiding n-permutations.
Case 3. If π n−2 = n then two subcases are possible when inserting n leads to an occurrence of p.
(a) π n is involved in an occurrence of p. The number of such permutations is given by b(n − 1) because removing n from π we have a p-avoiding (n − 1)-permutation with the element in position n − 2 larger than the element in position n.
(b) π n is not involved in an occurrence of p, but π n−1 is involved. In this case π must end with uxnyz, where z > y, z > u (otherwise π n is also involved in an occurrence of p which is impossible in this case), u > y, so uxny is the only occurrence of p (otherwise we would have an occurrence of p before inserting n). This implies that z = n−1 because otherwise n − 1 with z would be involved in an occurrence of p since y cannot be n−1. So, the element π n = n−1 can be removed and the rest is counted like in case (a) by b(n − 2) after removing π n , we can think of inserting the largest element in a p-avoiding (n − 2)-permutation in the next to last position).
Next, we derive a recurrence relation for b(n). Recall that b(n) counts pavoiding n-permutations ending with xyz where x > z. Note that no element to the left of x is larger than z. We consider three subcases depending on the relative position of y with respect to x and z.
(i) y > x, in which case we must have y = n, x = n − 1 and z = n − 2.
Clearly there are a(n − 3) such permutations because appending the largest element to the right of a p-avoiding (n − 3)-permutation cannot introduce an occurrence of p.
(ii) x > y > z, in which case we must have x = n, y = n − 1 and z = n − 2.
Similarly to (i) we have a(n − 3) permutations in this case.
(iii) y < z, in which case we must have x = n andz = n − 1. z can be removed from π and the rest of the counting problem is the same as inserting the largest element in position n − 2 in a p-avoiding (n − 1)permutation, which is considered in Case 2. Thus, in this case we have a(n − 2) − b(n − 2) such permutations.
Proof. The initial condition is easy to check, so assume that n ≥ 1. We next derive the recurrence relation for a(n).
Consider the element 1 in a p-avoiding n-permutation. If 1 is in the first or last positions, then clearly it cannot contribute to an occurrence of p, so these cases give 2a(n − 1) possibilities. Now, if 1 is in position i, 2 ≤ i ≤ n − 1, then the elements to the left of 1 must be in increasing order to avoid p involving the element 1. Similarly, all elements to the right of 1 must be in decreasing order to avoid p involving the element 1.Thus, the number of p-avoiding n-permutations in this case is given by n−1 i−1 , which is the number of ways to choose the elements to the left of 1. Summing up over all i gives 2 n−1 − 2 possibilities giving the recurrence relation. It is straightforward to prove by induction that the desired formula satisfies the recurrence relation.
The g.f. is also easy to derive.
This is the sequence A077835 in [28].
Proof. The initial conditions are easy to check along with a(3) = 6 satisfying the recursion, so assume that n ≥ 4. Note that the class of p-avoiding permutations is closed under the operation of reverse, so that we can count p-avoiding n-permutations in which 1 is to the right of n, and then multiply the result by 2. Let π = π 1 · · · π n be a p-avoiding n-permutation. We claim that π n = 1 or π n−1 = 1. Indeed, otherwise n1π n−1 π n is an occurrence of p. There are two cases. Case 1. If π n = 1 then it does not affect the rest of π, so we have a(n − 1) possibilities.
Case 2. Let π n−1 = 1. If π n = 2 then the elements 1 and 2 do not affect the rest of the permutation and we have a(n − 2) such permutations. Now assume that π n > 2. If 2 is to the right of n then n21π n is an occurrence of p. Thus, 2 is to the left of n.
If π 1 = 2 and π 2 = 2 then π 1 π 2 2n is an occurrence of p. If π 1 = 2 then π n must be 3, as otherwise 231π n is an occurrence of p. But then, the elements 2, 1 and 3 do not affect the rest of π, so we have a(n − 3) such permutations. Finally, π 2 = 2 because otherwise π 1 21π n is an occurrence of p.
Remark 3.10. The combinatorial interpretation in [28, A077835] is "a(n) is the number of ways two opposing basketball teams could score a combined total of n points (counting one point free throws, two point field goals, and three point field goals) considering the order of the scoring as important." Based on the proof of Theorem 3.9 we can easily encode these objects by (n + 1)permutations avoiding the POP p = 3 1 2 4 as follows. Let a permutation π = π 1 · · · π n+1 be p-avoiding and n ≥ 1. If π n+1 = 1 (resp., π 1 = 1) then team A (resp., B) scored one at the beginning of the game. If π n π n+1 = 12 (resp., π 1 π 2 = 21) then team A (resp., B) scored two at the beginning of the game. If π n π n+1 = 13 (resp., π 1 π 2 = 31) then team A (resp., B) scored three at the beginning of the game. The rest is done by induction. Also, This is the sequence A271897 in [28].
Proof. We first prove that a(n) satisfies, for n ≥ 4, the recursion with the initial conditions a(0) = a(1) = 1, a(2) = 2 and a(3) = 6. The initial conditions are easy to see. To derive (7) for n ≥ 4, we consider three cases depending on the position of the element n in a p-avoiding permutation π = π 1 · · · π n . Case 1. π 1 = n. Then π 2 π n · · · π n−1 must be in decreasing order (otherwise π 1 and π n would be involved in an occurrence of p). There are no extra restrictions, so we have n − 1 possibilities in this case, which is the number of ways to pick π n . Case 2. π n = n. In this case n cannot be involved in an occurrence of p, so we have a(n − 1) possibilities.
Case 3. π i+1 = n, where 1 ≤ i ≤ n − 2. Note that in order to avoid p (keeping in mind that π i π i+1 can be two middle elements in an occurrence of p), all elements to the right of n must be larger than each element, if any, in positions 1, 2, ..., i − 1. Also, once the elements to the right of n are known, there are n − i − 1 ways to order them, since π i+2 π i+2 · · · π n−1 must be in decreasing order. We have two subcases.
(1) π i is less than any element to the right of n. Since the last n − i elements are then the largest in π, they do not affect the rest of π. So there are a(i) permutations of the smallest elements, and n − i − 1 ways to arrange the elements to the right of n. Thus we have (n − i − 1)a(i) possibilities, in this case.
(2) π i ∈ {i + 1, i + 2, . . . , n − 1}. In this case, π i does not affect whatever is to the right of n, the last n − i + 1 elements are the largest elements, and they do not affect the rest of π. Thus, we have n − i − 1 ways to choose π i , then n − i − 1 ways to order elements to the right of n, and a(i − 1) ways to pick a permutation of the smallest elements. Thus, we have (n − i − 1) 2 a(i − 1) possibilities in total here.
Summing over all i, we have possibilities in Case 3. Finally, adding up Cases 1-3, we get (7).
The g.f. can now be obtained by multiplying both sides of (7) by x n and summing over all n ≥ 4, and using i≥0 ix 3 . Finally, our g.f. matches the g.f. in [28, A271897] which gives the known recurrence relation (6) for a(n).
Note p-avoiding n-permutations in the next theorem are equinumerous with n-permutations avoiding eight patterns in [1]. However, our permutations cannot be mapped to the permutations in [1] via trivial bijection, because in our case the monotone pattern 4321 is forbidden, while no monotone pattern is forbidden in [1]. we have that This is the sequence A111281 in [28].
Proof. The initial conditions are easy to see. Let n ≥ 4. There are only three possible places for n in a p-avoiding permutation π = π 1 · · · π n . Case 1. If π n = n then clearly we have a(n − 1) possibilities.
Case 2. If π n−1 = n then we have a(n − 1) − b(n − 1) possibilities, where b(n) counts the number of p-avoiding n-permutations that end with xyz and x > y and x > z. Case 3. If π n−2 = n then we have a(n − 1) − c(n − 1) possibilities, where c(n) counts the number of p-avoiding n-permutations that end with xyzx + , where x > y, x > z and x + denotes an element larger than x (note that we are forced to have π n > x to avoid p). Summarizing where A(x), B(x), C(x) are the g.f.s for a(n), b(n), c(n), respectively. Next we derive a recurrence relation for b(n). Note that in n-permutations counted by b(n), π n−1 = n and π n = n. Thus, we must have x = n (x is used in the definition of b(n)), and this case is the same as Case 3 above, so we have b(n) = a(n − 1) − c(n − 1). Multiplying both sides of this relation by x n and summing over all n ≥ 4, we obtain Finally, we derive a recurrence relation for c(n). Note that we must have x + = n and x = n − 1. We can remove n (it cannot contribute an occurrence of p), and the rest is exactly Case 3 above with the indices shifted by 1. That is, c(n) = a(n − 2) − c(n − 2). Multiplying both sides of this relation by x n and summing over all n ≥ 4, we obtain Solving the system of linear equations (8), (9) and (10), we obtain A(x). we have a(0) = a(1) = 1, and for n ≥ 2, a(n) = 2(a(n − 1) + a(n − 2)). Also, This is essentially the sequence A002605 in [28] (a(0) = 0 there).
Proof. We think of generating all p-avoiding n-permutations from p-avoiding (n − 1)-permutations by inserting the element n. n can only be in positions n − 2, n − 1 and n.
Case 1. n is in position n. We clearly have a(n − 1) such permutations.
Case 2. n is in position n − 1. We clearly have a(n − 1) such permutations.
Case 3. n is in position n − 2. We clearly have a(n − 1) − b(n − 1) such permutations, where b(n − 1) counts p-avoiding (n − 1)-permutations ending with xyz, where x is larger than y and z. We need to subtract such permutations because when inserting n in position n − 2 in them we will get the forbidden pattern p. We do not need to subtract any other permutations because if p occurs as xnyz, and x is not next to n, then we would have an occurrence of p before inserting n. Summarizing Cases 1-3, we have We next derive a recurrence relation for b(n). Note that we must have x = n (x appears in the definition of b(n)), or else nxyz is an occurrence of p, which is impossible. But then, we are back to Case 3 above, since all such permutations can be obtained by inserting the largest element n in position n − 2 in a p-avoiding (n − 1)-permutation. So, we have Subtracting (12) from (11), we obtain b(n) = a(n) − 2a(n − 1).
Using (13) in (11) we get the desired recurrence. The g.f. is now straightforward to derive.
Proof. One can easily check that a(n) = n! for 1 ≤ n ≤ 3 and the recursion is satisfied, so assume that n ≥ 4. We consider possible places for the element n in a p-avoiding permutation π = π 1 · · · π n . There are only three possibilities.
Case 1. π 1 = n. In this case we clearly have a(n − 1) possibilities.
Case 2. π n = n. In this case we clearly have a(n − 1) possibilities.
Case 3. π n−1 = n. In this case, we have a(n − 1) − b(n − 1) possibilities where b(n) counts the number of p-avoiding n-permutations that end with xyz, where x < y and z < y, because in this case inserting n in position n − 1 will create an occurrence of p. Summarizing Cases 1-3, we have We next derive a recursion for b(n). Because we deal with p-avoiding permutations, there are three possibilities for a position of the element n, as mentioned above.
(i) If a permutation counted by b(n) begins with n, then clearly we have b(n − 1) possibilities.
(ii) No permutation ending with n can be counted by b(n).
(iii) Finally, any permutation with n in position n − 1 will be counted by b(n) since n ≥ 4, but the number of these permutations is given by Case 3 above, and it is a(n − 1) − b(n − 1).
Note that, according to [28, A111277], p-avoiding n-permutations in the next theorem are equinumerous with n-permutations avoiding simultaneously the patterns in {2413, 4213, 2431, 4231, 4321} and with n-permutations avoiding simultaneously the patterns in {3142, 3412, 3421, 4312, 4321}. However, our permutations cannot be mapped to any of these permutations via trivial bijection, because in our case no monotone pattern is forbidden, while the pattern 4321 is forbidden in both of the other cases. for n ≥ 2, a(n) = 4a(n − 1) − 3a(n − 2) + 1, so that This is the sequence A111277 in [28].
Proof. The initial values are easy to see, so let n ≥ 2. Clearly, to avoid p is the same as to avoid simultaneously the patterns in {4312} ∪ A, where A = {4213, 3214, 4123, 3124}. We claim that a(n) = 4a(n − 1) − 2a(n − 2) − (a(n − 2) − 1). (16) Observe that to avoid the patterns in A, an n-permutation must begin or end with 1 or 2. This explains the term 4a(n − 1) in (16) coming from generating all such n-permutations from p-avoiding (n − 1)-permutations. However, the n-permutations beginning and ending with 1 and 2 are counted twice, which explains the term −2a(n − 2) in (16). Next, observe that some of npermutations ending with 2 and counted by 4a(n−1) contain occurrence(s) of the pattern 4312, and they need to be subtracted (none of these permutations was subtracted by −2a(n−2) because the element 1 cannot be leftmost). Call these permutations "bad" permutations, and denote an occurrence of 4312 by xy12 (because the elements 1 and 2 must be involved in any occurrence of 4312). To see that the number of bad permutations is a(n − 2) − 1, and thus to complete the proof of (16), note that the element 1 must be next to the (rightmost) element 2 in any bad permutation. Indeed, if an element z is between 1 and 2, then • xy1z is an occurrence of the pattern 4312 if z < y, and • xy1z is an occurrence of the pattern 4213 or 3214 if z > y, which is impossible, because the (n − 1)-permutation obtained by removing the element 2 must avoid all 5 forbidden patterns. But any (n − 2)permutation, except for the increasing permutation, that avoid the 5 patterns with 12 appended to the right will result in a bad permutation, so the number of bad n-permutations is indeed a(n − 2) − 1, and (16) is proved.
Proof. The initial conditions are easy to check, so assume that n ≥ 2. Clearly, to avoid p is the same as to avoid simultaneously the patterns in {4132} ∪ A, where A = {4213, 3214, 4123, 3124}. We begin with proving that (18) Observe that to avoid the patterns in A, an n-permutation must begin or end with 1 or 2. This explains the term 4a(n − 1) in (18) coming from generating all such n-permutations from p-avoiding (n − 1)-permutations. However, the n-permutations beginning and ending with the elements in {1, 2} are counted twice, which explains the term −2a(n − 2) in (18). Next, observe that some of n-permutations ending with 2 and counted by 4a(n − 1) contain occurrence(s) of the pattern 4132, and they need to be subtracted (none of these permutations was subtracted by −2a(n − 2) because the element 1 cannot be leftmost). Call these permutations "bad" permutation.
To count bad permutations, we count n-permutations ending with 2 which cannot be bad, namely, which avoid all 5 patterns, and then subtract them from all n-permutations in question ending with 2. All such non-bad npermutations are given by considering two cases: (i) there are no elements between 1 and 2, that is an n-permutation ends with 12. We have a(n − 2) such permutations.
(ii) there is at least one element between 1 and 2, and every element to the left of 1 is less than any element to the right of 1 (except for the element 2). In this case, the elements to the left of 1 must be in increasing order, or else, we will get an occurrence of the pattern 3214 involving two elements to the left of 1, 1 itself, and an element to the right of 1.
Between the elements 1 and 2 we can have any permutation avoiding the 5 patterns. Thus, we have n−3 i=0 a(n − 2 − i) such permutations.
Proof. To avoid p is the same as avoiding the patterns 3214, 3124, 2134, and 2143, simultaneously. Applying inverse and then complement to the these permutations, we obtain permutations enumerated in [12,Thm 6.2]. .
The g.f. A(x) = n≥0 a(n)x n satisfies This is the sequence A257561 in [28].
Proof. To avoid p is the same as to avoid the patterns 4231, 4312, and 4321, and these are precisely the patterns in [2, Thm 3.1] and [28, A257561], from which the results follow.
This is the sequence A111279 in [28].
Proof. Clearly, avoiding p is equivalent to avoiding the patterns 4132, 4231, and 4123, simultaneously. Applying the inverse and reverse operations to these patterns gives the class Π 3 in [9], which was enumerated there.
Also, A(x) = n≥0 a(n)x n satisfies This is the sequence A106228 in [28].
Proof. Clearly, avoiding p is equivalent to avoiding the patterns 4213, 4123, and 4132, simultaneously, and these are precisely the patterns in [28, A106228]. The formula for a(n), and the relation for A(x), can be found in the OEIS. Note that the relation is coming from [10] as the triple 242 there is the reverse and complement of our patterns. Also, n≥0 a(n)x n = 2 This is the sequence A033321 in [28].
Proof. Clearly, avoiding p is equivalent to avoiding the patterns 2143, 3142 and 3241, simultaneously, which is reverse complement of the patterns considered in [6], where the g.f. is given. The recurrence relation for a(n) is given in [28, A033321].
Remark 3.22. Note that, by [28, A033321], the avoidance of the pattern The n-th large Schröder number is defined by the following recurrence relation: we have that a(0) = 0, and for n ≥ 1, a(n) = S n , the (n − 1)-th large Schröder number, so that This is the sequence A006318 in [28].
Proof. Avoding p is equivalent to avoiding 2134 and 2143. The result follows from [24] by applying the reverse and complement to these patterns.
The enumeration for the sequence in the next theorem is unknown, but its g.f. is conjectured to be non-D-finite [2]. we have that a(n) is given by the sequence A053617 in [28].
Proof. Clearly, to avoid p is the same as to avoid the patterns 4231 and 4321, which is the reverse of the patterns in [28, A053617].
The enumeration for the sequence in the next theorem is unknown. The sequence appears in [25] as avoidance of the patterns 2143 and 2413, and the patterns corresponding to our p are obtained from these by applying inverse. we have that a(n) is given by the sequence A165546 in [28].
Proof. To avoid p is the same as to avoid the patterns 2143 and 3142, simultaneously. The complement of these is the patterns in [28, A165546].

POPs of length 5
The next theorem gives a new enumerative result on permutations avoiding simultaneously 60 patterns of length 5 in which the first element is larger than the last one.
This is the sequence A276838 in [28].
Proof. The case k = 5 in Theorem 2.7 gives a one-to-one correspondence between p-avoiding n-permutations and the objects appearing in [28, A276838] with a known g.f.. The next theorem gives a new enumerative result on permutations avoiding simultaneously 60 patterns of length 5 in which the first element is larger than the second one. we have This is essentially A007531 in [28] (a(0) = a(1) = a(2) = 0 in A007531).
Proof. This is an immediate corollary of Theorem 2.4, or Theorem 2.6, with k = 5, s = 3 and b(n) = 1 for n ≥ 0 because only increasing permutations avoid the pattern p 1 = 2 1 . The g.f. can now be easily derived from the recurrence relation.
The next theorem gives a new enumerative result on permutations avoiding simultaneously 24 patterns of length 5 in which the first element is larger than any other element. we have This is the sequence A084509 in [28].
Proof. This is an immediate corollary of Theorem 2.2.
The next theorem gives a new enumerative result on permutations avoiding simultaneously 12 patterns of length 5 in which the first and the last elements are larger than any other element. we have This is the sequence A094433 in [28].
Proof. This is an immediate corollary of Theorem 2.3.
The next theorem gives a new enumerative result on permutations avoiding simultaneously 20 patterns of length 5.  we have This is the sequence A094012 in [28].
We can now use Theorem 2.4 to obtain the desired result.

Concluding remarks
A number of conjectured connections between sequences in the OEIS and permutations avoiding POPs of length 5 appear in Table 5. One can ask a number of bijective questions even in some cases where connections to the OEIS were explained. In Tables 6 and 7 we list a number of potentially interesting bijective questions. We refer to the OEIS [28] for the definitions/further details of the objects mentioned in the table. Note that Table 6  A025192 permutations π 1 · · · π 3n avoiding the patterns 231, 312, 321 and satisfying π 3i+1 < π 3i+2 and π 3i+1 < π 3i+3 for all 0 ≤ i < n. Equivalently, 2-ary shrub forests of n heaps avoiding the patterns 231, 312, 321; see [4]  A224295 permutations avoiding the patterns 12345 and 12354; note that, by Theorem 2.1, avoiding these patterns is the same as avoiding the POP {1 > 2, 2 > 3, 3 > 4, 3 > 5} Table 6: A list of potentially interesting bijective questions for permutations avoiding a POP and other pattern avoiding permutations.
classical pattern, but it allows imposing the condition on certain elements in an occurrence of the pattern to be consecutive in a permutation, which is denoted by underlying the respective elements in the pattern [20]. For example, in the permutation 2415763 there are three occurrences of the vincular pattern 123, namely, the subsequences 257, 457 and 157. Note that, e.g. the subsequence 256, being an occurrence of the pattern 123, is not an occurrence of the pattern 123 because 5 and 6 are not consecutive. A214663 n-permutations for which the partial sums of signed displacements do not exceed 2 A232164 Weyl group elements, not containing an s r factor, which contribute nonzero terms to Kostant's weight multiplicity formula when computing the multiplicity of the zero-weight in the adjoint representation for the Lie algebra of type C and rank n A118376 series-reduced enriched plane trees of weight n; also, trees of weight n, where nodes have positive integer weights and the sum of the weights of the children of a node is equal to the weight of the node Table 7: A list of potentially interesting bijective questions for permutations avoiding a POP and other combinatorial structures.
As a final remark, we note that there is a simple connection between p-avoiding n-permutations for the POP p = 2 in occurrences of which the elements in all but the first position must be consecutive. Wilf-equivalence of these POPs is essentially given by Wilf-equivalence of the sets of patterns {132, 231} and {312, 321} [20].