Fork me on GitHub

@sllyq: Thanks for your answer! simple_smile


@kopasetik: @sllyq: Your version of dot product can be written like so:

(defn dot-product [vector1 vector2]
                            (apply + (map * vector1 vector2)))
There's no need to wrap * in an anonymous fn


@kopasetik: I think you have a bug in your digits fn. I think you want a >= 10 or > 9.

(defn digits
  ([n] (digits n []))
  ([n digits]
   (let [digits (conj digits (mod n 10))]
     (if (> n 9)
       (recur (quot n 10) digits)

(defn dot-product
  [v1 v2]
  (reduce + (map * v1 v2)))

;; Not sure what this fn was supposed to do
(defn tens-by-13
  (map-indexed (fn [i ten]
                 (mod (Math/pow ten i) 13))
               (take length (repeat 10))))

(defn foo
  (let [digits (digits n)
        remainder-series (tens-by-13 (count digits))]
    (dot-product digits remainder-series)
If you get me more details and need some more help just ping me!