mersenneforum.org Largest Primorial that would Fit on a Terabyte Drive.
 Register FAQ Search Today's Posts Mark Forums Read

 2017-02-25, 17:07 #1 a1call     "Rashid Naimi" Oct 2015 Out of my Body 111000100012 Posts Largest Primorial that would Fit on a Terabyte Drive. Hi all, What would be a good estimate for the largest prime of the largest primorial that would fit on a terabyte dive? Thank you in advance.
2017-02-25, 17:24   #2
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

20C016 Posts

Quote:
 Originally Posted by a1call Hi all, What would be a good estimate for the largest prime of the largest primorial that would fit on a terabyte dive? Thank you in advance.
probably would depend on format for example 2*3*5= 11110 in binary which could be brought down to 1(4)0 which isn't any shorter in this case but in larger cases if this happened to be more than 4 it would start to be more efficient to compress it.

 2017-02-25, 17:35 #3 a1call     "Rashid Naimi" Oct 2015 Out of my Body 33×67 Posts Hi SM, I am looking for a rough estimate. The base of the number should not make much of a difference. Compression will, but only by a few orders of magnitude at its best. So let's say decimal digits stored without compression. I will be happy with a reasonable upper bound for the largest prime factor of the primorial that would fit on a terabyte dive.
 2017-02-25, 17:52 #4 a1call     "Rashid Naimi" Oct 2015 Out of my Body 33·67 Posts Let's break it down: How many decimal digits can be written to a terabyte dive without compression?
2017-02-25, 17:56   #5
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by a1call Hi SM, I am looking for a rough estimate. The base of the number should not make much of a difference. Compression will, but only by a few orders of magnitude at its best. So let's say decimal digits stored without compression. I will be happy with a reasonable upper bound for the largest prime factor of the primorial that would fit on a terabyte dive.
well each character is one byte and you'd have to account for EOF markers etc. but basically you're asking a terabyte has 10^12 bytes (more than 10^3 digits looks to take about 352 primes, 10^4 takes up to 2586, working on more data but already see your new post and have it answered in theory, 230567 for 10^5 digits) how many primes do I have to multiply together to fill that ? or what is the primorial prime that would fit? here's a question to start you off what happens when you multiply two n digits numbers ( or an n digit number with an m digit number) what number of digits is their product?

2017-02-25, 18:04   #6
xilman
Bamboozled!

May 2003
Down not across

32×11×101 Posts

Quote:
 Originally Posted by a1call Let's break it down: How many decimal digits can be written to a terabyte dive without compression?
If you store one digit per byte you are asking, in effect, for the largest primorial with not more than 1e12 digits. The decimal logarithm of this number is, of course, 1e12

Now write yourself a little program which sums the decimal logarithm of the successive prime numbers and stop when the sum exceeds 1e12. Barring rounding errors, which I will leave you to think about, you then have your answer.

Rounding errors will be severe, so you are still going to have to do some thinking to get an accurate answer. I'm prepared to give you a hint but not do all the work for you.

Note to real mathematicians: there are much better approaches but those take more thinking ability than a1call has demonstrated so far in public.

Last fiddled with by xilman on 2017-02-25 at 18:09 Reason: Add note.

 2017-02-25, 19:13 #7 Dr Sardonicus     Feb 2017 Nowhere 3,251 Posts xilman said: If you store one digit per byte you are asking, in effect, for the largest primorial with not more than 1e12 digits. The decimal logarithm of this number is, of course, 1e12 Taking 1e12 as a ballpark figure for the base-ten logarithm makes sense. Of course, given that kind of bound, figuring out (at least approximately) the size of the largest prime whose primorial isn't any larger is one thing, and actually determining all the primes up to that point and then multiplying them together, is quite another. How long might that take? My guess is, "WAY too long to worry about writing the answer to a drive."
 2017-02-25, 20:09 #8 a1call     "Rashid Naimi" Oct 2015 Out of my Body 34218 Posts Thank you for all the replies. I have always disliked the e in scientific and engineering notations. So let's say the primorial can have 1T dd. Now roughly for what size of p would p# have 1T dd? Now for a very rough estimate (that suits me just fine) I get. p^x=10^(T-1) p^x=10^T And I don't know how to go further with 2 variables and one equation. Last fiddled with by a1call on 2017-02-25 at 20:10
 2017-02-25, 20:23 #9 a1call     "Rashid Naimi" Oct 2015 Out of my Body 34218 Posts I think the next equation I need is the number of primes less than n. Isn't that ln(n)? Corrections are appreciated. p^x=10^T p^ln (p)=10^T Anyway this can be calculated without programming? Last fiddled with by a1call on 2017-02-25 at 20:30
2017-02-25, 20:25   #10
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by a1call Thank you for all the replies. I have always disliked the e in scientific and engineering notations. So let's say the primorial can have 1T dd. Now roughly for what size of p would p# have 1T dd? Now for a very rough estimate (that suits me just fine) I get. p^x=10^(T-1) p^x=10^T And I don't know how to go further with 2 variables and one equation.
I would think something like log_10(p^x)=T though you change from T-1 to T

my logic was that an n digit number times an m digit number can give at most a n+m digit number ( or roughly like that) so if you knew the number of primes with a certain number of digits ( in PARI/GP primepi(10^x)-primepi(10^(x-1)) ) you could add x that many times for an upper bound on the number of digits added when you multiply by the product of all the primes in that range. ( my math has up to 10 digits only giving about 4.5 *10^9 so a long way to go potentially.)

2017-02-25, 20:28   #11
CRGreathouse

Aug 2006

22·5·293 Posts

Quote:
 Originally Posted by Dr Sardonicus Of course, given that kind of bound, figuring out (at least approximately) the size of the largest prime whose primorial isn't any larger is one thing, and actually determining all the primes up to that point and then multiplying them together, is quite another. How long might that take? My guess is, "WAY too long to worry about writing the answer to a drive."
The hardest part would be coding the on-disk multiplications which I'm sure would be a pain. You start by sieving out a range of primes as large as memory allows, then multiplying together with binary splitting, then write the product to disk. Continue with the next range of primes until the drive is full. Then multiply the numbers you wrote to disk by each other by binary splitting, using memory and a second drive as scratch space as needed. You'll probably need a final multiplication by a relatively small number (the product of the remaining primes) to finish off the process.

I don't know how long these multiplications would take; they are huge compared to any benchmarks I've seen.

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Miscellaneous Math 11 2016-12-14 21:35 jasong Math 1 2006-08-12 01:38 Citrix Puzzles 3 2006-03-07 15:07 Dougy Math 2 2005-07-28 13:13 wfgarnett3 Lounge 7 2002-11-25 06:34

All times are UTC. The time now is 06:43.

Fri Jun 5 06:43:52 UTC 2020 up 72 days, 4:16, 0 users, load averages: 1.34, 1.08, 1.03