A271800 Five steps forward, four steps back.
0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13, 12, 11, 10
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,1,-1).
Crossrefs
Programs
-
Maple
A271800:=n->add((-1)^floor((2*i-2)/9), i=1..n): seq(A271800(n), n=0..200);
-
Mathematica
Table[Sum[(-1)^Floor[(2 i - 2)/9], {i, n}], {n, 0, 100}]
-
PARI
concat(0, Vec(x*(1+x+x^2+x^3+x^4-x^5-x^6-x^7-x^8)/((1-x)^2*(1+x+x^2)*(1+x^3+x^6)) + O(x^50))) \\ Colin Barker, Apr 15 2016
Formula
a(n) = a(n-1) + a(n-9) - a(n-10) for n>9.
a(n) = Sum_{i=1..n} (-1)^floor((2*i-2)/9).
G.f.: x*(1+x+x^2+x^3+x^4-x^5-x^6-x^7-x^8) / ((1-x)^2*(1+x+x^2)*(1+x^3+x^6)). - Colin Barker, Apr 15 2016