Sped up solution to problem 47 by using the abstracted Prime Generator class