A224288 Number of permutations of length n containing exactly 2 occurrences of 123 and 2 occurrences of 132.
0, 0, 0, 0, 1, 6, 26, 94, 306, 934, 2732, 7752, 21488, 58432, 156288, 411904, 1071104, 2750976, 6984704, 17545216, 43634688, 107511808, 262602752, 636223488, 1529741312, 3652059136, 8660975616, 20412104704, 47826599936, 111446851584, 258360737792, 596044152832
Offset: 0
Examples
a(4) = 1: (1,2,4,3). a(5) = 6: (2,3,5,1,4), (2,3,5,4,1), (2,5,1,3,4), (3,1,4,5,2), (4,1,2,5,3), (5,1,2,4,3).
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- B. Nakamura, Approaches for enumerating permutations with a prescribed number of occurrences of patterns, arXiv 1301.5080 [math.CO], 2013.
- B. Nakamura, A Maple package for enumerating n-permutations with r occurrences of the pattern 123 and s occurrences of the pattern 132 [Broken link]
- Index entries for linear recurrences with constant coefficients, signature (10,-40,80,-80,32).
Programs
-
Maple
# Programs can be obtained from the Nakamura link
-
Mathematica
Join[{0, 0, 0, 0, 1}, LinearRecurrence[{10, -40, 80, -80, 32}, {6, 26, 94, 306, 934}, 27]] (* Jean-François Alcover, Feb 29 2020 *)
Formula
G.f.: -(2*x^5+6*x^4-6*x^3+6*x^2-4*x+1)*x^4/(2*x-1)^5. - Alois P. Heinz, Apr 03 2013
a(n) = 2^(-11+n)*(1504-994*n+219*n^2-18*n^3+n^4) for n>4. - Colin Barker, Apr 14 2013