Further optimization

Complete runtime: ~ 23 seconds thanks to a major change in the implementation of problem 5 re: prime factorization.