cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A152035 Expansion of g.f. (1-2*x^2)/(1-2*x-2*x^2).

This page as a plain text file.
%I A152035 #26 Sep 21 2023 01:21:26
%S A152035 1,2,4,12,32,88,240,656,1792,4896,13376,36544,99840,272768,745216,
%T A152035 2035968,5562368,15196672,41518080,113429504,309895168,846649344,
%U A152035 2313089024,6319476736,17265131520,47169216512,128868696064,352075825152,961889042432,2627929735168,7179637555200,19615134580736
%N A152035 Expansion of g.f. (1-2*x^2)/(1-2*x-2*x^2).
%C A152035 Essentially same as A028860. - _Philippe Deléham_, Sep 21 2009
%H A152035 G. C. Greubel, <a href="/A152035/b152035.txt">Table of n, a(n) for n = 0..1000</a>
%H A152035 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,2).
%F A152035 a(n) = 2*(a(n-1) + a(n-2)) for n >= 3. - _Peter Luschny_, Jan 03 2019
%p A152035 a := proc(n) option remember;
%p A152035 `if`(n < 3, [1, 2, 4][n+1], 2*(a(n-1) + a(n-2))) end:
%p A152035 seq(a(n), n=0..31); # _Peter Luschny_, Jan 03 2019
%t A152035 f[n_] = 2^n*Product[(1 + 2*Cos[k*Pi/n]^2), {k, 1, Floor[(n - 1)/2]}]; Table[FullSimplify[ExpandAll[f[n]]], {n, 0, 15}]
%t A152035 CoefficientList[Series[(1-2x^2)/(1-2x-2x^2),{x,0,40}],x] (* _Harvey P. Dale_, Sep 23 2014 *)
%t A152035 LinearRecurrence[{2,2},{1,2,4},40] (* _Harvey P. Dale_, May 12 2023 *)
%o A152035 (Magma) [1] cat [n le 2 select 2^n else 2*(Self(n-1) +Self(n-2)): n in [1..30]]; // _G. C. Greubel_, Sep 20 2023
%o A152035 (SageMath)
%o A152035 @CachedFunction
%o A152035 def a(n): # a = A152035
%o A152035     if n<3: return (1,2,4)[n]
%o A152035     else: return 2*(a(n-1) + a(n-2))
%o A152035 [a(n) for n in range(31)] # _G. C. Greubel_, Sep 20 2023
%Y A152035 Cf. A028860. Row sums of A322942.
%K A152035 nonn,easy
%O A152035 0,2
%A A152035 _Roger L. Bagula_, Nov 20 2008
%E A152035 Edited by _N. J. A. Sloane_, Apr 11 2009, based on comments from _Philippe Deléham_ and _R. J. Mathar_
%E A152035 More terms from _Philippe Deléham_, Sep 21 2009