Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
(defn divides? [k n] (zero? (mod k n)))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(defn prime? [x]
|
||||
(or (= 2 x)
|
||||
(and (< 1 x)
|
||||
(odd? x)
|
||||
(not-any? (partial divides? x)
|
||||
(range 3 (inc (Math/sqrt x)) 2)))))
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(declare prime?)
|
||||
|
||||
(def primes (filter prime? (range)))
|
||||
|
||||
(defn prime? [x]
|
||||
(and (integer? x)
|
||||
(< 1 x)
|
||||
(not-any? (partial divides? x)
|
||||
(take-while (partial >= (Math/sqrt x)) primes))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue