login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A334667
For any number with binary expansion (b_1, ..., b_w), replace the i-th "1" by b_{w+1-i} for i = 1..A000120(n) and the j-th "0" by b_j for j = 1..A023416(n); the resulting binary expansion is that of a(n).
2
0, 1, 1, 3, 2, 6, 3, 7, 4, 12, 6, 14, 3, 11, 7, 15, 8, 24, 10, 26, 9, 25, 14, 30, 6, 22, 13, 29, 7, 23, 15, 31, 16, 48, 18, 50, 17, 49, 22, 54, 18, 50, 25, 57, 21, 53, 30, 62, 12, 44, 28, 60, 14, 46, 29, 61, 7, 39, 23, 55, 15, 47, 31, 63, 32, 96, 34, 98, 33
OFFSET
0,4
COMMENTS
Fixed points correspond to A000225.
FORMULA
A000120(a(n)) = A000120(n).
EXAMPLE
For n = 41:
- the binary representation of 41 is "101001",
- the 3 1's are replaced by 1, 0, 0, respectively,
- the 3 0's are replaced by 1, 0, 1, respectively,
- hence we obtain "110010",
- and a(41) = 50.
PROG
(PARI) a(n) = { my (b=binary(n), t=vector(#b), l=0, r=#b+1); for (k=1, #b, t[k] = if (!b[k], b[l++], b[r--])); fromdigits(t, 2) }
CROSSREFS
See A334666 for a similar sequence.
Sequence in context: A144559 A155114 A038572 * A245676 A341516 A060992
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 08 2020
STATUS
approved