OFFSET
1,2
COMMENTS
On the right side every node replaces its left child, on the left side the right children replace their parents and the left children are reflected to the right side (becoming right children). See comment at A065263.
LINKS
MAPLE
LeftChildInverted := proc(n) local k; if(1 = n) then RETURN(1); fi; k := floor_log_2(n)-1; if(3 = floor(n/(2^k))) then RETURN(2*n); fi; if(1 = (n mod 2)) then RETURN((n-1)/2); fi; RETURN(2^(k+1) + ((2^(k+2))-1) - n); end;
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 28 2001
STATUS
approved