Optimizations for isPrime()
Problem 10 - Summation of primes