Skip to content

Instantly share code, notes, and snippets.

View Jaskirat's full-sized avatar

Jaskirat Jaskirat

View GitHub Profile
;; 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)))