OFFSET
0,3
EXAMPLE
100 -> '1100100' -> 11[00]1[00] -> 11[0]1[0] -> '11010' -> 26=a(100).
PROG
(PARI) a(n)=my(v=binary(n), t); for(i=1, #v, if(v[i], t+=t+1, t%2, t+=t)); t \\ Charles R Greathouse IV, Aug 17 2016
(Python)
def a(n):
b = bin(n)[2:]
while "00" in b: b = b.replace("00", "0")
return int(b, 2)
print([a(n) for n in range(81)]) # Michael S. Branicky, Jul 27 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Nov 20 2003
STATUS
approved