Skip to main content
2 of 3
added 239 characters in body
ZaMoC
  • 24.9k
  • 2
  • 30
  • 81

#Mathematica, 33 bytes

(P=PrimeQ;P@#&&(P[#+2]||P[#-2]))&

Try it online!

ZaMoC
  • 24.9k
  • 2
  • 30
  • 81