First iteration of prime generator