diff options
Diffstat (limited to 'H40.hs')
-rw-r--r-- | H40.hs | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -0,0 +1,9 @@ +import H35 + +goldbach :: Integer -> (Integer, Integer) +goldbach x = sepToSum x primes $ reverse $ takeWhile (<x) primes + where + sepToSum n hhs@(h:hs) tts@(t:ts) + | h+t > n = sepToSum n hhs ts + | h+t < n = sepToSum n hs tts + | otherwise = (h,t) |