mersenneforum.org  

Go Back   mersenneforum.org > Math Stuff > Computer Science & Computational Number Theory > PARI/GP

Reply
 
Thread Tools
Old 2010-08-19, 15:41   #672
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Bumped into twin primes: 67787178174290220625980001 and 67787178174290220625979999.

And: 67787178174290220625980000^1 + 1 is prime: 67787178174290220625980000^2 + 1 is also prime!

That leads to n^(2^n)+1 chains/Fermat chains:

Has there been any search on that? I found 11861410^(1, 2, 4, 8, or 16) + 1 are all prime.

Last fiddled with by 3.14159 on 2010-08-19 at 15:57
3.14159 is offline   Reply With Quote
Old 2010-08-19, 15:47   #673
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
So I should revert back to Liftmodm1/em2/mem?
No, but you should put the loop from em2 into my function. (Mine has the appropriate loop for variable-n.) But don't print, store in a vector instead.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 15:57   #674
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Bumped into twin primes: 67787178174290220625980001 and 67787178174290220625979999.

And: 67787178174290220625980000^1 + 1 is prime: 67787178174290220625980000^2 + 1 is also prime!

That leads to n^(2^n)+1 chains/Fermat chains:

Has there been any search on that? I found 11861410^(1, 2, 4, 8, or 16) + 1 are all prime.
only example I've found is 1 wow who would of thought lol.
science_man_88 is offline   Reply With Quote
Old 2010-08-19, 16:01   #675
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
Originally Posted by CRGreathouse
No, but you should put the loop from em2 into my function. (Mine has the appropriate loop for variable-n.) But don't print, store in a vector instead.
From: em2(x,n,a)=forstep(b=lift(Mod(-1,x)/n),10^a,x,print(b))
To: em2(x,n,a)=forstep(b=lift(Mod(-1,x)/n),10^a,x,v[(b)])?

Last fiddled with by 3.14159 on 2010-08-19 at 16:03
3.14159 is offline   Reply With Quote
Old 2010-08-19, 16:02   #676
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by science_man_88
only example I've found is 1 wow who would of thought lol.
Stating the obvious: Every power of 1 plus 1 is prime.

2 = The oddest prime.
3.14159 is offline   Reply With Quote
Old 2010-08-19, 16:14   #677
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Code:
for(n=1,100,print(isprime(n^2+1)"," isprime(n^4+1)",",isprime(n^8+1)","isprime(n^16+1)"," isprime(n^32+1)"," isprime(n^64+1)))
figure it out.
science_man_88 is offline   Reply With Quote
Old 2010-08-19, 16:33   #678
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

I found this: 703 * p(125)#^66 + 1. (≈ 19100 digits)

Last fiddled with by 3.14159 on 2010-08-19 at 16:33
3.14159 is offline   Reply With Quote
Old 2010-08-19, 17:26   #679
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
From: em2(x,n,a)=forstep(b=lift(Mod(-1,x)/n),10^a,x,print(b))
To: em2(x,n,a)=forstep(b=lift(Mod(-1,x)/n),10^a,x,v[(b)])?
Let's see. (b) evaluates to b, v[b] evaluates to the b-th value in v. If v happens to be a vector, and #v is at least as large as the value of b, then it passes whatever happens to be in that location in the vector to forstep. Forstep ignores the values its given (unlike, say, sum() or prod()), so this code has the following behavior:

* If v is a vector with size at least as large as the final value of b (around 10^a), then do nothing.
* If lift(Mod(-1,x)/n) is greater than 10^a, then do nothing.
* Otherwise, if v is a vector, throw an "index out of bounds" error.
* If v is not a vector, and lift(Mod(-1,x)/n) is <= 10^a, then throw a "_[_]: not a vector" error.
CRGreathouse is offline   Reply With Quote
Old 2010-08-19, 17:29   #680
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24×3×5×7 Posts
Default

Quote:
Originally Posted by CRGreathouse
Let's see. (b) evaluates to b, v[b] evaluates to the b-th value in v. If v happens to be a vector, and #v is at least as large as the value of b, then it passes whatever happens to be in that location in the vector to forstep. Forstep ignores the values its given (unlike, say, sum() or prod()), so this code has the following behavior:

* If v is a vector with size at least as large as the final value of b (around 10^a), then do nothing.
* If lift(Mod(-1,x)/n) is greater than 10^a, then do nothing.
* Otherwise, if v is a vector, throw an "index out of bounds" error.
* If v is not a vector, and lift(Mod(-1,x)/n) is <= 10^a, then throw a "_[_]: not a vector" error.
Great. What if I pinned a return value on it instead? Oh. Right. Returns the first value

Last fiddled with by 3.14159 on 2010-08-19 at 17:39
3.14159 is offline   Reply With Quote
Old 2010-08-19, 18:19   #681
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

CRG I got my code to work to find primes and fill a vector of 0's with them I'm thinking of how to make a function VecApp(v,x,f) that takes one vector(v) into another vector(f) with 1 extra element which is appended with value x maybe that will make it easier on me. I think this would need to say something like f[i] = v[i] f[i]+1 = x but I'm without reading them all I have no idea how to get i not to go over the amount of indexes of v.
science_man_88 is offline   Reply With Quote
Old 2010-08-19, 18:19   #682
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3·1,993 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
Great. What if I pinned a return value on it instead? Oh. Right. Returns the first value
Just look at my code for how to use the vector!
CRGreathouse is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I sometimes see all the <> formatting commands when I quote or edit? cheesehead Forum Feedback 3 2013-05-25 12:56
Passing commands to PARI on Windows James Heinrich Software 2 2012-05-13 19:19
Ubiquity commands Mini-Geek Aliquot Sequences 1 2009-09-22 19:33
64-bit Pari? CRGreathouse Software 2 2009-03-13 04:22
Are these commands correct? jasong Linux 2 2007-10-18 23:40

All times are UTC. The time now is 23:05.


Fri Aug 6 23:05:08 UTC 2021 up 14 days, 17:34, 1 user, load averages: 3.39, 3.74, 3.87

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.