OFFSET
0,2
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..403
FORMULA
EXAMPLE
G.f. = 1 + 2*x + 5*x^2 + 23*x^3 + 156*x^4 + 1381*x^5 + 15035*x^6 + ...
MATHEMATICA
RecurrenceTable[{a[n] == (2*n-1)*a[n-1] - a[n-2], a[0] == 1, a[1] == 2}, a, {n, 0, 50}] (* G. C. Greubel, Aug 06 2018 *)
nxt[{n_, a_, b_}]:={n+1, b, b(2n+1)-a}; NestList[nxt, {1, 1, 2}, 20][[All, 2]] (* Harvey P. Dale, Aug 01 2022 *)
PROG
(PARI) {a(n) = if( n>-4, if( n<0, -2-n, (2*n - 1) * a(n-1) - a(n-2)), (2*n + 3) * a(n+1) - a(n+2))};
(Magma) I:=[1, 2]; [n le 2 select I[n] else (2*n-1)*Self(n-1) - Self(n-2): n in [1..30]]; // G. C. Greubel, Aug 06 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, May 08 2014
STATUS
approved