這是我的Clojure函式,用於從給定的起始編號獲取Collatz鏈的長度: (defn collatz-length [n] (loop [x n acc 1] (if (= 1 x) acc (recur (if (even? x) (/ x 2) (inc ...
確定! 回上一頁