Source

euler / src / problem7.clj

;; problem7
;; John Paulett - June 8, 2009
;;
;; By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6^(th) prime is 13.
;; What is the 10001^(st) prime number?

(use '[clojure.contrib.lazy-seqs :only (primes)])
(defn get-prime [idx] (nth primes (dec idx)))

;; tests
(assert (= 2 (get-prime 1)))
(assert (= 13 (get-prime 6)))

;; get the 10001st prime
(println (get-prime 10001))
;; 104743