login
Lexicographically earliest sequence of positive integers such that the pairs (a(n) AND a(n+1), a(n+1)) are all distinct (where AND denotes the bitwise AND operator).
2

%I #10 Aug 04 2024 12:42:49

%S 0,0,1,1,2,2,3,3,4,3,5,3,6,4,5,5,6,6,7,7,8,5,7,9,6,9,7,10,7,11,7,12,7,

%T 13,8,7,14,9,9,10,10,11,11,12,11,13,11,14,12,13,13,14,14,15,15,16,10,

%U 13,15,17,11,15,18,11,19,12,15,20,11,20,13,18,13,19

%N Lexicographically earliest sequence of positive integers such that the pairs (a(n) AND a(n+1), a(n+1)) are all distinct (where AND denotes the bitwise AND operator).

%C The value 0 appears twice; for any v > 0, the value v appears A001316(v) times.

%H Rémy Sigrist, <a href="/A375115/b375115.txt">Table of n, a(n) for n = 0..10000</a>

%H Rémy Sigrist, <a href="/A375115/a375115.gp.txt">PARI program</a>

%e The first terms, alongside the corresponding pairs, are:

%e n a(n) (a(n) AND a(n+1), a(n+1))

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

%e 0 0 (0, 0)

%e 1 0 (0, 1)

%e 2 1 (1, 1)

%e 3 1 (0, 2)

%e 4 2 (2, 2)

%e 5 2 (2, 3)

%e 6 3 (3, 3)

%e 7 3 (0, 4)

%e 8 4 (0, 3)

%e 9 3 (1, 5)

%e 10 5 (1, 3)

%e 11 3 (2, 6)

%e 12 6 (4, 4)

%e 13 4 (4, 5)

%e 14 5 (5, 5)

%e 15 5 (4, 6)

%o (PARI) \\ See Links section.

%Y See A375110 for similar sequences.

%Y Cf. A001316.

%K nonn,base

%O 0,5

%A _Rémy Sigrist_, Jul 30 2024