![]() |
![]() |
#1 |
Sep 2002
Database er0rr
2·33·83 Posts |
![]()
Consider [a,-1;1,a] = 2*a + [-a,-1;1,-a] where M=[a,-1;1,a] has the character x^2-2*a*x+a^2+1 and its discriminant = -1. Solving the character gives x=a+-sqrt(-1), leading to a test:
Code:
{tst(n,a)=n%4==3&& gcd(a^3-a,n)==1&& Mod(2,n)^(n-1)==1&& Mod(a,n)^(n-1)==1&& Mod(Mod(x+a,n),x^2+1)^(n+1)==a^2+1;} Last fiddled with by paulunderwood on 2022-07-17 at 17:38 |
![]() |
![]() |
![]() |
#2 |
Sep 2002
Database er0rr
118216 Posts |
![]()
Answer: [n, a]=[79786523, 1056446]
Now for a harder problem: Let a = 2^r, so that the test becomes: Code:
{tst(n,r)=local(a=lift(Mod(2,n)^r)); n%4==3&& gcd(a^3-a,n)==1&& Mod(2,n)^(n-1)==1&& Mod(Mod(x+a,n),x^2+1)^(n+1)==a^2+1;} Last fiddled with by paulunderwood on 2022-07-17 at 20:50 |
![]() |
![]() |
![]() |
#3 | |
Sep 2002
Database er0rr
10001100000102 Posts |
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#4 | |
Sep 2002
Database er0rr
2×33×83 Posts |
![]() Quote:
Note n divides 2^(n-1)-1. gcd(a^2-1,n)==1 ==> gcd(2^(2*r)-1,2^(n-1)-1)==1 ==> gcd(2*r,n-1)==2 if gcd(r,(n-1)/2)==1. Hence the required condition gcd(2,n-1)==2 which is met for n==3 mod 4. Last fiddled with by paulunderwood on 2022-07-19 at 02:53 |
|
![]() |
![]() |
![]() |
#5 |
Sep 2002
Database er0rr
2×33×83 Posts |
![]()
Let z=znorder(Mod(2,n)).
Then [2^(z-r),-1;1,2^(z-r)]^(n+1) == 4^(z-r)+1 == (4^z+4^r)/(4^r) == (1+4^r)/4^r all mod n So 2^(r*(n+1))*[2^-r,-1;1,2^-r]^(n+1) = (1+4^r)*2^(r*(n-1)) mod n Or [1,-2^r;2^r,1]^(n+1) == 4^r +1 == [2^r,-1;1,2^r]^(n+1) mod n Hence I need only verify 0<r<(z+1)/2, Thus speeding up the verification program by a factor of two: Code:
{for(v=1,#V,n=V[v]; if(n%4==3,z=znorder(Mod(2,n));print([v,n,z]); for(r=1,(z+1)/2, if(gcd(r,n-1)==1,a=lift(Mod(2,n)^r); if(Mod(Mod(x+a,n),x^2+1)^(n+1)==a^2+1, print([n,a,r,z]);break(2))))))} Testing has reached 1.5e12 ![]() I have now added Mod(det,n)^((n-1)/2)==kronecker(det,n) where det=a^2+1, to speed it up some more. Testing now at 2.7e12. Last fiddled with by paulunderwood on 2022-07-20 at 00:32 |
![]() |
![]() |
![]() |
#6 |
Sep 2002
Database er0rr
2×33×83 Posts |
![]()
Recap: I am testing: Fermat 2-prp and (x+2^r)^(n+1)==4^r+1 where gcd(r,n-1)==1, and have reached n<4*10^14 without counterexample.
Now, writing a=lift(Mod(2,n)^r) the Lucas part can be written as a Lucas test for y over y^2-2*a*y+a^2+1 which can be transformed into Euler-PRP for a^2+1 and z^((n+1)/2)==kronecker(a^2+1,n) (mod n, z^2-2*(a^2-1)/(a^2+1)*z+1). In testing this I have found that a 2-PRP plus the Lucas test on z with gcd(a^2+1,n)==1 (and gcd(r,n-1)==1) is enough without the Euler test ![]() Last fiddled with by paulunderwood on 2022-08-18 at 15:28 |
![]() |
![]() |
![]() |
#7 |
Sep 2002
Database er0rr
2×33×83 Posts |
![]()
A small observation: If a number n==3 mod 4 is Fermat 2-PRP then 2^(n-1)==1 mod n. If z is the multiplicative order of 2 mod n, then z divides n-1. Also (x+2^z) == x+1 mod n. Furthermore, (x+1)^(n+1) == 2 (mod n, x^2+1) is equivalent to a Fermat 2-PRP test. Neat, eh? And gcd(r,n-1) implies gcd(r,z)==1.
![]() |
![]() |
![]() |
![]() |
#8 | |
Sep 2002
Database er0rr
448210 Posts |
![]() Quote:
Does anyone care to complete the proof of the test? |
|
![]() |
![]() |
![]() |
#9 |
Sep 2002
Database er0rr
2×33×83 Posts |
![]()
Summarizing the two cases:
n%8=3 :: 2^((n-1)/2) == -1 mod n :: z/2 is odd :: two solutions exist: z and z/2 n%8=7 :: 2^((n-1)/2 == 1 mod n :: z is odd :: one solution exists. Due to z being on average much smaller than n, what appears to be true might be the law of small numbers.The leap from Fermat 2-PRP plus (x+2^r)^(n+1) == 4^r+1 (mod n, x^2+1) with gcd(r,n-1) == 1 to only a test for (x+2)^(n+1) == 5 (mod n,x^2+1) is a large one. Is it better to push the testing boundary beyond my 2^50 limit for the latter or to try and prove Euler 2-PRP + the test for (x+2)? ![]() Last fiddled with by paulunderwood on 2022-08-20 at 17:47 Reason: noting z/2 is odd |
![]() |
![]() |
![]() |
#10 | |
Sep 2002
Database er0rr
118216 Posts |
![]() Quote:
![]() I'll call it day after verification to 10^15 of the test: n==3 mod 4 2^n==2 mod n (I+2^r)^n==-I+2^r mod n where I is the sqrt(-1) gcd(r,n-1)==1 Last fiddled with by paulunderwood on 2022-08-20 at 19:48 |
|
![]() |
![]() |
![]() |
#11 | |
Sep 2002
Database er0rr
106028 Posts |
![]() Quote:
![]() Last fiddled with by paulunderwood on 2022-09-21 at 22:33 |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigma parameter in ecm | storm5510 | Information & Answers | 4 | 2019-11-30 21:32 |
PrimeNet error 7: Invalid parameter | ksteczk | PrimeNet | 6 | 2018-03-26 15:11 |
changing mprime's WorkerThreads parameter? | ozturkfa | Information & Answers | 7 | 2012-04-03 16:19 |
Parameter Underestimation | R.D. Silverman | Cunningham Tables | 14 | 2010-09-29 19:56 |
ECM Work and Parameter Choices | R.D. Silverman | Cunningham Tables | 11 | 2006-03-06 18:46 |