OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,12,0,-36).
FORMULA
a(n) = Sum_{k=0..2n} (k+1) * A026552(n, k).
G.f.: (1 +6*x +15*x^2 -18*x^3)/(1-6*x^2)^2.
a(n) = -(1/2)*[n=0] + (1/4)*6^(n/2)*(n + 1)*(3*(1 + (-1)^n) + sqrt(6)*(1 - (-1)^n)). - G. C. Greubel, Dec 18 2021
MATHEMATICA
Table[-(1/2)*Boole[n==0] + (1/4)*6^(n/2)*(n+1)*(3*(1+(-1)^n) + Sqrt[6]*(1-(-1)^n)), {n, 0, 40}] (* G. C. Greubel, Dec 18 2021 *)
PROG
(Magma) I:= [6, 27, 72, 270]; [1] cat [n le 4 select I[n] else 12*(Self(n-2) - 3*Self(n-4)): n in [1..41]]; // G. C. Greubel, Dec 18 2021
(Sage)
@CachedFunction
def T(n, k): # T = A026552
if (k==0 or k==2*n): return 1
elif (k==1 or k==2*n-1): return (n+2)//2
elif (n%2==0): return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
else: return T(n-1, k) + T(n-1, k-2)
@CachedFunction
def a(n): return sum( (k+1)*T(n, k) for k in (0..2*n) )
[a(n) for n in (0..40)] # G. C. Greubel, Dec 18 2021
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -36, 0, 12, 0]^n*[1; 6; 27; 72])[1, 1] \\ Charles R Greathouse IV, Oct 21 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved