a(n) is the least number whose binary representation has the same number of 0's and 1's as n.

A073137

a(n) is the least number whose binary representation has the same number of 0's and 1's as n.

Terms

    a(0) =0a(1) =1a(2) =2a(3) =3a(4) =4a(5) =5a(6) =5a(7) =7a(8) =8a(9) =9a(10) =9a(11) =11a(12) =9a(13) =11a(14) =11a(15) =15a(16) =16a(17) =17a(18) =17a(19) =19a(20) =17a(21) =19a(22) =19a(23) =23a(24) =17a(25) =19a(26) =19a(27) =23a(28) =19a(29) =23

External references