Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Jaskirat/1587473 to your computer and use it in GitHub Desktop.
Save Jaskirat/1587473 to your computer and use it in GitHub Desktop.
4Clojure Problem 148
;; jaskirat's solution to The Big Divide
;; https://4clojure.com/problem/148
(fn [n a b]
(let [e #(quot (- n 1) %)
f #(* % (/ (* (e %) (inc (e %))) 2))
x (f a)
y (f b)
z (f (* a b))]
(- (+ x y) z)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment