Primality Certificate for (3031^2753-1)/3030

Andy Steward9,582 digits19 September 2005
Originally by A.A.D.Steward 2005

This certificate uses a theorem of Konyagin and Pomerance to prove an integer N prime by making use of a partial prime factorization of N-1.

Factorizing N-1

As N is a Generalized Repunit, we make use of the algebraic factorization of N-1 to arrive at the following 30.596343% factorization of N-1:

From Factorisation
30317 · 433
Φ22 · 2 · 2 · 379
Φ42 · 4593481
Φ82 · 41 · 281 · 3662887441
Φ162 · 17 · 209511841405989952801226513
Φ322 · 37690369 · 9587677537 · p38
Φ438183761 · 38386240044637 · c126
Φ642 · 577 · 255639549313 · c97
Φ86173 · 1179920689 · p135
Φ1723612689 · 127741477 · p278
Φ3441721 · c582
Φ6884129 · c1167
Φ13762753 · 62426369 · 38218309983457 · p2315
Φ2752c4680

We need the product F of all the prime factors from this partial factorization:

64313 6968043798 4937398101 3940499689 3725942567 6947846483 1025917975 1778563657 3173617754 1421918283 6526087698 4773229691 3058675809 4685494570 9479817595 6163828341 3881860070 8805131224 7270215592 5363903697 6819710688 2370620335 5757472420 3888876085 2254481731 1302357061 9142856058 0620790605 5564550632 4096289515 5412521652 0331301254 6971056795 5153007525 2133448029 8055146591 0506753421 3033876006 9176831735 4163742004 6414425083 8555248355 5053101964 3969883517 6944465084 3876147491 8122210270 3486151688 4700820631 9342305704 4787765882 9356532286 8289067479 9704519471 1691931571 0684177417 8250632757 0045848942 7819714512 9508543982 7663362412 0213633675 0672542124 5464511487 7589829075 0357062658 9244234495 3659697352 6317159291 8242225513 4195650338 9961420900 3576495548 4974084718 2295696219 5114456662 3477059113 3078199603 6251776944 1144859899 7123240768 8835569889 5707792076 1688575203 3511670804 7109884176 5668030469 5079505191 3870223161 0997982692 4683134219 3967857271 0283908277 6036472696 0540937824 0691927466 5393084026 3612162159 4940946700 0437227491 7006727792 9772900121 4347126616 0641661491 1082143942 9102026349 8437994955 0440060823 3300060063 1386876549 1256607471 1475096982 9862655871 7482312483 6723002282 7208794095 1870390434 6204951067 5527435482 8448415997 7320378710 7181901476 4662205387 5504884256 8591660638 8483813818 2266199888 5374296315 8414372539 4042056210 7685896370 3988641269 5244468930 8664632091 3143651224 9961470219 0520089086 1140292654 1924626003 2402624067 2557321682 1884095241 0271180947 3262083927 6094661821 0910298885 1125713358 1685711327 6207841522 8401457346 1815980992 8207638192 6745773810 9306302395 4177252794 7386587799 5414681643 4420085263 3600897074 2828236863 2954172294 1588581302 2484321371 0327800271 7671014903 8209657572 7523082592 8133740309 8873634392 7255729084 4320466478 7032747788 2552520859 3143753932 6959024021 0009623162 7179607717 7313152972 9262784045 5130885417 5679665293 0449581616 3271328048 6544867139 8292802709 8867294081 2060876529 0822638447 7604932842 0071765437 3448721967 8590913423 5976401644 2907433650 8576824981 2493401905 6274364860 2001969026 9221014421 4401772837 8101226882 9967715233 1829528858 4729482451 6142096748 5590635140 4860484007 5402572609 3792276643 2732882687 4818007202 1018556439 6914834822 1638051637 4197291034 4101539447 7262117400 8993983252 9565738590 1524277174 6514130395 4792555571 8721224050 6659797788 1762060289 6954090454 0459639594 3444883407 0079932312 5485287227 9482582612 4921254369
61525633 9826239488 5833224146 2295979360 8283039229 8400305938 4516560950 2633094071 4319926397 9399531987 3066321406 8172045832 8207792049 0496108297 2959983446 1628052437 9156220989 1508981443 3683142312 7409201613 7015717890 1339373744 6711190382 8065542453 1055547043 9488136848 5835503207 1940560237
82521 5064461501 5858880267 2712715527 1128209468 9745405766 6466806401 8075590616 1712485505 6512525875 1155939666 0819024291 6628155862 5940277023
70210356 4530132186 7943262364 4095708897
2095118 4140598995 2801226513
3838 6240044637
3821 8309983457
25 5639549313
9587677537
3662887441
1179920689
127741477
62426369
37690369
8183761
4593481
3612689
4129
2753
1721
577
433
379
281
173
41
17
7
28

