Skip to main content
2 of 3
added 175 characters in body
flawr
  • 43.9k
  • 7
  • 104
  • 249

MATL, 12 bytes

60:B"@fQ6eq]

Explanation:

60:           % create a vector [1,2,3,...,60]
   B          % convert to binary matrix (each row corresponds to one number)
    "      ]  % loop over the columns and execute following commands:
     @f       % "find" all the nonzero entries and list their indices
       Q      % increment everything
        6e    % reshape and pad with a zero at the end
          q   % decrement (reverts the increment and makes a -1 out of the zero
              % display the entries implicitly

Try it online!

flawr
  • 43.9k
  • 7
  • 104
  • 249