OFFSET
0,5
COMMENTS
The variable y is responsible for indicating if we want just one non-overlapping occurrence, and the variable x is responsible for the length of the permutation.
LINKS
Vaclav Kotesovec, Table of n, a(n) for n = 0..480
Sergey Kitaev, Segmented partially ordered generalized patterns, Theoretical Computer Science 349(3) (2005), 420-428.
FORMULA
E.g.f.: (1/2 + (1/4)*tan(x)*(1 + e^(2*x) + 2*e^x*sin(x)) + (1/2)*e^x*cos(x))/(1 - y*(1 + (x - 1)*(1/2 + (1/4)*tan(x)*(1 + e^(2*x) + 2*e^x*sin(x)) + (1/2)*e^x*cos(x)))).
E.g.f.: (1/2 + 1/2*exp(x)*cos(x) + 1/4*(1 + exp(2*x) + 2*exp(x)*sin(x)) * tan(x)) * (1 + (-1 + x)*(1/2 + 1/2*exp(x)*cos(x) + 1/4*(1 + exp(2*x) + 2*exp(x)*sin(x))*tan(x))). - Vaclav Kotesovec, Aug 25 2014
a(n) ~ n! * (exp(Pi) * (Pi - 2) * cosh(Pi/4)^4 - (-1)^n * exp(-Pi) * (Pi + 2) * sinh(Pi/4)^4) * 2^(n+1) * n / Pi^(n+2). - Vaclav Kotesovec, Aug 25 2014
EXAMPLE
a(4) = 6 because the only bad permutations are 1243, 1342, 1432, 2341, 2431, and 3421.
MATHEMATICA
CoefficientList[Series[(1/2 + 1/2*E^(x)*Cos[x] + 1/4*(1 + E^(2*x) + 2*E^(x)*Sin[x])*Tan[x]) * (1 + (x-1)*(1/2 + 1/2*E^(x)*Cos[x] + 1/4*(1 + E^(2*x) + 2*E^(x)*Sin[x])*Tan[x])), {x, 0, 20}], x] * Range[0, 20]! (* Vaclav Kotesovec, Aug 25 2014 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Signy Olafsdottir (signy06(AT)ru.is), May 09 2010, May 14 2010
EXTENSIONS
Offset and example corrected by Vaclav Kotesovec, Aug 24 2014
More terms from Vaclav Kotesovec, Aug 24 2014
STATUS
approved