Project Euler : Problem 97
I just implemented a solution to problem 97 in clojure!
Problem 97 is to “Find the last ten digits of the non-Mersenne prime:
28433 × 27830457 + 1.”
My solution in clojure ran in 82165.759 milliseconds, which Google says is 1.36 minutes.
Here’s my implementation:
(require ‘math)
(time (rem (+ (* 28433 (expt 2 7830457)) 1) 10000000000))
My solution uses an external clojure library that implements the function expt (i.e. exponentiation). That library is posted for download here.