KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesStructure of the Jacobi Sum Primality TestEngineering · Engineering MathematicsLesson 861/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin JoginJacobi sum testAPR-CLprimality provingcyclotomic
On this page

Ask about this page

KEVOS AIStructure of the Jacobi Sum Primality Test

KEVOS knowledge first · trusted web sources when needed

Modern Primality Tests

Structure of the Jacobi Sum Primality Test

The overall design of the Jacobi sum primality test, its two phases, and where its complexity comes from.

Engineering / MathematicsModern Primality Tests2 min readKV-MATH-0659

The Jacobi sum test, also known as APR-CL, proves primality by checking cyclotomic congruences for many small characters. It is the fastest method for candidates of moderate size.

The idea

If the candidate is prime, Jacobi sums satisfy congruences reflecting the action of the Frobenius map. If it is composite, those congruences fail — and the same data restricts the possible divisors so tightly that a short final search settles the matter.

The two phases

Choose parameters→Check congruences→Final divisor search

The Jacobi sum test

  1. Choose a squarefree integerWhose prime power divisors minus one divide it, and whose associated product exceeds the square root of the candidate.
  2. Check the congruencesFor each character of each prime power order, verify the Jacobi sum condition — see condition C_p.
  3. Derive the constraintPassing all conditions forces every divisor of the candidate to be congruent to a power of the candidate modulo the chosen integer.
  4. SearchCheck the resulting short list of possible divisors directly.

Key point

The final search is what makes this a proof. The congruences narrow the possible divisors to a list short enough to check exhaustively, and finding none proves primality.

Parameter selection

The auxiliary integer must be highly composite with small prime factors, so that its associated product grows quickly while the individual characters stay cheap.

Note

Suitable parameters are precomputed and tabulated by size range rather than selected at run time. Their construction is essentially a search for integers with exceptionally smooth predecessors of their divisors.

Complexity

Cost ~ (log n)^(c log log log n)Almost polynomial: the exponent grows, but extraordinarily slowly.

Key point

The triple logarithm grows so slowly that the exponent is effectively constant across every input size that will ever be used. The test behaves as polynomial in practice even though it is not polynomial in theory.

The certificate problem

Caution

The test produces no certificate. Verification means re-running the whole computation, so the result rests on trust in the implementation. This is its principal disadvantage against ECPP.

Where it wins

Cost

For candidates up to a few thousand digits the Jacobi sum test is typically faster than ECPP, and its running time is far more predictable — ECPP's depends on how easily suitable curve orders are found, which varies.

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

  • The Pocklington-Lehmer N-1 Primality Test
  • Gauss Sums and Jacobi Sums
  • Checking the Condition C_p

Continue learning

Gauss Sums and Jacobi SumsArticle · Engineering MathematicsNEXT LESSON →Checking the Condition C_pArticle · Engineering MathematicsThe Modern Primality Testing LandscapeArticle · Engineering MathematicsImplementing the Jacobi Sum TestArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®