A014236 Expansion of g.f.: 2*x*(1-x)/((1-2*x)*(1-2*x^2)).
0, 2, 2, 8, 12, 32, 56, 128, 240, 512, 992, 2048, 4032, 8192, 16256, 32768, 65280, 131072, 261632, 524288, 1047552, 2097152, 4192256, 8388608, 16773120, 33554432, 67100672, 134217728, 268419072, 536870912, 1073709056, 2147483648, 4294901760, 8589934592
Offset: 0
Links
- Harvey P. Dale, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (2,2,-4).
Crossrefs
Second differences of A027556.
Programs
-
GAP
a:=[0,2,2];; for n in [4..30] do a[n]:=2*a[n-1]+2*a[n-2]-4*a[n-3]; od; a; # G. C. Greubel, Jun 22 2019
-
Magma
R
:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( 2*x*(1-x)/((1-2*x)*(1-2*x^2)) )); // G. C. Greubel, Jun 22 2019 -
Maple
f := n -> if n mod 2 = 0 then 2^n-2^(n/2) else 2^n; fi;
-
Mathematica
CoefficientList[Series[2x (1-x)/((1-2x)(1-2x^2)),{x,0,30}],x] (* or *) LinearRecurrence[{2,2,-4},{0,2,2},30] (* Harvey P. Dale, Dec 04 2018 *)
-
PARI
my(x='x+O('x^30)); concat([0], Vec(2*x*(1-x)/((1-2*x)*(1-2*x^2)))) \\ G. C. Greubel, Jun 22 2019
-
Sage
(2*x*(1-x)/((1-2*x)*(1-2*x^2))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jun 22 2019
Formula
a(n) = 2*A007179(n). - R. J. Mathar, Nov 14 2011
From G. C. Greubel, Jun 22 2019: (Start)
a(n) = 2^((n - 2)/2)*(2^((n + 2)/2) - 1 - (-1)^n).
E.g.f.: exp(2*x) - cosh(sqrt(2)*x). (End)
Extensions
G.f. corrected by Olivier Gérard, Nov 13 2011
Comments