Fix prime generation.
Fix to prime_after.
Solution for problem 3.