Add solutions for problems 8-10
Optimize is_prime() function

All primes above 3 can be written as 6k+1 or 6k-1, where k is an
integer. We can take advantage of this in our is_prime() function to
significantly increase performance. Instead of checking every integer up
to the square root of that number, we check every 6th number.