A077957 Powers of 2 alternating with zeros.
1, 0, 2, 0, 4, 0, 8, 0, 16, 0, 32, 0, 64, 0, 128, 0, 256, 0, 512, 0, 1024, 0, 2048, 0, 4096, 0, 8192, 0, 16384, 0, 32768, 0, 65536, 0, 131072, 0, 262144, 0, 524288, 0, 1048576, 0, 2097152, 0, 4194304, 0, 8388608, 0, 16777216, 0, 33554432, 0, 67108864, 0, 134217728, 0, 268435456
Offset: 0
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,2).
Crossrefs
Column k=3 of A219946. - Alois P. Heinz, Dec 01 2012
Cf. A016116 (powers repeated).
Programs
-
GAP
Flat(List([0..30],n->[2^n,0])); # Muniru A Asiru, Aug 05 2018
-
Haskell
a077957 = sum . a204293_row -- Reinhard Zumkeller, Jan 14 2012
-
Magma
&cat [[2^n,0]: n in [0..20]]; // Vincenzo Librandi, Apr 03 2018
-
Maple
seq(op([2^n,0]),n=0..100); # Robert Israel, Dec 23 2014
-
Mathematica
a077957[n_] := Riffle[Table[2^i, {i, 0, n - 1}], Table[0, {n}]]; a077957[29] (* Michael De Vlieger, Dec 22 2014 *) CoefficientList[Series[1/(1 - 2*x^2), {x,0,50}], x] (* G. C. Greubel, Apr 12 2017 *) LinearRecurrence[{0, 2}, {1, 0}, 54] (* Robert G. Wilson v, Jul 23 2018 *) Riffle[2^Range[0,30],0,{2,-1,2}] (* Harvey P. Dale, Jan 06 2022 *)
-
PARI
a(n)=if(n<0||n%2, 0, 2^(n/2))
-
Sage
def A077957(): x, y = -1, 1 while True: yield -x x, y = x + y, x - y a = A077957(); [next(a) for i in range(40)] # Peter Luschny, Jul 11 2013
Formula
G.f.: 1/(1-2*x^2).
E.g.f.: cosh(x*sqrt(2)).
a(n) = (1 - n mod 2) * 2^floor(n/2).
a(n) = sqrt(2)^n*(1+(-1)^n)/2. - Paul Barry, May 13 2003
a(n) = 2*a(n-2) with a(0)=1, a(1)=0. - Jim Singh, Jul 12 2018
Comments