OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = ((357*n^3 - 1625*n^2 + 2120*n - 720)*a(n-1) +2*(2*n-5)*(51*n^2 - 101*n + 36)*a(n-2))/(2*n*(51*n^2 - 203*n + 188)), with a(1) = 1, a(2) = 4, and a(3) = 14. - G. C. Greubel, Jun 20 2024
MATHEMATICA
a[n_]:= a[n]= If[n<4, 2*3^(n-1) -2^(n-1), ((357*n^3 -1625*n^2 +2120*n - 720)*a[n-1] +2*(2*n-5)*(51*n^2 -101*n +36)*a[n-2])/(2*n*(51*n^2 - 203*n +188))];
Table[a[n], {n, 40}] (* G. C. Greubel, Jun 20 2024 *)
PROG
(Magma)
[1] cat [n le 2 select 2*3^n -2^n else ((357*n^3 -554*n^2 -59*n +132)*Self(n-1) +2*(2*n-3)*(51*n^2 +n -14)*Self(n-2))/(2*(n+1)*(51*n^2-101*n+36)): n in [1..40]]; // G. C. Greubel, Jun 20 2024
(SageMath)
@CachedFunction
def a(n): # a = A026630
if (n<4): return 2*3^(n-1) -2^(n-1)
else: return ((357*n^3 -1625*n^2 +2120*n - 720)*a(n-1) +2*(2*n-5)*(51*n^2 -101*n +36)*a(n-2))/(2*n*(51*n^2 - 203*n +188))
[a(n) for n in range(1, 41)] # G. C. Greubel, Jun 20 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved