Completed single thread prime_generator