OFFSET
0,4
COMMENTS
The empty bit string is used as binary expansion of 0, so a(0) = 0.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..16383
FORMULA
MAPLE
b:= proc(n, k) option remember; local m;
`if`(n=0, 0, k*b(iquo(n, 2, 'm'), k)+2*m-1)
end:
a:= n-> b(n$2):
seq(a(n), n=0..44);
# second Maple program:
a:= n-> (l-> add((2*l[i]-1)*n^(i-1), i=1..nops(l)))(Bits[Split](n)):
seq(a(n), n=0..44);
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alois P. Heinz, Jan 25 2023
STATUS
approved