20120715, 18:51  #1 
May 2004
New York City
5·7·11^{2} Posts 
Primes in π
Finding primes in the digits of pi has been done,
so here is yet another primes in pi puzzle. For every positive integer n (in decimal) find the first occurrence in pi of the digits of that integer, then the first prime constructed from the subsequent digits of pi. Here's what I had in mind: __________________________________ 1 > 14159 2 > 2 3 > 3 4 > 41 5 > 59 (*) 6 > 653 7 > 79 (*) 8 > 89 9 > 9265358979323 (or 97 ??) 10 > 102701 (or 1058209749...6531873029_{<19128>} ?) (PRP) 11 > 11 12 > 12847564823 (or 12848111...678925903_{<211>} ?) ... 20 > (...more than 215000digit...) ... 62 > 3490digit Prime (and three more PRPs) 80 > 41938digit PRP. 81 > 4834digit PRP. 84 > 3057digit PRP. 96 > 140165digit PRP. 98 > 61303digit PRP. up to 100 (except 20): all primes/PRPs are less than 1000digits or shown above __________________________________ (*) of course 2, 5 and 7 are prime (**) My calculator only checks for small factors, so * and ** may not actually be prime I think the list carried to (at least) 100 will possibly contain some more interestingly large primes, or will the primechecking facility be tested only by going to 1000, or beyond? _______________ P.S. I could restore the original values for 2 and 10, but ... they were composite. You can easily see the original in post #2 (SB) Last fiddled with by Batalov on 20121105 at 23:33 Reason: updated up to 100 (except 20) 
20120715, 19:07  #2  
Bamboozled!
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across
97·113 Posts 
Quote:
Alternatively, those primes which begin with each of the digits <n in the radixn representation of the primes and of \pi Paul Last fiddled with by xilman on 20120715 at 19:09 

20120715, 20:16  #3 
"Patrik Johansson"
Aug 2002
Uppsala, Sweden
5^{2}×17 Posts 
26535897932384626433 = 150917801 x 175830139033
1058209749445923078164062862089986280348253421170679821480865132823 = 196699 x 1834313671 x 4817619413830406641955201 x 608784400187359263779612387 
20120715, 20:48  #4 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
5^{2}×383 Posts 
For 12, the value appears to be
Code:
1284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903 Makes one wonder that the first possible chain of digits might go without a prime (can it? on a simple probabilistic argument?), then the next one easily produces 102701 (*** same below) 13 > 13 14 > 14159 15 > 1592653 16 > 1693 17 > 17 18 > 1861 19 > 19 20 > 20................................... or 2089 (***) 21 > 211 22 > 223 Last fiddled with by Batalov on 20120715 at 21:55 Reason: CODE added 
20120715, 23:47  #5 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
5^{2}·383 Posts 
There shouldn't be a probabilistic argument, really. (Silly me.)
On one hand, these candidates are not sparser than any quasi/nearrepunits (one per a power of 10  except for some series with algebraic compositeness),  and we have tons of primes/PRPs for them. On the other hand, I actually found the 19128digit PRP (easy to recontruct from Pi, code is below; decimal view: 1058209749...6531873029). Now we need a healthy volunteer to prove it; it would be a Primo record! Code:
# gp \p 20000 write("p10",floor(Pi*10^19176)%(10^19128)) \q pfgw f tc p10 Last fiddled with by Batalov on 20120716 at 00:06 
20120716, 03:35  #6 
May 2004
New York City
5·7·11^{2} Posts 
I appreciate the editing of my OP.
It was after all just a starting point. For the sake of completeness, since 10..... and 20..... are producing long sequences, it might be interesting to check 30....., 40....., etc. 
20120716, 04:00  #7 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
10010101100111_{2} Posts 
I hoped that you wouldn't mind. Thank you for a nice problem!
30 and 40 turned out to be easy. 20 is still running empty (at least 9300 digits in it). In the meantime, I installed a shiny new Bosch dishwasher to please SWMBO. "Change of work is rest", they say? :) EDIT: ...oh and for 2, I found a 50digit prime, but then again, the mere "2" is already prime. Last fiddled with by Batalov on 20120716 at 04:03 
20120716, 12:44  #8 
Sep 2005
127 Posts 
You're aware that the first primeinstance might not necessarily start at the first instance?
(this is the same mistake as Shallit made) J 
20120716, 13:59  #9 
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
2^{2}×1,481 Posts 
The following pari code finds solutions for 2 digit starting points upto length 1000.
Code:
\p 20000 { found=0; for (n=10, 99, for (offset=0, 1000, if ((floor(Pi*10^(2+offset1))%(10^2))==n, for (digits=2, 1000, f=factor(floor(Pi*10^(digits+offset1))%(10^digits),9); if (matsize(f)==[1,2], if (ispseudoprime(floor(Pi*10^(digits+offset1))%(10^digits),20), print(floor(Pi*10^(digits+offset1))%(10^digits)); found=1; break; ); ); ); if (found==0, print("A solution has not been found for " n); ); found=0; break; ); ); ); } \q Code:
10 20 62 80 81 84 96 98 I will now write a script that produces input to pfgw for the harder numbers. Is there a way of redirecting the output from a pari script without getting things like the header as well? I am a bit of a pari novice. 
20120716, 15:55  #10  
Bamboozled!
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across
97·113 Posts 
Quote:
Here's how the Perl script which is used to update my factor table tests its argument for primality. Code:
# Primality testing function. # Initial sanity check to see whether Pari/gp is installed and working correctly. my $sc1 = `echo "isprime(1074884750872101952308847649628260864479,2)"  /usr/bin/gp f q`; # Known prime. my $sc2 = `echo "isprime(1074884750872101952308847649628260864481,2)"  /usr/bin/gp f q`; # Known composite. ($sc1 != 1 or $sc2 != 0) and die "Failed gp sanity check\n"; sub is_prime($) { my $num = shift; my $big_mem = length $num > 300 ? 'allocatemem(104857600);' : ''; return `echo "${big_mem}isprime($num,2)"  /usr/bin/gp f q ` == 1; } Paul Paul 

20120716, 18:43  #11  
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
5^{2}×383 Posts 
Quote:
How would you move on from the first instance to the next one? By proof? For example could you prove that there can not be a prime in these series: 1) 7019*10^n1 or in 2) 8579*10^n1. (subsequences of pi would be obviously harder) Yes, 2) is a trick proposition. There exists a prime. 

Thread Tools  
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  20170810 13:47 
Distribution of Mersenne primes before and after couples of primes found  emily  Math  34  20170716 18:44 
Conjecture about Mersenne primes and nonprimes v2  Mickey1  Miscellaneous Math  1  20130530 12:32 
A conjecture about Mersenne primes and nonprimes  Unregistered  Information & Answers  0  20110131 15:41 
possible primes (real primes & poss.prime products)  troels munkner  Miscellaneous Math  4  20060602 08:35 