Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created January 24, 2012 11:04
Show Gist options
  • Save stepankuzmin/1669641 to your computer and use it in GitHub Desktop.
Save stepankuzmin/1669641 to your computer and use it in GitHub Desktop.
Project Euler. Problem 3.
-module(euler3).
-export([start/0]).
start() ->
brute(600851475143, 2).
brute(N, N) ->
N;
brute(N, M) when N rem M == 0 ->
brute(N div M, M+1);
brute(N, M) ->
brute(N, M+1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment