Primality Certificate for (5855^6121-1)/5854

Andy Steward23,058 digits18 February 2010
Originally by Predrag Minovic & Larry Soule 2005
A066180 #798

This certificate uses a theorem of Coppersmith and Howgrave-Graham 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 27.442143% factorization of N-1:

From Factorisation
58555 · 1171
Φ22 · 2 · 2 · 2 · 2 · 3 · 61
Φ397 · 353473
Φ42 · 13 · 149 · 8849
Φ511 · 839651 · 127259521
Φ63 · 7 · 43 · 37957
Φ82 · 12097 · 48573558529
Φ937 · 1088828982414272088973
Φ1031 · 2584511 · 14665381
Φ121175188640769601
Φ151350751 · 1022270235970596277482271
Φ17p61
Φ183 · 19 · 706783725419765552443
Φ2041 · 12684873248041 · 2655493201742321
Φ24p31
Φ30154291 · 92692801 · 96583461043039291
Φ34513367 · p55
Φ361009 · 135355141 · p35
Φ401103289401 · p52
Φ45555554431 · 533195986951 · p70
Φ5175583 · 5364181 · p109
Φ6012781 · 97304643841 · 305775220921 · 666437792281 · 7526101920419365740181
Φ68137 · 613 · 3673 · 381481 · 1381386865117168537 · 1464324657462027992202848741 · p62
Φ7273 · 937 · 32745388209971473 · p70
Φ8515641 · 46411 · 80662807171 · 13081585409531 · 939427227359472602419046941 · 4208677030256162135434768111126725281 · c145
Φ90631 · 811 · 1825346640241 · 12328244679349881631 · p54
Φ102103 · p119
Φ1209721 · 11161 · 13921 · 503716463161 · 502814306066392888586205958112715727728931441 · p52
Φ1365849 · 818864569 · 1110889550805230501511209 · c205
Φ15313159 · 19891 · 379694088348035183779823079301 · c324
Φ17091116601531 · 18658870869631 · 280173725017401295614029895308551 · p185
Φ180181 · 5528161 · 12855356641 · 98142763065079118941 · 427989325385073362879513339197488906919601761 · p98
Φ2041947444126562329985129 · 10627622788552959455628770416257155667865132746709 · c171
Φ2551531 · 29255131 · p472
Φ306307 · 919 · 23563 · 29416087 · 160673257 · 6411464987482802557 · 138280310414754567802489 · 3772715653723301961660847 · 598790808244390906980850087 · c243
Φ3401021 · 2381 · 5441 · 40325593971150668737301 · c450
Φ3601262041201 · c353
Φ408409 · 184606129 · 40194964634568529 · 123149132521456397064617617 · c429
Φ510231263581 · 1867134848506111 · 22044155937242534940376891 · c434
Φ61227541 · 3973783321 · 1117964176201 · c698
Φ680153001 · 111193601 · 1796295310681 · 78250454294516282253167855761 · c911
Φ765315181 · 62571153222250021 · 4573968467948931817246427170438141 · p1391
Φ1020591601 · 7606018621 · 1081356412614001 · 508424255789011501 · c917
Φ122415913 · 1208089 · 471159217 · 4085627748409 · 63530555499103009819534099446889 · c1384
Φ15306121 · 146188009192667401 · c1426
Φ2040119444041 · 85275422491681 · p1907
Φ30603061 · 156061 · c2885
Φ612012241 · 659636018215099983721 · c5763

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

