OFFSET
0,2
COMMENTS
In each group of 8 consecutive numbers, swap 5 and 8 terms, 6 and 7 terms.
LINKS
FORMULA
G.f.: (1 + x + x^2 + x^3 + 4*x^4 - x^5 - x^6 - x^7 + 3*x^8)/((1 - x)^2*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)).
a(n) = a(n-1) + a(n-8) - a(n-9).
a(n) = 1 + n + 3*floor(n/4) - 2*floor((n+1)/8) - 2*floor((n+2)/8) - 2*floor((n+3)/8). - Vaclav Kotesovec, Apr 19 2016
MATHEMATICA
CoefficientList[Series[(1 + x + x^2 + x^3 + 4 x^4 - x^5 - x^6 - x^7 + 3 x^8)/((1 - x)^2 (1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7)), {x, 0, 75}], x]
LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 1, -1}, {1, 2, 3, 4, 8, 7, 6, 5, 9}, 75]
PROG
(PARI) x='x+O('x^99); Vec((1+x+x^2+x^3+4*x^4-x^5-x^6-x^7+3*x^8)/((1-x)^2*(1+x+x^2+x^3 +x^4+x^5+x^6+x^7))) \\ Altug Alkan, Apr 18 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ilya Gutkovskiy, Apr 17 2016
STATUS
approved