Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created January 26, 2012 11:53
Show Gist options
  • Save stepankuzmin/1682428 to your computer and use it in GitHub Desktop.
Save stepankuzmin/1682428 to your computer and use it in GitHub Desktop.
Project Euler. Problem 5.
-module(euler5).
-export([start/0]).
start() ->
start_acc(1).
start_acc(N) ->
case is_evently_divisible(N, 20) of
true -> N;
false -> start_acc(N+1)
end.
is_evently_divisible(_, 0) ->
true;
is_evently_divisible(N, M) when N rem M == 0 ->
is_evently_divisible(N, M-1);
is_evently_divisible(_, _) ->
false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment