login
a(n) = (2*n-1) * a(n-1) - a(n-2), a(0) = 1, a(1) = 2.
1

%I #18 Sep 08 2022 08:46:08

%S 1,2,5,23,156,1381,15035,194074,2896075,49039201,928848744,

%T 19456784423,446577192985,11144973040202,300467694892469,

%U 8702418178841399,269474495849190900,8883955944844458301,310668983573706849635,11485868436282308978194

%N a(n) = (2*n-1) * a(n-1) - a(n-2), a(0) = 1, a(1) = 2.

%H Indranil Ghosh, <a href="/A242227/b242227.txt">Table of n, a(n) for n = 0..403</a>

%F a(n) = A053983(n) + A053984(n) = -(-1)^n * A121323(-2-n) for all integer n.

%F 0 = a(n)*(a(n+2)) + a(n+1)*(-a(n+1) + 2*a(n+2) - a(n+3)) + a(n+2)*(a(n+2)) for all integer n.

%e G.f. = 1 + 2*x + 5*x^2 + 23*x^3 + 156*x^4 + 1381*x^5 + 15035*x^6 + ...

%t 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 *)

%t 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 *)

%o (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))};

%o (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

%Y Cf. A053983, A053984, A121323.

%K nonn

%O 0,2

%A _Michael Somos_, May 08 2014