Skip to content

Instantly share code, notes, and snippets.

@markchadwick
Created May 18, 2009 03:17
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 markchadwick/113296 to your computer and use it in GitHub Desktop.
Save markchadwick/113296 to your computer and use it in GitHub Desktop.
sieve([]) ->
[];
sieve([H|T]) ->
[H|filter(fun(I) -> I rem H /= 0 end, T)];
sieve(Max) ->
sieve(seq(2, Max)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment