aboutsummaryrefslogtreecommitdiff
path: root/problem9.erl
blob: 2948d18a41af9122e5f21bc061b5fc64a81c4b9a (plain)
1
2
3
4
5
6
7
8
9
10
-module(problem9).
-export([solve/0]).

solve() ->
	[{A,B,C}|_] = pythag(1000),
	A*B*C.

pythag(N) ->
	D = lists:seq(1,N),
	[{A,B,C} || A <- D, B <- D, C <- D, A+B+C=:=N, A*A+B*B=:=C*C].