A260644 Four steps forward, three steps back.
0, 1, 2, 3, 4, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 3, 4, 5, 6, 5, 4, 3, 4, 5, 6, 7, 6, 5, 4, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 9, 8, 7, 6, 7, 8, 9, 10, 9, 8, 7, 8, 9, 10, 11, 10, 9, 8, 9, 10, 11, 12, 11, 10, 9, 10, 11, 12, 13, 12, 11, 10, 11, 12, 13, 14, 13, 12, 11
Offset: 0
Examples
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, ...
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).
Crossrefs
Programs
-
Maple
A260644:=n->add((-1)^floor((2*i-2)/7), i=1..n): seq(A260644(n), n=0..100);
-
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 *)
-
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
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).