Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(defn delta [n]
(apply + (for [k (range (inc n))]
(/ (apply * (repeat k -1))
(inc (* 2 k))))))
(defn deltas [max]
(map-indexed (fn [idx n] (vector idx
(- (/ Math/PI 4)
(delta n))))
(range (inc max))))
user> (deltas 4)
([0 -0.21460183660255172] [1 0.11873149673078154] [2 -0.08126850326921842] [3 0.06158863958792449] [4 -0.04952247152318667])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.