Skip to main content
added 339 characters in body
Source Link
Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214

Python 2, 43 41 bytes

Saved 2 bytes thanks to Leaky Nun!

i=input();k=1
while~-i%-~k<1:k+=1
print k

Try it online!

Python 2, 40 bytes

f=lambda i,k=1:~-i%-~k<1and f(i,k+1)or k

Try it online!

Python 2, 43 41 bytes

Saved 2 bytes thanks to Leaky Nun!

i=input();k=1
while~-i%-~k<1:k+=1
print k

Try it online!

Python 2, 43 41 bytes

Saved 2 bytes thanks to Leaky Nun!

i=input();k=1
while~-i%-~k<1:k+=1
print k

Try it online!

Python 2, 40 bytes

f=lambda i,k=1:~-i%-~k<1and f(i,k+1)or k

Try it online!

saved 2 bytes using a very neat trick thanks to Leaky Nun!
Source Link
Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214

Python 2, 4343 41 bytes

Saved 2 bytes thanks to Leaky Nun!

i=input();k=1
while(i+k)%while~-i%-~k<1:k+=1
print k

Try it online!Try it online!

Python 2, 43 bytes

i=input();k=1
while(i+k)%-~k<1:k+=1
print k

Try it online!

Python 2, 43 41 bytes

Saved 2 bytes thanks to Leaky Nun!

i=input();k=1
while~-i%-~k<1:k+=1
print k

Try it online!

Source Link
Mr. Xcoder
  • 42.5k
  • 9
  • 81
  • 214

Python 2, 43 bytes

i=input();k=1
while(i+k)%-~k<1:k+=1
print k

Try it online!