Wrote a square function so that the result wasn't cast to Double, so I didn't have to mess about with the formatting of the answer.
(defn square [num]
(* num num))
(defn sum-squares [max]
(reduce + (map #(square %) (range 1 max))))
(defn square-sum [max]
(square (apply + (range 1 max))))
(defn solve []
(- (square-sum 101) (sum-squares 101)))
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