OFFSET
1,2
COMMENTS
LINKS
MAPLE
[seq(QuQR1toQuQR2(j), j=1..128)];
QuQR1toQuQR2 := proc(n) local m; m := n + 2^floor_log_2(n); frac2position_in_whole_SB_tree(Q0_1toQ(SternBrocotTreeNum(m)/SternBrocotTreeDen(m))); end;
Q0_1toQ := proc(rr) local r, i; r := rr; i := 0; while(r >= 1/2) do r := 2*(r-(1/2)); i := i+1; od; RETURN(i + (2*r)); end;
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 07 2001
STATUS
approved