Note that all prime factors listed above have been proven. As primes of under 250 decimal digits can be verified in a few seconds, proof of their primality is not included here, in order to save space. Larger prime factors can take from hours to months to prove; certificates for all such factors have been PKZIPped into this file.

We set R = (N-1)/F. Note that GCD(F,R)=1 and Log(F)/Log(N) = 30.596343%

Finding a Witness to Primality

Next, we find an integer witness w such that for each prime factor p of N-1, w(N-1) ≡ 1 mod N and GCD(w(N-1)/p-1,N) = 1. In this case, w = 3 suffices.

Express N in base F

Let N = c3·F3 + c2·F2 + c1·F + 1. Let c4 = c3·F+c2.

Square Checks

For t = 0 to 5, we prove that Q(t) = (c1+t·F)2+4·t-4·c4 is not a perfect square. This is done by checking whether Q(t) is a quadratic residue modulo a variety of bases. If it happens to be a QR in all of the bases, we calculate s = floor(sqrt(Q(t))) and show that s2 < Q(t).

Continued Fraction

We approximate c1/F by a continued fraction u/v such that v is maximal while remaining less than F2 / N1/2 = 255 5703748241 1694193488 1348845791 7492892932 6730698017 0141803870 6495383043 0910470748 8477252999 3291920060 6829954329 4343623026 5796859676 3727889365 9399011404 7981470829 8801046399 2556933951 9344375871 4453774233 5181633398 1527370833 6184723990 5339662905 2500548518 6063089414 5529100572 1459731749 6477660657 9805728364 3936802656 6089353239 2007635309 1583721799 8207354697 3776490860 2455937768 3503945128 2375889612 9456862072 6540109007 8243111387 1927052586 0159747204 2837092333 4156042194 3897283913 1132229771 8498604077 5748887834 2390802567 5889528284 0042509967 2090850730 5090587328 0638580175 1231364728 7616751176 7088869372 8546103882 5813237004 9656630366 3645764290 1680822283 2368941567 7993800289 9113663499 7889923256 6181724020 0737857471 4142135330 2141037567 8500074401 7910452987 3077842537 1352948587 9380334441 3634401251 7982190518 9973227876 4178263790 4666657130 7333301103 9783357746 6290988421 1300499065 3242154686 2453228408 7946235338 1520953119 4884750170 5838048247 9212795493 9815851272 1596959751 5067716886 6762690818 3418576987 5913186241 4793041120 1162108359 5813169403 1109118337 8542124156 8675588105 5124413376 6014134297.

