Skip to content

Instantly share code, notes, and snippets.

@vlas-ilya
Created November 9, 2015 18:38
Show Gist options
  • Save vlas-ilya/1ee52f0964dfb9e88c45 to your computer and use it in GitHub Desktop.
Save vlas-ilya/1ee52f0964dfb9e88c45 to your computer and use it in GitHub Desktop.
prime :: Int -> Int
prime n = last $ take n $ preparePrime [2, 3 ..]
where preparePrime (x:xs) = [x] ++ [y | y <- xs, y `mod` x /= 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment