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
From Paul Barry, Mar 03 2004: (Start)
G.f.: (1+4*x+6*x^2)/(1-6*x^2)^2 = (d/dx)((1+3*x)/(1-6*x^2)).
a(n) = 6^(n/2)*((3-sqrt(6))*(-1)^n + (3+sqrt(6)))*(n+1)/6. (End)
a(n) = 4*b(n) + b(n+1) + 6*b(n-1) with b(n)= 0, 1, 0, 12, 0, 108, 0, 864, ... (aerated A053469). - R. J. Mathar, Sep 29 2012
E.g.f.: (1 + 2*x)*cosh(sqrt(6)*x) + sqrt(2/3)*(1 + 3*x)*sinh(sqrt(6)*x). - Stefano Spezia, May 07 2023
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[n/2], If[EvenQ[n], T[n-1, k-2] +T[n-1, k-1] +T[n-1, k], T[n-1, k-2] +T[n-1, k]] ]];
Table[A027271[n], {n, 0, 40}] (* G. C. Greubel, Apr 12 2022 *)
PROG
(PARI) A027271(n)=my(b(n)=if(!bittest(n, 0), n\2*6^(n\2-1))); 4*b(n+1)+b(n+2)+6*b(n) \\ could be made more efficient and explicit by simplifying the formula for n even and for n odd separately. - M. F. Hasler, Sep 29 2012
(Magma) [Round(6^(n/2)*( 3*((n+1) mod 2) + Sqrt(6)*(n mod 2) )*(n+1)/3): n in [0..40]]; // G. C. Greubel, Apr 12 2022
(SageMath) [6^(n/2)*( 3*((n+1)%2) + sqrt(6)*(n%2) )*(n+1)/3 for n in (0..40)] # G. C. Greubel, Apr 12 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved