Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created January 23, 2012 17:28
Show Gist options
  • Save stepankuzmin/1664381 to your computer and use it in GitHub Desktop.
Save stepankuzmin/1664381 to your computer and use it in GitHub Desktop.
Project Euler. Problem 1.
-module(euler1).
-export([start/0]).
start() ->
start_acc(0, 0).
start_acc(1000, Acc) ->
Acc;
start_acc(N, Acc) when N rem 3 == 0; N rem 5 == 0 ->
start_acc(N+1, Acc+N);
start_acc(N, Acc) ->
start_acc(N+1, Acc).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment