login
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).
1
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,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
FORMULA
a(n) >= A370427(n).
EXAMPLE
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
PROG
(PARI) See Links section.
CROSSREFS
Sequence in context: A004442 A065190 A152208 * A282650 A270671 A282664
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 18 2024
STATUS
approved