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.

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

Original entry on oeis.org

2, 2, 4, 9, 16, 32, 65, 128, 256, 513, 1024, 2048, 4097, 8192, 16384, 32769, 65536, 131072, 262145, 524288, 1048576, 2097153, 4194304, 8388608, 16777217, 33554432, 67108864, 134217729, 268435456, 536870912, 1073741825, 2147483648
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Programs

  • GAP
    a:=[2,2,4,9];; for n in [5..40] do a[n]:=2*a[n-1]+a[n-3]-2*a[n-4]; od; a; # G. C. Greubel, Oct 18 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (2-2*x-x^3)/((1-2*x)*(1-x^3)) )); // G. C. Greubel, Oct 18 2019
    
  • Maple
    spec:= [S,{S=Union(Sequence(Prod(Z,Z,Z)),Sequence(Union(Z,Z)))},unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);
    seq(coeff(series((2-2*x-x^3)/((1-2*x)*(1-x^3)), x, n+1), x, n), n = 0 .. 40); # G. C. Greubel, Oct 18 2019
  • Mathematica
    CoefficientList[Series[(2-2*x-x^3)/((1-2*x)*(1-x^3)), {x, 0, 40}], x] (* G. C. Greubel, Oct 05 2017 *)
    LinearRecurrence[{2,0,1,-2}, {2,2,4,9}, 40] (* G. C. Greubel, Oct 18 2019 *)
  • PARI
    my(x='x+O('x^40)); Vec((2-2*x-x^3)/((1-2*x)*(1-x^3))) \\ G. C. Greubel, Oct 05 2017
    
  • Sage
    def A052935_list(prec):
        P. = PowerSeriesRing(ZZ, prec)
        return P((2-2*x-x^3)/((1-2*x)*(1-x^3))).list()
    A052935_list(40) # G. C. Greubel, Oct 18 2019
    

Formula

G.f.: (2-2*x-x^3)/((1-x^3)*(1-2*x)).
a(n) = a(n-1) + a(n-2) + 2*a(n-3) - 1.
a(n) = 2^n + Sum_{alpha=RootOf(-1+z^3)} alpha^(-n)/3.
a(n) = 2*A033138(n+1) - 2*A033138(n) - A033138(n-2). - R. J. Mathar, Nov 28 2011

Extensions

More terms from James Sellers, Jun 05 2000