# Problem 29 – Distinct terms of sequence

Here is my solution for the 29th Euler problem:

import List f = length $ nub [a^b | a <- [2..100], b <-[2..100]] main = print f

Thanks to Haskell, it was relatively easy to solve. GHC’s execution time was:

real 0m0.650s

user 0m0.646s

sys 0m0.003s

Advertisements

Leave a Comment