4 ms·
The list of primes below 600851475143 contains 23038900221 elements. If each element is a long, that takes a little over 184GB (decimal) of storage. May I ask h
by Smaug123 3y ago
The list of primes below 600851475143 contains 23038900221 elements. If each element is a long, that takes a little over 184GB (decimal) of storage. May I ask how you managed it without running out of memory?
(Project Euler 3 asks for a factorisation, which using the most memory-hungry but reasonable algorithm would require a list of merely sqrt=775146 in length, which is much more manageable.)