summaryrefslogtreecommitdiff
path: root/H40.hs
diff options
context:
space:
mode:
Diffstat (limited to 'H40.hs')
-rw-r--r--H40.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/H40.hs b/H40.hs
index 448d372..4a31727 100644
--- a/H40.hs
+++ b/H40.hs
@@ -1,4 +1,9 @@
+module H40
+( goldbach
+) where
+
import H35
+import H31
goldbach :: Integer -> (Integer, Integer)
goldbach x = sepToSum x primes $ reverse $ takeWhile (<x) primes
@@ -7,3 +12,5 @@ goldbach x = sepToSum x primes $ reverse $ takeWhile (<x) primes
| h+t > n = sepToSum n hhs ts
| h+t < n = sepToSum n hs tts
| otherwise = (h,t)
+
+goldbach' n = head [(x,y) | x <- (takeWhile (<n) primes),let y = n - x, isPrimeT y]