Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --ghc 7.10
- main = print $ test
- fibinacci = 1:1:[a + b | (a,b) <- zip fibinacci $ tail fibinacci]
- factorial 0 = 1
- factorial n = n * factorial (n-1)
- test = primes !! 1000
- --isPrime n = all (/=0) [n `mod` p | p <- takeWhile (<n) primes]
- --primes = 2:[x | x <- [3..], isPrime x]
- primes = filterPrime [2..]
- where filterPrime (p:xs) =
- p : filterPrime [x | x <- xs, x `mod` p /= 0]
Add Comment
Please, Sign In to add comment