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

#JavaScript, 28 bytes

n=>g=(x=2)=>++n%x?--x:g(++x)
Shaggy
  • 43.5k
  • 4
  • 36
  • 94