OFFSET
0,2
COMMENTS
a(n) = number of permutations of [n+1] in which the first entry does not start a (classical) 1234 pattern. The number of such permutations with first entry i is n!/(n + 1 - i)! C(n + 1 - i) where C(n) is the Catalan number A000108(n). - David Callan, Jun 12 2017
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..449
FORMULA
E.g.f.: exp(2*x)/(1-x)*(BesselI(0,2*x)-BesselI(1,2*x)).
a(n) = Sum_{i=0..n} binomial(n,i) * C(i) * (n-i)!.
a(n) ~ exp(2) * BesselI(2,2) * n!. - Vaclav Kotesovec, Oct 13 2016
MAPLE
a:= proc(n) option remember; `if`(n<2, n+1,
((n^2+5*n-2)*a(n-1)-(4*n-2)*(n-1)*a(n-2))/(n+1))
end:
seq(a(n), n=0..30);
MATHEMATICA
a[n_] := Sum[Binomial[n, i] CatalanNumber[i] (n-i)!, {i, 0, n}];
a /@ Range[0, 30] (* Jean-François Alcover, Dec 21 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Oct 02 2016
STATUS
approved