mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2012-07-15, 18:51   #1
davar55
 
davar55's Avatar
 
May 2004
New York City

2×2,099 Posts
Default 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)
davar55 is offline   Reply With Quote
Old 2012-07-15, 19:07   #2
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

1019410 Posts
Default

Quote:
Originally Posted by davar55 View Post
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
xilman is offline   Reply With Quote
Old 2012-07-15, 20:16   #3
patrik
 
patrik's Avatar
 
"Patrik Johansson"
Aug 2002
Uppsala, Sweden

42410 Posts
Default

26535897932384626433 = 150917801 x 175830139033
1058209749445923078164062862089986280348253421170679821480865132823 = 196699 x 1834313671 x 4817619413830406641955201 x 608784400187359263779612387
patrik is offline   Reply With Quote
Old 2012-07-15, 20:48   #4
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

915810 Posts
Default

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
Batalov is offline   Reply With Quote
Old 2012-07-15, 23:47   #5
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2×19×241 Posts
Default

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
Batalov is offline   Reply With Quote
Old 2012-07-16, 03:35   #6
davar55
 
davar55's Avatar
 
May 2004
New York City

2·2,099 Posts
Default

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.
davar55 is offline   Reply With Quote
Old 2012-07-16, 04:00   #7
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2×19×241 Posts
Default

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
Batalov is offline   Reply With Quote
Old 2012-07-16, 12:44   #8
bearnol
 
bearnol's Avatar
 
Sep 2005

1778 Posts
Default

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
bearnol is offline   Reply With Quote
Old 2012-07-16, 13:59   #9
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

574710 Posts
Default

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
File Type: txt primesinpi.txt (2.3 KB, 297 views)
henryzz is online now   Reply With Quote
Old 2012-07-16, 15:55   #10
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

1019410 Posts
Default

Quote:
Originally Posted by henryzz View Post
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
xilman is offline   Reply With Quote
Old 2012-07-16, 18:43   #11
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2·19·241 Posts
Default

Quote:
Originally Posted by bearnol View Post
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.
Batalov is offline   Reply With Quote
Reply

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 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 13:49.

Thu Nov 26 13:49:42 UTC 2020 up 77 days, 11 hrs, 3 users, load averages: 1.29, 1.29, 1.37

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.