#Perl 5 (-n
), 41 bytes
map{/01.*1/||say oct"0b$_"}glob"{0,1}"x$_
"{0,1}"x$_
: the string"{0,1}"
repeated n timesglob
: glob expansion (cartesian product)map{
...}
: for each element/01.*1/||
: to skip when01
followed by something then1
say oct"0b$_"
: to convert to decimal and say