Problem 97

Thanks to the beauty of Haskell, the 97th Euler problem was easy to solve:

    last10digits = non_mersenne_prime `mod` 10^10
      where non_mersenne_prime = 28433 * 2^(7830457)+1

    main = print last10digits

It was also quite fast (in GHCi): (0.40 secs, 29534168 bytes)

Published: May 14 2010

blog comments powered by Disqus