Problem 41

Find all even numbers within a range which are the sum of two prime numbers that are both greater than a specified threshold.

Example

goldbachGT 1 2000 50 == [(73,919),(61,1321),(67,1789),(61,1867)]

Unit Test

import Html
import List


goldbachGT : Int -> Int -> Int -> List (Int, Int)
goldbachGT low high limit = 
  -- your implemenation goes here
  []


main =
    Html.text
        (if (test) then
            "Your implementation passed all tests."
         else
            "Your implementation failed at least one test."
        )


test : Bool
test =
    List.all ((==) True)
        [ goldbachGT 1 2000 50 == [(73,919),(61,1321),(67,1789),(61,1867)]
        , goldbachGT (73 + 919) (73 + 919) 50 == [(73,919)]
        , goldbachGT 1 1000 80 == []
        , goldbachGT 1 200 12 == [(19,79),(13,109),(13,113),(19,109)] 
        ]

Hints

  1. Use the solution from Problem 40.

Solutions

Solutions

results matching ""

    No results matching ""