Well, I see, it is indeed very complex requirement... Maybe you could do the very complex following operation to at least test the speed of this implementation : let lastPrime = primes !! 17983 -- Jedaï