login
Lexicographically earliest sequence of positive integers such that the sums SumXOR_{i = 1+k*2^e..(k+1)*2^e} a(i) with k, e >= 0 are all distinct (where SumXOR is the analog of summation under the binary XOR operation).
2

%I #9 Mar 13 2023 07:21:19

%S 1,2,4,8,5,11,6,16,7,10,9,21,18,32,19,64,20,33,25,49,26,34,27,65,30,

%T 35,31,66,36,71,37,105,38,67,39,108,41,68,42,128,43,69,44,116,45,70,

%U 51,176,52,72,57,129,58,73,59,118,60,78,63,130,74,132,80,256,81

%N Lexicographically earliest sequence of positive integers such that the sums SumXOR_{i = 1+k*2^e..(k+1)*2^e} a(i) with k, e >= 0 are all distinct (where SumXOR is the analog of summation under the binary XOR operation).

%C In other words, a(1), a(2), a(1) XOR a(2), a(3), a(4), a(3) XOR a(4), a(1) XOR a(2) XOR a(3) XOR a(4), a(5), a(6), a(5) XOR a(6), etc. are all distinct.

%C In particular, all terms are distinct (but not necessarily in increasing order).

%C We can arrange the terms of the sequence as the leaves of a perfect infinite binary tree, the sums with e > 0 corresponding to parent nodes; each node will contain a different value and all values will appear in the tree (if n = 2^m+1 for some m > 0, then a(n) will equal the least missing value so far in the tree).

%C This sequence is a variant of A361144 based on the bitwise XOR operator.

%H Rémy Sigrist, <a href="/A361191/b361191.txt">Table of n, a(n) for n = 1..8191</a>

%H Rémy Sigrist, <a href="/A361191/a361191.txt">C++ program</a>

%e The first terms (at the bottom of the tree) alongside the corresponding sums are:

%e 103

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

%e 23 112

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

%e 15 24 17 97

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

%e 3 12 14 22 13 28 50 83

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

%e 1 2 4 8 5 11 6 16 7 10 9 21 18 32 19 64

%o (C++) See Links section.

%Y Cf. A361144.

%K nonn,base

%O 1,2

%A _Rémy Sigrist_, Mar 03 2023