summaryrefslogtreecommitdiff
path: root/31-41/39.hs
diff options
context:
space:
mode:
Diffstat (limited to '31-41/39.hs')
-rw-r--r--31-41/39.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/31-41/39.hs b/31-41/39.hs
new file mode 100644
index 0000000..68909d7
--- /dev/null
+++ b/31-41/39.hs
@@ -0,0 +1,5 @@
+primesR :: Int -> Int -> [Int]
+
+primesR l r = takeWhile (<= r) $ dropWhile (< l) primes
+ where primes = filterPrime[2..]
+ filterPrime (p:xs) = p:filterPrime [x | x <- xs, x `mod` p /= 0]