Skip to main content
-1 byte
Source Link
daniero
  • 18.7k
  • 5
  • 51
  • 78

Ruby, 3938 + 6 = 4544 bytes

Requires options -rprime.

->n{n.prime?&&[n&[n-2,n+2].any?(&:prime?)}

Try it online!Try it online!

Ruby, 39 + 6 = 45 bytes

Requires options -rprime.

->n{n.prime?&&[n-2,n+2].any?(&:prime?)}

Try it online!

Ruby, 38 + 6 = 44 bytes

Requires options -rprime.

->n{n.prime?&[n-2,n+2].any?(&:prime?)}

Try it online!

Source Link
daniero
  • 18.7k
  • 5
  • 51
  • 78

Ruby, 39 + 6 = 45 bytes

Requires options -rprime.

->n{n.prime?&&[n-2,n+2].any?(&:prime?)}

Try it online!