OFFSET
0,3
COMMENTS
Partial sums of A003269 (with leading zero).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,1,-1)
FORMULA
G.f.: x/((1-x)^2-x^4(1-x)) = x / ((x-1)*(x^4+x-1)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - a(n-5).
a(n) = a(n-1) + a(n-4) + 1.
MATHEMATICA
CoefficientList[Series[x/((1-x)^2-x^4*(1-x)), {x, 0, 50}], x] (* or *) LinearRecurrence[{2, -1, 0, 1, -1}, {0, 1, 2, 3, 4}, 50] (* G. C. Greubel, Feb 03 2018 *)
PROG
(PARI) x='x+O('x^30); concat([0], Vec(x/((1-x)^2-x^4*(1-x)))) \\ G. C. Greubel, Feb 03 2018
(Magma) I:=[0, 1, 2, 3, 4]; [n le 5 select I[n] else 2*Self(n-1) - Self(n-2) + Self(n-4) - Self(n-5): n in [1..30]]; // G. C. Greubel, Feb 03 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Sep 16 2004
STATUS
approved