mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PARI/GP (https://www.mersenneforum.org/forumdisplay.php?f=155)
-   -   PARI's commands (https://www.mersenneforum.org/showthread.php?t=13636)

3.14159 2010-08-19 15:41

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.

CRGreathouse 2010-08-19 15:47

[QUOTE=3.14159;226167]So I should revert back to Liftmodm1/em2/mem?[/QUOTE]

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.

science_man_88 2010-08-19 15:57

[QUOTE=3.14159;226170]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.[/QUOTE]

only example I've found is 1 wow who would of thought lol.

3.14159 2010-08-19 16:01

[QUOTE=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.
[/QUOTE]

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)])?

3.14159 2010-08-19 16:02

[QUOTE=science_man_88]only example I've found is 1 wow who would of thought lol.
[/QUOTE]

Stating the obvious: Every power of 1 plus 1 is prime.

2 = The oddest prime.

science_man_88 2010-08-19 16:14

[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)))[/CODE]

figure it out.

3.14159 2010-08-19 16:33

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

CRGreathouse 2010-08-19 17:26

[QUOTE=3.14159;226174]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)])?[/QUOTE]

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.

3.14159 2010-08-19 17:29

[QUOTE=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.[/QUOTE]

Great. What if I pinned a return value on it instead? Oh. Right. Returns the first value

science_man_88 2010-08-19 18:19

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.

CRGreathouse 2010-08-19 18:19

[QUOTE=3.14159;226190]Great. What if I pinned a return value on it instead? Oh. Right. Returns the first value[/QUOTE]

Just look at my code for how to use the vector!


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.