Skip to content

Instantly share code, notes, and snippets.

@ahmedissa
Created July 5, 2014 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedissa/002ab1e12b19f7248216 to your computer and use it in GitHub Desktop.
Save ahmedissa/002ab1e12b19f7248216 to your computer and use it in GitHub Desktop.
Haskell Prime Numbers
primenumbers :: Integer -> [Integer]
primenumbers n = sieb [2..n]
where
sieb [] = []
sieb (p:xs) = p: sieb [k | k<-xs, k `mod` p>0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment