Created
January 23, 2012 17:28
-
-
Save stepankuzmin/1664381 to your computer and use it in GitHub Desktop.
Project Euler. Problem 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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