Skip to content
Browse files

Solved 87.

  • Loading branch information...
1 parent 30dbc4d commit cea9f4f373727771f35d509348099c9155bdf9e3 @darrenaustin committed Oct 6, 2011
Showing with 13 additions and 1 deletion.
  1. +0 −1 README.md
  2. +13 −0 src/dma/euler/p087.clj
View
1 README.md
@@ -45,7 +45,6 @@ in many cases the Clojure solution is very different from how I solved
it in Ruby. Here is my migration TODO list. Problems I have solved
in Ruby, but not yet in Clojure:
-* 87
* 89
* 92
* 96
View
13 src/dma/euler/p087.clj
@@ -0,0 +1,13 @@
+(ns dma.euler.p087
+ (:use (dma.euler numeric primes)))
+
+(defn solution {:answer 1097343} []
+ (let [target 50000000
+ ps (primes)
+ squares (take-while-< target (map square ps))
+ cubes (take-while-< target (map cube ps))
+ forths (take-while-< target (map #(* % % % %) ps))]
+ (count
+ (set
+ (for [f forths c cubes s squares :let [sum (+ f c s)] :when (< sum target)]
+ sum)))))

0 comments on commit cea9f4f

Please sign in to comment.
Something went wrong with that request. Please try again.