Prime generator.
Python solution for problem 6.