9242386 5732150016 1647175983 5455038568 8278024094 8308124623 8285436454 3526400195 5165910502 5506943171 5399492936 9288367789 7444327035 1624084408 6505753927 7100882068 5421742387 7595793986 6373347289 6734899076 5010778865 6763319016 9650066532 1114095654 9457584907 4718655353 1945628980 2891888517 7568528446 7710142020 3570783220 5429391997 4086436676 5396090963 6735073186 2335170323 8685820367 4634481812 8558712596 8253910129 2195498749 5761335436 2153341954 3731179246 0065531249 7227881098 0098861150 1593180689 0384038986 4398539305 0791625575 0258802705 4885088375 0755870564 7407357791 7604934800 6586242195 0672569130 6250646098 2132055972 7700746079 5593386183 5887616977 0741265984 4798347449 7165031586 2248172018 4582100046 9290859982 6746499266 5986892050 5883102450 5696715650 8628384683 1322265172 0041303091 0773628832 5597798911 1304929408 1876902237 9992232285 3411459654 1044186101 5562203896 7882652258 1360459243 5740565628 9883448009 7282379316 4253966676 3547395631 9374347907 8286140064 0943862268 2448081375 5472716493 9849953934 7898254491 1638049440 2034064324 5154085811 1862832510 7878158286 9793323865 6553239930 3920855542 5173026180 4769636406 5563571719 3955618019 6897394329 1501758299 7645238461 3094280729 8679232134 1139628503 8792424375 8886875624 4427580803 3102931594 7182818923 4541727866 6282266847 6796753603 6015523195 1568866486 2367903341 9400082777 9762229210 7296353061 5027331562 4255542195 5567710985 9325967030 8154682089 2021948446 5850075335 0661826361 0109263310 9585156651 8209517440 7931098680 2817459745 4590595889 1960156145 8308841368 4114717670 2846100639 2042841454 2199790994 4248964772 2337317386 3986384932 3366458460 5489708099 9960258549 6696570989 9540585712 5406406641 8143806099 9467403274 1837198854 8429636198 3128460339 7256575283 3331583098 9297266474 6927715701 1225447611 4232360585 2025142105 8594739599 2578129442 0537136736 5002048988 4073971826 7236703232 8281413465 7681656692 6685149704 1692397313 0121133421 7810323459 9540900654 5481952269 4441030531 8987811870 0002085108 8275040259 3325616997 0405515481
5 9580208408 8703352244 6217538988 7304183199 2731132384 2398891559 2131092788 4377574521 9662580549 6549297979 5966778747 4457897231 5306129830 7618170882 6520709753 1025093412 4728533682 5675255035 2273437691 7263877051 7338068974 5044720276 8668571978 6784297421 6372135492 2885326457 6279239348 3580643926 7939897166 1841635195 5416764193 0622907337 2628012286 3795466603 6010704286 7819721936 8693781453 7360481706 7488892979 8433124625 2578899847 7576258828 5165933318 2715789194 3049761192 7944120410 6653608031 9257507871 1315577917 2385938989 6434269492 0066047353 1500936213 7296947075 7291099007 4667037310 4488416132 6944831484 2581526800 7011906930 2163860643 9429757738 0518085330 3840138656 5057924019 5242528551 9058345089 9986989352 5078878717 4780999902 3947632365 1448999128 0764157772 4115606177 1534452189 5375508826 5579889034 8367531976 1418106403 7539145915 9569634232 9299807904 4435822034 7213229794 6966843750 3585970531 4596194580 2565165388 3241198665 3412347267 7092407557 4038819161 9146774032 7294464605 1801578330 5602096476 6645168928 1844587490 5706211157 0339087617 3022980620 4978062204 6576316660 5288457546 1541990960 0223495833 1157082603 9117316041 1624875346 4128767638 1906347509 7835552401 1391749080 7195875738 9129704098 9601646071 3023138806 9946203452 7513242039 9817460933 1803212790 8930149784 8525722992 2967569172 2592003333 7510295996 3373803225 3824286362 1902032915 9581361460 3160909894 9615233740 3859379372 2756350486 5474500121 1529008566 2236502718 5090777228 5792072661
39 1147057698 6223533882 6099787855 3849018344 8799649574 3933527193 5585655689 1857234718 5084318813 6100346172 4386312213 9233046457 1634705542 2919067337 5829992408 9188396031 3759548789 4019235275 7430072933 5828289686 4256343719 0133467847 5435093570 3437885054 3483797126 1614820928 5850710371 8731034797 4474285714 6558813603 7090812490 6691055573 2278799607 5220460014 5348877972 6058800954 3815236919 1941311621 4565449401 5849898589 4519828871 0844201444 8670406876 6184114651 4809941030 1264326050 1075274121
27789 8021180884 9322958893 5859618668 8364311969 8883060564 6117749827 0446129790 0708393526 0500120762 5663250021 7160929939 3847353812 6655057199 8305541584 8928624827 1476999473 8886604858 2176036171
353262652 0586351366 9330812449 2115190269 4303841921 0302472762 1568231100 8239957747 8288215445 1136822328 5299944333 1887683927
897137582 8750106210 0328347982 3306454028 9474976758 8180565104 0466908755 8486721525 1118258408 9429739890 5684853827
12842706 7601624474 5906755524 8163490903 1874825079 0320865431 1390671258 4426765754 2303629588 9673301921
8892668395 4219119887 0194619568 7155504722 3101967683 5987722119 5667240521
1176069511 0056634687 9461151434 3627391509 4283418993 5970459399 4800092737
15 2838648363 4778708619 4585328888 1191485804 0882799462 5954432201
1 9076758061 0489651163 3945985029 6147935898 5217158351 0080538881
37147 3872976368 3537819443 1344177561 0503492081 6392469463
2287 4350755240 8044608329 1794001153 3056653495 1721026491
95 1004397833 5118330315 7166300056 2421067592 3663031401
17 2878483598 8006074975 5820871130 9703419717 6056910601
1062762278 8552959455 6287704162 5715566786 5132746709
50281 4306066392 8885862059 5811271572 7728931441
42798 9325385073 3628795133 3919748890 6919601761
4208677 0302561621 3543476811 1126725281
11883 8420545379 8667093802 9704916829
4573 9684679489 3181724642 7170438141
280 1737250174 0129561402 9895308551
63 5305554991 0300981953 4099446889
1 3810684219 6724230315 7637840001
3796940883 4803518377 9823079301
782504542 9451628225 3167855761
14643246 5746202799 2202848741
9394272 2735947260 2419046941
5987908 0824439090 6980850087
1231491 3252145639 7064617617
220441 5593724253 4940376891
37727 1565372330 1961660847
11108 8955080523 0501511209
10222 7023597059 6277482271
1382 8031041475 4567802489
403 2559397115 0668737301
75 2610192041 9365740181
19 4744412656 2329985129
10 8882898241 4272088973
7 0678372541 9765552443
6 5963601821 5099983721
9814276306 5079118941
1232824467 9349881631
641146498 7482802557
138138686 5117168537
50842425 5789011501
14618800 9192667401
9658346 1043039291
6257115 3222250021
4019496 4634568529
3274538 8209971473
265549 3201742321
186713 4848506111
117518 8640769601
108135 6412614001
8527 5422491681
1865 8870869631
1308 1585409531
1268 4873248041
408 5627748409
182 5346640241
179 6295310681
111 7964176201
66 6437792281
53 3195986951
50 3716463161
30 5775220921
9 7304643841
9 1116601531
8 0662807171
4 8573558529
1 2855356641
7606018621
3973783321
1262041201
1103289401
818864569
555554431
471159217
231263581
184606129
160673257
135355141
127259521
119444041
111193601
92692801
29416087
29255131
14665381
5528161
5364181
2584511
1350751
1208089
839651
591601
513367
381481
353473
315181
156061
154291
153001
75583
46411
37957
27541
23563
19891
15913
15641
13921
13159
12781
12241
12097
11161
9721
8849
6121
5849
5441
3673
3061
2381
1531
1171
1021
1009
937
919
811
631
613
409
307
181
149
137
103
97
73
61
43
41
37
31
19
13
11
7
5
33
27

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

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 = 493 suffices.

