![]() |
|
|
#1706 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Wait; How do you code Pollard's Rho?
|
|
|
|
|
|
#1707 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Last fiddled with by science_man_88 on 2010-11-27 at 01:21 |
|
|
|
|
|
#1708 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
If I knew a few more things maybe I could make it work,However I don't so I won't.
|
|
|
|
|
|
#1709 |
|
Aug 2006
3×1,993 Posts |
Yes, thats certainly substpol. Honestly, I haven't tested this vs. subst for performance or anything, but I imagine there are reasons to split the special case out.
|
|
|
|
|
|
#1710 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
9,497 Posts |
Here's the script by D. Broadhurst in all its beauty minus some lines that I couldn't understand or that were not entirely by the book and cost nothing to be by the book. The script's result appears to tell us that this
27810-digit number is prime by Konyagin-Pomerance N-1 test with 30.2% factored N-1. I was looking for a way not to put the 7334-digit prime there literally. If this is correct by the book, I could proceed adding it to PFGW. Does it look proper to you, Charles? Thanks. |
|
|
|
|
|
#1711 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
224318 Posts |
P.S. That previous number was actually 32.99% factored (but still short of B-L-S N-1 proof; N+1 side doesn't help enough). Here's the 30.2% factored N-1-based KP proof. Runs really fast, because the number is fairly small and within reach of Primo anyway.
|
|
|
|
|
|
#1712 | |
|
Aug 2006
3×1,993 Posts |
Quote:
Code:
test()={
print("D Broadhurst, KP N-1 test, 8 Jul 2001");
\\ checked for correctness as a Konyagin-Pomerance N-1 test
\\ Origin: http://tech.groups.yahoo.com/group/primeform/files/KP/KonPom.gp
\\ KP Combined test seemed to be a work in progress
\\ it would need more operations as were in the original script
\\ (See Theorem 4.2.9, p.186 in Crandall-Pomerance PN-ACP)
my(N=(8*10^27811-71)/9,p7334,p557,p202,lsm,F,R,c1,c4);
\\ Supply N-1 factors in the lsm[] array:
p7334 = subst(polcyclo(13905),x,10)/83431/333721;
p557 = subst(polcyclo(927),x,10)/46351/181693/1405333/43604227/75178674467317/664958944842271489;
p202 = subst(polcyclo(618),x,10)/619;
lsm=[2,2,2,2,3,3,3,5,7,11,13,19,31,37,41,211,241,271,619,1031,1237,2161,7211,9091,29611,46351,52579,181693,238681,333667,380071,\
497491,704521,1358983,1405333,2906161,3762091,7034077,\
43604227,44092859,102860539,569836171,984385009,2013681931,5905014721,326345481191,8595591045751,8985695684401,75178674467317,\
301917502615411,612053256358933,2702394989404991,41343860637475219,167798066344417387,664958944842271489,4185502830133110721,\
244261115576975427841,290934235666553153131,3462948230491376473027,182725114866521155647161,567664121498896654896380203841,\
896048585318577702680084550566846611,1471865453993855302660887614137521979,7073532436575439739956079653594194521,\
85517237338860102283865323577960208481,5294796903161592416528456780680376286484870226446771978908657527791,\
153211620887015423991278431667808361439217294295901387715486473457925534859044796980526236853,\
292815973319957863643663090772618219691707118842359217315010640397456279188940711108958040881306849,\
757,5563,6481,83431,333721,1577071,16357951,22053331,70541929,310362841,2016447481,\
14175966169,18245696041,258360989311,577603663291,31023833790241,440334654777631,\
483418418597220677238517353915231961831,8610583349234340055547908764091017276717091,\
p202,p557,p7334];
F=prod(k=1,length(lsm),lsm[k]);
R=(N-1)/F;
if(denominator(R)==1
&& gcd(F,R)==1
&& F^(1/3)/6>1
&& 1>3*N/F^(10/3),
,
error("Fail")
);
\\ Here, log(F)/log(N) =~ 0.3299 > 3/10, but less than 1/3
print("Factored part is: ", log(F)/log(N));
c1=divrem(R,F);
c4=c1[1];
c1=c1[2];
print();
\\ Unsure why the square test was not performed six times in the original script
\\ This is part 1 from Theorem 4.1.6 (or 4.2.9):
for(t=0,5,
if(issquare((c1+t*F)^2+4*t-4*c4),error("Fail @ "t))
);
my(b=contfrac(c1/F), v=0, vn=1, u=1, un=b[1], n=1);
while(F^(1/3)>vn,
bn=b[n++];
uo=u;
u=un;
vo=v;
v=vn;
un=bn*un+uo;
vn=bn*vn+vo
);
\\ Here, u/v is as per Part 2 of Theorem 4.1.6
my(d=round(c4*v/F), zs=[v,u*F-c1*v,c4*v-d*F+u,-d], q=0);
for(k=1,4,
print("zs["k"] = ", zs[k]);
q += zs[k]*x^(4-k)
);
print();
\\ required precision is dependent on the size of N
default(realprecision, 10000);
my(ps=polroots(q), r, q1, q2);
for(k=1,3,
r=floor(real(ps[k]));
print(r);
q1=substpol(q, x, r);
q2=substpol(q, x, r+1);
if(q1*q2>=0,error("Fail root ",k))
);
print("OK, no integral roots");
\\ if there's a root a, check: if aF+1 is a nontrivial factor of N, then N is composite
\\ Note to myself: for implementation in PFGW: one root is very close to 0 and can be found by Newton iter, with initial 0; then reduce to quadratic.
print(ps[2]);
};
test()
Last fiddled with by CRGreathouse on 2010-11-27 at 15:38 |
|
|
|
|
|
|
#1713 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
Here's one of them. Some sort of iterated algorithm to try, for some fairly large semiprime n (Ex: 5403615307171909) .. Oh, dear. This tutorial of theirs is a nightmare. Last fiddled with by 3.14159 on 2010-11-27 at 16:49 |
|
|
|
|
|
|
#1714 | |
|
"Forget I exist"
Jul 2009
Dumbassville
203008 Posts |
Quote:
|
|
|
|
|
|
|
#1715 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
Figured it out I think. Want my take on it Pi ?
|
|
|
|
|
|
#1716 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why do I sometimes see all the <> formatting commands when I quote or edit? | cheesehead | Forum Feedback | 3 | 2013-05-25 12:56 |
| Passing commands to PARI on Windows | James Heinrich | Software | 2 | 2012-05-13 19:19 |
| Ubiquity commands | Mini-Geek | Aliquot Sequences | 1 | 2009-09-22 19:33 |
| 64-bit Pari? | CRGreathouse | Software | 2 | 2009-03-13 04:22 |
| Are these commands correct? | jasong | Linux | 2 | 2007-10-18 23:40 |