login
a(n) = -(n-3)*a(n-1) + 2*(n-2)^2.
1

%I #23 Nov 18 2024 12:53:23

%S 2,6,6,14,-6,102,-514,3726,-29646,267014,-2669898,29369166,-352429654,

%T 4581585894,-64142202066,962133031502,-15394128503454,261700184559366,

%U -4710603322067866,89501463119290254,-1790029262385804198,37590614510101889126

%N a(n) = -(n-3)*a(n-1) + 2*(n-2)^2.

%H Stefano Spezia, <a href="/A051398/b051398.txt">Table of n, a(n) for n = 3..452</a>

%H Alexsandar Petojevic, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL5/Petojevic/petojevic5.html">The Function vM_m(s; a; z) and Some Well-Known Sequences</a>, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7

%F a(n) = A056158(n) + 2n.

%t a[3]=2; a[n_]:=a[n]=-(n-3)*a[n-1]+2*(n-2)^2; Array[a,22,3] (* _Stefano Spezia_, Sep 16 2022 *)

%t nxt[{n_,a_}]:={n+1,2(n-1)^2-a(n-2)}; NestList[nxt,{3,2},30][[;;,2]] (* _Harvey P. Dale_, Nov 18 2024 *)

%Y Cf. A056158.

%K sign,changed

%O 3,1

%A _Aleksandar Petojevic_