Skip to main content
4 of 4
added 1 character in body
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 38 34 bytes

3 3(1 e.+/,4&{)@,;._3^:31*/~0=i:62

Try it online!

-3 bytes thanks to ngn

-1 byte thanks to Bubbler

Try it online!

Core ideas taken from Bubbler's elegant APL answer -- be sure to upvote him.

This was an experiment to see how close I could get using J, which lack's APL diamond operator and so is at a disadvantage.

Instead, J has SubArrays, which requires you to manually add the padding of zeros. I opted here to add all the padding at once, up front: a 125 x 125 matix of zeros with a 1 in the center.

After each iteration, we'll lose 2 from our dimension, so after 31 iterations we'll be down to 63 x 63, which is what we need.

Jonah
  • 33.8k
  • 4
  • 40
  • 94