A052935 Expansion of (2-2*x-x^3)/((1-2*x)*(1-x^3)).
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
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 923
- Index entries for linear recurrences with constant coefficients, signature (2,0,1,-2).
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.
Extensions
More terms from James Sellers, Jun 05 2000