OFFSET
0,3
COMMENTS
Fixed points correspond to A023758.
LINKS
EXAMPLE
For n = 41:
- the binary representation of 41 is "101001",
- the 3 1's are replaced by 1, 0, 1, respectively,
- the 3 0's are replaced by 1, 0, 0, respectively,
- hence we obtain "110001",
- and a(41) = 49.
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
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 07 2020
STATUS
approved