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.

Showing 1-2 of 2 results.

A077989 Expansion of 1/(1+2*x+x^2-2*x^3).

Original entry on oeis.org

1, -2, 3, -2, -3, 14, -29, 38, -19, -58, 211, -402, 477, -130, -1021, 3126, -5491, 5814, 115, -17026, 45565, -73874, 68131, 28742, -273363, 654246, -977645, 754318, 777501, -4264610, 9260355, -12701098, 7612621, 15996566, -65007949, 129244574, -161488067, 63715662, 292545891
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Crossrefs

Cf. A077942.

Programs

  • GAP
    a:=[1,-2,3];; for n in [4..40] do a[n]:=-2*a[n-1]-a[n-2]+2*a[n-3]; od; a; # G. C. Greubel, Jun 26 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( 1/(1+2*x+x^2-2*x^3) )); // G. C. Greubel, Jun 26 2019
    
  • Mathematica
    LinearRecurrence[{-2,-1,2}, {1,-2,3}, 40] (* or *) CoefficientList[Series[1/(1+2*x+x^2-2*x^3), {x,0,40}], x] (* G. C. Greubel, Jun 26 2019 *)
  • PARI
    my(x='x+O('x^40)); Vec(1/(1+2*x+x^2-2*x^3)) \\ G. C. Greubel, Jun 26 2019
    
  • Sage
    (1/(1+2*x+x^2-2*x^3)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 26 2019
    

Formula

a(n) = (-1)^n * A077942(n). - G. C. Greubel, Jun 26 2019
a(n) = (-1)^n*Sum_{k=0..(n+1)/2} binomial(n+1-k,2k+1)*(-2)^k, n>=0. - Taras Goy, Apr 15 2020

A123957 Expansion of g.f.: x^4/((1+2*x) * (1-2*x+x^2+2*x^3)).

Original entry on oeis.org

0, 0, 0, 1, 0, 3, -4, 5, -24, 19, -76, 133, -208, 627, -852, 2181, -4232, 7443, -18012, 30533, -66880, 133875, -250724, 547013, -1020152, 2108435, -4245612, 8217861, -17089968, 33202291, -67158900, 135095301, -265925992, 541112339, -1069523580, 2146659781, -4309316128, 8553624307
Offset: 1

Views

Author

Roger L. Bagula and Gary W. Adamson, Oct 27 2006

Keywords

Programs

  • GAP
    a:=[0, 0, 0, 1];; for n in [5..40] do a[n]:=3*a[n-2]-4*a[n-3] -4*a[n-4]; od; a; # G. C. Greubel, Aug 05 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); [0,0,0] cat Coefficients(R!( x^4/((1+2*x)*(1-2*x+x^2+2*x^3)) )); // G. C. Greubel, Aug 05 2019
    
  • Maple
    seq(coeff(series(x^4/((1+2*x)*(1-2*x+x^2+2*x^3)), x, n+1), x, n), n = 1..40); # G. C. Greubel, Aug 05 2019
  • Mathematica
    M = {{0,1,0,0}, {0,0,1,0}, {0,0,0,1}, {-4,-4,3,0}}; v[1] = {0,0,0,1}; v[n_]:= v[n] = M.v[n-1]; Table[v[n][[1]], {n, 40}]
    Rest@CoefficientList[Series[x^4/((1+2*x)*(1-2*x+x^2+2*x^3)),{x,0,40}],x] (* or *) LinearRecurrence[{0,3,-4,-4},{0,0,0,1},40] (* Harvey P. Dale, Dec 27 2015 *)
  • PARI
    my(x='x+O('x^40)); concat([0,0,0], Vec(x^4/((1+2*x)*(1-2*x+x^2+ 2*x^3)))) \\ G. C. Greubel, Aug 05 2019
    
  • Sage
    a=(x^4/((1+2*x) * (1-2*x+x^2+2*x^3))).series(x, 40).coefficients(x, sparse=False); a[1:] # G. C. Greubel, Aug 05 2019
    

Formula

a(n)= 3*a(n-2) -4*a(n-3) -4*a(n-4).
a(n)= ((-2)^n -9*A077942(n) +20*A077942(n-1) -17*A077942(n-2))/32, n>3.

Extensions

Definition replaced with generating function. - the Assoc. Eds of the OEIS, Mar 28 2010
Showing 1-2 of 2 results.