OFFSET
0,8
COMMENTS
Diagonal sums of A117906.
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).
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
KEYWORD
easy,sign
AUTHOR
Paul Barry, Apr 01 2006
STATUS
approved