OFFSET
0,3
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,2,0,0,0,0,0,0,-1).
FORMULA
a(n) = a(n-7) + (-1)^((n+1) mod 7) + 7 for n>6.
From Colin Barker, Dec 13 2015: (Start)
a(n) = 2*a(n-7) - a(n-14) for n>13.
G.f.: x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2). (End)
EXAMPLE
-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, ...
+ + + + + + + + + + + + + + + + + + +
0, 0, 0, 0, 0, 0, 1, -1, 1, -1, 1, -1, 1, 2, -2, 2, -2, 2, -2, ...
-------------------------------------------------------------------------
0, 1, 2, 3, 4, 5, 7, 6, 9, 8, 11, 10, 13, 15, 12, 17, 14, 19, 16, ...
-------------------------------------------------------------------------
MAPLE
A265672:=n->n + floor((n+1)/7)*(-1)^((n+1) mod 7): seq(A265672(n), n=0..100); # Wesley Ivan Hurt, Apr 09 2017
MATHEMATICA
Table[n + Floor[(n + 1)/7] (-1)^Mod[n + 1, 7], {n, 0, 80}] (* Bruno Berselli, Dec 22 2015 *)
PROG
(PARI) concat(0, Vec(x*(1 +x^2)*(1 +2*x +2*x^2 +2*x^3 +3*x^4 +5*x^5 +3*x^6 +2*x^7 +x^8 +3*x^9 +x^10) / ((1 -x)^2*(1 +x +x^2 +x^3 +x^4 +x^5 +x^6)^2) + O(x^100))) \\ Colin Barker, Dec 13 2015
(Magma) [n+Floor((n+1)/7)*(-1)^((n+1) mod 7): n in [0..80]]; // Bruno Berselli, Dec 26 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Dec 13 2015
EXTENSIONS
Edited by Bruno Berselli, Dec 22 2015
STATUS
approved