Fixed the memory overflow errors.
The program no longer caches the list of prime numbers, and instead
calculates them on the fly.