Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: Sieve of Erastosthenes optimized to the max Date: Sun, 24 Dec 2023 10:49:51 -0800 Organization: A noiseless patient Spider Lines: 20 Message-ID: <865y0nv3jk.fsf@linuxsc.com> References: <86il4ovkz3.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: dont-email.me; posting-host="e91b714cfd3f51772707cd580185f87c"; logging-data="2818417"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184l9H8QNZOupemAcZo9Zi7QzqBThFXs1g=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:eeWUq6/R/OhTOm/UK+gDp85eSQU= sha1:IkkWL/x7S+6lYzzqXVjWGKtSntU= Xref: csiph.com comp.lang.c++:118126 Vir Campestris writes: > On 23/12/2023 18:21, Tim Rentsch wrote: > >> Vir Campestris writes: >> >>> On my system my code takes about 20 seconds to produce 1e9 >>> primes. [...] >> >> Do you mean 1e9 primes or just the primes less than 1e9? To >> do the first 1e9 primes a sieve would need to go up to about >> 23.9e9 (so half that many bits if only odd numbers were >> represented). > > Primes up to 1e9. > > I have another idea though, watch this space... Does your have enough memory to compute all the primes up to 24e9? If it does I suggest that for your next milestone.