OFFSET
0,3
FORMULA
EXAMPLE
a(2) = 3.
a(3) = 2*3^2 = 18.
a(4) = 3*3*18 + 1*3*3 = 171.
a(5) = 3*4*171 + 1*3*18 + 2*18*3 = 2214.
a(6) = 3*5*2214 + 1*3*171 + 2*18*18 + 3*171*3 = 35910.
G.f.: A(x) = 1 + x + 3*x^2 + 18*x^3 + 171*x^4 + 2214*x^5 +...
= x/series_reversion(x + x^2 + 4*x^3 + 28*x^4 + 280*x^5 +...).
MATHEMATICA
x=3; a[0]=a[1]=1; a[2]=x; a[3]=2x^2; a[n_]:=a[n]=x*(n-1)*a[n-1]+Sum[(j-1)*a[j ]*a[n-j], {j, 2, n-2}]; Table[a[n], {n, 0, 18}](Robert G. Wilson v)
PROG
(PARI) a(n)=Vec(x/serreverse(x*Ser(vector(n+1, k, if(k==1, 1, prod(j=0, k-2, 3*j+1))))))[n+1]
(PARI) {a(n, x=3)=if(n<0, 0, if(n==0 || n==1, 1, if(n==2, x, if(n==3, 2*x^2,
x*(n-1)*a(n-1)+sum(j=2, n-2, (j-1)*a(j)*a(n-j))))))}
CROSSREFS
KEYWORD
nonn
AUTHOR
Philippe Deléham and Paul D. Hanna, Oct 28 2005
STATUS
approved