%I #28 Feb 04 2023 13:47:26
%S 1,1,2,2,-4,-4,-8,-8,16,16,32,32,-64,-64,-128,-128,256,256,512,512,
%T -1024,-1024,-2048,-2048,4096,4096,8192,8192,-16384,-16384,-32768,
%U -32768,65536,65536,131072,131072,-262144,-262144,-524288,-524288,1048576,1048576
%N a(n) = (-1)^floor(n/4) * 2^floor(n/2).
%H G. C. Greubel, <a href="/A320770/b320770.txt">Table of n, a(n) for n = 0..5000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,-4).
%F G.f.: (1 + x) * (1 + 2*x^2) / (1 + 4*x^4).
%F G.f.: A(x) = 1/(1 - x/(1 - x/(1 + 2*x/(1 - 4*x/(1 + 3*x/(1 + 5*x/(3 - 2*x))))))).
%F a(n) = (-1)^floor(n/2) * 2 * a(n-2) = -4 * a(n-4) for all n in Z.
%F a(n) = c(n) * (-2)^n * a(-n) for all n in Z where c(4*k+2) = -1 else 1.
%F a(n) = a(n+1) = (1+I)^n * (-I)^(n/2) * (-1)^floor(n/4) if n = 2*k.
%F a(n) = (-1)^floor(n/4) * A016116(n).
%F E.g.f.: cosh(x)*(cos(x) + sin(x)) + sin(x)*sinh(x). - _Stefano Spezia_, Feb 04 2023
%e G.f. = 1 + x + 2*x^2 + 2*x^3 - 4*x^4 - 4*x^5 - 8*x^6 - 8*x^7 + ...
%t a[ n_] := (-1)^Quotient[n, 4] * 2^Quotient[n, 2];
%o (PARI) {a(n) = (-1)^floor(n/4) * 2^floor(n/2)};
%o (Magma) [(-1)^Floor(n/4)* ^Floor(n/2): n in [0..50]]; // _G. C. Greubel_, Oct 27 2018
%o (Python)
%o def A320770(n): return -(1<<(n>>1)) if n&4 else 1<<(n>>1) # _Chai Wah Wu_, Jan 18 2023
%Y Cf. A016116.
%Y The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A029744 = {s(n), n>=1}, the numbers 2^k and 3*2^k, as the parent: A029744 (s(n)); A052955 (s(n)-1), A027383 (s(n)-2), A354788 (s(n)-3), A347789 (s(n)-4), A209721 (s(n)+1), A209722 (s(n)+2), A343177 (s(n)+3), A209723 (s(n)+4); A060482, A136252 (minor differences from A354788 at the start); A354785 (3*s(n)), A354789 (3*s(n)-7). The first differences of A029744 are 1,1,1,2,2,4,4,8,8,... which essentially matches eight sequences: A016116, A060546, A117575, A131572, A152166, A158780, A163403, A320770. The bisections of A029744 are A000079 and A007283. - _N. J. A. Sloane_, Jul 14 2022
%K sign,easy
%O 0,3
%A _Michael Somos_, Oct 20 2018