22:
1116:
375:
3397:
1642:
403:
In its simplest form, Fermat's method might be even slower than trial division (worst case). Nonetheless, the combination of trial division and Fermat's is more effective than either by itself.
1512:
3401:
1724:
1683:
1236:
577:
2909:
2649:, which are the "worst-case". The primary improvement that quadratic sieve makes over Fermat's factorization method is that instead of simply finding a square in the sequence of
1571:
2394:
186:
459:
2532:
2488:
2081:
1821:
1536:
1461:
1317:
1260:
863:
2627:
899:
240:
39:
985:
2942:
2680:
1990:
1945:
770:
738:
513:
2209:
2137:
2048:
2017:
1848:
1178:
935:
702:
676:
276:
2579:
2350:
2319:
1149:
807:
2444:
2421:
990:
288:
1466:
Trial division would normally try up to 48,432; but after only four Fermat steps, we need only divide up to 47830, to find a factor or prove primality.
3457:
3266:
2902:
2758:
3134:
86:
58:
3076:
2895:
1576:
3005:
3182:
2784:
65:
2980:
105:
1992:
produces 3, 4, 7, 8, 12, and 19 modulo 20 for these values. It is apparent that only the 4 from this list can be a square. Thus,
3091:
3066:
72:
3010:
2973:
3271:
3162:
3081:
3071:
2743:
2947:
3099:
43:
3352:
54:
3347:
3276:
3177:
3314:
2708:
2267:
3228:
1472:
2763:
2875:
2686:
is a square, and it does this in a highly efficient manner. The end result is the same: a difference of squares mod
3393:
3383:
3342:
3118:
3112:
3086:
2957:
2792:
2642:
32:
3378:
3319:
775:
Suppose N has more than two prime factors. That procedure first finds the factorization with the least values of
133:
3281:
3154:
3000:
2952:
1688:
1647:
1191:
79:
3296:
3187:
530:
3407:
3357:
3337:
2881:
2256:
b2 is a square, modulo modulus: FermatSieve(N, a, aend, astep * modulus, NextModulus)
3058:
3033:
2962:
2748:
2703:
1541:
3417:
2843:
2585:. R. Lehman devised a systematic way to do this, so that Fermat's plus trial division can factor N in
3412:
3304:
3286:
3261:
3223:
2967:
2728:
2723:
392:
are also odd, so those halves are integers. (A multiple of four is also a difference of squares: let
126:
2355:
1729:
In this regard, Fermat's method gives diminishing returns. One would surely stop before this point:
142:
3422:
3388:
3309:
3213:
3172:
3167:
3144:
3048:
418:
2493:
2449:
2060:
1800:
476:
a square: a â a + 1 b2 â a*a - N // equivalently: // b2 â b2 + 2*a + 1
3253:
3200:
3197:
3038:
2937:
2811:
1952:
1517:
1434:
1298:
1241:
816:
2994:
2987:
2588:
872:
198:
944:
3373:
3329:
3043:
3020:
2753:
2652:
1962:
1917:
743:
3218:
2855:
2801:
711:
492:
122:
2187:
2115:
2026:
1995:
1826:
3208:
3107:
2638:
2322:
1154:
1111:{\displaystyle (c+d)/2-{\sqrt {N}}=({\sqrt {d}}-{\sqrt {c}})^{2}/2=({\sqrt {N}}-c)^{2}/2c}
911:
681:
655:
252:
2556:
2327:
2296:
1128:
786:
2426:
2403:
3238:
3139:
3124:
3028:
2929:
2713:
3451:
3233:
2918:
2738:
370:{\displaystyle N=\left({\frac {c+d}{2}}\right)^{2}-\left({\frac {c-d}{2}}\right)^{2}}
1184:
has a factor close to its square root, the method works quickly. More precisely, if
3243:
2733:
2860:
1959:
by 10. In this example, N is 17 mod 20, so subtracting 17 mod 20 (or adding 3),
21:
2887:
2646:
579:. Since 125 is not a square, a second try is made by increasing the value of
2921:
2718:
2637:
The fundamental ideas of Fermat's factorization method are the basis of the
2286:
Fermat's method works best when there is a factor near the square-root of
2274:-values remain; that is, when (aend-astart)/astep is small. Also, because
2278:
s step-size is constant, one can compute successive b2's with additions.
583:
by 1. The second attempt also fails, because 282 is again not a square.
1262:, the method requires only one step; this is independent of the size of
2815:
192:
129:
2234:
One generally chooses a power of a different prime for each modulus.
1685:
the bound for trial division is 47830. A reasonable choice could be
1637:{\displaystyle a_{\mathrm {max} }-{\sqrt {a_{\mathrm {max} }^{2}-N}}}
2806:
2241:-values (start, end, and step) and a modulus, one can proceed thus:
1319:
rounded up to the next integer, which is 48,433, we can tabulate:
1469:
This all suggests a combined factoring method. Choose some bound
2244:
FermatSieve(N, astart, aend, astep, modulus) a â astart
242:; if neither factor equals one, it is a proper factorization of
2891:
15:
1423:
In practice, one wouldn't bother with that last row until
652:
The third try produces the perfect square of 441. Thus,
3438:
indicate that algorithm is for numbers of special forms
2682:, it finds a subset of elements of this sequence whose
2057:
This can be performed with any modulus. Using the same
1914:
It is not necessary to compute all the square-roots of
2581:
values can be tried, and try to factor each resulting
249:
Each odd number has such a representation. Indeed, if
2655:
2591:
2559:
2496:
2452:
2429:
2406:
2358:
2330:
2299:
2190:
2118:
2063:
2029:
1998:
1965:
1920:
1829:
1803:
1691:
1650:
1579:
1544:
1520:
1475:
1437:
1301:
1244:
1194:
1157:
1131:
993:
947:
914:
875:
819:
789:
746:
714:
684:
658:
533:
495:
421:
291:
255:
201:
145:
1951:. Squares are always congruent to 0, 1, 4, 5, 9, 16
1180:
steps. This is a bad way to prove primality. But if
3366:
3328:
3295:
3252:
3196:
3153:
3057:
3019:
2928:
46:. Unsourced material may be challenged and removed.
2674:
2621:
2573:
2526:
2482:
2438:
2415:
2388:
2344:
2313:
2203:
2131:
2075:
2042:
2011:
1984:
1939:
1842:
1823:, one can quickly tell that none of the values of
1815:
1718:
1677:
1636:
1573:. This gives a bound for trial division which is
1565:
1530:
1506:
1455:
1311:
1254:
1230:
1172:
1143:
1110:
979:
929:
893:
857:
801:
764:
732:
696:
670:
571:
507:
453:
369:
270:
234:
180:
1507:{\displaystyle a_{\mathrm {max} }>{\sqrt {N}}}
2645:, the best-known algorithms for factoring large
2497:
2453:
1463:, Fermat's method would have found it already.
2553:Generally, if the ratio is not known, various
2903:
8:
2023:is 1, 9, 11 or 19 mod 20; it will produce a
1955:20. The values repeat with each increase of
809:is the smallest factor â„ the square-root of
2690:that, if nontrivial, can be used to factor
1274:Consider trying to factor the prime number
2910:
2896:
2888:
1514:; use Fermat's method for factors between
987:, so the number of steps is approximately
468:a â ceiling(sqrt(N)) b2 â a*a - N
2859:
2805:
2660:
2654:
2606:
2602:
2590:
2563:
2558:
2495:
2451:
2428:
2405:
2357:
2334:
2329:
2303:
2298:
2293:If the approximate ratio of two factors (
2195:
2189:
2123:
2117:
2062:
2034:
2028:
2003:
1997:
1970:
1964:
1925:
1919:
1834:
1828:
1802:
1697:
1696:
1690:
1656:
1655:
1649:
1620:
1608:
1607:
1601:
1585:
1584:
1578:
1550:
1549:
1543:
1521:
1519:
1497:
1481:
1480:
1474:
1436:
1302:
1300:
1245:
1243:
1218:
1214:
1196:
1193:
1156:
1130:
1097:
1091:
1074:
1060:
1054:
1043:
1033:
1020:
1009:
992:
969:
946:
913:
874:
835:
818:
788:
745:
713:
683:
657:
551:
538:
532:
523:rounded up to the next integer, which is
494:
445:
426:
420:
361:
339:
325:
303:
290:
254:
200:
169:
156:
144:
106:Learn how and when to remove this message
2882:Fermat's Factorization Online Calculator
2759:Table of Gaussian integer factorizations
2050:which ends in 4 mod 20 and, if square,
1852:
1731:
1719:{\displaystyle a_{\mathrm {max} }=55000}
1678:{\displaystyle a_{\mathrm {max} }=48436}
1321:
585:
2775:
1231:{\displaystyle {\left(4N\right)}^{1/4}}
125:, is based on the representation of an
1947:, nor even examine all the values for
572:{\displaystyle b^{2}=78^{2}-5959=125}
7:
2844:"Speeding Fermat's factoring method"
44:adding citations to reliable sources
2876:Fermat's factorization running time
2019:must be 1 mod 20, which means that
1427:is an integer. But observe that if
2396:, and Fermat's method, applied to
1704:
1701:
1698:
1663:
1660:
1657:
1615:
1612:
1609:
1592:
1589:
1586:
1566:{\displaystyle a_{\mathrm {max} }}
1557:
1554:
1551:
1488:
1485:
1482:
1269:
14:
3119:Special number field sieve (SNFS)
3113:General number field sieve (GNFS)
3458:Integer factorization algorithms
20:
2352:can be picked near that value.
2252:: b2 â a*a - N
1797:When considering the table for
941:be the largest subroot factor.
55:"Fermat's factorization method"
31:needs additional citations for
2616:
2595:
2515:
2500:
2471:
2456:
2389:{\displaystyle Nuv=cv\cdot du}
1644:. In the above example, with
1167:
1161:
1088:
1071:
1051:
1030:
1006:
994:
966:
954:
852:
840:
229:
217:
214:
202:
181:{\displaystyle N=a^{2}-b^{2}.}
1:
2861:10.1090/S0025-5718-99-01133-3
2156:3 or 5 or 11 or 13 modulo 16
865:is the largest factor †root-
454:{\displaystyle a^{2}-N=b^{2}}
119:Fermat's factorization method
3077:Lenstra elliptic curve (ECM)
2744:Euler's factorization method
2709:Factorization of polynomials
2527:{\displaystyle \gcd(N,du)=d}
2483:{\displaystyle \gcd(N,cv)=c}
2076:{\displaystyle N=2345678917}
1816:{\displaystyle N=2345678917}
411:One tries various values of
2783:Lehman, R. Sherman (1974).
2054:will end in 2 or 8 mod 10.
1531:{\displaystyle {\sqrt {N}}}
1456:{\displaystyle a-b=47830.1}
1431:had a subroot factor above
1312:{\displaystyle {\sqrt {N}}}
1295:throughout. Going up from
1270:Fermat's and trial division
1255:{\displaystyle {\sqrt {N}}}
858:{\displaystyle a-b=N/(a+b)}
3474:
3384:Exponentiation by squaring
3067:Continued fraction (CFRAC)
2848:Mathematics of Computation
2837:, vol. 2, p. 256
2793:Mathematics of Computation
2785:"Factoring Large Integers"
2643:general number field sieve
2622:{\displaystyle O(N^{1/3})}
894:{\displaystyle N=1\cdot N}
235:{\displaystyle (a+b)(a-b)}
3431:
1726:giving a bound of 28937.
980:{\displaystyle a=(c+d)/2}
869:. If the procedure finds
134:difference of two squares
2400:, will find the factors
3297:Greatest common divisor
2675:{\displaystyle a^{2}-n}
1985:{\displaystyle a^{2}-N}
1940:{\displaystyle a^{2}-N}
765:{\displaystyle a+b=101}
489:For example, to factor
3408:Modular exponentiation
2676:
2623:
2575:
2528:
2484:
2440:
2417:
2390:
2346:
2315:
2282:Multiplier improvement
2205:
2133:
2077:
2044:
2013:
1986:
1941:
1844:
1817:
1720:
1679:
1638:
1567:
1532:
1508:
1457:
1313:
1256:
1232:
1174:
1145:
1112:
981:
931:
895:
859:
803:
766:
734:
733:{\displaystyle a-b=59}
698:
672:
573:
519:is the square root of
509:
508:{\displaystyle N=5959}
455:
371:
278:is a factorization of
272:
236:
182:
3135:Shanks's square forms
3059:Integer factorization
3034:Sieve of Eratosthenes
2749:Integer factorization
2704:Completing the square
2677:
2624:
2576:
2529:
2485:
2441:
2418:
2391:
2347:
2316:
2206:
2204:{\displaystyle a^{2}}
2134:
2132:{\displaystyle a^{2}}
2078:
2045:
2043:{\displaystyle b^{2}}
2014:
2012:{\displaystyle a^{2}}
1987:
1942:
1845:
1843:{\displaystyle b^{2}}
1818:
1721:
1680:
1639:
1568:
1533:
1509:
1458:
1314:
1257:
1233:
1175:
1146:
1113:
982:
932:
896:
860:
804:
767:
735:
704:, and the factors of
699:
673:
574:
510:
456:
372:
273:
237:
183:
3413:Montgomery reduction
3287:Function field sieve
3262:Baby-step giant-step
3108:Quadratic sieve (QS)
2764:Unique factorization
2724:Monoid factorisation
2653:
2589:
2557:
2494:
2450:
2427:
2404:
2356:
2328:
2297:
2270:is stopped when few
2237:Given a sequence of
2188:
2116:
2061:
2027:
1996:
1963:
1918:
1827:
1801:
1689:
1648:
1577:
1542:
1518:
1473:
1435:
1299:
1242:
1192:
1173:{\displaystyle O(N)}
1155:
1129:
991:
945:
930:{\displaystyle N=cd}
912:
873:
817:
787:
744:
712:
697:{\displaystyle b=21}
682:
671:{\displaystyle a=80}
656:
531:
515:, the first try for
493:
419:
289:
271:{\displaystyle N=cd}
253:
199:
143:
40:improve this article
3423:Trachtenberg system
3389:Integer square root
3330:Modular square root
3049:Wheel factorization
3001:Quadratic Frobenius
2981:LucasâLehmerâRiesel
2884:, at windowspros.ru
2574:{\displaystyle u/v}
2345:{\displaystyle v/u}
2321:) is known, then a
2314:{\displaystyle d/c}
1625:
1281:, but also compute
1144:{\displaystyle c=1}
802:{\displaystyle a+b}
191:That difference is
3315:Extended Euclidean
3254:Discrete logarithm
3183:SchönhageâStrassen
3039:Sieve of Pritchard
2854:(228): 1729â1737.
2672:
2633:Other improvements
2619:
2571:
2524:
2480:
2439:{\displaystyle du}
2436:
2416:{\displaystyle cv}
2413:
2386:
2342:
2311:
2260:a â a + astep
2201:
2129:
2073:
2040:
2009:
1982:
1937:
1840:
1813:
1716:
1675:
1634:
1603:
1563:
1528:
1504:
1453:
1309:
1252:
1228:
1188:differs less than
1170:
1141:
1125:is prime (so that
1108:
977:
927:
901:, that shows that
891:
855:
799:
762:
730:
694:
668:
569:
505:
485:// or a + sqrt(b2)
466:// N should be odd
451:
367:
268:
232:
178:
3445:
3444:
3044:Sieve of Sundaram
2842:McKee, J (1999).
2835:Oeuvres de Fermat
2754:Program synthesis
2729:Pascal's triangle
2232:
2231:
1912:
1911:
1793:Sieve improvement
1790:
1789:
1632:
1526:
1502:
1421:
1420:
1307:
1250:
1079:
1048:
1038:
1025:
650:
649:
479:// a â a + 1
464:FermatFactor(N):
355:
319:
116:
115:
108:
90:
3465:
3394:Integer relation
3367:Other algorithms
3272:Pollard kangaroo
3163:Ancient Egyptian
3021:Prime-generating
3006:SolovayâStrassen
2919:Number-theoretic
2912:
2905:
2898:
2889:
2878:, at blogspot.in
2865:
2863:
2838:
2820:
2819:
2809:
2800:(126): 637â646.
2789:
2780:
2681:
2679:
2678:
2673:
2665:
2664:
2628:
2626:
2625:
2620:
2615:
2614:
2610:
2580:
2578:
2577:
2572:
2567:
2533:
2531:
2530:
2525:
2489:
2487:
2486:
2481:
2445:
2443:
2442:
2437:
2422:
2420:
2419:
2414:
2395:
2393:
2392:
2387:
2351:
2349:
2348:
2343:
2338:
2320:
2318:
2317:
2312:
2307:
2228:4 or 5 modulo 9
2224:
2210:
2208:
2207:
2202:
2200:
2199:
2152:
2138:
2136:
2135:
2130:
2128:
2127:
2086:
2085:
2082:
2080:
2079:
2074:
2053:
2049:
2047:
2046:
2041:
2039:
2038:
2022:
2018:
2016:
2015:
2010:
2008:
2007:
1991:
1989:
1988:
1983:
1975:
1974:
1958:
1950:
1946:
1944:
1943:
1938:
1930:
1929:
1853:
1849:
1847:
1846:
1841:
1839:
1838:
1822:
1820:
1819:
1814:
1732:
1725:
1723:
1722:
1717:
1709:
1708:
1707:
1684:
1682:
1681:
1676:
1668:
1667:
1666:
1643:
1641:
1640:
1635:
1633:
1624:
1619:
1618:
1602:
1597:
1596:
1595:
1572:
1570:
1569:
1564:
1562:
1561:
1560:
1537:
1535:
1534:
1529:
1527:
1522:
1513:
1511:
1510:
1505:
1503:
1498:
1493:
1492:
1491:
1462:
1460:
1459:
1454:
1322:
1318:
1316:
1315:
1310:
1308:
1303:
1294:
1280:
1261:
1259:
1258:
1253:
1251:
1246:
1237:
1235:
1234:
1229:
1227:
1226:
1222:
1213:
1212:
1208:
1179:
1177:
1176:
1171:
1150:
1148:
1147:
1142:
1117:
1115:
1114:
1109:
1101:
1096:
1095:
1080:
1075:
1064:
1059:
1058:
1049:
1044:
1039:
1034:
1026:
1021:
1013:
986:
984:
983:
978:
973:
936:
934:
933:
928:
900:
898:
897:
892:
864:
862:
861:
856:
839:
808:
806:
805:
800:
771:
769:
768:
763:
739:
737:
736:
731:
707:
703:
701:
700:
695:
677:
675:
674:
669:
586:
578:
576:
575:
570:
556:
555:
543:
542:
526:
522:
514:
512:
511:
506:
460:
458:
457:
452:
450:
449:
431:
430:
376:
374:
373:
368:
366:
365:
360:
356:
351:
340:
330:
329:
324:
320:
315:
304:
277:
275:
274:
269:
241:
239:
238:
233:
187:
185:
184:
179:
174:
173:
161:
160:
123:Pierre de Fermat
111:
104:
100:
97:
91:
89:
48:
24:
16:
3473:
3472:
3468:
3467:
3466:
3464:
3463:
3462:
3448:
3447:
3446:
3441:
3427:
3362:
3324:
3291:
3248:
3192:
3149:
3053:
3015:
2988:Proth's theorem
2930:Primality tests
2924:
2916:
2872:
2841:
2833:Fermat (1894),
2832:
2829:
2824:
2823:
2807:10.2307/2005940
2787:
2782:
2781:
2777:
2772:
2700:
2656:
2651:
2650:
2639:quadratic sieve
2635:
2598:
2587:
2586:
2555:
2554:
2492:
2491:
2448:
2447:
2425:
2424:
2402:
2401:
2354:
2353:
2326:
2325:
2323:rational number
2295:
2294:
2284:
2264:
2222:
2191:
2186:
2185:
2150:
2119:
2114:
2113:
2059:
2058:
2051:
2030:
2025:
2024:
2020:
1999:
1994:
1993:
1966:
1961:
1960:
1956:
1948:
1921:
1916:
1915:
1830:
1825:
1824:
1799:
1798:
1795:
1692:
1687:
1686:
1651:
1646:
1645:
1580:
1575:
1574:
1545:
1540:
1539:
1516:
1515:
1476:
1471:
1470:
1433:
1432:
1297:
1296:
1286:
1279:= 2,345,678,917
1275:
1272:
1240:
1239:
1201:
1197:
1195:
1190:
1189:
1153:
1152:
1127:
1126:
1087:
1050:
989:
988:
943:
942:
910:
909:
871:
870:
815:
814:
785:
784:
742:
741:
710:
709:
705:
680:
679:
654:
653:
547:
534:
529:
528:
524:
520:
491:
490:
487:
441:
422:
417:
416:
409:
341:
335:
334:
305:
299:
298:
287:
286:
251:
250:
197:
196:
165:
152:
141:
140:
112:
101:
95:
92:
49:
47:
37:
25:
12:
11:
5:
3471:
3469:
3461:
3460:
3450:
3449:
3443:
3442:
3440:
3439:
3432:
3429:
3428:
3426:
3425:
3420:
3415:
3410:
3405:
3391:
3386:
3381:
3376:
3370:
3368:
3364:
3363:
3361:
3360:
3355:
3350:
3348:TonelliâShanks
3345:
3340:
3334:
3332:
3326:
3325:
3323:
3322:
3317:
3312:
3307:
3301:
3299:
3293:
3292:
3290:
3289:
3284:
3282:Index calculus
3279:
3277:PohligâHellman
3274:
3269:
3264:
3258:
3256:
3250:
3249:
3247:
3246:
3241:
3236:
3231:
3229:Newton-Raphson
3226:
3221:
3216:
3211:
3205:
3203:
3194:
3193:
3191:
3190:
3185:
3180:
3175:
3170:
3165:
3159:
3157:
3155:Multiplication
3151:
3150:
3148:
3147:
3142:
3140:Trial division
3137:
3132:
3127:
3125:Rational sieve
3122:
3115:
3110:
3105:
3097:
3089:
3084:
3079:
3074:
3069:
3063:
3061:
3055:
3054:
3052:
3051:
3046:
3041:
3036:
3031:
3029:Sieve of Atkin
3025:
3023:
3017:
3016:
3014:
3013:
3008:
3003:
2998:
2991:
2984:
2977:
2970:
2965:
2960:
2955:
2953:Elliptic curve
2950:
2945:
2940:
2934:
2932:
2926:
2925:
2917:
2915:
2914:
2907:
2900:
2892:
2886:
2885:
2879:
2871:
2870:External links
2868:
2867:
2866:
2839:
2828:
2825:
2822:
2821:
2774:
2773:
2771:
2768:
2767:
2766:
2761:
2756:
2751:
2746:
2741:
2736:
2731:
2726:
2721:
2716:
2714:Factor theorem
2711:
2706:
2699:
2696:
2671:
2668:
2663:
2659:
2634:
2631:
2618:
2613:
2609:
2605:
2601:
2597:
2594:
2570:
2566:
2562:
2523:
2520:
2517:
2514:
2511:
2508:
2505:
2502:
2499:
2479:
2476:
2473:
2470:
2467:
2464:
2461:
2458:
2455:
2446:quickly. Then
2435:
2432:
2412:
2409:
2385:
2382:
2379:
2376:
2373:
2370:
2367:
2364:
2361:
2341:
2337:
2333:
2310:
2306:
2302:
2283:
2280:
2243:
2230:
2229:
2226:
2219:
2216:
2215:
2212:
2198:
2194:
2182:
2179:
2178:
2175:
2172:
2169:
2168:
2167:0, 1, 4, or 7
2165:
2162:
2158:
2157:
2154:
2147:
2144:
2143:
2140:
2126:
2122:
2110:
2107:
2106:
2103:
2100:
2097:
2096:
2095:0, 1, 4, or 9
2093:
2090:
2072:
2069:
2066:
2037:
2033:
2006:
2002:
1981:
1978:
1973:
1969:
1936:
1933:
1928:
1924:
1910:
1909:
1906:
1903:
1900:
1897:
1891:
1890:
1887:
1884:
1881:
1878:
1872:
1871:
1868:
1865:
1862:
1859:
1837:
1833:
1812:
1809:
1806:
1794:
1791:
1788:
1787:
1784:
1781:
1771:
1770:
1767:
1764:
1758:
1757:
1756:1,254,561,087
1754:
1751:
1745:
1744:
1741:
1738:
1715:
1712:
1706:
1703:
1700:
1695:
1674:
1671:
1665:
1662:
1659:
1654:
1631:
1628:
1623:
1617:
1614:
1611:
1606:
1600:
1594:
1591:
1588:
1583:
1559:
1556:
1553:
1548:
1525:
1501:
1496:
1490:
1487:
1484:
1479:
1452:
1449:
1446:
1443:
1440:
1419:
1418:
1415:
1412:
1409:
1406:
1396:
1395:
1392:
1389:
1386:
1383:
1377:
1376:
1373:
1370:
1367:
1364:
1358:
1357:
1354:
1351:
1348:
1345:
1339:
1338:
1335:
1332:
1329:
1326:
1306:
1271:
1268:
1249:
1225:
1221:
1217:
1211:
1207:
1204:
1200:
1169:
1166:
1163:
1160:
1140:
1137:
1134:
1107:
1104:
1100:
1094:
1090:
1086:
1083:
1078:
1073:
1070:
1067:
1063:
1057:
1053:
1047:
1042:
1037:
1032:
1029:
1024:
1019:
1016:
1012:
1008:
1005:
1002:
999:
996:
976:
972:
968:
965:
962:
959:
956:
953:
950:
926:
923:
920:
917:
890:
887:
884:
881:
878:
854:
851:
848:
845:
842:
838:
834:
831:
828:
825:
822:
798:
795:
792:
761:
758:
755:
752:
749:
729:
726:
723:
720:
717:
693:
690:
687:
667:
664:
661:
648:
647:
644:
641:
638:
632:
631:
628:
625:
622:
616:
615:
612:
609:
606:
600:
599:
596:
593:
590:
568:
565:
562:
559:
554:
550:
546:
541:
537:
504:
501:
498:
463:
448:
444:
440:
437:
434:
429:
425:
415:, hoping that
408:
405:
378:
377:
364:
359:
354:
350:
347:
344:
338:
333:
328:
323:
318:
314:
311:
308:
302:
297:
294:
267:
264:
261:
258:
231:
228:
225:
222:
219:
216:
213:
210:
207:
204:
195:factorable as
189:
188:
177:
172:
168:
164:
159:
155:
151:
148:
121:, named after
114:
113:
28:
26:
19:
13:
10:
9:
6:
4:
3:
2:
3470:
3459:
3456:
3455:
3453:
3437:
3434:
3433:
3430:
3424:
3421:
3419:
3416:
3414:
3411:
3409:
3406:
3403:
3399:
3395:
3392:
3390:
3387:
3385:
3382:
3380:
3377:
3375:
3372:
3371:
3369:
3365:
3359:
3356:
3354:
3351:
3349:
3346:
3344:
3343:Pocklington's
3341:
3339:
3336:
3335:
3333:
3331:
3327:
3321:
3318:
3316:
3313:
3311:
3308:
3306:
3303:
3302:
3300:
3298:
3294:
3288:
3285:
3283:
3280:
3278:
3275:
3273:
3270:
3268:
3265:
3263:
3260:
3259:
3257:
3255:
3251:
3245:
3242:
3240:
3237:
3235:
3232:
3230:
3227:
3225:
3222:
3220:
3217:
3215:
3212:
3210:
3207:
3206:
3204:
3202:
3199:
3195:
3189:
3186:
3184:
3181:
3179:
3176:
3174:
3171:
3169:
3166:
3164:
3161:
3160:
3158:
3156:
3152:
3146:
3143:
3141:
3138:
3136:
3133:
3131:
3128:
3126:
3123:
3121:
3120:
3116:
3114:
3111:
3109:
3106:
3104:
3102:
3098:
3096:
3094:
3090:
3088:
3087:Pollard's rho
3085:
3083:
3080:
3078:
3075:
3073:
3070:
3068:
3065:
3064:
3062:
3060:
3056:
3050:
3047:
3045:
3042:
3040:
3037:
3035:
3032:
3030:
3027:
3026:
3024:
3022:
3018:
3012:
3009:
3007:
3004:
3002:
2999:
2997:
2996:
2992:
2990:
2989:
2985:
2983:
2982:
2978:
2976:
2975:
2971:
2969:
2966:
2964:
2961:
2959:
2956:
2954:
2951:
2949:
2946:
2944:
2941:
2939:
2936:
2935:
2933:
2931:
2927:
2923:
2920:
2913:
2908:
2906:
2901:
2899:
2894:
2893:
2890:
2883:
2880:
2877:
2874:
2873:
2869:
2862:
2857:
2853:
2849:
2845:
2840:
2836:
2831:
2830:
2826:
2817:
2813:
2808:
2803:
2799:
2795:
2794:
2786:
2779:
2776:
2769:
2765:
2762:
2760:
2757:
2755:
2752:
2750:
2747:
2745:
2742:
2740:
2739:Factorization
2737:
2735:
2732:
2730:
2727:
2725:
2722:
2720:
2717:
2715:
2712:
2710:
2707:
2705:
2702:
2701:
2697:
2695:
2693:
2689:
2685:
2669:
2666:
2661:
2657:
2648:
2644:
2640:
2632:
2630:
2611:
2607:
2603:
2599:
2592:
2584:
2568:
2564:
2560:
2551:
2549:
2545:
2541:
2537:
2521:
2518:
2512:
2509:
2506:
2503:
2477:
2474:
2468:
2465:
2462:
2459:
2433:
2430:
2410:
2407:
2399:
2383:
2380:
2377:
2374:
2371:
2368:
2365:
2362:
2359:
2339:
2335:
2331:
2324:
2308:
2304:
2300:
2291:
2289:
2281:
2279:
2277:
2273:
2269:
2263:
2259:
2255:
2251:
2247:
2242:
2240:
2235:
2227:
2220:
2218:
2217:
2213:
2196:
2192:
2183:
2181:
2180:
2176:
2173:
2171:
2170:
2166:
2163:
2160:
2159:
2155:
2148:
2146:
2145:
2141:
2124:
2120:
2111:
2109:
2108:
2104:
2101:
2099:
2098:
2094:
2091:
2088:
2087:
2084:
2070:
2067:
2064:
2055:
2035:
2031:
2004:
2000:
1979:
1976:
1971:
1967:
1954:
1934:
1931:
1926:
1922:
1907:
1904:
1901:
1898:
1896:
1893:
1892:
1888:
1885:
1882:
1879:
1877:
1874:
1873:
1869:
1866:
1863:
1860:
1858:
1855:
1854:
1851:
1850:are squares:
1835:
1831:
1810:
1807:
1804:
1792:
1785:
1782:
1780:
1776:
1773:
1772:
1768:
1765:
1763:
1760:
1759:
1755:
1753:1,254,441,084
1752:
1750:
1747:
1746:
1742:
1739:
1737:
1734:
1733:
1730:
1727:
1713:
1710:
1693:
1672:
1669:
1652:
1629:
1626:
1621:
1604:
1598:
1581:
1546:
1523:
1499:
1494:
1477:
1467:
1464:
1450:
1447:
1444:
1441:
1438:
1430:
1426:
1416:
1413:
1410:
1407:
1405:
1401:
1398:
1397:
1393:
1390:
1387:
1384:
1382:
1379:
1378:
1374:
1371:
1368:
1365:
1363:
1360:
1359:
1355:
1352:
1349:
1346:
1344:
1341:
1340:
1336:
1333:
1330:
1327:
1324:
1323:
1320:
1304:
1293:
1289:
1284:
1278:
1267:
1265:
1247:
1223:
1219:
1215:
1209:
1205:
1202:
1198:
1187:
1183:
1164:
1158:
1151:), one needs
1138:
1135:
1132:
1124:
1119:
1105:
1102:
1098:
1092:
1084:
1081:
1076:
1068:
1065:
1061:
1055:
1045:
1040:
1035:
1027:
1022:
1017:
1014:
1010:
1003:
1000:
997:
974:
970:
963:
960:
957:
951:
948:
940:
924:
921:
918:
915:
906:
904:
888:
885:
882:
879:
876:
868:
849:
846:
843:
836:
832:
829:
826:
823:
820:
812:
796:
793:
790:
782:
778:
773:
759:
756:
753:
750:
747:
727:
724:
721:
718:
715:
691:
688:
685:
665:
662:
659:
645:
642:
639:
637:
634:
633:
629:
626:
623:
621:
618:
617:
613:
610:
607:
605:
602:
601:
597:
594:
591:
588:
587:
584:
582:
566:
563:
560:
557:
552:
548:
544:
539:
535:
518:
502:
499:
496:
486:
483:a - sqrt(b2)
482:
478:
475:
471:
467:
462:
446:
442:
438:
435:
432:
427:
423:
414:
406:
404:
401:
399:
395:
391:
387:
384:is odd, then
383:
362:
357:
352:
348:
345:
342:
336:
331:
326:
321:
316:
312:
309:
306:
300:
295:
292:
285:
284:
283:
281:
265:
262:
259:
256:
247:
245:
226:
223:
220:
211:
208:
205:
194:
193:algebraically
175:
170:
166:
162:
157:
153:
149:
146:
139:
138:
137:
135:
131:
128:
124:
120:
110:
107:
99:
96:February 2022
88:
85:
81:
78:
74:
71:
67:
64:
60:
57: â
56:
52:
51:Find sources:
45:
41:
35:
34:
29:This article
27:
23:
18:
17:
3435:
3129:
3117:
3100:
3092:
3011:MillerâRabin
2993:
2986:
2979:
2974:LucasâLehmer
2972:
2851:
2847:
2834:
2797:
2791:
2778:
2734:Prime factor
2691:
2687:
2683:
2636:
2582:
2552:
2547:
2543:
2539:
2535:
2397:
2292:
2287:
2285:
2275:
2271:
2265:
2261:
2257:
2253:
2249:
2245:
2238:
2236:
2233:
2056:
1913:
1894:
1875:
1856:
1796:
1778:
1774:
1761:
1748:
1735:
1728:
1468:
1465:
1428:
1424:
1422:
1403:
1399:
1380:
1361:
1342:
1291:
1287:
1282:
1276:
1273:
1263:
1185:
1181:
1122:
1120:
938:
907:
902:
866:
810:
780:
776:
774:
651:
635:
619:
603:
580:
516:
488:
484:
480:
477:
473:
470:repeat until
469:
465:
461:, a square.
412:
410:
407:Basic method
402:
397:
393:
389:
385:
381:
379:
279:
248:
243:
190:
118:
117:
102:
93:
83:
76:
69:
62:
50:
38:Please help
33:verification
30:
3267:Pollard rho
3224:Goldschmidt
2958:Pocklington
2948:BaillieâPSW
2211:can only be
2164:Squares are
2139:can only be
2102:N mod 16 is
2092:Squares are
783:. That is,
3379:Cornacchia
3374:Chakravala
2922:algorithms
2827:References
2647:semiprimes
2534:. (Unless
2174:N mod 9 is
2089:modulo 16:
2071:2345678917
1811:2345678917
905:is prime.
400:be even.)
66:newspapers
3353:Berlekamp
3310:Euclidean
3198:Euclidean
3178:ToomâCook
3173:Karatsuba
2719:FOIL rule
2667:−
2378:⋅
2268:recursion
2161:modulo 9:
1977:−
1932:−
1786:24,582.2
1769:35,419.8
1627:−
1599:−
1442:−
1417:47,830.1
1082:−
1041:−
1018:−
886:⋅
824:−
813:, and so
719:−
558:−
433:−
346:−
332:−
224:−
163:−
3452:Category
3320:Lehmer's
3214:Chunking
3201:division
3130:Fermat's
2698:See also
2546:divides
2538:divides
2266:But the
2248:modulus
1889:367,179
1783:24,582.9
1766:35,418.1
1414:47,915.1
1411:48,017.5
1408:48,156.3
1375:367,179
3436:Italics
3358:Kunerth
3338:Cipolla
3219:Fourier
3188:FĂŒrer's
3082:Euler's
3072:Dixon's
2995:PĂ©pin's
2816:2005940
2684:product
2225:must be
2153:must be
1886:270,308
1883:173,439
1870:48,436
1743:60,002
1451:47830.1
1372:270,308
1369:173,439
1356:48,436
527:. Then
282:, then
132:as the
130:integer
80:scholar
3418:Schoof
3305:Binary
3209:Binary
3145:Shor's
2963:Fermat
2814:
2629:time.
1953:modulo
1908:605.9
1880:76,572
1867:48,435
1864:48,434
1861:48,433
1740:60,001
1394:605.9
1366:76,572
1353:48,435
1350:48,434
1347:48,433
937:, let
481:return
380:Since
82:
75:
68:
61:
53:
3239:Short
2968:Lucas
2812:JSTOR
2788:(PDF)
2770:Notes
2262:enddo
2258:endif
2250:times
1905:519.9
1902:416.5
1899:276.7
1714:55000
1673:48436
1391:519.9
1388:416.5
1385:276.7
1238:from
643:16.79
640:11.18
589:Try:
87:JSTOR
73:books
3234:Long
3168:Long
2641:and
2490:and
2423:and
2221:and
2149:and
1538:and
1495:>
1337:4th
1325:Try
1285:and
908:For
779:and
740:and
708:are
706:5959
630:441
561:5959
521:5959
503:5959
396:and
388:and
59:news
3398:LLL
3244:SRT
3103:+ 1
3095:â 1
2943:APR
2938:AKS
2856:doi
2802:doi
2583:Nuv
2550:.)
2542:or
2498:gcd
2454:gcd
2398:Nuv
2184:so
2112:so
1334:3rd
1331:2nd
1328:1st
1121:If
760:101
646:21
627:282
624:125
614:80
567:125
472:b2
127:odd
42:by
3454::
3402:KZ
3400:;
2852:68
2850:.
2846:.
2810:.
2798:28
2796:.
2790:.
2694:.
2290:.
2276:a'
2254:if
2246:do
2214:7
2177:7
2142:9
2105:5
2083:,
1777:â
1402:â
1290:â
1266:.
1118:.
772:.
728:59
692:21
678:,
666:80
611:79
608:78
598:3
549:78
525:78
474:is
246:.
136::
3404:)
3396:(
3101:p
3093:p
2911:e
2904:t
2897:v
2864:.
2858::
2818:.
2804::
2692:n
2688:n
2670:n
2662:2
2658:a
2617:)
2612:3
2608:/
2604:1
2600:N
2596:(
2593:O
2569:v
2565:/
2561:u
2548:v
2544:d
2540:u
2536:c
2522:d
2519:=
2516:)
2513:u
2510:d
2507:,
2504:N
2501:(
2478:c
2475:=
2472:)
2469:v
2466:c
2463:,
2460:N
2457:(
2434:u
2431:d
2411:v
2408:c
2384:u
2381:d
2375:v
2372:c
2369:=
2366:v
2363:u
2360:N
2340:u
2336:/
2332:v
2309:c
2305:/
2301:d
2288:N
2272:a
2239:a
2223:a
2197:2
2193:a
2151:a
2125:2
2121:a
2068:=
2065:N
2052:b
2036:2
2032:b
2021:a
2005:2
2001:a
1980:N
1972:2
1968:a
1957:a
1949:a
1935:N
1927:2
1923:a
1895:b
1876:b
1857:a
1836:2
1832:b
1808:=
1805:N
1779:b
1775:a
1762:b
1749:b
1736:a
1711:=
1705:x
1702:a
1699:m
1694:a
1670:=
1664:x
1661:a
1658:m
1653:a
1630:N
1622:2
1616:x
1613:a
1610:m
1605:a
1593:x
1590:a
1587:m
1582:a
1558:x
1555:a
1552:m
1547:a
1524:N
1500:N
1489:x
1486:a
1483:m
1478:a
1448:=
1445:b
1439:a
1429:N
1425:b
1404:b
1400:a
1381:b
1362:b
1343:a
1305:N
1292:b
1288:a
1283:b
1277:N
1264:N
1248:N
1224:4
1220:/
1216:1
1210:)
1206:N
1203:4
1199:(
1186:c
1182:N
1168:)
1165:N
1162:(
1159:O
1139:1
1136:=
1133:c
1123:N
1106:c
1103:2
1099:/
1093:2
1089:)
1085:c
1077:N
1072:(
1069:=
1066:2
1062:/
1056:2
1052:)
1046:c
1036:d
1031:(
1028:=
1023:N
1015:2
1011:/
1007:)
1004:d
1001:+
998:c
995:(
975:2
971:/
967:)
964:d
961:+
958:c
955:(
952:=
949:a
939:c
925:d
922:c
919:=
916:N
903:N
889:N
883:1
880:=
877:N
867:N
853:)
850:b
847:+
844:a
841:(
837:/
833:N
830:=
827:b
821:a
811:N
797:b
794:+
791:a
781:b
777:a
757:=
754:b
751:+
748:a
725:=
722:b
716:a
689:=
686:b
663:=
660:a
636:b
620:b
604:a
595:2
592:1
581:a
564:=
553:2
545:=
540:2
536:b
517:a
500:=
497:N
447:2
443:b
439:=
436:N
428:2
424:a
413:a
398:d
394:c
390:d
386:c
382:N
363:2
358:)
353:2
349:d
343:c
337:(
327:2
322:)
317:2
313:d
310:+
307:c
301:(
296:=
293:N
280:N
266:d
263:c
260:=
257:N
244:N
230:)
227:b
221:a
218:(
215:)
212:b
209:+
206:a
203:(
176:.
171:2
167:b
158:2
154:a
150:=
147:N
109:)
103:(
98:)
94:(
84:·
77:·
70:·
63:·
36:.
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.