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!)
A338824 Lexicographically earliest sequence of nonnegative integers such that for any distinct m and n, a(m) OR a(m+1) <> a(n) OR a(n+1) (where OR denotes the bitwise OR operator). 3

%I #11 Nov 13 2020 14:21:17

%S 0,0,1,2,0,4,1,6,0,8,1,10,0,12,1,14,0,16,1,18,0,20,1,22,0,24,1,26,0,

%T 28,1,30,0,32,1,34,0,36,1,38,0,40,1,42,0,44,1,46,0,48,1,50,0,52,1,54,

%U 0,56,1,58,0,60,1,62,0,64,1,66,0,68,1,70,0,72,1,74

%N Lexicographically earliest sequence of nonnegative integers such that for any distinct m and n, a(m) OR a(m+1) <> a(n) OR a(n+1) (where OR denotes the bitwise OR operator).

%H Rémy Sigrist, <a href="/A338824/a338824.txt">C program for A338824</a>

%F a(2*n) = 2*n-2 for any n > 0.

%F a(4*n+1) = 0 for any n >= 0.

%F a(4*n+3) = 1 for any n >= 0.

%F a(n) OR a(n+1) = A116966(n-2) for any n > 1.

%e The first terms, alongside a(n) OR a(n+1), are:

%e n a(n) a(n) OR a(n+1)

%e -- ---- --------------

%e 1 0 0

%e 2 0 1

%e 3 1 3

%e 4 2 2

%e 5 0 4

%e 6 4 5

%e 7 1 7

%e 8 6 6

%e 9 0 8

%e 10 8 9

%e 11 1 11

%e 12 10 10

%t Block[{a = {0, 0}, b = {0}}, Do[Block[{k = 0, m}, While[! FreeQ[b, Set[m, BitOr @@ {a[[-1]], k}]], k++]; AppendTo[a, k]; AppendTo[b, m]], {i, 3, 76}]; a] (* _Michael De Vlieger_, Nov 12 2020 *)

%o (C) See Links section.

%Y Cf. A116966, A338823.

%K nonn,base

%O 1,4

%A _Rémy Sigrist_, Nov 11 2020

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 May 1 07:19 EDT 2024. Contains 372149 sequences. (Running on oeis4.)