A117907 Expansion of x + (1-x)^2/(1-x^6).
1, -1, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1, 0, 0, 0, 1, -2, 1
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (-1,-1,-1,-1,-1).
Programs
-
Magma
R
:=PowerSeriesRing(Integers(), 90); Coefficients(R!( x + (1-x)^2/(1-x^6) )); // G. C. Greubel, Oct 20 2021 -
Mathematica
(* From Harvey P. Dale, Nov 29 2013 *) CoefficientList[Series[x+(1-x)^2/(1-x^6), {x,0,90}], x] Join[{1,-1}, LinearRecurrence[{-1,-1,-1,-1,-1}, {1,0,0,0,1}, 90]] PadRight[{1,-1}, 90, {1,-2,1,0,0,0}] (* End *)
-
Sage
def A117907(n): return (-1)^n if (n<2) else (((5*n-1)//3)%2) - 3*bool(n%6==1) [A117907(n) for n in (0..90)] # G. C. Greubel, Oct 20 2021
Formula
G.f.: (1 +x^2 +x^3 +x^4 +x^5 +x^6)/(1 +x +x^2 +x^3 +x^4 +x^5).
a(n) = floor((5*n-1)/3) mod 2 - 3*[(n mod 6) = 1], n >= 2, with a(0) = 1, a(1) = -1. - G. C. Greubel, Oct 20 2021
Comments