Given such a witness, Pocklington's Theorem shows that every prime factor of N ≡ 1 (mod F). As F4>N, N can have no more than three 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 has exactly two prime factors if and only if c12-4·c2 is a perfect square.

Here, c12-4·c2 is ≡ 51 (mod 63) and therefore cannot be a square and this stage of the proof is passed.

Coppersmith and Howgrave-Graham

We are left with two possibilities for N: either it has exactly three prime factors or it is prime. The non-existence of exactly three factors is demonstrated by the Theorem of Coppersmith and Howgrave-Graham, here performed by a Pari/GP script written by John Renze and David Broadhurst. Here is the stdout:

realprecision = 10008 significant digits (10000 digits displayed)

Welcome to the CHG primality prover!
------------------------------------

Found values of n, F and G.
    Number to be tested has 23058 digits.
    Modulus has 6328 digits.
Modulus is 27.44214267% of n.

NOTICE: This program assumes that n has passed
    a BLS PRP-test with F and G as given.  If not,
    then any results will be invalid!

Square test passed for F >> G.  Using modified right endpoint.

Search for factors congruent to 1.
    Running CHG with h = 11, u = 4. Right endpoint has 4076 digits ... done in 7844 sec.
    Running CHG with h = 11, u = 4. Right endpoint has 4008 digits ... done in 8600 sec.
    Running CHG with h = 11, u = 4. Right endpoint has 3923 digits ... done in 9333 sec.
    Running CHG with h = 11, u = 4. Right endpoint has 3816 digits ... done in 10950 sec.
    Running CHG with h = 11, u = 4. Right endpoint has 3683 digits ... done in 29116 sec.
    Running CHG with h = 10, u = 4. Right endpoint has 3516 digits ... done in 23904 sec.
    Running CHG with h = 9, u = 3. Right endpoint has 3393 digits ... done in 6651 sec.
    Running CHG with h = 9, u = 3. Right endpoint has 3320 digits ... done in 7993 sec.
    Running CHG with h = 9, u = 3. Right endpoint has 3224 digits ... done in 13541 sec.
    Running CHG with h = 9, u = 3. Right endpoint has 3095 digits ... done in 4116 sec.
    Running CHG with h = 9, u = 3. Right endpoint has 2922 digits ... done in 6193 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2693 digits ... done in 1041 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2650 digits ... done in 1078 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2589 digits ... done in 1316 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2496 digits ... done in 1538 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2358 digits ... done in 1986 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 2150 digits ... done in 3328 sec.
    Running CHG with h = 7, u = 2. Right endpoint has 1838 digits ... done in 3978 sec.
    Running CHG with h = 5, u = 1. Right endpoint has 1371 digits ... done in 447 sec.
    Running CHG with h = 5, u = 1. Right endpoint has 632 digits ... done in 391 sec.

