20160515, 20:42  #34 
"NOT A TROLL"
Mar 2016
California
C5_{16} Posts 
I was actually lucky that I got a 1/28676 chance for being prime and only nextprime(x)x was 2652 for the number I picked. (Could have been worse) or even a 1/120000 chance, so I picked a good range for pfgw's calculations.

20160515, 21:13  #35  
Sep 2002
Database er0rr
2×3×691 Posts 
Quote:
Last fiddled with by paulunderwood on 20160515 at 21:17 

20160515, 21:23  #36 
"NOT A TROLL"
Mar 2016
California
197 Posts 
I generated 1000 random 1000 digit numbers, manually used pfgw, and found 2 PRPs. (Which I will eventually prove with Primo.)

20160515, 22:25  #37 
Sep 2002
Database er0rr
4146_{10} Posts 

20160515, 22:51  #38 
"NOT A TROLL"
Mar 2016
California
197 Posts 
Thanks for helping me bring up another point:
My pfgw.out file is too large (I cannot open it with notepad at least), can I create a second file or delete some output? 
20160515, 23:31  #39  
"Dana Jacobsen"
Feb 2011
Bangkok, TH
1615_{8} Posts 
Quote:
Sieving and the compositeness test are both important. Perl/ntheory does deep sieving, while the other tools do not. Paul's script isn't the most efficient, but it's a hell of a lot better than not doing it, and it's simple and concise. For the compositeness tests, GMP is great under 1k digits, gwnum can be much faster with big inputs. In 2013 I did some tests on a 140k digit PRP and PFGW's Fermat was 5x faster than GMP MR (from Perl/ntheory, essentially identical to WraithX's MR code), and 11x faster than Pari/GP's MR. At 8000 digits, Perl/ntheory is about 4x faster than Pari/GP. I suspect most of this is the sieving. Timing for 10^8000 on an i6700: 58 min 3s PFGW's nextprime 17min 53.5s Pari/GP 4min 29.5s Perl/ntheory 41.7s the script below using Perl/ntheory for sieve and calls to PFGW's PRP test for each candidate Code:
perl Mntheory=:all E 'use Math::GMP qw/:constant/; $n=10**8000; @f=Math::Prime::Util::GMP::sieve_primes($n+1,$n+500000,5e8); for (@f) { $i=$_$n; last if !system("./pfgw64s k Cquiet f0 u0 q\"10^8000+$i\"") && is_bpsw_prime($n+$i); }' Plugging in 10^12000 I got a PRP (including the BPSW test) in 75 seconds. I'll point out again the advantages of starting with some expression rather than 500k random digits. Even if you get it to work, you get a big PRP that you can't submit anywhere because it's 500k random digits. Why not 10^500000 or some other succinctly written number? You also won't have shell input problems  I'm almost sure this is what's going on with your big input for Perl: the DOS shell is barfing on a giant line. It's possible it is Perl itself  there are lots of ways around this, but this forum seems like a bad place for elementary howtouseacomputer threads. Something things really messed up if it took more than more than a couple hours for nextprime on a 12k digit input that isn't in a large merit gap. Even PFGW's slow nextprime shouldn't be *that* bad. 

20160516, 00:47  #40 
"NOT A TROLL"
Mar 2016
California
197 Posts 
Using PrimeInc:
Average times for random 1000, 2000, 3000, 4000, 8000, 16000 digit numbers: 1000 digits: 7.8s 2000 digits: 15.9s 3000 digits: 5.0s (25.8s) 4000 digits: 5.9s (50.8s) 5000 digits: 4 min. 51s (2 min. 20s) 6000 digits: 7 min. 22s I know the time for 3000 and 4000 digits is less extreme for average timing, but my guess for that is I had picked integers close to a prime number. (I'll redo those ones). The 5000 digits is more extreme timing. 
20160517, 05:27  #41 
"NOT A TROLL"
Mar 2016
California
305_{8} Posts 
I read on another forum when someone told me that I could open a .txt file with Perl functions in the command window (for perl/ntheory). I am basically putting in the commands I would normally use in the command window, except having perl read the .txt file with the commands, then process it:
C:\Users\Username\Documents>perl C:\Users\Username\Documents\Perl Scripts\input.txt (Nothing) C:\Users\Username\Documents> Here is what was in the .txt file: perl Mntheory=:all E "say is_prime('100288370102196085733993')" With the command window: C:\Users\Username\Documents> perl Mntheory=:all E "say is_prime('100288370102196085733993')" 1 And again does not work after reading it in a Perl Guide for Dummies, so I am doing my last and final solution to see if anyone here knows it. EDIT: Reason I need to do this in a .txt file is to input all of the digits for a random 500k digit number or more, and output the file back to me with the result. Last fiddled with by PawnProver44 on 20160517 at 05:36 
20160517, 06:53  #42 
Sep 2002
Database er0rr
2×3×691 Posts 
You are trying to run a command line program from within a file
You need to structure your program file similarly to this However, running Dana's perl is_prime() on a random 500k digit number will not work. You will have to call out to PFGW instead. Last fiddled with by paulunderwood on 20160517 at 07:08 
20160517, 07:18  #43 
"NOT A TROLL"
Mar 2016
California
197_{10} Posts 
Okay, thanks for that warning. (I believe perl/ntheory handles about 8,000 digits at most? I'll preform more tasks and report the final limit myself.) I'm assuming it's the same with next_prime(x) and random_ndigit_prime(x) too. I know how to use pfgw for nextprime(x), though I was nearly afraid that the number of digits doubled in x would take 16 times as long to compute, or is that only for ECPP proof?

20160517, 07:24  #44 
Sep 2002
Database er0rr
2×3×691 Posts 
PFGW will take 4 times as long for a doubling in length of the number, remembering that the primes are sparser for bigger numbers.

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Near and quasirepunit PRPs  Batalov  And now for something completely different  10  20190912 13:31 
OEIS  2^n5  LLTlike algorithm for finding PRPs  T.Rex  Miscellaneous Math  13  20150901 13:09 
PRPs not prime  schickel  FactorDB  1  20150803 02:50 
Proven PRPs?  Random Poster  FactorDB  0  20120724 10:53 
PRPs that are composites  gd_barnes  Conjectures 'R Us  57  20110912 12:31 