The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A052552 a(2*n+1) = 1, a(2*n) = 2*a(2*n-2) - 1. 1
 2, 1, 3, 1, 5, 1, 9, 1, 17, 1, 33, 1, 65, 1, 129, 1, 257, 1, 513, 1, 1025, 1, 2049, 1, 4097, 1, 8193, 1, 16385, 1, 32769, 1, 65537, 1, 131073, 1, 262145, 1, 524289, 1, 1048577, 1, 2097153, 1, 4194305, 1, 8388609, 1, 16777217, 1, 33554433, 1, 67108865, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,1 COMMENTS Interleaving of A000051 and A000012. - Klaus Brockhaus, Jun 27 2011 LINKS G. C. Greubel, Table of n, a(n) for n = 0..1000 INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 489 Index entries for linear recurrences with constant coefficients, signature (1,2,-2). FORMULA G.f.: (2 - x - 2*x^2)/((1-2*x^2)*(1-x)). a(n) = +a(n-1) +2*a(n-2) -2*a(n-3). a(n) = 1 + Sum(1/2*_alpha^(-n), _alpha=RootOf(-1+2*_Z^2)). a(n) = abs(a(n-1)-a(n-2)-a(n-1)*a(n-2)), a(0)=2, a(1)=1. - Pasi Airikka, Jun 27 2011 a(n) = 1 + (1+(-1)^n)*sqrt(2)^(n-2). - Bruno Berselli, Jun 27 2011 MAPLE spec := [S, {S=Union(Sequence(Prod(Z, Union(Z, Z))), Sequence(Z))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20); MATHEMATICA LinearRecurrence[{1, 2, -2}, {2, 1, 3}, 60] (* G. C. Greubel, May 07 2019 *) PROG (MAGMA) [ n eq 1 select 2 else IsOdd(n) select 2*Self(n-2)-1 else 1: n in [1..60] ]; // Klaus Brockhaus, Jun 27 2011 (MAGMA) I:=[ 2, 1 ]; [ n le 2 select I[n] else Abs(Self(n-1)-Self(n-2)-Self(n-1)*Self(n-2)): n in [1..60] ]; // Klaus Brockhaus, Jun 27 2011 (PARI) my(x='x+O('x^60)); Vec((2-x-2*x^2)/((1-2*x^2)*(1-x))) \\ G. C. Greubel, May 07 2019 (Sage) ((2-x-2*x^2)/((1-2*x^2)*(1-x))).series(x, 60).coefficients(x, sparse=False) # G. C. Greubel, May 07 2019 (GAP) a:=[2, 1, 3];; for n in [4..60] do a[n]:=a[n-1]+2*a[n-2]-2*a[n-3]; od; a; # G. C. Greubel, May 07 2019 CROSSREFS Sequence in context: A227288 A126132 A129982 * A147000 A147486 A168018 Adjacent sequences:  A052549 A052550 A052551 * A052553 A052554 A052555 KEYWORD easy,nonn AUTHOR encyclopedia(AT)pommard.inria.fr, Jan 25 2000 EXTENSIONS More terms from James A. Sellers, Jun 05 2000 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified January 23 01:15 EST 2020. Contains 331166 sequences. (Running on oeis4.)