Skip to content

Instantly share code, notes, and snippets.

@boxp
Created June 22, 2013 14:17
Show Gist options
  • Save boxp/5841032 to your computer and use it in GitHub Desktop.
Save boxp/5841032 to your computer and use it in GitHub Desktop.
clojureでproject-eulerに挑戦 〜四問目〜
(defn palindromic? [number]
(loop [numseq (seq (str number))]
(cond (<= (count numseq) 1) true
(= (first numseq) (last numseq)) (recur (drop-last (rest numseq)))
:else false)))
(def thdigits
(range 100 1000))
(println (last (sort (filter palindromic? (for [x thdigits y thdigits] (* x y))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment