20160517, 15:59  #56  
"NOT A TROLL"
Mar 2016
California
197 Posts 
Quote:


20160517, 16:34  #57 
"Mike"
Aug 2002
2^{2}·5·397 Posts 
FWIW
Our wrapper script: until [ e pfgw.log ]; do nice 19 ./program4.py > tmp && ../pfgw64 f k tmp; done; rm tmp && rm pfgw.ini program4.py is our (very lame) sieve program More craziness here: http://www.mersenneforum.org/showthread.php?t=21252 So far 50,000 digit PRPs have been (fairly easily?) found using our very slow NUC. We are slowly improving our sieve program before going larger. YMMV 
20160517, 16:42  #58  
"NOT A TROLL"
Mar 2016
California
197 Posts 
Quote:


20160517, 16:48  #59 
"Mike"
Aug 2002
2^{2}·5·397 Posts 
We forgot to mention this:
Our sieve program is most likely slower than just feeding pfgw the unsieved candidates, but we want to convince ourselves that we have done at least a little of the programming to find stuff. Perhaps it gives us the illusion of control? We are interested in improving our code but most suggestions will be beyond our math understanding. We hope to slowly remedy this. The following code is lame, but for us it represents a lot of hard work and learning: Code:
#!/usr/bin/python from random import randint from random import randrange mp = 46 length = 50000 sievesize = 1000000 def quicktest(n): for p in smallprimes: if n % p == 0: return False return True def sieve(n): multiples = set() for i in range(2, n + 1): if i not in multiples: yield i multiples.update(range(i * i, n + 1, i)) smallprimes = list(sieve(sievesize)) with open(str(mp)) as f: data = f.read() flag = False while flag == False: start = randint(0, len(data)  length) result = int(data[start:start + length]) if len(str(result)) == length: if result % 10 == 1 or result % 10 == 3 or result % 10 == 7 or result % 10 == 9: if quicktest(result) == True: print result flag = True 
20160517, 16:51  #60 
"NOT A TROLL"
Mar 2016
California
197 Posts 
The sieve size I can choose, but I hope I do not pick a large range with no primes, that's the worst, though composites are limited by maximum prime gaps.
Here is a sieve example: ABC2 233100857649...(200k+digits)...210016697705+$a a: from 1 to 1000000 "step 2" then autostop prp testing when one prime (prp) is found. (As I am confused at "step 2" though I think I am just locating another .txt file with my remaining candidates.) Last fiddled with by PawnProver44 on 20160517 at 16:55 
20160517, 18:02  #61 
"Dana Jacobsen"
Feb 2011
Bangkok, TH
2·3·151 Posts 
For generating a list of primes in python, RWH's python functions are short and very fast.
One thing I don't see in the docs is how to make PFGW stop once it finds a PRP. Your (Xyzzy) script would seem to make pfgw run on every value. Maybe that's ok  you just find multiple PRPs. It does avoid the overhead of making the script call it one at a time. For something not too dissimilar to generate a random 50k digit number then sieve 100k to depth 1e8: Code:
perl Mntheory=:all E 'use bigint; my $n = join("",1+int(rand(9)),map { int(rand(10)) } 2..50000); say for Math::Prime::Util::GMP::sieve_primes($n,100000+$n,1e8);' >foo Code:
perl Mntheory=:all E 'my $n = join("",1+int(rand(9)),map { int(rand(10)) } 2..50000); say "$n+$_" for sieve_range($n,100000,1e8);' >foo Sieving to 1e9 on the 50kdigit random input with width 100k takes about 90 seconds. Sieving to 1e9 on 100kdigit random input with width 500k takes about 3 minutes. We would want deeper sieving for these sizes, but this shows the idea and gives an indication of time. It looks like your program generates many random results, while mine is generating one then sieving a range. This should be more efficient than the trial division on each candidate. Looks like PFGW is taking about 90100 seconds for each 50kdigit candidate (with no trial factoring). For 100kdigits it is taking about 400 seconds. About 4x longer for 2x larger input, which is great vs. the ~6x longer time for GMP BPSW for doubling bits. That doesn't count the lowered expectations of finding a prime at the larger size, meaning more expected tests per PRP found. Last fiddled with by danaj on 20160517 at 18:05 Reason: Note difference in scripts 
20160518, 02:38  #62 
Jun 2003
47·103 Posts 

20160518, 03:48  #63  
Romulan Interpreter
Jun 2011
Thailand
23×397 Posts 
Quote:
BTW, couldn't he use +2*$a and avoid the "step 2" contraption? beside of the fact he said he is confused by it, the increment would be faster Told ye he is only trolling... 

20160518, 04:27  #64  
"Mike"
Aug 2002
2^{2}×5×397 Posts 
Quote:


20160518, 04:40  #65 
"NOT A TROLL"
Mar 2016
California
197 Posts 
Sucess!!
nextprime(233100857649...(200k+digits)...210016697705) = 233100857649...(200k+digits)...210016702491 My point: I actually had someone else give me an output example using everything suggested here to give me a sample output of a "random" prp that size. Last fiddled with by PawnProver44 on 20160518 at 04:47 
20160518, 04:48  #66  
"Dana Jacobsen"
Feb 2011
Bangkok, TH
2·3·151 Posts 
Quote:


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 