Primality Certificate for (7888^2011-1)/7887

Andy Steward7,833 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 31.905446% factorization of N-1:

From Factorisation
78882 · 2 · 2 · 2 · 17 · 29
Φ27 · 7 · 7 · 23
Φ33 · 20742811
Φ541 · 4241 · 26141 · 851821
Φ613 · 271 · 17659
Φ10571 · 6779168760451
Φ1531 · 4441 · 16411 · 1327446061 · 4996728572281
Φ3061 · p30
Φ67269 · 2011073 · 18198139 · 93307809559 · c231
Φ13457487 · p253
Φ201652447 · c509
Φ335957431 · 2392571 · 45530521 · c1009
Φ40298491 · c510
Φ670c1029
Φ10052011 · 2102461 · c2048
Φ2010p2058

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

39670636 3138916726 4195583386 1806327181 2475077036 9731558108 7625839363 6778015958 8231558522 9498500527 4239589669 8632972818 3652914507 6857121471 3213445076 7929123815 6788305981 3703539297 3334297113 2774523184 4728324018 1341910668 7862669835 5793185051 0187634003 0566348854 3797180094 7220590948 7502601147 7762557182 2882699918 8748054738 4719097909 7662111081 8037181085 9056175481 3990878916 7977224293 7428638917 3545278990 2554138441 2248679929 0795548748 8020675408 4349182863 9142664826 9924954591 9865272030 3468956569 9507822768 9322659636 9326024917 0446139404 1114438902 6438714993 6413091911 1463453984 6432856518 8846795144 5784349016 1188288552 3471168417 3719227933 0691916715 3967818199 2870751579 1200715870 8158037757 5142794671 3348905361 1925048220 8592345234 9049293326 1787336934 8674634377 0698033507 9937826006 0431700659 2680266257 7002029538 1225367466 0699020253 0087483269 1345005821 3690351046 8370697466 2614858622 2951906680 0056890116 1322939166 5784418492 7251039190 4495081632 5069530624 5702937282 8430343415 0019249121 2471031151 0718434719 8676659191 1767573876 9006122390 0962736711 2901365328 5228506673 7238545143 1692113423 2730953252 7085268275 4074012487 1271683929 6752566517 3398537007 4047140210 7550883290 4694251529 7950435655 7737035687 8526332500 2215822506 6487003548 0748792646 8287014433 5600112547 1312142484 0185695750 1309801508 2210687425 5961563213 0054090627 7120226999 1479010282 4585358972 1579645470 5738988959 4627610506 4900605314 4949940851 3389801273 7506246973 8055775756 1707494048 2530882332 4756869762 4172443547 4848106177 1085373244 0852699608 3906876519 2647671945 2364946132 5838151467 4752028376 4075379990 8781316255 2870966935 5065886866 1030894011 6366121290 4768014248 9073121548 1999582024 5535713321 4736357808 7457254897 9366182785 8724866248 2138987551 3937049077 4073552921 5818790670 1327098153 1097016697 7999901762 9052597492 6178817158 8036130669 9485642649 7120992908 0704047490 3863474686 7727128796 4142612286 4953323696 0591782136 4737598491 6499154497 9353389831 6324237442 4322780555 1091805716 4542884516 6626858692 4631426246 4969028336 4164322977 6533441724 4920013891 1468602361 8407502462 7288135436 4330946086 4246780455 0940643759 8479657935 4187745841
275 5439172244 0086864978 8180314845 0540508971 1787590735 3315598383 2544846325 9618162560 2151887784 1750665163 0774769014 8299982642 9979837452 4340998672 5508149361 8218596091 4403158836 9604198256 5916530788 0083000986 5119504771 0675460583 1638886794 2030715196 9413650751
2457312753 0814440611 4437512741
677 9168760451
499 6728572281
9 3307809559
1327446061
45530521
20742811
18198139
2392571
2102461
2011073
957431
851821
652447
98491
57487
26141
17659
16411
4441
4241
2011
571
271
269
61
41
31
29
23
17
13
73
3
24

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

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 = 235 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 = 62 1989721737 2708547188 7755570151 5483662962 4882161605 1411158296 5239981851 6220919416 6006902192 3422722012 1951781962 3140942278 4398601006 8878665053 7619473964 5123391349 5211511312 8062893674 4891032459 5187617194 8128897989 4899811667 5996282083 8756945104 5913366152 0234267848 1065669623 7531209585 3242251332 0371835297 3695725101 9061192078 1632979143 3603072402 1592096748 8604368970 9374190810 0539187045 7687862401 8161910638 4257110612 8198078756 7111538240 3154140117 8876459599 7123716193 1089676433 0580179259 6057193529 5518250573 0416538672 8885787360 6100473688 5697561141 8002658518 8224024100 3275940527 3807542058 8272563626 4324584605 1377188327 2773685107 0188252810 7640377641 1977858365 0994006720 3342343883 5881252783 4372913059 3518383427 5502437253 1509249945 3252199000 4516420006 4653730575 2835777957 5744549626 4958240601 9779045644 8655180264 0284912107 0759717390 5823708817 3458804211 2709370808 1573797059 2457574814 0671524611 5930418169 6186982234 7361504606 7720844020 2236981495 6931551769 5289245124 6530327223 8415836821 1852919578 8629829194 8840849379 6888935880 4636884093 5629036228 0725203022 4623948200 5732449912 7514574459 3379296904.

