Created
December 15, 2011 07:13
-
-
Save kei-q/1480163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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