here is where you could get more clever. if nothing else, no need to check even numbers...or ones above i/2.

but you got the generator part right -- which is the point of this excercise.

nicely done.