From 0248ed34ce3d05228bc5084669c3a27933be0c2e Mon Sep 17 00:00:00 2001 From: Nathan Lasseter Date: Sun, 4 Oct 2009 00:56:56 +0100 Subject: first commit --- problem15.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 problem15.erl (limited to 'problem15.erl') diff --git a/problem15.erl b/problem15.erl new file mode 100755 index 0000000..eef8fa9 --- /dev/null +++ b/problem15.erl @@ -0,0 +1,12 @@ +-module(problem15). +-export([solve/0]). + +solve() -> + N = 40, + K = 20, + fact(N) div (fact(K) * fact(N-K)). + +fact(0) -> + 1; +fact(N) -> + N * fact(N-1). -- cgit v1.2.1