OFFSET
0,3
COMMENTS
Suggest by Eric Angelini's yranib sequence A341707.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 0..10000
N. J. A. Sloane, Exciting Number Sequences (video of talk), Mar 05 2021.
EXAMPLE
17 = 16+1 becomes 1+61 = 62 = a(17).
MAPLE
revbin:= n-> (s-> parse(cat(s[-i]$i=1..length(s))))(""||(2^n)): # A004094
f:=proc(n) local t1, i;
t1:=convert(n, base, 2);
add(t1[i]*revbin(i-1), i=1..nops(t1));
end:
seq(f(n), n=0..72);
PROG
(Python)
def A341709(n):
m, c = 1, 0
while n > 0:
n, b = divmod(n, 2)
c += b*int(str(m)[::-1])
m *= 2
return c # Chai Wah Wu, Feb 18 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Feb 18 2021
STATUS
approved