OFFSET
3,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 3..500
A. Claesson and T. Mansour, Counting patterns of type (1,2) or (2,1), arXiv:math/0110036 [math.CO], 2001.
FORMULA
G.f.: Sum_{n>=1} (x/(1-n*x)) * Sum_{k>=0} k*x^(k+n)/Product_{l=1..k+n} (1-l*x).
Recurrence: a(n) = 2a(n-1) + Sum_{k=0..n-3} C(n-2, k)*(a(k+1) + B(k+1)), with B(n) the Bell numbers A000110(n).
MATHEMATICA
a[n_ /; n<3] = 0; a[n_] := a[n] = 2 a[n-1] + Sum[Binomial[n-2, k] (a[k+1] + BellB[k+1]), {k, 0, n-3}];
Table[a[n], {n, 3, 24}] (* Jean-François Alcover, Aug 19 2018 *)
PROG
(PARI) a(n)=if(n<1, 0, 2*a(n-1)+sum(k=0, n-3, binomial(n-2, k)*(a(k+1)+polcoeff(serlaplace(exp(exp(x)-1)), k+1))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Apr 18 2004
STATUS
approved