OFFSET
0,2
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
This sequence has similarities with A238757; here we consider runs of consecutive 1's, there individual 1's in binary expansions.
The binary expansion of n and a(n) may share some 1's, but cannot have a common run of consecutive 1's (as given by A352724).
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
Rémy Sigrist, Scatterplot of the first 32769 terms
Rémy Sigrist, Scatterplot of (x, y) such that x, y < 2^10 and the binary expansions of x and y have no common runs of consecutive 1's
Rémy Sigrist, PARI program
EXAMPLE
The first terms, alongside the corresponding partitions into runs of 1's, are:
n a(n) runs in n runs in a(n)
-- ---- --------- ------------
0 0 [] []
1 2 [1] [2]
2 1 [2] [1]
3 4 [3] [4]
4 3 [4] [3]
5 6 [1, 4] [6]
6 5 [6] [1, 4]
7 8 [7] [8]
8 7 [8] [7]
9 12 [1, 8] [12]
10 13 [2, 8] [1, 12]
11 14 [3, 8] [14]
12 9 [12] [1, 8]
13 10 [1, 12] [2, 8]
14 11 [14] [3, 8]
15 16 [15] [16]
16 15 [16] [15]
PROG
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 30 2022
STATUS
approved