OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..500
FORMULA
MAPLE
a:= n-> Bits[Join](subs(0=[0$n][], Bits[Split](n))):
seq(a(n), n=0..25);
# second Maple program:
b:= proc(n, k) option remember; `if`(n<2, n,
`if`(irem(n, 2, 'r')=1, b(r, k)*2+1, b(r, k)*2^k))
end:
a:= n-> b(n$2):
seq(a(n), n=0..25);
PROG
(Python)
def A340667(n):
return 0 if n == 0 else int(bin(n)[2:].replace('0', '0'*n), 2) # Chai Wah Wu, Jan 29 2021
CROSSREFS
KEYWORD
AUTHOR
Alois P. Heinz, Jan 15 2021
STATUS
approved