Find the nth binary number of given weight and length

length =
weight =
n =