Created
December 28, 2013 22:52
-
-
Save mikamix/8165233 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
euler9(Answer) :- | |
between(1, 999, A), | |
between(A, 999, B), | |
C is 1000 - A - B, | |
is_pythagorean_triplet(A, B, C), | |
Answer is A * B * C. | |
is_pythagorean_triplet(A, B, C) :- | |
A < B, B < C, | |
A ^ 2 + B ^ 2 =:= C ^ 2. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment