[project @ 1996-11-26 14:59:00 by dnt]
[nofib.git] / imaginary / primes / Main2.hs
1 succ :: Int -> Int
2 succ x = x + 1
3
4 isdivs :: Int -> Int -> Bool
5 isdivs n x = mod x n /= 0
6
7 the_filter :: [Int] -> [Int]
8 the_filter (n:ns) = filter (isdivs n) ns
9
10 main = let
11 primes :: [Int]
12 primes = map head (iterate the_filter (iterate succ 2))
13 in
14 print (primes !! 1500)
15 --OLD: main = print (take 300 primes)