mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2009-01-27, 10:10   #12
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

27168 Posts
Default

All of the posted codes are wrong:
Code:
nextprime(x): finds the smallest pseudoprime (see ispseudoprime) greater than or equal
to x.
And there is a large conjectured table also: http://www.research.att.com/~njas/sequences/A005235 for the first 2000 terms.
And http://www.research.att.com/~njas/sequences/A055211 for the other sequence.
R. Gerbicz is offline   Reply With Quote
Old 2009-01-27, 12:37   #13
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

23·11·73 Posts
Default

isprime() does APRCL tests (as you can tell by running it after doing setdefault(debug,3)); runtime in the up-to-kilodigit range on K8/2200 is fit quite nicely by

10 nanoseconds * (number of digits) ^ 3.63

which suggests (extrapolating horribly) that 6k digits would take about a week on such a system. Better than I'd thought.

I'd install 64-bit Linux rather than trying to compile pari-gp on Vista x64, but this may just be my prejudices showing. There's no point trying to optimise the search code, the isprime() will take the dragon's share (larger than a lion ...) of the time.

Last fiddled with by fivemack on 2009-01-27 at 12:38
fivemack is offline   Reply With Quote
Old 2009-01-27, 15:03   #14
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

23·59 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
All of the posted codes are wrong:
Code:
nextprime(x): finds the smallest pseudoprime (see ispseudoprime) greater than or equal
to x.
I already said that. Where is my code wrong?
lavalamp is offline   Reply With Quote
Old 2009-01-27, 15:51   #15
Joshua2
 
Joshua2's Avatar
 
Sep 2004

13·41 Posts
Default

Quote:
Originally Posted by fivemack View Post
I think you have very much underestimated the sloth of guaranteed primality tests for large general numbers. The product of the first 2000 primes is about 10^7483; checking such a number with a competent parallel implementation of ECPP (NB I don't know if such a thing exists) would take about a week, using gp would take to a fair approximation forever.
I was planning on not doing a deterministic test in order to try and exceed the n=2000 that is already tested. I ran the deterministic test up to 150 or so and it gets slow fast. I thought I might run it and see if any of the probable tests were actually wrong. (I could log the numbers and test them with primo.)

The problem with installing linux is I use this machine for other stuff like school. Maybe in the summer, or I can try messing with dual partition or a live CD or something, but it seems this code is likely to take a month at least.

Do you think it would be reasonable to do this distributed? Or computing the bases take too much duplicate time? It seems the primorials are definetely not the limiting factor here.

Last fiddled with by Joshua2 on 2009-01-27 at 15:51
Joshua2 is offline   Reply With Quote
Old 2009-01-27, 16:50   #16
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

23·59 Posts
Default

This could easily be broken up into a distributed project, as testing each term is completely independant of other terms. It takes almost no time at all to calculate the primorial function up to very high levels, in fact I just ran this code to see the iterations where the primorial function has grown by another 1000 digits:
Code:
P=1;
k=0;
x=1;

forprime(a=2,500000,
  P*=a;
  k++;
  d=ceil(log(P)/log(10));

  if(d>=x*1000,
    print("iter\t= ",k,"\nprime\t= ",a,"\ndigits\t= ",d,"\n");
    x++
  );

  if(d>=20000,
    break()
  )
);
The code runs in sub 100ms, and goes through 4792 iterations.

The first output from it is:
Code:
iter	= 350
prime	= 2357
digits	= 1000
I decided to calculate P to the 350th iteration, then I ran q=nextprime(P+2), which took 49 seconds. I verified it was prime with isprime(q), that took 37 minutes and returned in the affirmative.

q-P=3133 for the 350th iteration, which agrees with this table.

For distribution, perhaps run the project in two stages, the first being calculating values using nextprime only (which would have to be uploaded), the second checking that the output of nextprime is in fact prime. If you ran both projects at the same time, the folks with faster computers could verify with isprime, and the slower computers could advance the list of tentatively fortunate numbers.

I doubt that even distributed, the isprime() side would get much past (or even to) the thousandth iteration though.
lavalamp is offline   Reply With Quote
Old 2009-01-27, 17:42   #17
Joshua2
 
Joshua2's Avatar
 
Sep 2004

13×41 Posts
Default

How do you make pari log the probable primes?
Joshua2 is offline   Reply With Quote
Old 2009-01-27, 18:41   #18
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by Joshua2 View Post
How do you make pari log the probable primes?
Code:
\\ blah blah blah
if(ispseudoprime(n),
  write("mylogfile.txt","Pari sez that "n" is probably prime.");
  \\ do whatever else you need here
);
\\ blah blah blah
CRGreathouse is offline   Reply With Quote
Old 2009-01-27, 18:58   #19
Joshua2
 
Joshua2's Avatar
 
Sep 2004

13×41 Posts
Default

Thanks! Does anyone know if the proof or same here is true? I can't follow it myself. Also has anyone heard my generalized conjecture before?

Last fiddled with by Joshua2 on 2009-01-27 at 18:58
Joshua2 is offline   Reply With Quote
Old 2009-01-27, 19:18   #20
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Maybe I just don't understand it, but as I read it there are lots of counterexamples. Sampler:


5083 - 7! = 43

43 is prime
43 < 7^2
5083 = 13 * 17 * 23

----

17 + 7! = 5057

17 is prime
17 < 7^2
5057 = 13 * 389

----

5043 - 7! = 3

3 is prime
3 < 7^2
5043 = 3 * 41^2

Last fiddled with by CRGreathouse on 2009-01-27 at 19:18
CRGreathouse is offline   Reply With Quote
Old 2009-01-27, 19:36   #21
Joshua2
 
Joshua2's Avatar
 
Sep 2004

10258 Posts
Default

So your saying that you don't think that proof is valid. You haven't found any errors with my q-kPrimorial(n) is prime (or the first couple on a few can be 9) have you?
Joshua2 is offline   Reply With Quote
Old 2009-01-27, 19:49   #22
lavalamp
 
lavalamp's Avatar
 
Oct 2007
Manchester, UK

23×59 Posts
Default

Quote:
Originally Posted by Joshua2 View Post
How do you make pari log the probable primes?
Quote:
Originally Posted by CRGreathouse View Post
Code:
\\ blah blah blah
if(ispseudoprime(n),
  write("mylogfile.txt","Pari sez that "n" is probably prime.");
  \\ do whatever else you need here
);
\\ blah blah blah
To make it easier to read into Pari again later, I'd write it like so:
Code:
write("C:/trip/probprime.txt","probprime=",q,";");
If you were writing a lot of these files, you might also wish to include the number of the iteration in the file name.
lavalamp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Let's attack the Bayesian-ECM-bounds again fivemack Math 34 2021-08-05 10:55
Nuke attack - run or hide? MooMoo2 Soap Box 40 2018-01-19 23:48
TF: A job half done? davieddy Lounge 35 2010-10-01 20:18
Attack of the Cosmic Rays S485122 Hardware 3 2010-08-24 01:19
Attack of the Killer Zombies ewmayer Lounge 12 2007-01-30 05:56

All times are UTC. The time now is 22:11.


Fri Aug 6 22:11:54 UTC 2021 up 14 days, 16:40, 1 user, load averages: 2.67, 3.02, 2.89

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.