Skip to main content
2 of 3
deleted 227 characters in body
Fatalize
  • 39.3k
  • 5
  • 70
  • 162

Brachylog, 7 5 bytes

;I≜-ṗ

Try it online!

Saved 2 bytes thanks to @DLosc.

###Explanation

;I≜      Label an unknown integer I (tries 0, then 1, then -1, then 2, etc.)
   -     Subtract I from the input
    ṗ    The result must be prime
Fatalize
  • 39.3k
  • 5
  • 70
  • 162