This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A360363 #18 Feb 06 2023 15:04:09 %S A360363 1,2,3,4,8,12,16,32,48,64,85,106,128,150,171,216,237,247,256,279,297, %T A360363 452,512,537,558,594,640,803,860,997,1024,1051,1069,1115,1169,1333, %U A360363 1345,1620,1866,2048,2077,2086,2159,2257,2363,2446,2737,2860,3212,3335,3761 %N A360363 Lexicographically earliest sequence of distinct positive integers such that the bitwise XOR of two distinct terms are all distinct. %C A360363 This sequence is well defined as we can always extend it with a power of 2 not yet in the sequence. %C A360363 This sequence contains all powers of 2 (A000079). %C A360363 This sequence has similarities with A011185: here we combine terms with the bitwise XOR operator, there with the addition. %C A360363 Every positive integer can be uniquely expressed as a(i) XOR a(j) with i < j (see A360364). %H A360363 Rémy Sigrist, <a href="/A360363/b360363.txt">Table of n, a(n) for n = 1..10000</a> %H A360363 Rémy Sigrist, <a href="/A360363/a360363.txt">C++ program</a> %e A360363 The first terms are: %e A360363 n a(n) a(k) XOR a(n) (for k = 1..n-1) %e A360363 -- ---- ---------------------------------------------------------- %e A360363 1 1 N/A %e A360363 2 2 3 %e A360363 3 3 2, 1 %e A360363 4 4 5, 6, 7 %e A360363 5 8 9, 10, 11, 12 %e A360363 6 12 13, 14, 15, 8, 4 %e A360363 7 16 17, 18, 19, 20, 24, 28 %e A360363 8 32 33, 34, 35, 36, 40, 44, 48 %e A360363 9 48 49, 50, 51, 52, 56, 60, 32, 16 %e A360363 10 64 65, 66, 67, 68, 72, 76, 80, 96, 112 %e A360363 11 85 84, 87, 86, 81, 93, 89, 69, 117, 101, 21 %e A360363 12 106 107, 104, 105, 110, 98, 102, 122, 74, 90, 42, 63 %e A360363 13 128 129, 130, 131, 132, 136, 140, 144, 160, 176, 192, 213, 234 %o A360363 (C++) See Links section. %o A360363 (Python) %o A360363 from itertools import islice %o A360363 def agen(): # generator of terms %o A360363 aset, xset, k = set(), set(), 0 %o A360363 while True: %o A360363 k += 1 %o A360363 while any(k^an in xset for an in aset): k += 1 %o A360363 yield k; xset.update(k^an for an in aset); aset.add(k) %o A360363 print(list(islice(agen(), 51))) # _Michael S. Branicky_, Feb 05 2023 %Y A360363 Cf. A000079, A011185, A346298, A360364. %K A360363 nonn,base %O A360363 1,2 %A A360363 _Rémy Sigrist_, Feb 04 2023