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!)
A182202 Fibonacci-type sequence based on bitwise inclusive-or: a(0) = 0, a(1) = 1 and a(n) = a(n-1) + (a(n-1) or a(n-2)). 0

%I #16 Oct 12 2023 15:29:54

%S 0,1,2,5,12,25,54,117,236,489,982,2005,4012,8105,16214,32597,65196,

%T 130729,261462,523605,1047212,2095785,4191574,8385877,16771756,

%U 33548969,67097942,134206805,268413612,536849065,1073698134,2147439957,4294879916,8589847209

%N Fibonacci-type sequence based on bitwise inclusive-or: a(0) = 0, a(1) = 1 and a(n) = a(n-1) + (a(n-1) or a(n-2)).

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

%F From _Chai Wah Wu_, Oct 12 2023: (Start)

%F a(n) = a(n-1) + 3*a(n-2) - a(n-3) - 2*a(n-5) - 4*a(n-6) for n > 7.

%F G.f.: x*(8*x^6 + 2*x^3 + x + 1)/(4*x^6 + 2*x^5 + x^3 - 3*x^2 - x + 1). (End)

%e a(2) = 1 + (1 or 0) = 2, a(3) = 2 + (2 or 1) = 5.

%t t = {0, 1}; Do[AppendTo[t, t[[-1]] + BitOr[t[[-1]], t[[-2]]]], {n, 2, 50}]; t (* _T. D. Noe_, Apr 18 2012 *)

%o (Python)

%o def A182202_gen(): # generator of terms

%o a, b = 0, 1

%o yield a

%o while True:

%o yield b

%o a, b = b, b+(a|b)

%o A182202_list = list(islice(A182202_gen(),30)) # _Chai Wah Wu_, Oct 12 2023

%K nonn,base

%O 0,3

%A _Alex Ratushnyak_, Apr 17 2012

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 23 13:38 EDT 2024. Contains 371914 sequences. (Running on oeis4.)