With those constraints, the unique continued fraction is: {0, 1, 2, 5, 6, 6, 1, 1, 2, 2, 3, 11, 23, 2, 34, 1, 2, 1, 5, 2, 1, 1, 6, 1, 1, 3, 2, 8, 1, 4, 13, 8, 1, 2, 1, 4, 3, 2, 1, 2, 5, 3, 2, 2, 4, 1, 1, 3, 1, 2, 5, 3, 1, 1, 1, 7, 4, 1, 4, 2, 2, 3, 11, 1, 5, 32, 1, 73444887 6340703289 3212332544 0956237315 6653866157 4906523353 5599042100 5719198337 9885695164 0876666357 0304764804 8757344699 4328492051 3308449503 5774231486 9789689759 1612715281 5805980780 0622891948 5413150123 8762598026 3326935180 6029949049 8164132234 9150470749 0394520861 4872526457 9167754081 3880524617 5086489839 1793910819 2789184477 1803613800 5740055324 9970091363 2613586863 5322454571 3568059861 9848656894 6426367503 1615062413 5966590374 4432831355 6525187792 6034877991 7392029862 2173467555 8425694429 0191157536 7018155938 8218097972 2579531634 4628951546 3735889674 7638245681 9027129518 6033180257 4457265353 7997016842 9467040744 8828236629 1098682739 1061254330 2472910226 8168823559 3403664676 4430410059 1094370393 5962599510 3011024493 9554277934 2289648271 6623139813 3217891466 6294608374 2338166989 6879263725 2468345640 2727933883 9564502576 3518389501 2498108672 6771697553 8198058486 4458713870 9573116554 4924561360 8895234074 1420759927 5593380256 5181570035 7606126646 2691727337 2755334097 8175645445 1000898682 4033340072 3581147523 4325912195 8776437949 3898274981, 46, 1, 1, 3, 1, 2, 2, 1, 37, 3, 6, 18, 1, 1, 10, 1, 63, 1, 4, 2, 2, 1, 1, 7, 2, 2, 7, 3, 1, 1, 2, 2, 1, 2, 30, 1, 2, 1, 4, 1, 54, 1, 2, 2, 1, 3, 4, 1, 2, 7, 1, 2, 1, 1, 2, 1, 974, 1, 3, 9, 1, 2}, giving these values for u and v:

We also need to calculate d = floor(c4·v/F + 0.5) = 670352361 0360152900 0305315852 7035215304 8621497150 9063774683 9004317717 0367585007 6454173471 9667762163 0091745770 7174969065 9700044359 6893583232 8973578558 6768404784 4401357378 1934021072 3130401546 4533517269 0550089391 8032015399 9661360295 5092416356 7957964832 2840968060 8856247857 5386210177 6069468380 8071487311 2249176445 8003352684 1194528165 5270224420 8023660356 2475897084 5339171171 3418324318 7478337312 8856133400 9118472245 6271540249 5093742749 3319589591 2660742695 4744794484 2961811535 5063212237 3574640590 3533392584 1994284287 4009240521 8512296920 3656397967 8128001723 7880045285 6750494455 8986844086 8476281391 6671810560 7839608884 4261221481 7044293248 8699410472 9990069355 1571224499 4303749296 9214306995 2328117012 9087053209 4295340814 9080219279 4371260277 0681700077 8352971041 3221453189 5743841236 7486458605 5133869061 4192017790 3635806749 6937587674 4093091955 7025451735 6255468809 8492766455 0610224803 7709385224 2671932466 6002864158 6991537039 5647720995 9211347960 4669619168 2602842645 1329854637 1259038066 3598127535 8404259333 1482307982 9995077244 3601040506 3287729008 3597643304 6184436976 8249823115 5724727113 3975415939 6934950124 5478527302 6721798503 1317581899 3890074455 4414418252 6686697995 3848415794 8307654098 1071261751 6450476922 5516852404 1005264680 0600569262 5078459247 5693325364 4056140325 1193532483 0844478801 0334033393 5555153374 0078520058 1604236540 2372714990 8922988183 1588885457 8421925276 3715420275 7095645295 7056032429 5478265876 8681182321 7693946675 3575205571 6858572648 7835520341 8509400771 4408920209 0212712560 7629665439 8571243515 4802476889 2100064465 4206330998 2874854404 2547340438 4582678271 7772586980 0943872907 7072842987 7257865768 7220734517 7714920396 1225661982 3875349949 8545043953 8784903136 3755843377 3917698055 1201507735 6356542761 3427496644 8599807345 8800611849 2096163639 9522258089 6804353956 3620621679 1953733181 4903244275 1793895926 4975657460 9475638164 3515701953 8431975088 7865679419 0469778479 2998685032

Cubic Polynomial

We now consider the cubic P(x)= v·x3 + (u·F-c1·v)·x2 + (c4·v-d·F+u)·x - d, which we express as: z1·x3 + z2·x2 + z3·x + z4, where:

We need to prove that this cubic has no integer roots r such that r·F+1 is a non-trivial factor of N. Clearly r (if it exists) must lie between 1 and R.

The real roots of P are:

There are no integer roots of P in the interval (1,R), so the proof of primality is complete.