Created
November 17, 2011 10:10
-
-
Save ypsilon-takai/1372842 to your computer and use it in GitHub Desktop.
project euler 63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Problem 63 : 2011/11/17 | |
| ;; "Elapsed time: 1.326705 msecs" | |
| (require '[clojure.contrib.math :as math]) | |
| (defn digits-of-pow [x n] | |
| (count (str (math/expt x n)))) | |
| (defn pe63 [] | |
| (for [x (range 1 10)] | |
| (count | |
| (take-while #(= (first %) (last %)) | |
| (map #(vector % (digits-of-pow x %)) (iterate inc 1)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment