Forked from anonymous/jaskirat-4clojure-solution148.clj
Created
January 10, 2012 06:42
-
-
Save Jaskirat/1587473 to your computer and use it in GitHub Desktop.
4Clojure Problem 148
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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