OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..450
FORMULA
a(n) = 3*floor(e*(n-1)!) - 1, n>1. - Gary Detlefs, Jun 10 2010
a(n) = (n-1) * a(n-1) + n + 1 for n > 0 and a(0) = 1. - Werner Schulte, Oct 20 2023
a(n) = A000522(n-1)*3 - 1, n > 0. - M. F. Hasler, Oct 20 2023
EXAMPLE
G.f.: A(x) = 1 + 2*x + 5*x^2 + 14*x^3 + 47*x^4 + 194*x^5 + 977*x^6 +...
x^2*A'(x) = 2*x^2 + 10*x^3 + 42*x^4 + 188*x^5 + 970*x^6 + 5862*x^7 +...
MAPLE
a:= proc(n) option remember; `if`(n<3, n^2+1,
((n^2+1)*a(n-1)-(n-2)*(n+1)*a(n-2))/n)
end:
seq(a(n), n=0..25); # Alois P. Heinz, Jul 16 2017
MATHEMATICA
a[0]=1; a[n_]:=(n-1)*a[n-1]+n+1; Array[a, 23, 0] (* Stefano Spezia, Oct 20 2023 *)
PROG
(PARI) {a(n)=local(A=1+x+x*O(x^n)); for(i=1, n, A=1/(1-x+x*O(x^n))^2+x^2*deriv(A)); polcoeff(A, n)}
(PARI) A143918_upto(N)=vector(N, n, N=if(n>1, (n-2)*N+n, 1)) \\ Gives the N initial values a(0..N-1). - M. F. Hasler, Oct 20 2023
(PARI) A143918(n)=if(n>1, localprec(max(logint(n=(n-1)!, 10), 5)+5); n\exp(-1)*3-1, n+1) \\ M. F. Hasler, Oct 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Sep 05 2008
STATUS
approved