Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Parallel-calculations/Clojure/parallel-calculations.clj
Normal file
14
Task/Parallel-calculations/Clojure/parallel-calculations.clj
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(use '[clojure.contrib.lazy-seqs :only [primes]])
|
||||
|
||||
(defn lpf [n]
|
||||
[n (or (last
|
||||
(for [p (take-while #(<= (* % %) n) primes)
|
||||
:when (zero? (rem n p))]
|
||||
p))
|
||||
1)])
|
||||
|
||||
(->> (range 2 100000)
|
||||
(pmap lpf)
|
||||
(apply max-key second)
|
||||
println
|
||||
time)
|
||||
Loading…
Add table
Add a link
Reference in a new issue