A370429 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n OR a(n) is a binary palindrome (where OR denotes the bitwise OR operator).
0, 1, 3, 2, 5, 4, 7, 6, 9, 8, 13, 12, 11, 10, 15, 14, 17, 16, 25, 24, 21, 20, 27, 26, 19, 18, 23, 22, 31, 30, 29, 28, 33, 32, 49, 48, 41, 40, 57, 56, 37, 36, 53, 52, 45, 44, 51, 50, 35, 34, 47, 46, 43, 42, 59, 58, 39, 38, 55, 54, 63, 62, 61, 60, 65, 64, 97, 96
Offset: 0
Examples
The first terms, alongside the corresponding binary expansions, are: n a(n) bin(n) bin(a(n)) bin(n OR a(n)) -- ---- ------ --------- -------------- 0 0 0 0 0 1 1 1 1 1 2 3 10 11 11 3 2 11 10 11 4 5 100 101 101 5 4 101 100 101 6 7 110 111 111 7 6 111 110 111 8 9 1000 1001 1001 9 8 1001 1000 1001 10 13 1010 1101 1111 11 12 1011 1100 1111 12 11 1100 1011 1111 13 10 1101 1010 1111 14 15 1110 1111 1111 15 14 1111 1110 1111
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..8192
- Rémy Sigrist, Scatterplot of the first 2^18 terms
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
See Links section.
Formula
a(n) >= A370427(n).
Comments