A certificate has been saved to the file "chg5855out.txt".
\\ Coppersmith--Howgrave-Graham certificate tester, Version 0.6,
\\ David Broadhurst, 25 Nov 2005, with huge help from John Renze

Testing a PRP called "Phi(6121,5855)".

LLL[1, 1] with [h, u]=[5, 1] has norm/bound=7.67508157 E-453 and witness=3.
LLL[2, 1] with [h, u]=[4, 1] has norm/bound=0.894427191 and witness=5.
LLL[3, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=29.
LLL[4, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=7.
LLL[5, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=2.
LLL[6, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=11.
LLL[7, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=7.
LLL[8, 1] with [h, u]=[7, 2] has norm/bound=1.000000000 and witness=23.
LLL[9, 1] with [h, u]=[6, 2] has norm/bound=0.925820100 and witness=2.
LLL[10, 1] with [h, u]=[9, 3] has norm/bound=1.000000000 and witness=11.
LLL[11, 1] with [h, u]=[9, 3] has norm/bound=1.000000000 and witness=11.
LLL[12, 1] with [h, u]=[9, 3] has norm/bound=1.000000000 and witness=7.
LLL[13, 1] with [h, u]=[9, 3] has norm/bound=1.000000000 and witness=17.
LLL[14, 1] with [h, u]=[9, 3] has norm/bound=1.000000000 and witness=19.
LLL[15, 1] with [h, u]=[10, 4] has norm/bound=1.000000000 and witness=11.
LLL[16, 1] with [h, u]=[11, 4] has norm/bound=1.000000000 and witness=41.
LLL[17, 1] with [h, u]=[11, 4] has norm/bound=1.000000000 and witness=41.
LLL[18, 1] with [h, u]=[11, 4] has norm/bound=1.000000000 and witness=97.
LLL[19, 1] with [h, u]=[11, 4] has norm/bound=1.000000000 and witness=31.
LLL[20, 1] with [h, u]=[11, 4] has norm/bound=1.000000000 and witness=23.

Validated in 129 sec.
Congratulations! n is prime!
Goodbye!

The actual input file containing N and F and the output certificate are included in this file.