KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesModern Factoring Methods ComparedEngineering · Engineering MathematicsLesson 882/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginfactoring comparisonmethod selectionECMquadratic sieve
On this page

Ask about this page

KEVOS AIModern Factoring Methods Compared

KEVOS knowledge first · trusted web sources when needed

Software, Tables and Sources

Modern Factoring Methods Compared

Comparing factoring methods by target size, expected factor size and available hardware, with a practical sequencing recommendation.

Engineering / MathematicsSoftware, Tables and Sources2 min readKV-MATH-0680

Factoring method selection turns on two independent questions: how large the target is, and how large the factors are expected to be. Conflating them is the commonest mistake.

The two axes

Key point

The sieves depend on the size of the target; ECM depends on the size of the factor. A hundred-digit number with a twenty-five-digit factor is easy for ECM and hard for a sieve, while a hundred-digit product of two fifty-digit primes is the reverse.

Method summary

Factoring methods compared
MethodCost depends onBest for
Trial divisionThe smallest factorFactors below about a million
Pollard rhoThe smallest factorFactors up to about 12 digits
SQUFOFThe targetTargets up to about 18 digits; very small constants
Pollard p-1Smoothness of one less than the factorA cheap opportunistic attempt
ECMThe factor foundFactors from 15 to about 60 digits
MPQS or SIQSThe targetTargets up to about 100 digits
Number field sieveThe targetTargets beyond about 100 digits

Recommended sequencing

Practical factoring sequence

  1. Trial divideTo a modest bound; clears most inputs instantly.
  2. Test for primalityWith Baillie-PSW — never factor a prime.
  3. Check for a perfect powerSee perfect power detection.
  4. Run Pollard rho brieflyCheap; catches small factors.
  5. Run p-1 brieflyCheap and occasionally spectacular.
  6. Run ECM at increasing boundsStrips medium factors; stop when the expected effort exceeds the sieve cost.
  7. Apply a sieveSIQS or the number field sieve by target size.
  8. Recurse on cofactorsEach factor found must itself be tested and factored.

Key point

ECM before a sieve is not optional. Stripping medium factors first can reduce the sieve input dramatically, and ECM is cheap relative to any sieve run on a large target.

Knowing when to stop with ECM

Cost

ECM effort for a factor of a given size is predictable from published tables. When the expected remaining ECM effort exceeds the cost of a sieve on the full target, switch. Continuing ECM past that point is the commonest way to waste large amounts of time.

Hardware

Parallelism by stage
StageParallelism
ECMPerfect; curves are independent
SievingExcellent; intervals are independent
Sieve linear algebraPoor; needs tight coupling
Number field sieve square rootLimited

Note

The linear algebra stage is why very large factorisations require a cluster for one phase even when the sieving ran on widely distributed volunteer hardware. Planning a large computation means planning for that phase specifically.

Special forms

Targets of special algebraic shape admit far better polynomials and are factored well beyond the general record size. Always check whether a target has such a form before treating it as general.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 10. Structural reference unverified: the source file was not available during authoring; chapter and section numbers are taken from the published edition and have not been checked against a physical copy.

Related pages

  • Computational Algebraic Number Theory: Field Overview
  • The Elliptic Curve Method: Stage One
  • The Multiple Polynomial Quadratic Sieve
  • Number Field Sieve: Polynomial Selection and Structure
  • Choosing an Algorithm: Decision Guide

Continue learning

Choosing an Algorithm: Decision GuideArticle · Engineering MathematicsNEXT LESSON →Implementation Pitfalls and Testing StrategyArticle · Engineering MathematicsPublished Tables of Fields and CurvesArticle · Engineering MathematicsFurther Reading and Source NotesArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®