OFFSET
0,9
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..5000
FORMULA
Euler transform of length 12 sequence [0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, -1].
G.f.: x * (1 - x + x^3 - x^5 + x^6) / (1 - x - x^7 + x^8).
G.f.: x / (1 - x^3 / (1 - x / (1 + x / (1 - x^5 / (1 - x / (1 + x^2 / (1 - x^2))))))).
a(n) = -a(-n) = a(n-7) + 1 = a(n-1) + a(n-7) - a(n-8) for all n in Z.
0 = 2*a(n) - a(n+1) + a(n+2) - 2*a(n+3) + (a(n+1) - a(n+2))^2 for all n in Z.
a(n+1) - a(n) = A131372(n).
EXAMPLE
G.f. = x + x^4 + x^5 + x^7 + 2*x^8 + x^9 + x^10 + 2*x^11 + 2*x^12 + x^13 + ...
MAPLE
a:= n -> [0, 1, 0, 0, 1, 1, 0][n mod 7 + 1] + floor(n/7):
seq(a(n), n=0..20); # Robert Israel, Aug 13 2014
MATHEMATICA
a[ n_] := Quotient[ n+3, 7] + {1, 0, 0, 0, 0, -1, 0}[[Mod[ n, 7, 1]]];
a[ n_] := Sign[n] * SeriesCoefficient[ x * (1 - x^12) / ((1 - x^3) * (1 - x^4) * (1 - x^7)), {x, 0, Abs[n]}];
CoefficientList[Series[x (1 - x + x^3 - x^5 + x^6)/(1 - x - x^7 + x^8), {x, 0, 100}], x] (* Vincenzo Librandi, Aug 14 2014 *)
LinearRecurrence[{1, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 0, 0, 1, 1, 0, 1}, 90] (* Harvey P. Dale, Sep 29 2024 *)
PROG
(PARI) {a(n) = (n+3)\7 + (n%7==1) - (n%7==6)};
(PARI) {a(n) = sign(n) * polcoeff( x * (1 - x^12) / ((1 - x^3) * (1 - x^4) * (1 - x^7)) + x * O(x^abs(n)), abs(n))};
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!(x*(1 -x+x^3-x^5+x^6)/(1-x-x^7+x^8))); // G. C. Greubel, Aug 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Aug 13 2014
STATUS
approved