Refactor lambda in problem 3 primes function.
Solve problem 7.