OFFSET
0,2
COMMENTS
Partial sums of A155980 for n > 2. - Klaus Purath, Jan 30 2021
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
FORMULA
G.f.: x*(2 - 4*x + x^2)/((1-x^2)*(1-2*x)).
E.g.f.: (exp(2*x) + 3*exp(x) - 7*exp(-x) + 3)/6.
From Paul Curtz, Dec 20 2020: (Start)
a(n) + (period 2 sequence: repeat [1, -2]) = A328284(n+2).
a(n+1) + (period 2 sequence: repeat [-2, 1]) = A001045(n).
a(n+1) + (period 2 sequence: repeat [-1, 0]) = A078008(n).
a(n+1) + (period 2 sequence : repeat [-3, 2]) = -(-1)^n*A084247(n).
a(n+4) = a(n+1) + 7*A001045(n).
a(n+4) + a(n+1) = A181565(n).
MAPLE
G(x):=x*(2 - 4*x + x^2)/((1-x^2)*(1-2*x)): f[0]:=G(x): for n from 1 to 30 do f[n]:=diff(f[n-1], x) od: x:=0: seq(f[n]/n!, n=0..30);
MATHEMATICA
Join[{0}, Table[(2^n +3 -7*(-1)^n)/6, {n, 40}]] (* G. C. Greubel, Oct 11 2016 *)
LinearRecurrence[{2, 1, -2}, {0, 2, 0, 3}, 40] (* Harvey P. Dale, Feb 13 2024 *)
PROG
(Magma) a135351:=func< n | (2^n+3-7*(-1)^n+3*0^n)/6 >; [ a135351(n): n in [0..32] ]; // Klaus Brockhaus, Dec 05 2009
(PARI) a(n) = (2^n + 3 - 7*(-1)^n + 3*0^n)/6; \\ Michel Marcus, Oct 11 2016
(Sage) [(2^n+3-7*(-1)^n+3*0^n)/6 for n in (0..40)] # G. C. Greubel, Sep 02 2019
(GAP) List([0..40], n-> (2^n+3-7*(-1)^n+3*0^n)/6); # G. C. Greubel, Sep 02 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Miklos Kristof, Dec 07 2007
EXTENSIONS
First part of definition corrected by Klaus Brockhaus, Dec 05 2009
STATUS
approved