login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A026640
a(n) = A026637(2*n, n-2).
9
1, 8, 38, 161, 662, 2672, 10676, 42398, 167756, 662252, 2610758, 10283861, 40490702, 159394424, 627456188, 2470223186, 9726696572, 38308366784, 150916209308, 594704861546, 2344206594332, 9243186573248, 36456892635848
OFFSET
2,2
LINKS
FORMULA
a(n) = ((7*n^2 - 4*n + 4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2)), n >= 5. - G. C. Greubel, Jul 01 2024
MATHEMATICA
a[n_]:= a[n]= If[n<5, 4^(n-1) -3^(n-1) +1 -Boole[n==2], ((7*n^2 -4*n + 4)*a[n-1] +2*n*(2*n-1)*a[n-2])/(2*(n-2)*(n+2))];
Table[a[n], {n, 2, 40}] (* G. C. Greubel, Jul 01 2024 *)
PROG
(Magma)
[1] cat [n le 2 select 4^(n+1) -3^(n+1) +1 else ((7*n^2+24*n+24 )*Self(n-1) + 2*(2*n+3)*(n+2)*Self(n-2))/(2*n*(n+4)): n in [1..40]]; // G. C. Greubel, Jul 01 2024
(SageMath)
@CachedFunction
def a(n): # a = A026640
if n<5: return 4^(n-1) -3^(n-1) +1 -int(n==2)
else: return ((7*n^2-4*n+4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2))
[a(n) for n in range(2, 41)] # G. C. Greubel, Jul 01 2024
KEYWORD
nonn
STATUS
approved