Solving the primes HW from Coursera