login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

For any n >= 0: consider all pairs of numbers (x, y) whose binary representations can be interleaved (or shuffled) to produce the binary representation of n (possibly with leading zeros); a(n) is the least possible value of x OR y (where OR denotes the bitwise OR operator).
2

%I #7 Jan 05 2020 12:58:07

%S 0,1,1,1,1,1,3,3,1,1,2,3,2,3,3,3,1,1,2,3,2,3,3,3,3,3,3,3,6,7,7,7,1,1,

%T 2,3,2,3,3,3,3,3,3,3,5,5,7,7,3,3,3,3,5,5,6,7,6,7,6,7,6,7,7,7,1,1,2,3,

%U 2,3,3,3,3,3,3,3,5,5,7,7,3,3,3,3,5,5,6

%N For any n >= 0: consider all pairs of numbers (x, y) whose binary representations can be interleaved (or shuffled) to produce the binary representation of n (possibly with leading zeros); a(n) is the least possible value of x OR y (where OR denotes the bitwise OR operator).

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

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%e For n = 5:

%e - the binary representation of 5 is "101",

%e - the possible values for (x, y), restricted to x >= y without loss of generality, are:

%e bin(5) x y x OR y

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

%e "101" 5 0 5

%e "1/01" 1 1 1

%e "10/1" 2 1 3

%e "1/0/1" 3 0 3

%e - hence a(5) = 1.

%o (C) See Links section.

%Y See A330925 for similar sequences.

%Y Cf. A327186.

%K nonn,base

%O 0,7

%A _Rémy Sigrist_, Jan 04 2020