I'm working on an OEIS submission that counts the number of n-digit A157711 primes. Working with PrimeQ as my primality determinator, I can generate some 1200 terms. However, it has been pointed out to me that as the terms get larger so does the probability that at least one of the probable primes thus counted may turn out to be composite.
In an effort to put my terms on a more secure mathematical footing I decided to recalculate the initial terms using ProvablePrimeQ instead of PrimeQ. ProvablePrimeQ is one of those old Mathematica functions that was never incorporated into Wolfram proper. It needs PrimalityProving`. I was able to go somewhat further than expected, but at n=142 I ran into what I'm calling a recalcitrant prime. ProvablePrimeQ appeared to be stuck on 10^141+10^131+10^49+1. I don't know if I just needed to wait longer for the primality determination or if Mathematica was in some sort of buggy loop. At any rate, since other length-142 integers were not so encumbered, it was easy to step around the number (using factordb to confirm its proven primality status) and continue with the effort in Mathematica.
Since then, I have run into other recalcitrant provable primes (10^158+10^99+10^42+1, 10^160+10^95+10^56+1, 10^163+10^43+10^35+1, 10^164+10^124+10^84+1, ...) and my idea of getting up to n=200 is on hold because there are too many interruptions to make the process palatable. I welcome insights and/or suggestions.
Update: Recalcitrant Provable Primes 2.0
Stan Wagon has pointed out that some of the ProvablePrimeQ non-responses using the Atkin–Morain primality test (which is the default for integers greater than 10^50) may be proven prime by using the Pratt test (which requires a complete factorization of the integer minus one). Why does ProvablePrimeQ only use one or the other? As I mentioned earlier, the approach is somewhat old. Using only the Pratt test already gives non-responses for n in the 70s (on my computer) while Atkin-Morain takes it all the way to n=142.
Fine. I'll build a procedure that, when ProvablePrimeQ fails to give a result after 20 seconds, it will try ProvablePrimeQ with "Small Prime" -> 10^300 (which forces the Pratt test) for 2 minutes. If that fails, it will print the integer for subsequent, external verification. This printout then represents Recalcitrant Provable Primes version 2.0.
s={}; Do[q = 10^(n-1) + 1; p = 0;
Do[qx = q + 10^x;
Do[qy = qx + 10^y; If[TimeConstrained[ProvablePrimeQ[qy], 20, TimeConstrained[ProvablePrimeQ[qy, "SmallPrime" -> 10^300], 120,
Print["10^",n-1,"+10^",x,"+10^",y,"+1"]]], p++], {y, x-1, 1, -1}], {x, n-2,
2, -1}]; AppendTo[s,p], {n, 140, 200}] - 10^163+10^43+10^35+1
- 10^166+10^138+10^51+1
- 10^166+10^79+10^26+1
- 10^167+10^90+10^14+1
- 10^169+10^71+10^25+1
- 10^172+10^61+10^2+1
- 10^174+10^137+10^22+1
- 10^174+10^110+10^63+1
- 10^177+10^35+10^23+1
- 10^178+10^106+10^34+1
- 10^178+10^97+10^28+1
- 10^180+10^154+10^27+1
- 10^181+10^127+10^45+1
- 10^181+10^99+10^43+1
- 10^183+10^49+10^43+1
- 10^184+10^164+10^58+1
- 10^185+10^153+10^33+1
- 10^185+10^66+10^50+1
- 10^187+10^106+10^42+1
- 10^188+10^87+10^70+1
- 10^190+10^137+10^24+1
- 10^190+10^95+10^14+1
- 10^190+10^88+10^13+1
- 10^190+10^53+10^18+1
- 10^191+10^188+10^8+1
- 10^191+10^174+10^84+1
- 10^191+10^60+10^8+1
- 10^192+10^45+10^26+1
- 10^192+10^28+10^8+1
- 10^193+10^177+10^109+1
- 10^194+10^93+10^36+1
- 10^195+10^183+10^39+1
- 10^195+10^60+10^40+1
- 10^196+10^165+10^28+1
- 10^197+10^178+10^72+1
- 10^197+10^151+10^75+1
- 10^197+10^151+10^67+1
- 10^197+10^128+10^62+1
- 10^197+10^51+10^37+1
- 10^197+10^30+10^20+1
- 10^198+10^65+10^42+1
- 10^198+10^62+10^42+1
Thus 42 RPPs in the range of n=140 to n=200. This took about 2 hours on my computer. Another 15 minutes to manually (copy/paste) these into factordb and verify proven primality. A printout of s matches the probable prime counts derived by using PrimeQ as the primality determinator.
I hadn't realized that ProvablePrimeQ is listed in the Wolfram Function Repository (version 1.0.0: 7 March 2019). It may well be the same code as the PrimalityProving` version (with the exception of upping the "SmallPrime" default value from 10^10 to 10^50) that appears to go back to Mathematica 3.0 (1996). Almost 30 years old! Is it any wonder that the function struggles?