Skip to content

Instantly share code, notes, and snippets.

@kei-q
Created December 15, 2011 07:13
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 kei-q/1480163 to your computer and use it in GitHub Desktop.
Save kei-q/1480163 to your computer and use it in GitHub Desktop.
import Data.Time.Calendar
isPrime n=all ((/=0) . mod n) $ takeWhile (\i->i*i<=n) (2:[3,5..])
days=map (filter (/= '-') . show) $ [fromGregorian 2012 1 1 .. fromGregorian 2013 1 1]
main=mapM_ print $ filter (isPrime.read) days
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment