login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A008936
Expansion of (1 - 2*x -x^4)/(1 - 2*x)^2 in powers of x.
1
1, 2, 4, 8, 15, 28, 52, 96, 176, 320, 576, 1024, 1792, 3072, 5120, 8192, 12288, 16384, 16384, 0, -65536, -262144, -786432, -2097152, -5242880, -12582912, -29360128, -67108864, -150994944, -335544320, -738197504, -1610612736, -3489660928, -7516192768, -16106127360, -34359738368
OFFSET
0,2
FORMULA
From Michael Somos, Aug 19 2014: (Start)
a(n) = 2^n for all n<4.
a(n) = 2^n - (n-3) * 2^(n-4) for all n>=4.
a(n) = 4*(a(n-1) - a(n-2)) for all n in Z except n=4.
a(n) = 2*a(n-1) - 2^(n-4).
0 = a(n)*(-8*a(n+1) + 8*a(n+2) - 2*a(n+3)) + a(n+1)*(+4*a(n+1) - 4*a(n+2) + a(n+3)) for all n in Z. (End)
E.g.f.: ( -3 -4*x -2*x^2 + (19 - 2*x)*exp(2*x) )/16. - G. C. Greubel, Sep 13 2019
EXAMPLE
G.f. = 1 + 2*x + 4*x^2 + 8*x^3 + 15*x^4 + 28*x^5 + 52*x^6 + 96*x^7 + 176*x^8 + ...
MAPLE
A008936 := proc(n) option remember; if n <= 3 then 2^n else 2*A008936(n-1)-2^(n-4); fi; end;
MATHEMATICA
a[ n_]:= 2^n - 2^(n-4) Max[0, n-3]; (* Michael Somos, Aug 19 2014 *)
Table[If[n < 4, 2^n, 2^(n-4)*(19 - n)], {n, 0, 40}] (* G. C. Greubel, Sep 13 2019 *)
PROG
(PARI) {a(n) = 2^n - 2^(n-4) * max(n-3, 0)}; /* Michael Somos, Jan 12 2000 */
(PARI) Vec((1-2*x-x^4)/(1-2*x)^2 +O(x^40)) \\ Charles R Greathouse IV, Sep 26 2012
(Magma) [n lt 4 select 2^n else 2^(n-4)*(19-n): n in [0..40]]; // G. C. Greubel, Sep 13 2019
(Sage) [1, 2, 4, 8]+[2^(n-4)*(19 - n) for n in (4..40)] # G. C. Greubel, Sep 13 2019
(GAP) a:=[1, 2];; for n in [3..40] do a[n]:=4*(a[n-1]-a[n-2]); od; a; # G. C. Greubel, Sep 13 2019
CROSSREFS
Sequence in context: A114833 A065617 A062065 * A320452 A073769 A008937
KEYWORD
sign,easy
AUTHOR
N. J. A. Sloane, Alejandro Teruel (teruel(AT)usb.ve)
EXTENSIONS
Better description from Michael Somos, Jan 12 2000
More terms added by G. C. Greubel, Sep 13 2019
STATUS
approved