login
A357523
Reverse run lengths in binary expansions of terms of A166535: for n > 0, a(n) is the unique k such that A166535(k) = A056539(A166535(n)); a(0) = 0.
3
0, 1, 2, 3, 6, 5, 4, 7, 14, 9, 10, 13, 12, 11, 8, 15, 20, 23, 24, 19, 16, 27, 26, 17, 18, 25, 22, 21, 40, 41, 46, 35, 32, 49, 50, 31, 36, 45, 42, 39, 28, 29, 38, 43, 44, 37, 30, 51, 48, 33, 34, 47, 88, 63, 62, 89, 94, 57, 68, 83, 80, 71, 54, 53, 72, 79, 84, 67
OFFSET
0,3
COMMENTS
This sequence is a self-inverse permutation of the nonnegative integers.
FORMULA
a(n) = n iff n = 0 or A166535(n) belongs to A044918.
EXAMPLE
For n = 42:
- A166535(42) = 50,
- the binary expansion of 50 is "110010",
- reversing run lengths yields "101100",
- this corresponds to 44 = A166535(38),
- hence a(42) = 38.
PROG
(PARI) See Links section.
CROSSREFS
See A357522 for a similar sequence.
Sequence in context: A305418 A284459 A106451 * A056539 A105726 A336962
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 02 2022
STATUS
approved