login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A140407 A000225 interleaved with A000051. 1

%I #19 Dec 22 2022 02:42:44

%S 1,2,3,3,7,5,15,9,31,17,63,33,127,65,255,129,511,257,1023,513,2047,

%T 1025,4095,2049,8191,4097,16383,8193,32767,16385,65535,32769,131071,

%U 65537,262143,131073,524287,262145,1048575,524289,2097151,1048577,4194303

%N A000225 interleaved with A000051.

%H Harvey P. Dale, <a href="/A140407/b140407.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,2,2).

%F a(2n) = A000225(n+1) = A135530(2n) - 1. a(2n+1) = A000051(n) = 1 + A135530(2n+1).

%F a(n) = -a(n-1) + 2*a(n-2) + 2*a(n-3). a(2n) + a(2n+1) = 3*A000079(n).

%F O.g.f.: (1 + 3x + 3x^2)/((1+x)*(1-2x^2)). - _R. J. Mathar_, Jul 08 2008

%t LinearRecurrence[{-1,2,2},{1,2,3},50] (* _Harvey P. Dale_, Apr 03 2013 *)

%o (Python)

%o def A140407(n): return 2 if n == 1 else (1<<(n>>1))|1 if n&1 else -1^(-2<<(n>>1)) # _Chai Wah Wu_, Dec 21 2022

%Y Cf. A000051, A000225, A000079, A135530.

%K nonn

%O 0,2

%A _Paul Curtz_, Jun 16 2008

%E Edited and extended by _R. J. Mathar_, Jul 08 2008

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 16:23 EDT 2024. Contains 371989 sequences. (Running on oeis4.)