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.
%I A052531 #57 Jul 02 2025 16:01:58 %S A052531 2,2,5,8,17,32,65,128,257,512,1025,2048,4097,8192,16385,32768,65537, %T A052531 131072,262145,524288,1048577,2097152,4194305,8388608,16777217, %U A052531 33554432,67108865,134217728,268435457,536870912,1073741825,2147483648 %N A052531 If n is even then 2^n+1 otherwise 2^n. %H A052531 G. C. Greubel, <a href="/A052531/b052531.txt">Table of n, a(n) for n = 0..1000</a> %H A052531 IBM Research, <a href="https://www.research.ibm.com/haifa/ponderthis/challenges/October2020.html">Control-flow graphs</a>, Ponder This Challenge, October 2020. %H A052531 INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=461">Encyclopedia of Combinatorial Structures 461</a> %H A052531 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-2). %F A052531 G.f.: (2 - 2*x - x^2)/( (1-x^2)*(1-2*x) ). %F A052531 a(n) = a(n-1) + 2*a(n-2) - 1, with a(0) = 2, a(1) = 2, a(2) = 5. %F A052531 a(n) = 2^n + Sum_{alpha = RootOf(-1+x^2)} alpha^(-n)/2. %F A052531 a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3), with a(0) = 2, a(1) = 2, a(2) = 5. - _G. C. Greubel_, May 09 2019 %F A052531 a(n) = 2^n + (1 + (-1)^n)/2. - _G. C. Greubel_, Oct 17 2019 %F A052531 E.g.f.: exp(2*x) + cosh(x). - _Stefano Spezia_, Oct 18 2019 %p A052531 spec:= [S,{S=Union(Sequence(Union(Z,Z)),Sequence(Prod(Z,Z)))},unlabeled]: seq(combstruct[count](spec,size=n), n=0..20); %p A052531 seq(2^n + (1+(-1)^n)/2, n=0..30); # _G. C. Greubel_, Oct 17 2019 %t A052531 2^# + (1 - Mod[#, 2]) & /@ Range[0, 40] (* Peter Pein, Jan 11 2008 *) %t A052531 Table[If[EvenQ[n], 2^n + 1, 2^n], {n, 0, 40}] (* _Vladimir Joseph Stephan Orlovsky_, Feb 07 2010, modified by _G. C. Greubel_, May 09 2019 *) %t A052531 Table[2^n + Boole[EvenQ[n]], {n, 0, 31}] (* _Alonso del Arte_, May 09 2019 *) %o A052531 (PARI) my(x='x+O('x^40)); Vec((2-2*x-x^2)/((1-x^2)*(1-2*x))) \\ _G. C. Greubel_, May 09 2019 %o A052531 (PARI) a(n) = 1<<n + 1 - (n%2) \\ _David A. Corneth_, Oct 18 2019 %o A052531 (Magma) [2^n + (1+(-1)^n)/2: n in [0..30]]; // _G. C. Greubel_, May 09 2019 %o A052531 (Sage) [2^n + (1+(-1)^n)/2 for n in (0..30)] # _G. C. Greubel_, May 09 2019 %o A052531 (GAP) a:=[2,2,5];; for n in [4..40] do a[n]:=2*a[n-1]+a[n-2]-2*a[n-3]; od; a; # _G. C. Greubel_, May 09 2019 %Y A052531 Cf. A001045, A042950, A052929, A062510, A087288, A280345. %K A052531 easy,nonn %O A052531 0,1 %A A052531 encyclopedia(AT)pommard.inria.fr, Jan 25 2000 %E A052531 More terms from _James Sellers_, Jun 05 2000 %E A052531 Better definition from Peter Pein (petsie(AT)dordos.net), Jan 11 2008