View Single Post
2021-01-29, 09:53   #2
kruoli

"Oliver"
Sep 2017
Porta Westfalica, DE

2·383 Posts

What are the requirements for the way you want to store the primes ((either) in RAM or on disk?). If none, you should be able to cut the memory requirement roughly in half, maybe even more. There are nearly 91 billion primes up to 2.5$$\cdot$$1012. If you would store the differences between primes like this instead of their exact values, it will save a lot of memory, but you can only access a single item by reading all values before it, so you would have random access in O(n). One could optimize this a lot by having intermediate values every so often, which might slightly increase memory demands, but will improve random access greatly.

Quote:
 Originally Posted by Viliam Furik BTW2: Are there any volunteers who would like to test the upcoming C version of the code? It will have the multi-core computation implemented in it.
Yes.