OFFSET
0,2
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-3,2).
FORMULA
G.f.: (1+x^4)/((1-x)*(1-2*x)*(1-x^2)). - Ralf Stephan, Apr 30 2004
From Colin Barker, Sep 29 2017: (Start)
a(n) = (17*2^n - 6*n - 9 + (-1)^n)/6 for n>0.
a(n) = 3*a(n-1) - a(n-2) - 3*a(n-3) + 2*a(n-4) for n>4. (End)
E.g.f.: (1/6)*(-3 -3*3+2*x)*exp(x) + 17*exp(2*x) + exp(-x)). - G. C. Greubel, Jun 21 2024
MATHEMATICA
LinearRecurrence[{3, -1, -3, 2}, {1, 3, 8, 18, 40}, 40] (* Harvey P. Dale, Jan 17 2024 *)
PROG
(PARI) Vec((1 + x^4) / ((1 - x)^2*(1 + x)*(1 - 2*x)) + O(x^40)) \\ Colin Barker, Sep 29 2017
(Magma) [n eq 0 select 1 else (17*2^n -6*n-9+(-1)^n)/6: n in [0..40]]; // G. C. Greubel, Jun 21 2024
(SageMath) [(17*2^n -6*n -9 +(-1)^n -3*int(n==0))/6 for n in range(41)] # G. C. Greubel, Jun 21 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved