diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-04-01 17:41:53 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-04-01 17:41:53 +0800 |
commit | b47befab3696c40c710ee80f366fa376ec967b30 (patch) | |
tree | 7859df15302b2ba7bea0a6eaa41dac1052d2deb6 /H40.hs | |
parent | d09ec147fa223dcf760eaa592bc0573e678ea412 (diff) | |
download | h99-b47befab3696c40c710ee80f366fa376ec967b30.tar.gz h99-b47befab3696c40c710ee80f366fa376ec967b30.tar.bz2 h99-b47befab3696c40c710ee80f366fa376ec967b30.zip |
+40 +41
Diffstat (limited to 'H40.hs')
-rw-r--r-- | H40.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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] |