OFFSET
0,3
FORMULA
a(0) = 1; a(n) = n * Sum_{k=2..n} 3^(k-1) * binomial(n-1,k-1) * a(n-k).
a(n) = n! * Sum_{k=0..floor(n/2)} 3^(n-k) * k! * Stirling2(n-k,k)/(n-k)!.
PROG
(PARI) a(n) = n!*sum(k=0, n\2, 3^(n-k)*k!*stirling(n-k, k, 2)/(n-k)!);
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Dec 04 2023
STATUS
approved