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 (3,-4,6,-4).
FORMULA
From R. J. Mathar, Apr 04 2008: (Start)
O.g.f.: (1 - x + 2*x^2 - 3*x^3)/((1-x)*(1-2*x)*(1+2*x^2)).
a(n) = (5*2^n + 2 - A077966(n))/6. (End)
MATHEMATICA
LinearRecurrence[{3, -4, 6, -4}, {1, 2, 4, 7}, 41] (* Harvey P. Dale, Aug 12 2016 *)
PROG
(PARI) a(n)=(5<<n - imag(quadgen(-8)^(n+1)) + 2)/6 \\ Charles R Greathouse IV, Mar 30 2022
(Magma) [(5*2^n +2 -((n+1) mod 2)*(-2)^Floor((n+1)/2))/6: n in [0..40]]; // G. C. Greubel, Jan 19 2023
(SageMath) [(5*2^n +2 -((n+1)%2)*(-2)^((n+1)//2))/6 for n in range(41)] # G. C. Greubel, Jan 19 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Mar 31 2008
EXTENSIONS
More terms from R. J. Mathar, Apr 04 2008
STATUS
approved