login
A151755
a(n) = 0 for n <= 4; for n >= 5, write n = 2^i + j, 0 <= j < 2^i; if j <= 2^i-2 then a(n) = 2*a(j) + a(j+1); if j = 2^i-1 then a(n) = 2*a(j) + a(j+1) + 1.
3
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 7, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 6, 0, 0, 0, 0, 0, 1, 4, 4, 0, 0, 0, 0, 1, 7, 17, 15, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 6, 0, 0, 0, 0, 0, 1, 4, 4, 0, 0, 0, 0, 1, 7, 17, 14, 0, 0, 0, 0, 0, 1, 4
OFFSET
0,16
EXAMPLE
May be written as a triangle:
.0,
.0,
.0, 0,
.0, 0, 0, 1,
.0, 0, 0, 0, 0, 0, 1, 3,
.0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 7,
.0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 5, 6, 0, 0, 0, 0, 0, 1, 4, 4, 0, 0, 0, 0, 1, 7, 17, 15,
....
The rows converge to A151756.
MAPLE
f:=proc(n) option remember; local i, j;
if (n <= 4) then RETURN(0); fi;
i:=floor(log(n)/log(2)); j:=n-2^i;
if (j < 2^i-1) then RETURN(2*f(j)+f(j+1)); fi;
RETURN(2*f(j)+f(j+1)+1); end proc;
[seq(f(n), n=0..256);
CROSSREFS
Sequence in context: A324326 A341743 A348945 * A325739 A181004 A051344
KEYWORD
nonn,tabf
AUTHOR
N. J. A. Sloane, Jun 21 2009
STATUS
approved