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