Ad
  • Custom User Avatar
  • Custom User Avatar

    Suppose there are no primes in [m..n]:

    • find (\(a, b) -> b-a == g) . uncurry zip . (id &&& drop 1) . filter isPrime $ [m..n]
    • find (\(a, b) -> b-a == g) . uncurry zip . (id &&& drop 1) $ []
    • find (\(a, b) -> b-a == g) . uncurry zip $ ([], [])
    • find (\(a, b) -> b-a == g) []
    • Nothing

    Which is exactly what supposed to happen:

    function should return the first pair of two prime numbers spaced with a gap of g between the limits m, n if these numbers exist otherwise Nothing.