Skip to main content
1 of 4
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#JavaScript, 93 bytes

A (rather rushed) port of Nick's Python solution.

n=>(g=x=>n--?g(x<y-(-~z>>1)*6+z%2>>1?++x:(z<(y/6|0)+(-~y/6|0)?++z:z=!++y,0)):[x,y,+z])(y=z=0)

Try It Online!

Shaggy
  • 43.5k
  • 4
  • 36
  • 94