3629dbe4d8ff
Comment
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Mon, 25 Sep 2017 20:14:29 -0400 |
parents | c81a4bca6e78 |
children | 072186c1d12e |
branches/tags | (none) |
files | src/problems.lisp |
Changes
--- a/src/problems.lisp Mon Sep 25 20:11:11 2017 -0400 +++ b/src/problems.lisp Mon Sep 25 20:14:29 2017 -0400 @@ -1718,6 +1718,13 @@ ;; given above. (iterate (for line-number :from 1) + ;; Lisp can compute the exponents, but it takes a really long time. We can + ;; avoid having to compute the full values using: + ;; + ;; log(base^expt) = expt * log(base) + ;; + ;; Taking the log of each number preserves their ordering, so we can compare + ;; the results and still be correct. (for (base exponent) :in-csv-file "data/099-exponents.txt" :key #'parse-integer) (finding line-number :maximizing (* exponent (log base)))))