login
A271800
Five steps forward, four steps back.
6
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,3
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
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}]
PROG
(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
CROSSREFS
Cf. A008611 (one step back, two steps forward).
Cf. A058207 (three steps forward, two steps back).
Cf. A260644 (four steps forward, three steps back).
Sequence in context: A131974 A181975 A062406 * A073792 A017870 A017860
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Apr 15 2016
STATUS
approved