OFFSET
0,3
COMMENTS
Leading zeros are ignored.
All terms belong to A063037.
LINKS
EXAMPLE
For n = 43: the binary expansion of 43 is "101011", the corresponding ordinal transform is "1, 1, 2, 2, 3, 4", reducing modulo 2 yields "110010", the binary expansion of a(43), so a(43) = 50.
MATHEMATICA
{0}~Join~Array[(c[0] = 1; c[1] = 1; FromDigits[Map[Mod[c[#]++, 2] &, IntegerDigits[#, 2] ], 2]) &, 120] (* Michael De Vlieger, Apr 16 2024 *)
PROG
(PARI) a(n) = { my (b = binary(n), f = vector(2)); for (i = 1, #b, b[i] = f[1+b[i]]++; ); fromdigits(b % 2, 2); }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 13 2024
STATUS
approved