OFFSET
0,3
REFERENCES
S. Kitaev and T. Mansour, On multi-avoidance of generalized patterns, Ars Combinatoria 76 (2005), 321-350.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
R. E. L. Aldred, M. D. Atkinson, and D. J. McCaughan, Avoiding consecutive patterns in permutations Adv. in Appl. Math., 45(3), 449-461, 2010.
A. Baxter, B. Nakamura, and D. Zeilberger, Automatic generation of theorems and proofs on enumerating consecutive Wilf-classes
S. Kitaev, On multi-avoidance of generalized patterns
FORMULA
We have c(n)= )=\sum_{i,j=1}^{n} c(n;i,j) with c(n;i;i)=0 for all n, i >= 1; b(n;i,j)= \sum_{k=1}^{i-1}b(n-1;j,k) if i > j; b(n;i,j)= \sum_{k=1}^{i-1}b(n-1;j-1,k) +\sum_{k=j}^{n-1}b(n-1;j-1,k) if i > j; and b(2;1,2)= b(2;2,1)=1, b(2;1,1)= b(2;1,1)=0.
a(n) ~ c * d^n * n!, where d = 0.6017307279439431870308246204583329377..., c = 3.15506287220052225202744035520726815... . - Vaclav Kotesovec, Aug 22 2014
EXAMPLE
For n = 3 c(3) = 4 since 123, 132, 312, and 321 are the 3-permutations avoiding 213 and 231.
MAPLE
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
add(b(u-j, o+j-1, -j), j=1..`if`(t>0, t-1, u))+
add(b(u+j-1, o-j, j), j=1..`if`(t<0, -t-1, o)))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..25); # Alois P. Heinz, Nov 04 2013
MATHEMATICA
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Sum[b[u - j, o + j - 1, -j], {j, 1, If[t > 0, t - 1, u]}] + Sum[b[u + j - 1, o - j, j], {j, 1, If[t < 0, -t - 1, o]}]];
a[n_] := b[n, 0, 0];
a /@ Range[0, 25] (* Jean-François Alcover, Nov 21 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Signy Olafsdottir (signy06(AT)ru.is), Mar 03 2010
EXTENSIONS
More terms from Alois P. Heinz, Nov 03 2013
STATUS
approved