KEVOS
ArticlesServicesCase studiesAboutContact
ArticlesServicesCase studiesAboutContact
← ArticlesThe Modern Primality Testing LandscapeEngineering · Engineering MathematicsLesson 859/884← PrevNext →
ArticlePublished 7 Aug 20262 min readBy Kevin Joginprimality provingAPR-CLECPPAKS
On this page

Ask about this page

KEVOS AIThe Modern Primality Testing Landscape

KEVOS knowledge first · trusted web sources when needed

Modern Primality Tests

The Modern Primality Testing Landscape

The methods available for proving primality, their complexities, and which to use for a given size of candidate.

Engineering / MathematicsModern Primality Tests2 min readKV-MATH-0657

Proving primality without factoring one less or one more than the candidate requires modern methods. Three families exist, and the one that is theoretically most satisfying is the one least used.

The three families

Modern primality proving methods
MethodComplexityCertificatePractical use
Jacobi sum (APR-CL)Almost polynomial — a slowly growing exponentNone; the run must be trusted or repeatedVery fast up to a few thousand digits
Elliptic curve (ECPP)Heuristically polynomialYes, quickly verifiableThe general workhorse
AKSProvably polynomialThe run itselfNot competitive in practice

Key point

AKS settled the theoretical question — primality is in polynomial time unconditionally — but its exponent is large enough that it has never been the practical choice. The theoretical and practical answers are different, which is unusual and worth noting.

Choosing

  • How certain must the result be?
  • Practical certainty sufficesBaillie-PSW — cheapest by far
  • A proof is required
  • Does one less or one more factor easily?Pocklington-Lehmer or the N+1 test
  • Up to a few thousand digits, no certificate neededJacobi sum
  • Certificate needed, or very largeECPP

Why certificates matter

Key point

A certificate can be checked far more cheaply than it was produced, and by independent software. This converts trust in an implementation into a verifiable claim, which is why ECPP is preferred for published results even where the Jacobi sum test would be faster — see certificates.

Always test before proving

The standard sequence

  1. Trial divideRemoves most composites at negligible cost.
  2. Run Baillie-PSWSettles compositeness with near certainty.
  3. Only then proveProving methods are expensive and should never be run on a number not already known to be a probable prime.

Cost

Running a proving algorithm on an untested candidate wastes enormous effort on numbers a single strong pseudoprime test would have eliminated instantly. The cheap test always comes first.

Practical scale

Baillie-PSW is effectively instantaneous at any size encountered in practice. The Jacobi sum test handles a few thousand digits comfortably. ECPP has proved primality of numbers with tens of thousands of digits, though such runs take considerable time.

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

  • Primality Versus Factoring: Framing the Problems
  • Gauss Sums and Jacobi Sums

Continue learning

Shanks's Square Forms Factorisation (SQUFOF)Article · Engineering MathematicsNEXT LESSON →Gauss Sums and Jacobi SumsArticle · Engineering MathematicsShanks's Class Group Factoring MethodArticle · Engineering MathematicsStructure of the Jacobi Sum Primality TestArticle · Engineering Mathematics
KEVOS · Engineering, manufacturing and project improvement
ArticlesServicesCase studiesAboutContact
© 2026 KEVOS®