Primality Certificate for (4018^4177-1)/4017

Andy Steward15,051 digits17 June 2008
Originally by A.A.D.Steward 2008

This certificate uses a theorem of Brillhart, Lehmer and Selfridge 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 37.967644% factorization of N-1:

From Factorisation
40182 · 7 · 7 · 41
Φ24019
Φ33 · 5382781
Φ45 · 5 · 733 · 881
Φ616140307
Φ8769 · 4289 · 79023697
Φ93 · 19 · 119987227 · 615247308163
Φ1273 · 3570399743461
Φ1617 · 187801777 · 21278001767528031553
Φ1813933 · 363151 · 831625337971
Φ24956881 · 1493281 · 34045057 · 1396451713
Φ299890509 · 40448563 · 80238470934217129 · 47311710370227900921096523 · p44
Φ3637 · 1549 · 3313 · p35
Φ48687073 · 1599889 · 6295873 · 7173409 · 4337350220881 · 21431873676018567649
Φ5859 · 215587 · 16436976922112393 · p78
Φ727706944193313512314873 · 91172532635403685494579775801 · p36
Φ8782228921 · c194
Φ116349 · 1538393 · 101600921 · 95980144336819806999337 · c163
Φ144c173
Φ174c202
Φ232233 · 3440561 · 13942430895641 · 1426019374138937185609 · c361
Φ2611567 · 76213 · 4656565729 · 18848583761467951 · c572
Φ34841761 · 249517 · 10589305525369 · 184212407176981 · c367
Φ4641017553 · 23914097 · 544448708833 · c783
Φ522523 · 1087309113669981250003 · c582
Φ6964177 · 26449 · 679297 · 482098347341646601 · 46646643639566966089 · c757
Φ10442089 · 101578069 · 2180993691966049 · c1185
Φ1392c1615
Φ208818793 · 148249 · 98664950953 · 19445426215921 · c2389
Φ41764621102190222465962544977 · p4820

From this partial factorization, we use sufficient of the largest prime factors of N-1 so that their product F is at least N 1/3 :