With those constraints, the unique continued fraction is: {0, 1, 3, 2, 3, 6, 14, 1, 2, 1, 2, 1, 8, 3, 29, 4, 7, 9, 7, 4, 8, 1, 2, 61, 1, 2, 3, 1, 3, 12, 13, 1, 4, 70, 8, 35, 1, 7, 1, 1, 3, 1, 3, 1, 3, 1, 1, 2, 1, 1, 7, 4, 1, 10, 2, 1, 1, 83, 1, 1, 11, 1, 1, 8, 1, 1, 6, 1, 2, 19, 1, 4, 1, 1, 3, 3, 5, 22, 5, 19, 1, 1, 1, 4, 2, 2, 2, 1, 6, 2, 1, 1, 1, 1, 2, 1, 1, 16, 1, 76, 1, 45, 3, 1, 41,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920 8116605438 2968518785 5745148972 1635225308 6131023103 6284929141 4504068326 0815004873 0056279563 8161239616 8519745056 7731285033 7210382520 0928785922 7549609385 7328796052 2864865728 1317614586 2570310677 8459589783 2792779234 9422539743 0143175152 6193351957 9327820326 6752120787 3464309693 3038055951 9299766045 2257106339 7482631278 9762129650 5657296080 4494041132 4052822352 2971628872 5032146579 6773405553 6232140273 2118412095 0426129045 2839985811 9863381422 6897626204 0468140052 4897434858 4512806340 5217143112 2570490658 6436296052 6971100944 1204358726 0246327260, 4, 1, 3, 21, 40, 3, 1, 8, 7, 4, 1, 9, 1, 6, 3, 1, 2, 4, 4, 29, 2, 2, 1, 2, 2, 1, 1, 1, 4, 4, 1, 2, 33, 1, 1, 1, 29, 1, 1, 12, 3, 1, 1, 2, 2, 10, 2, 3, 2, 1, 47, 2, 1, 3, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 2, 16, 1, 2, 1, 1, 10, 1, 3, 6, 2, 3, 5, 1, 1, 3, 21, 5, 1, 10, 3, 1, 12, 4, 21, 7, 3, 1, 90, 2, 1, 1, 2, 7, 1, 2, 3, 6, 28, 6, 1, 1, 2, 1, 3, 2, 10, 18, 2, 1, 1, 6, 2, 1, 14, 23, 3, 4, 3, 1, 25, 8, 2, 9, 3, 3, 2, 1, 1, 2, 1, 1, 31, 1, 6, 1, 3, 2, 1, 1, 1, 1, 194, 8, 1, 1, 5, 2, 1, 1, 3, 1, 1, 9, 1, 3, 3, 4, 1, 1, 5, 1, 3, 7, 1, 27, 20, 2, 1, 3, 1, 2, 1, 1, 22, 9, 2, 3, 3, 2, 1, 1, 66, 5, 1, 1, 2, 2, 5, 1, 3, 7, 1, 1, 1, 3, 5, 1, 2, 1, 5, 2, 4, 7, 65, 7, 1, 1, 138, 6, 2, 1, 1, 1, 7, 6, 7, 2, 3, 1, 4, 2, 1, 1, 1, 5, 1, 3, 1, 4, 1, 1, 2, 5, 2, 8, 2, 2, 1, 5, 1, 45, 3, 1, 8, 1, 7, 1, 1, 16, 1, 1, 26, 1, 1, 1, 2, 6, 11, 10, 3, 1, 1, 4, 1, 3, 60, 2, 6, 3, 10, 103, 1, 3, 1, 8, 2, 1, 15, 1, 35, 1, 1, 137, 2, 2, 9, 12, 7, 2, 9, 2, 21, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 67, 1, 3, 1, 3, 1, 1, 36, 1, 8, 2, 5, 2, 1, 5, 2, 27, 3, 1, 4, 5, 4, 5, 9, 8, 2, 944, 41, 2, 4, 12, 1, 4, 20, 2, 2, 1, 2, 1, 19, 2, 1, 1, 7, 7, 7, 1, 1, 29, 2, 1, 9, 1, 2, 8, 1, 3, 1, 1, 1, 66, 1, 1, 10, 8, 1, 1, 1, 1, 1, 34, 2, 7, 1, 1, 2, 15, 1, 3, 1, 7, 3, 4, 1, 10, 1, 6, 1, 1, 66, 4, 4, 1, 1, 22, 1, 12, 9, 1, 4, 4, 1, 1, 1, 3, 1, 1, 1, 7, 5, 24, 3, 2, 1, 1, 1, 1, 1, 2, 5, 1, 1, 1, 2, 1, 7, 3, 2, 1, 2, 11, 1, 12, 1, 6, 2, 2, 9, 1, 1, 5, 2, 13, 3, 1, 1, 1, 1, 1, 1}, giving these values for u and v:

