Three-Letter-Pattern Avoiding Permutations and Functional Equations
We present an algorithm for finding a system of recurrence relations for the number of permutations of length $n$ that satisfy a certain set of conditions. A rewriting of these relations automatically gives a system of functional equations satisfied by the multivariate generating function that counts permutations by their length and the indices of the corresponding recurrence relations. We propose an approach to describing such equations. In several interesting cases the algorithm recovers and refines, in a unified way, results on $\tau$-avoiding permutations and permutations containing $\tau$ exactly once, where $\tau$ is any classical, generalized, and distanced pattern of length three.