aboutsummaryrefslogtreecommitdiff
path: root/problem53.erl
blob: f18f81c1bab4df2499ea58f47e10a8f9f0c07305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-module(problem53).
-export([solve/0]).

solve() ->
	L = lists:seq(1,100),
	G = [fact(N) div (fact(R) * fact(N-R)) ||
		N <- L, R <- L, R < N],
	H = [X || X <- G, X > 1000000],
	length(H).

fact(1) ->
	1;
fact(N) ->
	N * fact(N-1).