Adding a cache layer to the primes algorithm solver.
Faster algorithm if we compute smaller primes first.