OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000 (a(301) = 43 corrected by Georg Fischer, Apr 10 2019 *)
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,1,-1).
FORMULA
G.f.: x*(1+x+x^2+x^3-x^4-x^5-x^6) / ((1-x)^2*(1+x+x^2+x^3+x^4+x^5+x^6)).
a(n) = a(n-1) + a(n-7) - a(n-8) for n>7.
a(n) = Sum_{i=1..n} (-1)^floor((2i - 2)/7).
EXAMPLE
a(6k): 0, 2, 4, 6, 6, 6, 6, 6, 8, 10, 12, 12, 12, 12, 12, 14, ...
a(6k+1): 1, 1, 3, 5, 7, 7, 7, 7, 7, 9, 11, 13, 13, 13, 13, 13, ...
a(6k+2): 2, 2, 2, 4, 6, 8, 8, 8, 8, 8, 10, 12, 14, 14, 14, 14, ...
a(6k+3): 3, 3, 3, 3, 5, 7, 9, 9, 9, 9, 9, 11, 13, 15, 15, 15, ...
a(6k+4): 4, 4, 4, 4, 4, 6, 8, 10, 10, 10, 10, 10, 12, 14, 16, 16, ...
a(6k+5): 3, 5, 5, 5, 5, 5, 7, 9, 11, 11, 11, 11, 11, 13, 15, 17, ...
MATHEMATICA
Table[Sum[(-1)^Floor[(2 i - 2)/7], {i, n}], {n, 0, 100}]
LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 2, 3, 4, 3, 2, 1}, 90] (* Harvey P. Dale, Dec 27 2023 *)
PROG
(PARI) concat(0, Vec((x+x^2+x^3+x^4-x^5-x^6-x^7)/((x-1)^2*(1+x+x^2+x^3+x^4+x^5+x^6)) + O(x^100))) \\ Altug Alkan, Nov 12 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Nov 11 2015
STATUS
approved