cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A117907 Expansion of x + (1-x)^2/(1-x^6).

Original entry on oeis.org

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

Views

Author

Paul Barry, Apr 01 2006

Keywords

Comments

Diagonal sums of A117906.

Crossrefs

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