Skip to content

Instantly share code, notes, and snippets.

@etianen
Created May 3, 2010 18:39
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 etianen/388433 to your computer and use it in GitHub Desktop.
Save etianen/388433 to your computer and use it in GitHub Desktop.
-- Quick and dirty solution
sum [n | n <- [1..999], n `mod` 3 == 0 || n `mod` 5 == 0]
-- Better, more efficient solution
sum [1,3..999] + sum [1,5..999] + sum[1,15..999]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment