mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2015-08-30, 16:58   #1
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

22·229 Posts
Default OEIS - (2^n-5)/3 - n odd - LLT-like algorithm for finding PRPs

It looks like this sequence (n such that (2^n-5)/3 is prime or PRP, n odd) does not exist in OEIS:
Code:
7, 13, 19, 31, 51, 55, 85, 111, 319, 373, 505, 811, 901, 943, 1117, 2199, 2431,
There are 2 cases, depending if n == 0 mod 3 or not.

1) n == 1 or 2 mod 3
Code:
for(i=3, 10000, n=2*i+1; N=(2^n-5)/3; s=4; s=s^2-2; x=s; for(j=1, n-1, x=Mod(x^2-2,N)); if(x==s, print1(n,", ")))
7, 13, 19, 31, 55, 85, 319, 373, 505, 811, 901, 943, 1117, 2431, 5059,
2) n == 0 mod 3
Code:
for(i=3, 10000, n=2*i+1; if(Mod(n,3)==0, N=(2^n-5)/3; s=13; s=s^2-2; x=s; for(j=1, n-1, x=Mod(x^2-2,N)); if(x==s, print1(n,", "))))
51, 111, 2199,
My Pari/gp programs are still running for completing the 3 sequences up to 10000. I will update the post then.
T.Rex is offline   Reply With Quote
Old 2015-08-30, 18:03   #2
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts
Default

Quote:
Originally Posted by T.Rex View Post
It looks like this sequence (n such that (2^n-5)/3 is prime or PRP, n odd) does not exist in OEIS:
Code:
7, 13, 19, 31, 51, 55, 85, 111, 319, 373, 505, 811, 901, 943, 1117, 2199, 2431,
There are 2 cases, depending if n == 0 mod 3 or not.

1) n == 1 or 2 mod 3
Code:
for(i=3, 10000, n=2*i+1; N=(2^n-5)/3; s=4; s=s^2-2; x=s; for(j=1, n-1, x=Mod(x^2-2,N)); if(x==s, print1(n,", ")))
7, 13, 19, 31, 55, 85, 319, 373, 505, 811, 901, 943, 1117, 2431, 5059,
2) n == 0 mod 3
Code:
for(i=3, 10000, n=2*i+1; if(Mod(n,3)==0, N=(2^n-5)/3; s=13; s=s^2-2; x=s; for(j=1, n-1, x=Mod(x^2-2,N)); if(x==s, print1(n,", "))))
51, 111, 2199,
My Pari/gp programs are still running for completing the 3 sequences up to 10000. I will update the post then.
not sure why you are making a new pari/gp program each time:

http://mersenneforum.org/showpost.ph...&postcount=396

is my combo of TF and LLT into one for the mersennes just append the values needed and it can work for any of these for TF or LL.
science_man_88 is offline   Reply With Quote
Old 2015-08-30, 18:22   #3
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

16248 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
not sure why you are making a new pari/gp program each time:

http://mersenneforum.org/showpost.ph...&postcount=396

is my combo of TF and LLT into one for the mersennes just append the values needed and it can work for any of these for TF or LL.
I'm just copying as-is the exact code that proved to provide correct results.
I do not understand your code. Which language ? I know basic PARI/gp code only.

The difficulty is to find a universal initial value (the seed) and a number of iterations that work fine with all primes (or PRPs) of the sequence being studied, and to deal with exceptions (n== 0 mod 3 like here). However, it is not so difficult. But I never thought to start from a seed which is outside of the cycle.
T.Rex is offline   Reply With Quote
Old 2015-08-30, 18:29   #4
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by T.Rex View Post
I'm just copying as-is the exact code that proved to provide correct results.
I do not understand your code. Which language ? I know basic PARI/gp code only.

