Doubled performance of solution 50 by using prime sieve