mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2016-12-31, 16:39   #12
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

100101000001012 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
I given this some more thought.

PRP does Mod(3,mp)^(2^p-2) == 1,
which is at best Mod(3,mp)^2^p == 9,
whereas what I propose is Mod(3,mp)^2^(p-1) == -3.
Exactly. Mod(3,mp)^2^p == 9 is the PRP test.

So, for the saving of 1 squaring* you are proposing something that you haven't proved.
It can (?) be proven but you didn't demonstrate it.
And then it will still be a PRP test, whereas LL test is a primality test at another 0.000001% cost of subtracting 2 at each iteration.

Additionally, your code doesn't implement the "square_carefully" for the first and last 30-50 iterations, which could be lead to false positives and negatives for large p values. But P95 likely does.

P.S. Finally, I can't shake the feeling that solving x2 + x +1 == 0 (mod mp) wasn't a red herring. Where is it used in this test?
____________
* which is a staggering 0.000001% saving!
Batalov is offline   Reply With Quote
Old 2016-12-31, 17:24   #13
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

7×1,373 Posts
Default

That is the "square root of 9" test (or square root of any quadratic residue). Because m=2^p-1 is 3 (mod 4), then -1 is a non-residue, and therefore one can apply these formulas to get the square root of 9, which, if m is prime, it is either 3 or -3. If m is not prime, you will get other numbers. But the fact that you will get another number is not proved, there are no counterexamples and it is believed to be true, but unless a proof will be available, this is only a PRP test.
LaurV is offline   Reply With Quote
Old 2016-12-31, 20:31   #14
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

373910 Posts
Default

If you can solve x^2+3 == 0 (mod mp), then mp is prime, I think
paulunderwood is online now   Reply With Quote
Old 2016-12-31, 20:41   #15
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22×7×53 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
If you can solve x^2+3 == 0 (mod mp), then mp is prime, I think
False. x=14697820651 and p=37 is a counter-example. Just used Pari-Gp and Wolfram Alpha: https://www.wolframalpha.com/input/?...2%5E37-1%5D%5D
R. Gerbicz is offline   Reply With Quote
Old 2016-12-31, 20:54   #16
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
If you can solve x^2+3 == 0 (mod mp), then mp is prime, I think
I think you should try remainder math within the mersennes themselves or something like that for a while because that can be related somewhat to the reduced LL test. 2*x^2-1 etc. I do have things I've found about it around this forum and in some PM's I've sent at one point but this might help you think about modular math more ?
science_man_88 is offline   Reply With Quote
Old 2016-12-31, 21:45   #17
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,739 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
False. x=14697820651 and p=37 is a counter-example. Just used Pari-Gp and Wolfram Alpha: https://www.wolframalpha.com/input/?...2%5E37-1%5D%5D
Is this easily done? Can the non-existence of a solution help screen out prime exponents?

Last fiddled with by paulunderwood on 2016-12-31 at 21:48
paulunderwood is online now   Reply With Quote
Old 2016-12-31, 22:11   #18
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22·7·53 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Is this easily done? Can the non-existence of a solution help screen out prime exponents?
The x solution exists iff kronecker(-3,q)=1 for all q|2^p-1, so it doesn't really helps.
R. Gerbicz is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solving for x in Phi(n, x) = 0 (mod p) carpetpool Abstract Algebra & Algebraic Number Theory 1 2017-11-04 16:53
Solving systems of equations modulo n carpetpool carpetpool 2 2017-02-05 20:40
Solving x^2==1 (mod n) paulunderwood Miscellaneous Math 2 2016-12-30 07:34
New Method for Solving Linear Systems Dubslow Miscellaneous Math 24 2012-08-24 10:46
solving modular constraints Joshua2 Homework Help 12 2010-02-19 22:59

All times are UTC. The time now is 01:43.


Sat Jul 17 01:43:25 UTC 2021 up 49 days, 23:30, 1 user, load averages: 1.30, 1.28, 1.25

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.