Completing Problem 7 with brute force prime generating algo