1332304790 6107965994 7467205129 9744648079 2760367624 6777378338 7754186881 1288933638 3931149638 9840196063 7733705310 9001096380 3846437791 7451149444 3643272336 3928720322 6664780476 3028463250 1959323485 2369575614 0876236245 4236496733 9834006011 5940464548 7345256199 5921500030 2403870645 9267522577 8656843945 5829724591 6004213084 2504410753 2728379396 0376701202 0985674861 1012795577 6451084749 7933298124 2077608001 9969227312 4248028968 6829936763 8164386380 0477734845 9974600258 8220189099 6418444009 2193100573 8722738385 8980069210 2909907280 0046405091 7226154377 0737064564 8033397369 0735505423 6888099030 8204044796 3982517409 7310774051 9630849225 7297527894 7529512959 3174777921 5842519374 5240668138 5849457921 4461375464 3802712745 1305270520 8942469652 5845653208 7946265809 5537324173 0745884189 9501865290 2497772551 0010703454 8878294443 9127120747 8100275916 2569846675 5045475242 7435928820 3038954765 2893122632 3018727540 2042346625 0419172030 0809759947 1908014374 9579160845 2603887872 5166990848 8926883394 9946073761 8249282924 6196037622 1546439619 7512612454 8900473814 2380690097 9035731649 3721427187 7081495386 5326479198 5680156145 0362654447 8987804739 9992064988 7358582322 3506274525 9605562876 9382453334 1999939319 0927806993 5085822678 3306456787 6704257348 9551968542 2007254788 3911701791 1570316801 5931236738 0942996320 8351828508 0675304052 5695724469 0378964138 5759079623 2421338316 2922013357 7603721155 0511735596 1444444015 7474995724 1426256489 5265849067 0907501110 9412810665 6599594979 5501337548 7552066329 0225939804 3972764714 4007615321 4731295484 5800704199 6679538297 6586093525 5821459078 0105873935 2816554798 8017220620 2354808045 8161705472 8801515084 9364199606 4053773471 2716378262 8850540475 7055222018 4895215070 7363777309 6057754442 6958711173 6739496597 2832150873 9910989641 7629519280 1595238979 3844777692 3319305547 3951237624 6475275181 1913528519 2201962620 2132606603 1723387172 0610859251 0506490429 3507715960 4776958518 2559787674 1443989589 7267864488 4100894408 5513807906 0071634313 0729248845 7812406918 6526351108 1646878699 4525700514 4152377571 2519219812 1352006137 2049133038 4882026294 2851846111 1371250436 3265748714 9251677951 0407981193 1365703395 7559804255 2504997144 5786571729 4009768876 2295381888 6784408663 9610133350 7129291262 9586545267 4568407741 1387562649 5667030420 1365231578 8543172602 1897588779 2040970108 9891958149 4065935229 8352301671 8326486785 7010510929 5819718636 7900158629 8020465879 7147478485 4904169182 2198426426 7210407240 0924998447 8250167056 0724527855 7973863772 7148645228 7938503526 6533093831 1512199143 7130736929 7692802472 3954242021 5268571355 8152926294 9430784926 6115836968 8961423458 1565841861 3767364548 3625971088 2466244432 3668073442 2488354017 1724448432 2870657734 2380867931 9905728091 2023189975 4184887306 0659425082 4106730252 1178385553 2364802494 1167933720 9010286949 0924405030 6933234703 8338729168 0630172473 1716084718 3842841247 3114461855 1682905154 7856762943 6438552148 3060360239 1765598698 1663116466 4852733810 7820305988 0054002217 5105662942 6242500190 5616641787 7601652451 7113810955 3725760479 4056819517 3152338994 1333898505 6879356655 4213292686 5112861615 2113144702 1854494231 1807270357 2380569776 1820189303 4581770859 8465136370 2587824434 1120766860 2537267149 0165993791 0707189982 3757936948 7298321182 0382727206 9997803136 8996884616 8057692964 7418830143 9540780300 8927792587 9897019386 9517233107 8550848509 9266559612 3050932394 0535283795 3873897818 9543050617 7872645919 7358840722 1099367784 9716886321 1977319103 6622976012 3955160121 6429922993 3008524872 5631998439 9272715657 8905745330 3180968302 6894631574 9997959542 8413682824 3873329248 3083550560 4711337323 8406838591 9292820569 2135173503 1847841067 0996341734 1449465498 2734796674 7825780054 6957913583 4398689411 5903053490 3635090287 3545098249 1984481810 1554928094 6132783669 4431821697 1577863075 7500654646 4175090028 3614381669 0959689237 4157629911 3179043475 0823259003 8310559529 2481382517 9642187990 0804326795 2643337756 9233613847 6690795413 3345236132 8696084757 9987093347 1415251417 9716713454 4505487761 2698317467 1766692233 4993078866 5191392351 7075706772 4343071645 5491574001 1558172794 8824001708 1123985769 0116774747 3686010939 9888271432 9482072588 0475458569 1897991510 0717489818 1907705993 9336670067 8891056846 9277746881 1874155673 8845525274 5231707026 6850298676 9973995674 4256431236 5599558063 2107939391 2344603024 9636057408 0389016181 0151538140 0024494125 4111444862 0935352492 8679577671 0817111642 1594670206 8826931457 5790044295 7643642605 1809719649 8249271356 9395782488 8589640989 9957427202 9959270332 4555672893 6671596060 2790527902 0683675314 5010708502 1572112788 5161706028 0370925004 8825762634 7812516498 5166355873 6922727350 7730578026 8951518329 9359859902 0624048153 6013754496 0964447606 5599071344 3466991125 0122241143 1049288690 4000338180 7353566350 9814175941 6304317819 9392735524 8097864901 2803900675 6059780120 2641119706 1520455472 7859192167 9570732077 7666017992 8468864869 4667941849 7339615775 7176339906 9171718703 7559745115 5641898232 8111106979 9641427952 3012474424 4526835360 0721296985 5278749673 9499417642 5225598354 0085408622 1053548442 9583227313
39072707 6227690351 8869794603 8302608484 6171741322 6084960084 9081008909 4687680179
5381 6218259825 4758971353 8826916544 3291361059
446161 5545104369 7953073377 7650497937
93249 0919182166 5560111018 9412669937
911725326 3540368549 4579775801

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) = 33.487778%

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.

Given such a witness, Pocklington's Theorem shows that every prime factor of N ≡ 1 (mod F). As F3>N, N can have no more than two prime factors.

Express N in base F

As F2 < N < F3 and N ≡ 1 (mod F), we can let N = c2·F2 + c1·F + 1.

Brillhart, Lehmer and Selfridge

Brillhart, Lehmer and Selfridge's Theorem shows that N is prime if and only if c12-4·c2 is not a square (given 2F3 > N).

Here, c12-4·c2 is ≡ 13 (mod 64) and therefore cannot be a square and N is prime.