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.

A247920 Expansion of 1 / (1 + x + x^2 - x^5) in powers of x.

Original entry on oeis.org

1, -1, 0, 1, -1, 1, -1, 0, 2, -3, 2, 0, -2, 4, -5, 3, 2, -7, 9, -7, 1, 8, -16, 17, -8, -8, 24, -32, 25, -1, -32, 57, -57, 25, 31, -88, 114, -83, -6, 120, -202, 196, -77, -125, 322, -399, 273, 49, -447, 720, -672, 225, 496, -1168, 1392, -896, -271, 1663, -2560
Offset: 0

Views

Author

Michael Somos, Sep 26 2014

Keywords

Examples

			G.f. = 1 - x + x^3 - x^4 + x^5 - x^6 + 2*x^8 - 3*x^9 + 2*x^10 - 2*x^12 + ...
		

Crossrefs

Cf. A017818.

Programs

  • GAP
    a:=[1,-1,0,1,-1];; for n in [6..60] do a[n]:=-(a[n-1]+a[n-2]-a[n-5]); od; a; # G. C. Greubel, Dec 29 2019
  • Magma
    m:=50; R:=PowerSeriesRing(Integers(), m); Coefficients(R!(1 / ((1+x^2)*(1+x-x^3)))); // G. C. Greubel, Aug 04 2018
    
  • Maple
    seq(coeff(series(1/(1+x+x^2-x^5), x, n+1), x, n), n = 0..60); # G. C. Greubel, Dec 29 2019
  • Mathematica
    CoefficientList[Series[1/(1+x+x^2-x^5), {x, 0, 60}], x] (* Vincenzo Librandi, Sep 27 2014 *)
  • PARI
    {a(n) = if( n<0, n=-5-n; polcoeff( 1 / (1 - x^3 - x^4 - x^5) + x * O(x^n), n), polcoeff( 1 / (1 + x + x^2 - x^5) + x * O(x^n), n))};
    
  • Sage
    def A247920_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P( 1/(1+x+x^2-x^5) ).list()
    A247920_list(60) # G. C. Greubel, Dec 29 2019
    

Formula

G.f.: 1 / ((1 + x^2) * (1 + x - x^3)).
a(n) = A017818(-5-n) for all n in Z.
0 = a(n) - a(n+3) - a(n+4) - a(n+5) for all n in Z.
0 = a(n) - a(n+2) - a(n+3) + (-1)^floor(n/2) * mod(n,2) for all n in Z.