We also need to calculate d = floor(c4·v/F + 0.5) = 4853859 4154144805 4182914039 8621013828 1796820617 1789518085 3695418947 5592577822 1258889863 5716066466 4988098300 7358914446 2400420830 9654534482 3215720496 1222942363 6801446658 6812939834 5234622694 4777865802 3684782825 5823207973 5616889689 3565805733 3263060751 7563130063 5838361989 4797161211 1866037695 6069751606 6617758029 7458457587 9079458960 3050455627 2563253834 8146319869 5322835298 7815768092 7122670420 8065366677 6841975568 5737192097 9289945840 8049290402 7770416395 6131849424 2322433642 9053179146 9720312520 9986419143 4437864074 7551375433 1230843806 8820504723 4525487278 8194845049 9690785301 2861597288 5600876038 7384983506 0658093970 2564425048 5013674597 9517189962 2916638725 1103615424 7401743174 0417048915 7697744485 0315904409 0643674457 6107237276 5426255437 9166484784 5749817354 8895428148 8786762797 6780729798 7368717025 6555861271 4582278204 3080018111 7386486151 6217682107 5918777825 2580074679 4793640386 3033696747 0197109826 1619437684 1453023255 9942778412 8576886008 6170486172 3918369395 0030853398 9053270987 5277219527 7254567141 0672245509 8402447569 1317501510 4164114091 4662908822 8077045802 5742375227 2959439897 9623687091 1819193214 3123893166 3343612677 2969080588 4221064233 3357518112 0921755890 6588010878 6310121348 1592084209 2141287349 0523316536 6575913194 8485635719 6946126023 0374127367 1509433640 9803399470 8268220156 7514986737 6920204656 9606088182 1270387536 5284721404 8872349734 4240765263 8896742538 4449800028 4454005006 9483564024 9741507433 4610736359 0680904541 8887608884

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.