mersenneforum.org Primes in π
 Register FAQ Search Today's Posts Mark Forums Read

 2012-07-15, 18:51 #1 davar55     May 2004 New York City 5×7×112 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 26535897932384626433 (*) 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 215000-digit...) ... 62 --> 3490-digit Prime (and three more PRPs) 80 --> 41938-digit PRP. 81 --> 4834-digit PRP. 84 --> 3057-digit PRP. 96 --> 140165-digit PRP. 98 --> 61303-digit PRP. up to 100 (except 20): all primes/PRPs are less than 1000-digits 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 prime-checking 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 2012-11-05 at 23:33 Reason: updated up to 100 (except 20)
2012-07-15, 19:07   #2
xilman
Bamboozled!

"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

22×3×11×83 Posts

Quote:
 Originally Posted by davar55 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 --> 26535897932384626433 (*) 3 --> 3 4 --> 41 5 --> 59 (*) 6 --> 653 7 --> 79 (*) 8 --> 89 9 --> 9265358979323 10 -> 1058209749445923078164062862089986280348253421170679821480865132823 (**) 11 --> 11 12 --> 12847564823 (*) 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 prime-checking facility be tested only by going to 1000, or beyond?
Another, related problem, would be to to find the first radix-n representation of primes in the radix-n representation of \pi which begin with the digit n-1 for all integer n >=2.

Alternatively, those primes which begin with each of the digits <n in the radix-n representation of the primes and of \pi

Paul

Last fiddled with by xilman on 2012-07-15 at 19:09

 2012-07-15, 20:16 #3 patrik     "Patrik Johansson" Aug 2002 Uppsala, Sweden 52·17 Posts 26535897932384626433 = 150917801 x 175830139033 1058209749445923078164062862089986280348253421170679821480865132823 = 196699 x 1834313671 x 4817619413830406641955201 x 608784400187359263779612387
 2012-07-15, 20:48 #4 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 225468 Posts For 12, the value appears to be Code: 1284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903 But for 10, ...that's a real beauty! 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 2012-07-15 at 21:55 Reason: CODE added
 2012-07-15, 23:47 #5 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 2×4,787 Posts There shouldn't be a probabilistic argument, really. (Silly me.) On one hand, these candidates are not sparser than any quasi/near-repunits (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 19128-digit 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 I still don't have a PRP for 20.............. though. Last fiddled with by Batalov on 2012-07-16 at 00:06
 2012-07-16, 03:35 #6 davar55     May 2004 New York City 5·7·112 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.
 2012-07-16, 04:00 #7 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 2·4,787 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 50-digit prime, but then again, the mere "2" is already prime. Last fiddled with by Batalov on 2012-07-16 at 04:03
 2012-07-16, 12:44 #8 bearnol     Sep 2005 1778 Posts You're aware that the first prime-instance might not necessarily start at the first instance? (this is the same mistake as Shallit made) J
2012-07-16, 13:59   #9
henryzz
Just call me Henry

"David"
Sep 2007
Cambridge (GMT/BST)

10111001000102 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+offset-1))%(10^2))==n,
for (digits=2, 1000,
f=factor(floor(Pi*10^(digits+offset-1))%(10^digits),9);
if (matsize(f)==[1,2],
if (ispseudoprime(floor(Pi*10^(digits+offset-1))%(10^digits),20),
print(floor(Pi*10^(digits+offset-1))%(10^digits));
found=1;
break;
);
);
);
if (found==0,
print("A solution has not been found for " n);
);
found=0;
break;
);
);
);
}
\q
I have attached solutions for 10-99 that I have found. The following have no solutions upto 1000.
Code:
10
20
62
80
81
84
96
98
All this is ignoring what bearnol just pointed out.
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.
Attached Files
 primesinpi.txt (2.3 KB, 491 views)

2012-07-16, 15:55   #10
xilman
Bamboozled!

"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

253148 Posts

Quote:
 Originally Posted by henryzz 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.
Yes.

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;
}
You should be able to read Perl well enough to translate that function into the language of your choice.

Paul

Paul

2012-07-16, 18:43   #11
Batalov

"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2·4,787 Posts

Quote:
 Originally Posted by bearnol You're aware that the first prime-instance might not necessarily start at the first instance? (this is the same mistake as Shallit made) J
Would you care to expand on this?
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^n-1 or in 2) 8579*10^n-1. (subsequences of pi would be obviously harder)

Yes, 2) is a trick proposition. There exists a prime.

 Similar Threads Thread Thread Starter Forum Replies Last Post carpetpool Miscellaneous Math 3 2017-08-10 13:47 emily Math 34 2017-07-16 18:44 Mickey1 Miscellaneous Math 1 2013-05-30 12:32 Unregistered Information & Answers 0 2011-01-31 15:41 troels munkner Miscellaneous Math 4 2006-06-02 08:35

All times are UTC. The time now is 06:31.

Tue Oct 26 06:31:46 UTC 2021 up 95 days, 1 hr, 0 users, load averages: 1.37, 1.80, 1.85

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.