Skip to content

Instantly share code, notes, and snippets.

@hierophantos
Created July 1, 2019 20:49
Show Gist options
  • Save hierophantos/8407bd8fd825c8d5913a7e5baf034747 to your computer and use it in GitHub Desktop.
Save hierophantos/8407bd8fd825c8d5913a7e5baf034747 to your computer and use it in GitHub Desktop.
(declare _logistic-rec)
(defn logistic-rec [x r n]
(_logistic-rec x r n []))
(defn _logistic-rec [x r n acc]
(if (= n 0) acc
(let [new-x (* r x (- 1 x))]
(_logistic-rec new-x r (dec n) (conj acc x)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment