Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created April 2, 2012 08:15
Show Gist options
  • Save stepankuzmin/2281576 to your computer and use it in GitHub Desktop.
Save stepankuzmin/2281576 to your computer and use it in GitHub Desktop.
Project Euler. Problem 10.
module(euler10).
-compile(export_all).
start() ->
sieve(lists:seq(2, 2000000)).
sieve(List) ->
sieve(List, 0).
sieve([], Acc) ->
Acc;
sieve([H|T], Acc) ->
sieve([X || X <- T, X rem H =/= 0], Acc+H).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment