I am doing this exercise. Pascal's Trapezoid
My solution is:
(fn pascal[initseq]
(let [gen-nextseq (fn [s]
(let [s1 (conj (vec s) 0)
s2 (cons 0 s)]
(map + s1 s2)))]
(cons
initseq
(lazy-seq
(pascal
(gen-nextseq initseq))))))
I passed first three test cases, but failed the last one.
It says "java.lang.ArithmeticException: integer overflow"
So, is there a big integer in Clojure, or is there a better way to solve the problem?