A375115 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).
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, 13, 8, 7, 14, 9, 9, 10, 10, 11, 11, 12, 11, 13, 11, 14, 12, 13, 13, 14, 14, 15, 15, 16, 10, 13, 15, 17, 11, 15, 18, 11, 19, 12, 15, 20, 11, 20, 13, 18, 13, 19
Offset: 0
Examples
The first terms, alongside the corresponding pairs, are: n a(n) (a(n) AND a(n+1), a(n+1)) -- ---- ------------------------- 0 0 (0, 0) 1 0 (0, 1) 2 1 (1, 1) 3 1 (0, 2) 4 2 (2, 2) 5 2 (2, 3) 6 3 (3, 3) 7 3 (0, 4) 8 4 (0, 3) 9 3 (1, 5) 10 5 (1, 3) 11 3 (2, 6) 12 6 (4, 4) 13 4 (4, 5) 14 5 (5, 5) 15 5 (4, 6)
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10000
- Rémy Sigrist, PARI program
Programs
-
PARI
\\ See Links section.
Comments