A065263 Infinite binary tree inspired permutation of N: 1 -> 3, 11ab..yz -> 11ab..yz1, 10ab..y0 -> 10ab..y, 10ab..y1 -> 11AB..Y0 (where 1AB..Y0 is the complement of 0ab..y1).
3, 1, 7, 2, 6, 13, 15, 4, 14, 5, 12, 25, 27, 29, 31, 8, 30, 9, 28, 10, 26, 11, 24, 49, 51, 53, 55, 57, 59, 61, 63, 16, 62, 17, 60, 18, 58, 19, 56, 20, 54, 21, 52, 22, 50, 23, 48, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 32, 126, 33, 124
Offset: 1
Keywords
Crossrefs
Programs
-
Maple
RightChildInverted := proc(n) local k; if(1 = n) then RETURN(3); fi; k := floor_log_2(n)-1; if(3 = floor(n/(2^k))) then RETURN((2*n)+1); fi; if(0 = (n mod 2)) then RETURN(n/2); fi; RETURN(2^(k+1) + ((2^(k+2))-1) - n); end;
Comments