Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn logistic [x r n]
- (loop [x x
- n n
- xs []]
- (if (= n 0) xs
- (recur (* r x (- 1 x))
- (dec n)
- (conj xs x)))))
- (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)))))
Add Comment
Please, Sign In to add comment