Improved upperbound for trial division.
Solution 6 in Python.
Solution 7 in Python.