The difficulty is to find a universal initial value (the seed) and a number of iterations that work fine with all primes (or PRPs) of the sequence being studied, and to deal with exceptions (n== 0 mod 3 like here). However, it is not so difficult. But I never thought to start from a seed which is outside of the cycle.
it is all basic pari/gp basically here's the explanation basically in the gimps math section it says that during TF to test a factor we write the exponent in binary and then it checks to see if the value in the binary is 1 and does a computation if it is and another if it's not in the case of LL since it does the same calculation regardless we can see it as all 1's or all 0's and so it only really has one branch in the conditional it then checks the result in the case of TF against 1 ( because 2^p\eq1 \pmod {Mp}) and in the LL part against 0 because in the normal LL for mersennes we want to know if the final result is 0. all we need to do is alter the inputs for the given flag value to match a certain type of number.

Last fiddled with by science_man_88 on 2015-08-30 at 18:29
science_man_88 is offline   Reply With Quote
Old 2015-08-30, 18:46   #5
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

16248 Posts
Default

isprime() returns:
Code:
7, 13, 19, 31, 51, 55, 85, 111, 319, 373, 505, 811, 901, 943, 1117, 2199, 2431, 5059,
T.Rex is offline   Reply With Quote
Old 2015-08-30, 21:50   #6
T.Rex
 
T.Rex's Avatar
 
Feb 2004
France

22×229 Posts
Default

There is an issue with n==0 mod 3. Maybe 21 should be used as seed instead of 13, which misses 2199.
More values are required.
T.Rex is offline   Reply With Quote
Old 2015-08-30, 22:12   #7
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

1110101100102 Posts
Default

Tony, this brings into question how you choose the seeds.

Last fiddled with by paulunderwood on 2015-08-30 at 22:17
paulunderwood is offline   Reply With Quote
Old 2015-08-31, 12:32   #8
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

22·227 Posts
Default

For comparison, I get these BPSW PRPs from my program:
Code:
7, 13, 19, 31, 51, 55, 85, 111, 319, 373, 505, 811, 901, 943, 1117, 2199, 2431, 5059, 9423, 12601, 20295, 22755, 38659, 57219, 64179, ...
danaj is offline   Reply With Quote
Old 2015-08-31, 12:42   #9
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2·32·11·19 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Tony, this brings into question how you choose the seeds.
And the validity of the Reix-Vbra tests we ran for Wagstaff (up to exponent 10,000,000.)
paulunderwood is offline   Reply With Quote
Old 2015-09-01, 13:13   #10
primus
 
Jul 2014
Montenegro

2×13 Posts
Default

My solution :

For n>10 and n is odd .

Code:
PPT(n)=
{ 
my(s=Mod(6,(2^n-5)/3));
for(i=1,n-1,s=s^2-2);
s==2*polchebyshev(4,1,3)
}
primus is offline   Reply With Quote
Old 2015-09-01, 18:07   #11
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2×47×101 Posts
Question I'll juxtapose these two posts for Paul not to have to repeat his question:

Quote:
Originally Posted by paulunderwood View Post
Quote:
Originally Posted by primus View Post
My "solution" :

For n>10 and n is odd .
Code:
PPT(n)=
{ 
my(s=Mod(6,(2^n-5)/3));
for(i=1,n-1,s=s^2-2);
s==2*polchebyshev(4,1,3)
}
And the validity of this???
How is one "solution" different from another? One unproven hunch over another unproven hunch?
With both slower than a Fermat PRP test (which is proven to find all primes and PRPs), too!
Batalov is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Endorsement Prime Numbers finding algorithm marouane Computer Science & Computational Number Theory 18 2017-11-06 15:41
pari-algorithm for finding Gaussian integer bases devarajkandadai Software 0 2017-10-05 04:54
OEIS - 2^n-5 - LLT-like algorithm for finding PRPs T.Rex Miscellaneous Math 13 2015-09-01 13:09
OEIS - A050414 - 2^n-3 - LLT-like algorithm for finding PRPs T.Rex Miscellaneous Math 16 2015-08-31 02:32
New Prime-Finding Algorithm Discovered! L00K HERE! dilip_1bhowmik Miscellaneous Math 22 2009-01-09 23:39

All times are UTC. The time now is 14:39.


Mon Aug 2 14:39:39 UTC 2021 up 10 days, 9:08, 0 users, load averages: 3.91, 4.24, 3.96

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.