Printing large prime number

Pages: 123
the product of all primes less than n, plus one, is prime.

No, the product is prime or it has a factor larger than n. This proves that there are infinitely many primes.

A gigabyte of memory may seem like a lot for a sieve. That's 8*2^30 =2^33 bits. And using that handy fact that 10^N ~ 2^(3N), that's about 10^11 bits. Gosh, with that much memory, you'd only need 10^989 machines to store a bit for each of number.

Let's see, an atom is about 10^-10m in diameter. If each atom represented one bit and they were packed together, you'd need a cube only (10^320)m on a side to store those bits, assuming that you could find the atoms.

And with a light year being about 10^16m, that cube would be about 10^304 light years across. With a universe that's less than 20 billion light years in size, that's around 10^294 universes wide.

So to recap, if you packed the entire universe with atoms and each atom represented a bit, you'd still need a a cube about 10^294 universes wide to represent the sieve.

My point is that a number with 1000 digits is a really Really REALLY big number.
closed account (48T7M4Gy)
Yes and even though a few posts ago there is a single 1000 digit prime printed out, to get there by using the sieve you need to store around 10^500 of them. That's where the problem lays.
Actually, that number I printed out is probably not prime since I created it using my fallacious logic.
closed account (48T7M4Gy)
probably not prime

It's the principle that counts Ispil. We all tried hard and learned a thing or two. I'm just happy that my confidence in my credit card safety is intact.

This is 10^999 + 5537073003 and it is the smallest 1000-digit prime. I state it without proof since Google is never wrong.


                                                       1000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 0000000000
0000000000 0000000000 0000000000 0000000000 0000000000 0000000000 5537073003 
Last edited on
https://en.wikipedia.org/wiki/Largest_known_prime_number


A couple of interesting things to note:

1. Have we heard from the OP?
2. The current largest prime has 17,425,170 digits. IIRC I read somewhere else, it took 40 networked machines 40 days to complete the task.

Hope all is well :+)
The smallest 1000-digit prime is (101000+7). I computed it in just a few seconds (about 23) using Tcl to implement the method I recommended on the last page.
Last edited on
My mistake. (101000+7) is a 1001-digit number. I actually computed (10999+7), and dumbly mistyped it here.
http://www.wolframalpha.com/input/?i=is+%2810%5E999%2B7%29+prime
closed account (48T7M4Gy)
Oops! 10^1000 + 7 has 1001 digits prime or not.

(I got the correct answer in a millisecond after I visited a reliable website.)
Yes, it should be very quick. My Tcl implementation necessarily shimmers due to my need to repeatedly create a random bignum (as part of the is_prime test), killing performance. (Also, Wolfram should have the value cached.)

BTW, the smallest 1001-digit prime is (101000+453).
closed account (48T7M4Gy)
This is 10^999 + 5537073003 and it is the smallest 1000-digit prime.

Whichever way one tries 10^999 + 7 is the smallest 1000 digit prime.

[ 10^999 + 5537073003 is the smallest 1000-digit prime with the first digit being equal to preceding gap and the last digit being equal to following gap, whatever that means. http://primes.utm.edu/curios/page.php?number_id=1277&submitter=Kulsha ]
Last edited on
closed account (E0p9LyTq)
scientist wrote:
Any one knows how to print prime number of large number of digits about 1000 digits


Dealing with numbers with a large number of digits requires a 3rd party library, C++ doesn't have that as part of the ISO standard.

Maybe later standards, but not currently.
closed account (48T7M4Gy)
Printing a 1000 digit prime number is fairly easy. Finding it is the hard part.
Topic archived. No new replies allowed.
Pages: 123