OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (2,2,-4).
FORMULA
G.f.: x*(1 - x^2)/(1 - 2*x - 2*x^2 + 4*x^3). - Michael De Vlieger, Sep 23 2016
From Colin Barker, Sep 23 2016: (Start)
a(n) = 3*2^(n-2)-2^(n/2-1) for n even.
a(n) = 3*2^(n-2)-2^((n-3)/2) for n odd.
(End)
a(n) = A135098(n-1) for n >= 1. - Georg Fischer, Nov 02 2018
EXAMPLE
MATHEMATICA
Table[2^n - (2^(n - 2) + 2^(Floor[n/2] - 1)), {n, 40}] (* after Harvey P. Dale at A005418, or *)
CoefficientList[Series[(1 - x^2)/(1 - 2 x - 2 x^2 + 4 x^3), {x, 0, 40}], x] (* Michael De Vlieger, Sep 23 2016 *)
PROG
(PARI) Vec(x*(1-x)*(1+x)/((1-2*x)*(1-2*x^2)) + O(x^40)) \\ Colin Barker, Sep 23 2016
(Magma) [2^n - (2^(n - 2) + 2^(Floor(n/2) - 1)): n in [1..40]]; // G. C. Greubel, Nov 02 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Jan 01 2008
EXTENSIONS
More terms from Colin Barker, Mar 19 2013
Missing a(4) added by Michael De Vlieger, Sep 23 2016
STATUS
approved