Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(pythag).
- -export([pythag/1]).
- pythag(N) ->
- [{A,B,C} ||
- A <- lists:seq(1,N-2),
- B <- lists:seq(A+1,N-1),
- C <- lists:seq(B+1,N),
- A+B+C =:= N,
- A*A+B*B =:= C*C ].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement