Last active
May 24, 2017 17:52
-
-
Save thieux/c1554fdbd0605487ed3c5649482f60a6 to your computer and use it in GitHub Desktop.
A brute force approach to the pythagorean triples problem in Clojure
This file contains hidden or 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
(let [max 100] | |
(take 100 | |
(for [a (range 1 max) | |
b (range 1 max) | |
c (range 1 max) | |
:when (= (+ (* a a) (* b b)) (* c c))] | |
[a b c]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment