login
Lexicographically earliest sequence of positive integers such that the binary expansions of two consecutive terms have a 1 at the same position and for any distinct m and n, {a(m), a(m+1)} <> {a(n), a(n+1)}.
2

%I #12 Dec 10 2023 09:29:37

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

%T 2,14,3,9,5,11,3,13,1,15,2,18,3,15,4,13,5,14,4,20,5,15,6,11,7,12,6,13,

%U 7,14,6,18,7,15,8,8,9,9,10,8,11,9,12,8,13,9,14

%N Lexicographically earliest sequence of positive integers such that the binary expansions of two consecutive terms have a 1 at the same position and for any distinct m and n, {a(m), a(m+1)} <> {a(n), a(n+1)}.

%H Rémy Sigrist, <a href="/A352836/b352836.txt">Table of n, a(n) for n = 1..9999</a>

%H Rémy Sigrist, <a href="/A352836/a352836.png">Colored scatterplot of (a(n), a(n+1)) for n < 2^18</a> (where the hue is function of n)

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

%e The first terms, alongside their binary expansion and {a(n), a(n+1)}, are:

%e n a(n) bin(a(n)) {a(n), a(n+1)}

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

%e 1 1 1 {1}

%e 2 1 1 {1, 3}

%e 3 3 11 {2, 3}

%e 4 2 10 {2}

%e 5 2 10 {2, 6}

%e 6 6 110 {3, 6}

%e 7 3 11 {3}

%e 8 3 11 {3, 5}

%e 9 5 101 {1, 5}

%e 10 1 1 {1, 7}

%e 11 7 111 {2, 7}

%e 12 2 10 {2, 10}

%e 13 10 1010 {3, 10}

%e 14 3 11 {3, 7}

%e 15 7 111 {4, 7}

%o (C++) See Links section.

%Y Cf. A352835.

%K nonn,look,base

%O 1,3

%A _Rémy Sigrist_, Apr 05 2022