KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesThe Continued Fraction Factorisation MethodEngineering · Engineering MathematicsLesson 868/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin JoginCFRACcontinued fractioncongruence of squaresfactor base
On this page

Ask about this page

KEVOS AIThe Continued Fraction Factorisation Method

KEVOS knowledge first · trusted web sources when needed

Modern Factoring Methods

The Continued Fraction Factorisation Method

CFRAC: generating small quadratic residues from the continued fraction expansion, and the congruence-of-squares framework it established.

Engineering / MathematicsModern Factoring Methods2 min readKV-MATH-0666

The continued fraction method was the first sub-exponential factoring algorithm to be practical. It established the framework — collect relations, do linear algebra, extract a congruence of squares — that the quadratic and number field sieves inherit.

The framework

If two numbers have equal squares modulo the target but are not congruent up to sign, their difference shares a non-trivial factor with the target.

x^2 = y^2 (mod n), x not congruent to plus or minus y => gcd(x - y, n) is a proper factorThe congruence-of-squares principle.

Key point

Every method in this stream except ECM produces a factorisation this way. The methods differ only in how they generate the relations that combine into such a congruence.

Generating small residues

The convergents of the continued fraction expansion of the square root of the target produce numerators whose squares reduce to unusually small residues.

|A_k^2 - n B_k^2| < 2 sqrt(n)The convergents give residues bounded by twice the square root.

Key point

Small residues are far more likely to be smooth than random ones. This is the method's entire advantage, and it is the same insight that reduction supplies in class group computation — see continued fractions.

The algorithm

The continued fraction factoring method

  1. ExpandCompute the continued fraction of the square root of the target.
  2. Collect residuesEach convergent gives a residue to test.
  3. Test smoothnessTrial divide against the factor base.
  4. Build the matrixRows are exponent vectors modulo two.
  5. Find dependenciesA kernel vector gives a product that is a perfect square.
  6. ExtractForm the congruence of squares and take a GCD.

Exponents modulo two

Key point

Only the parity of each exponent matters, since the goal is a perfect square. The linear algebra is therefore over the field with two elements, which is enormously cheaper than working over the integers — see the linear algebra stage.

Why sieving beat it

Caution

CFRAC must test each residue for smoothness individually by trial division. The quadratic sieve tests a whole interval at once by sieving, which is dramatically faster per candidate even though its residues are larger — see the sieving stage.

Why the quadratic sieve replaced CFRAC
AspectCFRACQuadratic sieve
Residue sizeSmaller — better smoothness oddsLarger, growing across the interval
Smoothness testingIndividual trial divisionBulk sieving
Net effectSupersededMuch faster in practice

Historical importance

CFRAC factored numbers previously out of reach and demonstrated that the relation-collection framework worked. Its structure survives unchanged in every later sieve.

Source. Henri Cohen, A Course in Computational Algebraic Number Theory, Springer GTM 138 — 10.1. 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

  • Continued Fraction Expansion of Real Numbers
  • Smoothness and Sub-exponential Complexity
  • The Schnorr-Lenstra Class Group Factoring Method

Continue learning

Smoothness and Sub-exponential ComplexityArticle · Engineering MathematicsNEXT LESSON →The Schnorr-Lenstra Class Group Factoring MethodArticle · Engineering MathematicsPrimality Certificates and Independent VerificationArticle · Engineering MathematicsElliptic Curves Modulo NArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®