Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Square-but-not-cube/Clojure/square-but-not-cube.clj
Normal file
9
Task/Square-but-not-cube/Clojure/square-but-not-cube.clj
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(def squares (map #(* % %) (drop 1 (range))))
|
||||
(def square-cubes (map #(int (. Math pow % 6)) (drop 1 (range))))
|
||||
|
||||
(def squares-not-cubes (filter #(not (= % (first (drop-while (fn [n] (< n %)) square-cubes)))) squares))
|
||||
|
||||
(println "Squares but not cubes:")
|
||||
(println (take 30 squares-not-cubes))
|
||||
(println "Both squares and cubes:")
|
||||
(println (take 15 square-cubes))
|
||||
Loading…
Add table
Add a link
Reference in a new issue