mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2012-10-05, 21:20   #56
davar55
 
davar55's Avatar
 
May 2004
New York City

2·29·73 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
He since increased it to 127,523 if I read this correctly:
http://mathworld.wolfram.com/IntegerSequencePrimes.html
That appears to be the latest search limit, not itself prime; if I read that
list correctly. So a(96) is longer (yay). News on a(20)?
davar55 is offline   Reply With Quote
Old 2012-10-05, 21:53   #57
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36×13 Posts
Default

No, ran some more than rebooted ...and into the bit bucket the trail went.

I was going to refactor (probably with a "real" sieve) and then rerun a(20) in another base from the start. The previous perl sieve was a toy:
Code:
for($j=1;$j<$l-$i;$j++) {
  $d=substr($_,$i+$j,1);
  $s=(10*$s+$d) % 999999;
  print substr($_,$i,$j+1),"\n" if($d =~ /[1379]/ && gcd($s, 999999)==1);
                                #this takes care of 2,3,5,7,11,13,37
}
Batalov is offline   Reply With Quote
Old 2012-10-06, 00:44   #58
davar55
 
davar55's Avatar
 
May 2004
New York City

2×29×73 Posts
Default

Quote:
Originally Posted by Batalov View Post
No, ran some more than rebooted ...and into the bit bucket the trail went.

