mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Lounge (https://www.mersenneforum.org/forumdisplay.php?f=7)
-   -   Finding primes from 1 upwards (https://www.mersenneforum.org/showthread.php?t=9465)

henryzz 2007-10-12 17:23

Finding primes from 1 upwards
 
has anyone seached exhautively for primes particularly high
i have seached the web but cannot find any projects

if not what would be the best method for starting this search

ewmayer 2007-10-12 17:40

[QUOTE=henryzz;116204]what would be the best method for starting this search[/QUOTE]

Well, starting from 2 rather than 1 would probably be a good idea.

Now that I've done half the work for you and found the largest even prime, I'll let you do the odds.

petrw1 2007-10-12 17:58

[QUOTE=henryzz;116204]has anyone seached exhautively for primes particularly high
i have seached the web but cannot find any projects

if not what would be the best method for starting this search[/QUOTE]

I wrote a program a few years ago based on the Seive Of Eratosthenes. Due to memory limitations of the program I used (BASIC :no:) I had to stop at about the number 6 Billion. It only took about a day to run on a P3 400Mhz.

There are some links to lists here: [url]http://primes.utm.edu/lists/small/[/url]

bsquared 2007-10-12 18:22

I guess it depends by what you mean by "particularly high". Here: [URL]http://www.ieeta.pt/~tos/primes.html[/URL], tables of pi(x) (the number of primes less than x) are given, and have been found/verified by the sieve of eratosthenes. It would be impractical/useless to write down all these primes. For instance, he gives pi(10^23) = [SIZE=2]1925320391606803968923, which would take something like 17087218 peta bytes of storage if you wanted to list them all.[/SIZE]

[SIZE=2]If you want to help find the biggest known primes, join GIMPS.[/SIZE]

Jens K Andersen 2007-10-12 19:08

pi(x) can be computed much faster than computing all primes up to x. Only some of the pi(x) values up to pi(10^23) have been verified by the sieve of Eratosthenes. The largest exhaustive computation of primes is part of the Goldbach conjecture verification at [url]http://www.ieeta.pt/~tos/goldbach.html[/url]. They reached 10^18 in April. pi(10^18) = 24,739,954,287,740,860 is also far too many primes to store. They were only kept shortly in ram.

Garman 2007-10-12 22:45

Hmm, my old account (think of years, not month) is not active any more... anyways:

I still find this text about the practical limitations of computing and saving all primes to be rather good. It starts easy, but at the end it goes into detail about the limits of todays technologies. (clustering techniques etc. and where is will fail)
[URL]http://www.troubleshooters.com/codecorn/primenumbers/primenumbers.htm[/URL]

xilman 2007-10-13 09:38

[QUOTE=ewmayer;116205]Well, starting from 2 rather than 1 would probably be a good idea.[/QUOTE]
I guess so, but the additional work saved is insignificant.

Here's a list of primes from 14 upwards: 17, 19, 23, 29, ...

I'll leave you to find the primes from 1 to 14.

Paul

henryzz 2007-10-13 13:33

so how much disk space would it take to store the first 1,000,000 primes
i have previously written a vb.net program which uses the sieve of Eratosthenes to find all primes up to 2^30
it took about 90 second to run
my program doesnt work any higher than that because the index for a bitarray has a max of (2^31)-1

Mr. P-1 2007-10-13 14:32

[QUOTE=henryzz;116269]so how much disk space would it take to store the first 1,000,000 primes[/QUOTE]

As a text file: Less than 8MB. In fact I keep the first 4,630,913, primes (up to 79,299,959) in a 40MB text file as I have a script which uses it.

wblipp 2007-10-13 14:41

[QUOTE=henryzz;116269]so how much disk space would it take to store the first 1,000,000 primes[/QUOTE]

You could download them and see.

[url]http://www.rsok.com/~jrm/printprimes.html[/url]

ATH 2007-10-13 16:12

I have a file taking 285,714,288 bytes with all primes up below 10,000,000,080 using the 48 bit / 210 integers format.


All times are UTC. The time now is 23:29.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.