From: Nate Eldredge Newsgroups: comp.os.msdos.djgpp Subject: Re: prime numbers Date: 24 Jun 2000 13:10:00 -0700 Organization: Posted via Supernews, http://www.supernews.com Lines: 24 Sender: nate AT mercury DOT bitbucket Message-ID: <83aegakfhj.fsf@mercury.bitbucket> References: <8j2kh1$v5e$1 AT nnrp1 DOT deja DOT com> <39550689 DOT 9FC1C065 AT home DOT com> X-Complaints-To: newsabuse AT supernews DOT com User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Robin Johnson writes: > keep the credits to the code, don't rip it for your homework or something.... > > /* Quick Prime Finder by Robin Johnson > 24 June 2000 > > This uses the sieve of Erosthenes method of finding primes. > It's a memory hog sometimes. But I believe it's the quickest > method of finding all the primes up to a particular number, > as it avoids any recalculation involved in recursive methods. > It believe it follow an O(n log n) growth. I think some > problems involved in this, namely the memory it takes up, > might be solvable by using BitSets or something similar, > as that could allow a memory saving of approx 8x. > */ I have an implementation of a bit-set method that I wrote; contact me if interested. -- Nate Eldredge neldredge AT hmc DOT edu