Skip to main content
2 of 2
added 92 characters in body
MarcMush
  • 6.6k
  • 13
  • 17

Julia 1.0, 27 24 bytes

>(x,i=1)=1+(0<x-1/i>i+1)

Try it online!

-3 bytes thanks to H.PWiz

the same approach as xnor

MarcMush
  • 6.6k
  • 13
  • 17