Solves in about 16sec. I quite liked the solution though of course the forum posts on the Project Euler site show some much cleverer solutions.
(defn pythagorean-triplet? [a b c]
(and
(< a b)
(< b c)
(= (+ (* a a) (* b b)) (* c c))))
(defn solve []
(first
(for [a (range 1 1000) b (range a 1000) c (range b 1000)
:when (and
(pythagorean-triplet? a b c)
(= 1000 (+ a b c)))]
(* a b c))))
Org-mode PDF export failure
-
Having replaced my laptop due to a tea related accident, I am finding a few
things that I need to reconfigure. Org exports are one of them. On my new
fedor...
14 years ago
No comments:
Post a Comment