I was going to refactor (probably with a "real" sieve) and then rerun a(20) in another base from the start. The previous perl sieve was a toy:
Code:
for($j=1;$j<$l-$i;$j++) {
  $d=substr($_,$i+$j,1);
  $s=(10*$s+$d) % 999999;
  print substr($_,$i,$j+1),"\n" if($d =~ /[1379]/ && gcd($s, 999999)==1);
                                #this takes care of 2,3,5,7,11,13,37
}
Are all these perl variables automatically strings?
W/O any declarations, and not yet having used perl,
I wasn't sure. Looks like they're pre-initialized - to null?
(I'm referring particularly to $l and $i in the for loop control,
but they can't both be null - oh well).
I see it's basically C. I'll have to look up perl.
davar55 is offline   Reply With Quote
Old 2012-11-05, 23:19   #59
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36×13 Posts
Default

This is just a replacement shippet of the full code (which was posted earlier), where $p is a long string with 250000 digits of \pifollowing "20" ($i is the offset of "20"). I've attached here the latest variation, that saves on disk space and spawns pfgw on chunks.

Quote:
Originally Posted by Batalov View Post
Well, ok, records are made to be broken. With a bit of luck I found a 140,165-digit PRP that starts with the first "96" in Pi, the a(96). a(20) is still ongoing.

EDIT2: strictly speaking, because a(96) is quite big - it may not be a minimal solution: ...
a(96) is double-checked (this time using base 2) and is the minimal solution. The gaps, if there were any, are now covered.

a(20)>10^215000. I've stopped the search.
Attached Files
File Type: txt a_pip.pl.txt (1.1 KB, 194 views)

Last fiddled with by Batalov on 2012-11-05 at 23:23
Batalov is offline   Reply With Quote
Old 2012-11-28, 20:20   #60
davar55
 
davar55's Avatar
 
May 2004
New York City

2·29·73 Posts
Default

Does anyone think this series is oeis-worthy?
As OP I'm not entitled to an opinion.
But some of those PRPs batalov discovered
are eye-worthy, I think.
Maybe when a(20) is finally tackled ...
davar55 is offline   Reply With Quote
Old 2013-08-16, 11:13   #61
davar55
 
davar55's Avatar
 
May 2004
New York City

10000100010102 Posts
Default

Quote:
a(96) is double-checked (this time using base 2) and is the minimal solution. The gaps, if there were any, are now covered.

a(20)>10^215000. I've stopped the search.
Any news? Have you run it further?

What would it take to PRP test an unknown (C or P)215000?

Can you tell us the first 200 digits in pi of a(20)?

Last fiddled with by davar55 on 2013-08-16 at 11:22 Reason: pi
davar55 is offline   Reply With Quote
Old 2013-08-16, 13:06   #62
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

55308 Posts
Default

Generate your Pi with y-cruncher.
kar_bon is offline   Reply With Quote
Old 2013-08-16, 13:15   #63
davar55
 
davar55's Avatar
 
May 2004
New York City

10000100010102 Posts
Default

Wouldn't want to crunch too many y''s, they're rare enough.

I see the first 20 occurs at digit 53.

Thanks.
davar55 is offline   Reply With Quote
Old 2013-08-23, 15:41   #64
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

90810 Posts
Default

I decided to give this a go, since it lends itself well to Perl, and seemed like a useful test case for my module. Attached is a simple serial script that outputs the result (using the "skip uninteresting" criteria) with a BPSW test all done in Perl, and no need for presieving etc. Thanks to Batalov for the initial script.

I've gone through all the numbers to 100 other than a(20) which I've got to 231k. All results pass BPSW, M-R with bases 3 and 5, and the Frobenius-Underwood test. I also had it run a proof (BLS75 theorem 5 or ECPP) on anything under 1000 digits. All of this is easily available in Perl. I used the "skip uninteresting numbers" variant, and I start with the first occurrence of the target number, so a(10) = PRP(19128), a(12) = PRP(211).

I also wrote a threads version where multiple threads pull lengths off a shared queue. I ran it for a(20) for a while on 48 cores of a Power7 machine. Starting at 214000 it got to 231000 before I had to quit. I'll run it with 12 threads on my Intel machine next. It's ugly managing the locks, writing out checkpoint marks, and making sure we output the minimum digits found rather than the first one found. I can post a link if anyone wants it.

To get the 'Pi-2M.txt' file I used y-cruncher, but at only 2M digits there are plenty of other tools that would do it.

The more interesting numbers, with their PRP digits:
10 -> 19128
17 -> 6918
20 -> ??? >231000
62 -> 3490
80 -> 41938
81 -> 4834
84 -> 3057
96 -> 140165
97 -> 821
98 -> 61303

[Digressions ahead]

This is convenient, but is it fast? The BPSW test is faster than Pari, and the next_prime function is much faster than PFGW 3.7.7 for 2000+ digit inputs (digressing even more here, but perhaps PFGW isn't doing any sieving of candidates, or perhaps I'm using it wrong. "say next_prime(2**6600)-2**6600" takes ~30s for my code, "nextprime(2^6600)-2^6600" takes a bit under 2 minutes for Pari 2.6.1, while "./pfgw64s -V -q'nextprime(2^6600)'" takes over 4 minutes). However, PFGW's PRP tests are definitely faster (3.7.7 AVX FFT).

Well, everything is looking fine until we get into 30k+ digits. PFGW is much faster there (I imagine those familiar with it are eminently unsurprised). There isn't much I can do about the PRP tests, but it did give me the push I needed to put in a rudimentary treesieve (thanks to Jens Andersen for the nice writeup), which speeds up my trial division step for big numbers. Probably the fastest complete solution would be to put in a function like is_smooth($n, $B) that would just do the initial trial division, then we let PFGW handle the PRP tests on what's left.

To give some idea of just how bad this gets, for a(96), a 140,165 digit PRP on my computer:

5m 50s PFGW (Fermat)
6m 15s PFGW (F-strong)
26m 30s PFGW (Fermat and Lucas PRP)
30m 15s MPU::GMP is_strong_pseudoprime($n,2) (1 M-R)
63m 40s Pari 2.6.1 ispseudoprime($n,1) (1 M-R)
85m 45s MPU::GMP ES Lucas test
90m 15s MPU::GMP Frobenius-Underwood test
115m 55s MPU::GMP is_prob_prime (ES BPSW)
127m 0s MPU::GMP strong Lucas test
206m 20s mpz_prp is_strongbpsw_prime (S BPSW)
213m 15s Pari 2.6.2 ispseudoprime($n) (AES BPSW)

It's much closer at 10k digits. Also until we hit the PRP at this range basically everything would be found composite by the SPSP-2 test, so we just pay the cost of the SPSP test until we found the prime where we do the full BPSW cost. The result has also passed BPSW when we're done, which we probably would have wanted to do anyway.
Attached Files
File Type: txt primes-in-pi-serial.pl.txt (796 Bytes, 142 views)
danaj is offline   Reply With Quote
Old 2013-09-02, 23:04   #65
J F
 
J F's Avatar
 
Sep 2013

23·7 Posts
Default

Hi!

I did read this (then long dead) thread in early summer
and played around. Now some activity again, maybe
someone is interested in some newer numbers.
It seems me setting the end point to 1111 was
a bit optimistic...
Attached Files
File Type: zip pip-prps.zip (12.9 KB, 136 views)
J F is offline   Reply With Quote
Old 2013-09-04, 00:04   #66
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

22·227 Posts
Default

JF, very impressive. What did you use for the primality testing?

I noticed you're not including the initial 3 in your search (e.g. you have 314 starting at 2120 instead of 0). I guess it's a bit ambiguous, but I read "digits of Pi" rather than "decimal digits of Pi".

I suspect dropping the "uninteresting" restriction I used (where we don't allow the result to be equal to the number) is probably best if the series is extended far enough.

There are a couple typos in the results:
- number 119 the start is at 494, not 404
- number 471 the length is 8610, not 8619

With corrections above, all results from your list with length < 100,000 verified with BPSW.
danaj is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mersenne Primes p which are in a set of twin primes is finite? carpetpool Miscellaneous Math 3 2017-08-10 13:47
Distribution of Mersenne primes before and after couples of primes found emily Math 34 2017-07-16 18:44
Conjecture about Mersenne primes and non-primes v2 Mickey1 Miscellaneous Math 1 2013-05-30 12:32
A conjecture about Mersenne primes and non-primes Unregistered Information & Answers 0 2011-01-31 15:41
possible primes (real primes & poss.prime products) troels munkner Miscellaneous Math 4 2006-06-02 08:35

All times are UTC. The time now is 02:55.


Sat Jul 17 02:55:58 UTC 2021 up 50 days, 43 mins, 1 user, load averages: 1.17, 1.29, 1.37

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.