OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..200
Sergey Kitaev, Partially Ordered Generalized Patterns, preprint.
Sergey Kitaev, Partially Ordered Generalized Patterns, Discrete Math. 298(1-3) (2005), 212-229.
FORMULA
E.g.f.: (1/2)+(1/4)*tan(x)*(1+exp(2*x) + 2*exp(x)*sin(x)) + (1/2)*exp(x)*cos(x).
a(n) ~ n! * (1 + 2*exp(Pi/2) + exp(Pi) + (-1)^n*(2/exp(Pi/2) - 1/exp(Pi) - 1)) * 2^(n-1) / Pi^(n+1). - Vaclav Kotesovec, Mar 20 2014
EXAMPLE
Example: a(4) = 18 because the following 6 permutations contain the prohibited pattern: 1243, 1342, 1432, 2341, 2431, 3421.
MAPLE
b:= proc(u, o, s, t) option remember; `if`(u+o=0, 1,
`if`(s, 0, add(b(u-j, o+j-1, t, false), j=1..u))+
add(b(u+j-1, o-j, t, true), j=1..o))
end:
a:= n-> b(n, 0, false$2):
seq(a(n), n=0..25); # Alois P. Heinz, Oct 25 2013
MATHEMATICA
CoefficientList[Series[1/2+1/4*Tan[x]*(1+E^(2*x) + 2*E^x*Sin[x]) + 1/2*E^x*Cos[x], {x, 0, 20}], x] * Range[0, 20]! (* Vaclav Kotesovec, Mar 20 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Signy Olafsdottir (signy06(AT)ru.is), Feb 17 2010
EXTENSIONS
More terms from Alois P. Heinz, Oct 25 2013
STATUS
approved