Improve performance
Improve performance by reusing the already generated primes,
by taking them from the cache instead of generating them again.