![]() |
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 |
[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. |
[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] |
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] |
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.
|
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] |
[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 |
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 |
[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. |
[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] |
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.