![]() |
![]() |
#12 | |
Sep 2002
Database er0rr
362610 Posts |
![]() Quote:
Code:
{ tst(n,a,b)=local(Q=b^2-a); kronecker(a,n)==-1&& kronecker(Q,n)==-1&& Mod(2,n)^(n-1)==1&& Mod(Mod(z,n),z^2-(4*b^2/Q-2)*z+1)^((n+1)/2)==-1&& Mod(Mod(z,n),z^2-(4*b^2/a-2)*z+1)^((n+1)/2)==-1; } ![]() Last fiddled with by paulunderwood on 2021-02-16 at 04:13 |
|
![]() |
![]() |
![]() |
#13 |
Sep 2002
Database er0rr
2·72·37 Posts |
![]() Code:
{ tst(n,a)=local(A=a^2+a); kronecker(A,n)==-1&& kronecker(a,n)==-1&& Mod(A,n)^((n-1)/2)==-1&& Mod(a,n)^((n-1)/2)==-1&& Mod(Mod(z,n),z^2-(4*a/(a-1)-2)*z+1)^((n+1)/2)==-1 } The latter has only produced unique solutions for a given n, making 2 rounds with different a's sufficient for a primality proof?!?!? ![]() Those pesky primes! I just found 2 solutions for 2728624939. However gcd(a1^2-a2^2,n)>1 ![]() I have now found n with 3 or 4 solutions too, and gcd(ai^2-aj^2,n)>1 for i != j. I am seeing the same sort of GCDs for A=a+1 and kronecker(A,n)==-1. Hence the corresponding test can be done for suitable {a, a+1} and {a+1,a+2} which reduces the number of sub-tests, and no GCD need be calculated. Last fiddled with by paulunderwood on 2021-02-18 at 05:03 |
![]() |
![]() |
![]() |
#14 | |
Aug 2006
135418 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#15 | |
Sep 2002
Database er0rr
2×72×37 Posts |
![]() Quote:
I am now testing: Code:
{tst(n,a)=kronecker(a,n)==-1&&kronecker(a-1,n)==1&&kronecker(a+1,n)==-1&& Mod(a,n)^((n-1)/2)==-1&&Mod(a-1,n)^((n-1)/2)==1&&Mod(a+1,n)^((n-1)/2)==-1&& Mod(Mod(x,n),x^2-(4*a/(a-1)-2)*x+1)^((n+1)/2)==-1;} {tst1(p,q)=local(n=p*q,u=[]); for(a=2,p-3,if((n%(p-1)==1)|| Mod(a,p)^(n-1)==1&&Mod(a-1,p)^(n-1)==1&&Mod(a+1,p)^(n-1)==1&& Mod(Mod(x,p),x^2-(4*a/(a-1)-2)*x+1)^(n+1)==1, u=concat(u,a)));Mod(u,p);} {tst2(p,q)=local(n=p*q,up,uq,a,V=[]); up=tst1(p,q);if(#up,uq=tst1(q,p);if(#uq, for(i=1,#up,for(j=1,#uq,a=lift(chinese(up[i],uq[j])); if(tst(n,a),V=concat(V,a))))));V=vecsort(V); if(#V,for(v=1,#V,print([n,V[v],gcd(V[v]^2-V[1]^2,n)])));V;} {forprime(p=7,10000000,for(k=4,12,q=1+2*k*(p-1); if(ispseudoprime(q),tst2(p,q)))); print("\\\\ "round(gettime/1000)" seconds");} This test has zero or a unique solution for n so far; These unique solutions have either a+3==n or a+1/a+6 == 0 mod n. I found a non-unique solution. So I have added justifiable Fermat 2-PRP into the test and am running again. Last fiddled with by paulunderwood on 2021-02-19 at 06:05 Reason: FIXED JACOBI SYMBOL |
|
![]() |
![]() |
![]() |
#16 |
Sep 2002
Database er0rr
2×72×37 Posts |
![]()
The rationale for the above test:
Code:
{ tst(n,a)= gcd(a+3,n)==1&& gcd(a^2+6*a+1,n)==1&& kronecker(a,n)==-1&& kronecker(a-1,n)==1&& kronecker(a+1,n)==-1&& Mod(2,n)^(n-1)==1&& Mod(a,n)^((n-1)/2)==-1&& Mod(a-1,n)^((n-1)/2)==1&& Mod(a+1,n)^((n-1)/2)==-1&& Mod(Mod(z,n),z^2-(4*a/(a-1)-2)*z+1)^((n+1)/2)==-1; } ![]() Last fiddled with by paulunderwood on 2021-02-21 at 05:49 Reason: wrong n |
![]() |
![]() |
![]() |
#17 |
Sep 2002
Database er0rr
1110001010102 Posts |
![]()
I am now testing:
Code:
{tst(n,a)=kronecker(a,n)==-1&&kronecker(a-1,n)==-1&&kronecker(a+1,n)==-1&& Mod(a,n)^((n-1)/2)==-1&&Mod(a-1,n)^((n-1)/2)==-1&&Mod(a+1,n)^((n-1)/2)==-1&& Mod(Mod(x,n),x^2-(4*a/(a-1)-2)*x+1)^((n+1)/2)==1;} {tst1(p,q)=local(n=p*q,u=[]); for(a=2,p-2,if((n%(p-1)==1)|| Mod(a,p)^(n-1)==1&&Mod(a-1,p)^(n-1)==1&&Mod(a+1,p)^(n-1)==1&& Mod(Mod(x,p),x^2-(4*a/(a-1)-2)*x+1)^(n+1)==1, u=concat(u,a)));Mod(u,p);} {tst2(p,q)=local(n=p*q,up,uq,a,V=[]); up=tst1(p,q);if(#up,uq=tst1(q,p);if(#uq, for(i=1,#up,for(j=1,#uq,a=lift(chinese(up[i],uq[j])); if(tst(n,a),V=concat(V,a))))));V=vecsort(V); if(#V,for(v=1,#V,print([n,V[v],gcd(V[v]+3,n),gcd(3*V[v]+1,n),gcd(V[v]^2+6*V[v]+1,n)])));V;} {forprime(p=7,1000000,for(k=4,12,q=1+2*k*(p-1); if(ispseudoprime(q)&&Mod(2,p*q)^(p*q)==2,tst2(p,q)))); print("\\\\ "round(gettime/1000)" seconds");} I found a counterexample for n=415681338623. Now I am testing with a 3-PRP test too since "3" is in the GCDs. Last fiddled with by paulunderwood on 2021-02-21 at 14:58 |
![]() |
![]() |
![]() |
#18 |
Sep 2002
Database er0rr
2×72×37 Posts |
![]()
Latest test:
Code:
{EulerPRP(a,n)=Mod(a,n)^((n-1)/2)==kronecker(a,n);} { tst(n,a)= gcd(a+3,n)==1&& gcd(3*a+1,n)==1&& gcd(a^2+6*a+1,n)==1&& kronecker(a,n)==-1&& Mod(a,n)^((n-1)/2)==-1&& EulerPRP(2,n)&& EulerPRP(3,n)&& EulerPRP(a-1,n)&& EulerPRP(a+1,n)&& Mod(Mod(x,n),x^2-(4*a/(a-1)-2)*x+1)^((n+1)/2)==kronecker(a*(a-1),n); } Last fiddled with by paulunderwood on 2021-02-21 at 16:33 |
![]() |
![]() |
![]() |
#19 |
Sep 2002
Database er0rr
362610 Posts |
![]()
Are the solutions to b^2 = 2^i*3^j + 1 finite? (i, j >= 0)
I have only found b in [2, 3, 5 ,7, 17]. Last fiddled with by paulunderwood on 2021-02-21 at 19:38 |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
I found the primality test, there seems to be no composite numbers that pass the test | sweety439 | sweety439 | 7 | 2020-02-11 19:49 |
Modifying the Lucas Lehmer Primality Test into a fast test of nothing | Trilo | Miscellaneous Math | 25 | 2018-03-11 23:20 |
Double check LL test faster than first run test | lidocorc | Software | 3 | 2008-12-03 15:12 |
Will the torture test, test ALL available memory? | swinster | Software | 2 | 2007-12-01 17:54 |
A primality test for Fermat numbers faster than Pépin's test ? | T.Rex | Math | 0 | 2004-10-26 21:37 |