Skip to main content
1 of 3
Neil
  • 177.2k
  • 12
  • 74
  • 281

Charcoal, 27 bytes

⊞υ⁰FN≔⁺⁺υυ⁺⁺υυX²ιυIE⊕⌈υ⌕Aυι

Try it online! Link is to verbose version of code. Explanation:

⊞υ⁰

Start with a 1×1 array of row numbers.

FN

Repeat the given number of times.

≔⁺⁺υυ⁺⁺υυX²ιυ

Each time, the array becomes four times larger. The previously calculated 4ⁱ elements go in the top left quadrant so they remain in the same row, the next 4ⁱ elements go in the top right quadrant so they have the same row as the previously calculated elements, then the remaining elements in the bottom left and bottom right quadrants go in the next 2ⁱ rows.

IE⊕⌈υ⌕Aυι

For each row list the elements assigned to that row.

Neil
  • 177.2k
  • 12
  • 74
  • 281