loop for each bit
while ( num_of_bits >= 0 ) { if ( ( N & ( 1 << num_of_bits ) ) != 0 ) r += " " ; else r += " " ; num_of_bits -- ; } return r ; } function NBitBinary ( N ) { let r = [ ] ; let first = 1 << ( N - 1 ) ; let last = first * 2 ;