login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A117907
Expansion of x + (1-x)^2/(1-x^6).
2
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,8
COMMENTS
Diagonal sums of A117906.
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
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 *)
PROG
(Magma) R<x>:=PowerSeriesRing(Integers(), 90); Coefficients(R!( x + (1-x)^2/(1-x^6) )); // G. C. Greubel, Oct 20 2021
(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
CROSSREFS
Sequence in context: A024944 A304871 A362370 * A300069 A284586 A281244
KEYWORD
easy,sign
AUTHOR
Paul Barry, Apr 01 2006
STATUS
approved