Yagel Numbers: the Mersenne × Primorial Grid — Structure, a Lucas–Lehmer-Type Test, and Proven Primes at Scale
Yagel Bar · Revision 2.8 — October 20, 2026 (Revision 2.0: July 2, 2026; Revision 1.0: October 23, 2024)
This page is the current edition:
Revision 2.8, last modified
. Corrections that
change a stated result are recorded in the
scientific errata.
Revision 1.0 was published
; its February 2025 edition
remains available as a PDF
and has not been corrected, so it should not be read as the
current edition. The catalogue of proven primes is at
yagelnumbers.org/primes.
Abstract. We study the two-parameter family , where is the -th prime and the primorial of its predecessor. Its first row () is the Mersenne numbers and its first column () the numbers , one below the primorials; among the genus it is the canonical, parameter-free specialization: for each prime base , is the least coefficient giving property (i) below. Three structural properties drive the paper. (i) for every prime , the maximal built-in small-prime sieve for the base. (ii) For , () is irreducible over , so, unlike the Mersenne row, no exponent is algebraically disqualified. (iii) is fully factored by construction, so every prime in the family admits a deterministic primality certificate.
We give that proof in Lucas–Lehmer form: a single -only Lucas ladder driven by the Chebyshev-type map , whose member is the classical iteration . The criterion belongs to the known family of Lucas–Lehmer-type tests for (Williams; Berrizbeitia–Berry; Grau–Oller-Marcén–Sadornil; Jakhar–Ram). What the grid contributes is the factored neighbor those tests require, supplied at every cell by construction. One-ladder certification holds in a stated size regime with a seed that succeeds; below that regime the multi-factor Brillhart–Lehmer–Selfridge form applies. For each fixed row, Proposition 4 also gives linear-time reduction of products already represented in radix , using a short division by the primorial and a final conditional subtraction.
The original study (Revision 1.0) took the census domain , , and that domain is now a complete enumeration on both faces: 482 primes of the first kind, 484 of the second kind over , and 22 cells prime on both faces — twin pairs in which each member has a completely factored neighbor. Every one of those primes is proven, as are the five Fermat primes , , on the second kind's first row; every other cell except , which is neither prime nor composite, carries a compositeness witness for its own integer.
We compare the census counts with a first-order Mertens heuristic: in the 100–5,000-digit window over , the minus face holds 344 primes and the plus face 357, against 361.8 expected on each. These comparisons are descriptive diagnostics; they do not establish a Poisson law, the presence or absence of an exponent effect, or a limiting row constant. Shared exponent periods make the sieve factors dependent, so the paper uses exact finite-sieve counts rather than a product of marginal factors.
Forward searches on the same machinery reach far beyond that domain. Their results are published at yagelnumbers.org as versioned data releases — a catalogue of proven primes, each backed by a certificate that replays against its own coordinates, and an index giving, per row and face, the exponent ranges in which every cell is decided. This paper states the method and scope behind them; their totals, which grow with each release, are in the releases. Every prime reported was proven, not screened.
This is a living document. Revision 1.0 appeared October 23, 2024. The present revision reports the family's structure theory, its deterministic primality criteria, the census of both faces over the original domain, the first forward campaigns (July 2026), and the method behind the catalogue of proven primes, whose current contents are published as versioned data releases (§5.2). The scientific errata at the end record the corrections since Revision 1.0 that change a stated result, and are followed by a summary of what the principal claims do and do not establish.
1. Introduction
Mersenne numbers owe their role in prime searching to two gifts: an algebraic one — a divisor for every , so only prime exponents need testing — and an arithmetic one — the Lucas–Lehmer test, which decides the primality of with one quadratic recurrence modulo . It is natural to ask what becomes of these gifts when the sieve idea behind Mersenne numbers ("exclude divisibility by 2") is pushed to its logical extreme.
Fix and let denote the -th prime, the primorial (). A Yagel number of order and exponent is
The construction removes divisibility by every prime up to the base: the primorial coefficient kills the primes below , the power kills itself (§2.1). Two classical families appear as the boundary of the grid:
row :, the Mersenne numbers;
column :, one below the primorial ; its primes are the primorial primes of the minus form (the name is Dubner's [8, §2.1]; for the searches see Dubner [7], Caldwell–Gallot [8] and the earlier work cited there).
Both "constants" in (1) are dictated by the prime sequence itself; the family has no free parameters and is indexed purely by the lattice point . The genus is classical: numbers with fixed coefficient and base have been studied at least since Lucas (see [12, §1]), with Riesel (), Thabit () and Williams (), and the mirrors (Proth, Sierpiński) as the familiar branches — and we claim nothing beyond that placement. What singles out within the genus is that the coefficient is not one of infinitely many arbitrary choices of but the parameter-free one, , coupled to the base : the specialization with the smallest positive coefficient giving the prescribed congruences for its base (§2.1) and the adjacent integer is fully factored at every cell (§2.3). The result is a natural two-dimensional table whose edges are the Mersenne numbers and the numbers and whose interior appears not to have been treated as a single object before.
Notation and nomenclature. Following the convention of Lucas sequences and Chebyshev polynomials, we call the Yagel numbers of the first kind and the Yagel numbers of the second kind; an unmarked always means the first kind (the historical default of Revision 1.0). Informally, as the Cunningham tables keep and in separate "" and "" tables, we speak of the and faces of the grid around the central column . The second kind has classical edges of its own: its column consists of the Euclid numbers, and its row is , prime at most when is a power of two — the Fermat form (see §4.5).
What is new here, and what is not. Numbers , their Lucas-type primality tests, and the two edges of the grid are classical (§3 lists the prior art for the test). What this paper introduces is the coupling: the coefficient is not a free parameter but the primorial of every prime below the base, and the base is the next prime — a canonical, parameter-free two-parameter family in which the Mersenne numbers are the first row and the numbers the first column. Some rows were known singly — row 2, , is the case of Williams's family [12] — but no name, sequence, or treatment of this family as one object was found in the literature or the OEIS before this work. The paper develops the following consequences and applications of the coupling: the structure theory of the grid (maximal sieve, Proposition 1; no algebraically dead cells, Lemma 2; no cheap coverings, Lemma 2′); the test of the interior stated as one family of Chebyshev maps with the classical Lucas–Lehmer iteration as its first member and an admissible trace on every minus-face cell with (§3); the fixed-row linear-time reduction in radix , by a fold valid for general (Proposition 4); the first-order statistical account of the census — the Mertens factor, the first-order window approximation (4), and the conditional comparison of search counts across rows (§4–5); the census of both faces to 5000 digits, the cells proven prime on both faces, and the large primes of §5; and the integer sequences the grid defines (first primes of each row, and the columns of both faces). The minus face of the grid is itself in the OEIS: read by antidiagonals, it is sequence A401136 [23]. Of the sequences derived from it, the first, the least exponent at which each order reaches a prime on the minus face, is OEIS sequence A400659 [22].
This paper presents the family from three angles.
Structure (§2). The sieve property is maximal; the interior admits no algebraic factorization in the exponent (a Capelli-type lemma; cf. [9]), so no lattice cell is ruled out by algebra — in sharp contrast to the Mersenne row, where composite exponents are disqualified; and both neighbors of the central point — the two faces — have that fully factored point as their own neighbor.
A deterministic test (§3). The fully factored adjacent integer supplies a deterministic certificate for every prime in either face, through the full-factor Lucas and Pocklington criteria (§2.3): the grid supplies the factorization at every cell, and each certificate checks the criterion's size, seed and coprimality conditions. For , in the one-ladder regime, Theorem 3 certifies with a single -only Lucas ladder: iterate the map from , at one modular square and one modular product per bit (Remark 4), and retry the seed if it does not separate the -part. At the map is , and the classical Lucas–Lehmer theorem supplies the fixed-seed criterion (Remark 1). These criteria belong to the classical theory (§3, Prior art). In radix , reduction modulo uses the primorial itself (Proposition 4).
Statistics and computation (§4–5). Over the census domain of the original study (, every exponent to 5000 digits; 482 minus-face primes, each proven) the counts are compared with the parameter-free sieve-adjusted prime-counting model, in aggregate and row by row; the Mersenne edge is compared with Wagstaff's divisor-class heuristic, prime exponents with composite ones, and the twin cells with the local-factor sum (6). All of these comparisons are descriptive (§4). The same domain on the face (§4.5) holds 484 primes over , and 22 cells are proven prime on both faces (§4.4). Running the same machinery forward (§5) yields primes far outside the domain — among the first, of digits, whose exponent is emphatically composite.
Throughout, we are explicit about what the family does not offer (§6): one trial of the test with a supplied seed costs bit operations, as Lucas–Lehmer does — with quasi-linear arithmetic — where is the candidate's bit length and the cost of fast multiplication with comparable modular reduction; finding a successful seed can cost more. Mersenne retains its divisor-class enrichment and its particularly simple shift-and-add reduction. Proposition 4 gives a fixed-row linear-time radix- reducer; its schoolbook bound is , with the bit length of the primorial. The family's genuine assets are that every prime in it is provable by construction, that no interior cell is algebraically dead in the sense of Lemma 2, and that the whole family is indexed by two parameters with no free choices.
2. Structure of the grid
2.1 The maximal small-prime sieve
Proposition 1.For every prime , . In particular : no prime up to the base divides any member of row .
Proof. If then , and if then ; in both cases .
The coefficient is the smallest positive coefficient with for every prime : since is invertible modulo each such , every one must divide the coefficient. Their product is necessary and sufficient; larger multiples also work.
This is the strongest clean congruence sieve available for the base: an integer modulo every prime up to . Quantitatively, coprimality to the first primes multiplies the prime density of a random integer of the same size by Mertens' factor
which is the precise form of the intuition that the construction "amplifies" prime density (explicit two-sided estimates for (2) in Rosser–Schoenfeld [11, Theorem 8]; as a function of real , takes both signs for arbitrarily large [21, Theorem 1.1]); §4 compares it with the data.
2.2 Every cell is live: no algebraic exponent filter
The Mersenne row loses all composite exponents to the identity . The interior loses nothing:
Lemma 2.For , the polynomial with is irreducible over for every .
Proof. Up to a nonzero scalar, the reciprocal polynomial is . Any prime dividing the squarefree integer divides its constant term but not its square and does not divide the leading coefficient. Eisenstein proves irreducibility. The same proof works for , hence for the plus face. This says nothing about numerical coverings or infinitude of prime values.
So no polynomial identity in can divide for composite : every exponent is a live candidate. The mechanism behind Mersenne's prime-exponent rule is exclusive to . One can see the same fact locally: a prime divides exactly when
a shifted arithmetic progression in — provided is a power of modulo ; otherwise divides no member of row (on the plus face the target is ). On the Mersenne row, , all shifts vanish and divisibility aligns with the divisor lattice of ; for the shift vanishes only for the finitely many ( on the plus face), so a prime dividing need not divide when . The shifts do not make divisibility independent of the arithmetic of : a prime of even order excludes exponents of one parity only. §4.3 compares prime- and composite-exponent counts, and three of the six minus-face primes tabulated in §5.1 have composite exponents.
Lemma 2 rules out polynomial identities, not covering systems: a hypothetical far row could still be Sierpiński–Riesel-style barren by a finite set of primes covering all residues (3). Two facts constrain that possibility.
Lemma 2′.For and either face , no prime kills all (period 1) or all of one parity (period 2). Every covering prime has and .
Proof. A covering prime has , so , and by Proposition 1. Period 1 means ; but has no prime factor in . Period 2 means with odd, so by Bertrand's postulate, whence and .
In particular the "trivial" Riesel exclusion of generic searches never occurs on the grid. Computationally, no row is covered by the primes up to on either face (every row keeps at least 279 of the exponents free of prime factors up to , fewest on row 3's plus face; the counts lie between 0.51 and 1.18 times the Mertens prediction , and within 5% of it for 1,905 of the 1,998 (row, face) pairs), and the largest covering density achievable from primes of order is (row 3, plus face, counting each prime whose class (3) exists), against the a covering needs; see §6. Nor do the binomial factorizations of or the Aurifeuillian identity apply at any cell: for the prime 2 divides exactly once, so is never a perfect power or of the form .
2.3 Both neighbors factored
The central object of cell is , with complete factorization known by construction. Its two neighbors are
and for both, the adjacent number is fully factored: for the face, for the face. Consequently the classical (Brillhart–Lehmer–Selfridge / Morrison [1, 3]) and (Pocklington [4]) theories give every prime in either face a deterministic certificate using the known factorization. When both faces are prime at the same cell, both members of the twin pair have such a certificate (§4.4). In the genus at large the neighbor is factored only as far as is — routinely for the small coefficients of classical searches, not for a large coefficient of unknown factorization; here it is factored by construction at every cell, including those where .
3. A Lucas–Lehmer-type test for every row
Throughout this section with , , and Lucas sequences have parameters with , , i.e. , , . Two classical facts (work in for a prime , with for the roots of ):
, so iff and iff : multiply by and use that a field has no nonzero nilpotents. Meanwhile iff with , allowing either V sign.
divides : Frobenius fixes the roots in the split case and interchanges them otherwise.
Because , the -sequence is closed under composition of indices: , where is a monic degree- polynomial — the Chebyshev polynomial up to scaling, — evaluated modulo by a two-term ladder with no -values. For , write . Starting from and processing all binary digits uses exactly modular squares and modular products. The cases may instead return directly; leading-bit or final-state optimizations change the exact count.
Theorem 3 (one-ladder test).Let be positive integers, , an odd prime, , and . Suppose satisfies and . Define
so that and . If
then is prime. Conversely, prime satisfies (i) for every admissible trace, and a successful seed exists. A particular admissible seed may fail (ii).
Proof. For each prime , (i) gives and (ii) gives . Thus the order divides but not , so its -adic valuation is because . Consequently and . If were composite, its smallest prime divisor would be at most , including for repeated prime factors. But , a contradiction. The Jacobi condition is needed for prime-case necessity, not sufficiency.
For prime the norm-one group has order and is cyclic. Exclude ; inversion pairs its remaining elements into admissible traces. The -th power subgroup contains elements including ( odd), leaving bad elements. Uniform admissible trace residues therefore succeed with , not exactly . For , , six of eight admissible traces succeed.
Parity also gives , so is a sharper sufficient bound. The research implementation of Theorem 3 used the conservative threshold, and the catalogue's certificates use the full factorization of (§5.2).
Remarks.
Classical edge. For , gives 1 and gives 3. Composite factors . For prime the classical Lucas–Lehmer theorem starts at 4, iterates exactly times and tests for zero modulo . Arbitrary Jacobi-admissible seeds do not supply an unconditional iff test. The minus-two condition is a sufficient order certificate; its converse needs the appropriate seed theorem, separately from the odd- argument.
Certificates and retries. Under the theorem's hypotheses, a failure of (i) witnesses compositeness, a proper gcd exposes a factor, and is inconclusive. Sequential seed retries have no proved expectation here.
Below the threshold. For , the one-ladder regime is exactly ; it covers all but an initial segment of each row. The prime number theorem gives . Here , where the minus-face candidate has 179 digits, and . Outside this regime use the following general Lucas certificate. Let be odd, , and choose a set of prime divisors of . Put . Use one integer discriminant for every , with and . For each supply an integer with , set , and check , and . If , then is prime. Indeed, modulo every prime divisor of , each root ratio has order dividing and carrying the entire -part of . The common discriminant makes the sign the same for every , hence and . The full factorization always meets this bound. The grid has distinct factors, so at most successful per-prime checks are needed. An unsuccessful seed, exhausted search or timeout is inconclusive unless a separate compositeness witness was obtained.
Cost. Put and . For one supplied seed, the full-bit pair ladder of §3 uses modular squares and modular products, initialization included: modular operations, and bit operations with fast modular arithmetic, gcd and Jacobi checks on reduced parameters included. A Fermat test with exponent by leading-bit binary powering uses modular squares and modular products, so one ladder trial and one Fermat test are of the same order; their measured ratio depends on windowing, the base and the relative costs of squares and products, and is not a constant. Witness search, retries, certificate replay and multi-factor proofs add to this cost. For factors sharing one base and ring, product-tree evaluation of cofactor powers uses ring operations, where is their product including multiplicities. Proposition 4 gives fixed-row linear-time reduction in radix , with schoolbook bound for .
Empirical validation. A research implementation (July 2026) was run on the 476 primes of the 2024 dataset and on 100 composite controls. The 376 primes and 17 controls with , and went through the ladder with zero disagreements, and seed retries were observed; the remaining cells were decided by an exact small-number test or a Lucas–Lehmer-type test on row 1, or lay below the regime and were skipped. At scale, the ladder proved the -digit prime of §5 in 17.7 s (single seed, ) on commodity hardware — faster in that run than the equivalent -sequence BLS routine (55.6 s).
Gcd-free form (Theorem 3′). Let be the minimal polynomial of , (degree , integer coefficients; , ), so that and . Under all hypotheses of Theorem 3, put . For any admissible trace with , is prime if and only if . Operationally, certifies primality; witnesses compositeness; and is inconclusive and requires another seed; , and witnesses compositeness. All comparisons are modulo . In the prime case the rejected traces correspond to -th powers of in the cyclic norm-one group; this is not a power condition on the integer . For sufficiency, implies (i) by the polynomial identity, and modulo every prime factor because and . Thus (ii) holds and Theorem 3 applies. Necessity follows in the field modulo prime ; no square is cancelled modulo a composite. This has the shape of Lucas–Lehmer, with a separate convention : , without a squared factor. The fixed-seed classical edge is covered by Remark 1. On row (, ), start at , perform cubic updates , and test for modulo . The case gives the prime 5 and is outside this size regime. Moreover is admissible on every minus-face cell with , since and give . A research implementation agreed with exact primality on every one-ladder-regime cell with and , on the dataset primes in the regime between and 1500 digits together with composite controls, and with a BPSW test on row 2 for every .
Prior art. Explicit Lucas–Lehmer-type criteria for numbers have a long history that Revision 2.0 cited only for base 2 [2, 5], where criteria for already start the iteration at of a fixed trace, as Theorem 3 does [13, §2]: Williams [12] for (1972), Bosma [13] for , Berrizbeitia–Berry [14, 15] for and , respectively, via cubic and biquadratic reciprocity ([15] with a seed that depends only on ), Stein–Williams [16] for , Grau–Oller-Marcén–Sadornil [17] for with a single exponentiation (the face) and [20] for , Deng–Huang [18] for , and Jakhar–Ram [19] (April 2026), Theorem 2.1, for odd in their coefficient and discriminant domain. On the domain of Theorem 3, write with squarefree and put . It has norm one. The identity , with , identifies their cyclotomic equation with Remark 6. Their nontriviality condition and the size bound must be retained. Theorem 3 is therefore a specialization, not a new test; it was derived for Revision 2.0 (July 2026) from the Brillhart–Lehmer–Selfridge theory [1] without knowledge of [19], which precedes it and treats the general form (the family itself, and its minus-face census, date from Revision 1.0, October 2024). What is specific to the grid is the factored neighbor these criteria need, present by construction at every cell; the presentation of all rows as one family of -only Chebyshev ladders, whose member is the classical Lucas–Lehmer map (with its separate seed theorem; single ladders of this kind are classical, e.g. the cubic ladders of [12, Theorem 4] and [14], which apply to row 2); the universally admissible trace for ; and the campaigns of §5. For prime , exhaustive deterministic search always finds a successful trace (Theorem 3); an explicit rule that avoids the search is open problem 3 (§6).
3.1 Modular reduction in radix
Mersenne shift-and-add reduction is the , case of the following fold at , which applies to every .
Proposition 4 (fold at ).Let , , and . Write , with . Then
One conditional subtraction gives the canonical residue. Put and . For grid inputs already represented in radix , schoolbook short division gives an reduction algorithm. For a fixed row this is worst-case in the ordinary dense-output model. When the division disappears, giving the Mersenne shift-and-add case.
Proof. Since , . For , , hence . Set and split , , by a radix- shift. Divide , ; then and the fold is . The input has at most bits and has bits, possibly about . Short division by the -bit coefficient and output assembly cost in the schoolbook model. No reciprocal precomputation is required, and conversion of binary products into radix is not counted. At , the only permitted input is .
Remark (Montgomery form). For , satisfies . Write , ; the first output is . For , ; products of canonical residues only guarantee . On that larger interval, . Split and divide , . Since , this division has -bit operands and costs by schoolbook arithmetic. Folding at gives , so one final conditional subtraction suffices. The multiplication by is thus followed by one normalization step. For , normalize the first output directly. This map reduces by the Montgomery factor , so representation setup and conversion are separate costs.
Folding plain residues at would introduce the dense constant ; folding at , or the normalized Montgomery form, uses itself. Under schoolbook arithmetic, reduction costs against for the dense product it follows, giving a relative work bound . For , the logarithmic work-scale estimate is with , ignoring the minus one and bit rounding; for , the bound is . A radix- limb prototype was compared with generic arithmetic on a finite set of cells. Extending optimized arithmetic to rows with large coefficients is an implementation question.
4. Statistics of the grid
The domain of this section. Everything in §4 is computed over one fixed domain, the census domain of the original study (Revision 1.0, 2024): orders and every exponent with , the rows running from to . The domain is fixed because it is the original study's; it serves this section as a benchmark for the model comparisons, and it is not a description of how far the project's computations now extend, which the published index records (§5.2). The plus face is taken over the same cells with (§4.5); its row is the Fermat form and is treated by algebra.
The domain is completely decided. On the minus face it holds 482 primes. Each is proven: it carries a stored certificate that replays against its own coordinates under the criteria of §3, or trial division below . is neither prime nor composite. Every other cell is composite, and each carries a compositeness witness for the integer its coordinates name, computed from those coordinates: a proper divisor, or failing that a strong probable-prime test to base 2 that the integer fails for — on the Mersenne row, the algebraic factor of a composite exponent or a failed Lucas–Lehmer test instead, since base 2 cannot witness compositeness for the remaining prime-exponent candidates (every with prime passes it). The plus face is decided the same way, with the algebraic factors of and Pépin's test on its first row. A witness decides its integer outright, so these composite verdicts are not a weaker grade of evidence than the prime certificates, and none of them is inferred from a cell's absence from the prime list. They also do not rest on the classifications of the 2024 sweep, of which a 2026 re-test found six wrong (errata, Revision 2.1): every composite cell was witnessed afresh from its coordinates, and the published index declares the verdict of every cell of the domain on both faces.
Except where stated, counts use cells with , that is, 100 through 5,000 decimal digits inclusive. Both faces use these same cells; selecting by either face's digit count gives the same window on these fifty rows. This window limits small-integer artifacts. Census membership is determined by coordinates: an in-domain prime is counted once regardless of when it was found. Results of §5 outside this domain are excluded from the census comparisons.
Primes of the census domain. Every prime found in the census, plotted by order against its number of decimal digits (logarithmic vertical scale). Circles are minus-face primes, triangles plus-face primes, and a ringed marker is a cell whose two faces are both prime, giving a twin pair (§4.4). This overview also includes the five plus-face primes on row 1; §4.5's plus count and interior comparisons exclude that row. The domain is and all exponents to 5,000 digits, so the vertical extent of each column is set by that digit cap and not by where primes stop. The larger primes of §5 come from targeted searches outside this domain and are deliberately not shown. Full size (895×600) ↗
How the comparisons are meant. Every comparison of an observed count with a model in §§4–5 is a descriptive diagnostic over its stated domain. The heuristics were formulated with this census in view, and the exponent sieves make the cells of a row dependent (§4.1), so no comparison here is a calibrated test, a fitted law or an out-of-sample prediction, and none establishes the presence or absence of a further effect. A -value, for observed and expected primes, is the distance from the expectation in units of , not a significance level; intervals computed under an independent-Poisson reference carry no coverage claim. The limiting questions the comparisons leave open are stated in §4.6.
4.1 A first-order model for the census counts
A first-order reference model transfers PNT for integers conditioned on the built-in sieve to this exponential family: a candidate of size is prime with probability with from (2) — computed exactly, not asymptotically. Expected counts per row are then over the window.
Result. Over the census domain restricted to and the 100–5,000-digit window: primes observed against expected, , with in every individual row (Fig. 2). The Mertens factor (2) is the model's only adjustment for the built-in sieve, and no parameter is fitted.
A pleasant closed form follows from : over a digit window ,
The last approximation is independent of : it replaces the finite ratio by its large- limit . The finite sums retain their row dependence. For Fig. 2 the leading approximation is per interior row; the 49 observed interior counts have mean and range from 2 to 12. Row 1 has separate exponent restrictions and the model of §4.2.
Dependent exponent sieves. For each explicit prime , divisibility excludes at most one phase modulo . These periods share factors. For , and , the minus face excludes and : seven of twelve exponents survive. The plus face excludes and : eight survive. The marginal-independence product is for both and is therefore not the joint density. Dividing exact survivals by gives finite corrections and , versus the baseline .
The supporting note on exponent sieves gives the complete period, an inclusion–exclusion proof and a standalone reproduction. Exact rational period counts and explicit finite-window counts retain the shared periods. Divisibility by at does not establish compositeness. The refined fits and -scores of Revision 2.1, which rested on the marginal product, are withdrawn.
Per-row prime counts against the first-order expectation. Bars are the number of minus-face primes observed in each row of the census domain within the 100–5,000-digit window; the solid line is the sieve-adjusted expectation over the same window for ; the dashed line is the -free constant of (4). The star at is the Wagstaff-corrected prediction for the Mersenne row (§4.2), evaluated with its separate exponent restrictions and divisor-class heuristic. Observed counts are the bars; everything else is a predicted quantity. Full size (912×614) ↗
4.2 The Mersenne edge is different in kind — measurably
On row , restricting to prime exponents and assigning probability gives primes in the window, against observed. For an odd prime exponent , every prime divisor of is and ; is a separate small case. Wagstaff's heuristic [6] assigns probability approximately , where for and for . Summing over prime with gives (unrounded, ), against the 11 observed. Interior divisors obey the shifted-progression rule (3); their joint correlations require further analysis.
4.3 Prime exponents: a descriptive comparison
Lemma 2 says no exponent is disqualified algebraically. Whether prime exponents are nonetheless favored is a separate, empirical question. Split every interior cell of the census domain (, ) by the primality of its exponent and normalize each group by its summed sieve-adjusted expectation:
exponent
cells
observed
expected
prime
20,846
108
109.0
composite
125,790
345
375.6
The expectation-normalized rate ratio (prime exponents : composite exponents) is , using unrounded expectations; an approximate log-Wald calculation under an independent-Poisson reference gives , or . The normalized rates of the two groups thus differ by about 8% in this domain. Composite exponents yield large primes too: has exponent and has — primes of many thousands of digits in cells that have no counterpart on the Mersenne row, where such exponents are excluded outright.
4.4 Cells prime on both faces
When both faces of a cell are prime, is a twin-prime pair in which each member has a completely factored neighbor — so the Lucas and Pocklington criteria apply to the two members using the same known factorization. Over the census domain, 22 cells are prime on both faces, at
the largest being , of 476 digits each. Twenty-one of the 22 lie at ; the twenty-second is , which the next paragraphs treat separately.
How many a heuristic expects, and where the heuristic stops. Both faces of a cell avoid every prime by construction: , so . For the model assumes that is uniform over the residues mod , which kills the pair with probability — two forbidden residues rather than one. That assumption is the model's weakest part and is not satisfied here: as runs, moves through a multiplicative orbit mod rather than over all residues, the same dependence §4.1 documents for the single-face sieve. Relative to the local survival fraction for two independently sampled integers, these assumptions give formal correction factors. Multiplying them and attaching the baseline defines the heuristic weight , with the specified logarithm at . This is a model prescription, not a consequence of marginal uniformity alone: it also ignores joint exponent-period correlations and assumes a prime-density interpretation of the local factors. Here
is as in (2), is the twin-prime constant [10] (the product is over primes), and the tail is taken over strictly greater than — so and .
Summed over and every exponent of the domain, (6) comes to 24.31, against the 21 twin cells the census holds at . Two of its terms, at and , exceed 1, so over the whole domain the weights are not probabilities; cells below 100 digits contribute 87% of the sum.
Over the 100–5,000-digit window in which §4.1 operates, (6) gives 3.07 and the census contains 3 — at , and . The whole-domain sum adds over the 146,685 cells with , and . The window sum uses the 144,694 cells that also satisfy . Both faces lie within these bounds at the same coordinates on these fifty rows. With defined by its convergent product and the logarithm taken at , both finite sums are specified independently of an implementation.
Row is excluded from both sums: , so requires prime and requires a power of two. Only meets both, and it is prime on both faces — the pair . Algebra fixes row 1 at exactly one twin cell, which is what the census finds, and the generic sum over the entire row is undefined: its term divides by . Searches outside the census domain have since found further such cells at larger ; they are catalogued separately and are not part of the count above.
4.5 The plus face
The second kind is not a Mersenne generalization — it lives in the branch of the genus — but it is the same grid seen from the other face, and the structure transfers wholesale: it satisfies the same Proposition 1 (with in place of ); Lemma 2 holds verbatim ( is irreducible for all when is squarefree , by the same Eisenstein argument applied to the reciprocal polynomial), so its interior has no algebraically dead cells either; and it is proven by Pocklington's test instead of the Lucas test. Its classical edges mirror the first kind's: the column is the Euclid numbers (Caldwell–Gallot [8]), and the row, , is, like the Mersenne row, algebraically gated — for odd, so only (the Fermat numbers) survive. Both faces thus have exactly one exceptional edge each () and fully live interiors.
The sieve-adjusted model of §4.1 draws no distinction between the two faces. Over the same grid (, all to 5,000 digits) the plus face holds 484 proven primes, and every other cell is witnessed composite as described at the head of §4. In the 100–5,000-digit window the plus face has 357 primes against a predicted 361.8 (, counting the boundary cell at exactly 5,000 digits, which Revision 2.0 omitted), and the minus face 344 against the same expectation (). Fig. 3 shows the two counts row by row.
The sweep also nearly doubled the family's inventory of proven primes, which is §2.3 in practice: each of its 470 probable-prime candidates was carried through to a deterministic Pocklington proof in the same run, so its output was a list of proven primes rather than a list of leads; the stored certificates came later (§5.2). The largest members of the plus-face census are (5,000 digits), (4,900) and (4,873).
Prime counts on the two faces. Observed primes per order in the 100–5,000-digit window of the census domain: minus face and plus face side by side, with the shared sieve-adjusted expectation of §4.1 as a line. The two faces are swept over the same grid, so the bars are directly comparable. Full size (853×578) ↗
4.6 Limiting density: an open question
Mertens' theorem gives for the sieve-only factor. Three further questions are left open here: a prime-count asymptotic along a fixed row as ; the convergence of the dependent row correction as the sieving bound grows; and the limit of the row corrections as . Neither finite product evaluations nor Mertens' theorem settles them. The claims and made in Revision 2.1 are withdrawn: they were inferred from products of marginal survival factors, which §4.1 shows need not equal joint survival fractions.
Two approaches do not settle them. Randomizing the coefficient studies a different population from the fixed primorial coefficients, and the census comparisons reuse the data that motivated the heuristic. A prospective comparison, with its model and domain fixed before the verdicts are inspected, would test the heuristic out of sample, though no finite agreement proves an asymptotic law; none is reported here.
5. Searching at scale
The properties of §2–3 assemble into a pipeline in which discovery and proof are the same pass:
Sieve. For fixed , mark exponents killed by primes via the rolling recurrence against the target residues of (3) — one pass per , both faces simultaneously if desired. A hit removes only when is a proper divisor; a candidate equal to is itself prime.
PRP. Survivors take one base-2 Fermat test, followed by a BPSW check.
Certificate. A survivor of step 2 is a candidate, not yet a prime. The full-factor Lucas criterion on the face, or Pocklington's criterion on the face (§2.3), is then attempted against it; on the face in the one-ladder regime that is the single ladder of Theorem 3 with a seed that must succeed, and below the regime it is the multi-factor certificate of Remark 3. A value enters the record only when the applicable criterion returns a certificate, and that certificate is stored and replayed. The known factorization makes such a certificate available for every prime; step 2 alone never settles the question.
A conditional first-order count comparison parallels (4). Fix an interior row, a common sieve depth , and a local digit window containing many exponents and candidates above . Model the joint sieve survival by — the uniform-residue model, an assumption that Mertens' formula alone does not supply, since exponent periods are dependent — and the prime density by . The modeled survivors then number and the modeled primes , so the modeled number of candidates per prime, , does not depend on the row to this order. The Mersenne row has separate exponent restrictions and the separate model of §4.2.
5.1 The first forward campaigns (July 2026)
These are campaign results, not census results. The searches below target chosen rows and large exponents; their results outside the census domain are excluded from §4. The table also repeats the in-domain boundary prime from §4.5, counted once in that census. Each value listed was proved prime in the run that found it, by a deterministic or routine; the stored certificates on which the catalogue now lists these values were generated and replayed later (§5.2). The first forward campaigns ran in July 2026 on a single desktop computer with GMP arithmetic (through gmpy2) and produced:
number
digits
face
note
18,664
largest of these campaigns; first prime found in row 's plus face
11,912
largest minus-face prime of these campaigns; exponent
10,988
10,263
exponent
6,691
6,230
5,286
5,076
5,047
exponent
5,000
largest of the census (§4.5)
The first prime in rows beyond . For each new row we searched upward from until a prime appeared, and proved it. The result is the first prime found in that row. Every smaller exponent was screened by a gcd with small primes or by Fermat and BPSW tests, whose failures are compositeness witnesses, but the searches kept no record of the witnesses and would have passed over a candidate whose proof failed; calling the result the row's smallest prime exponent therefore needs separate evidence (§6, open problem 4). For on the minus face, the programs described under Data and code availability supply it. The search was run for every and for milestone rows : fifty-six first-of-row primes, every one of them proven, from ( digits) to
the latter found after 856 Fermat tests ( minutes on one core) and proven in 16 s by the Lucas criterion with the single factor of , which suffices because its exponent lies above the one-ladder threshold . The first prime of row (, digits) falls below its threshold and was proved with the multi-factor form of Remark 3 (115 s). The same campaign on the face opened all fifty-six rows as well and produced the largest prime of these campaigns — later searches have gone well past it: row 1000's face resisted until — Fermat tests, under five hours on one core — yielding with digits, proven by Pocklington in 24 s and confirmed by a 50-round Miller–Rabin control. These first exponents vary substantially across rows: half of the rows reach their first prime by on the minus face and by on the plus face, while row 100, for instance, resists until ( digits). A single big-integer gcd against the product of all primes to served as the entire trial-division stage for these searches; since no prime up to divides a member of row , it can find only factors between and .
For the -digit record, the base-2 Fermat test and the BPSW check together took 31 s, the one-ladder proof 17.7 s (seed , first try) and the equivalent -based BLS routine 55.6 s — about 0.57 and 1.79 times the screening time; all three verdicts, plus a 50-round Miller–Rabin control, agree. For the six 5,001–7,000-digit row-faces at on both faces, the first-order finite sum of §4.1 gives 3.6 against 5 found. For the 10,000–12,000-digit windows on the minus face at , it gives 1.0 against 3 found; the plus-face census window of §4.5 gives 361.8 against 357; and the 20,000–26,000-digit minus-face probe of row 50 gives 0.47 against none; the windows were selected differently. Equation (4) is a leading approximation to these finite sums.
5.2 The catalogue and its releases
§4 is a census over one fixed domain and §5.1 is one pair of campaigns. Neither is the project's accumulated record, which grows with every search and is therefore not restated here. It is published as two versioned data releases, and a figure drawn from them should be cited with the version stamp the files carry.
The catalogue of proven primes (yagelnumbers.org/primes, machine-readable at yagelnumbers.org/data/primes.json) lists a value only when it carries a stored certificate that replays against its own coordinates. The criteria are the two of §3 and §4.5 — Lucas on the minus face, Pocklington on the plus face — with trial division below . A certificate that names an integer other than the one its coordinates define is rejected, not reinterpreted. The method under which an older value was originally found is history, not the grounds on which it is published.
The index (yagelnumbers.org/data/index.json) records, for each row and face, the exponent ranges in which every cell is decided — each prime by its certificate, every other cell by a compositeness witness of the kinds described at the head of §4. Inside such a range a cell that is not a listed prime is composite because it was witnessed, not because it is absent from the list; outside every such range, and with no certificate of its own, a cell is unknown. The calculator at yagelnumbers.org/datasets answers from the same rule, and reports as neither prime nor composite.
What a count of primes is not. A total of proven primes is not a claim about the regions they were found in. Much of the catalogue comes from targeted searches over chosen rows and exponent windows, and a prime found at one exponent says nothing about its neighbors; coverage is what the index states, range by range, and nothing more.
6. What the grid is, and is not
It is not a complexity breakthrough, and its test is not new. With fast modular arithmetic, Fermat, a fixed number of Miller–Rabin rounds, Lucas–Lehmer, and one Theorem 3 trial with a supplied seed each cost , the search for successful witnesses aside. Theorem 3 is a specialization of Jakhar–Ram's criterion [19] and belongs to the classical family of criteria [12–20]. The Mersenne edge keeps its divisor-class enrichment (§4.2) and its particularly simple shift-and-add reducer; Proposition 4 gives the interior an schoolbook radix- reducer, linear for a fixed row.
It is the canonical two-parameter interpolation between the Mersenne and primorial families — canonical in the sense of §2.1: each prime base carries the least coefficient giving Proposition 1 — with four universal gifts: a maximal built-in sieve (Proposition 1), polynomial irreducibility in the interior (Lemma 2) and no cheap coverings (Lemma 2′), a certificate for every prime ever found in it (the full-factor Lucas and Pocklington criteria of §2.3) — resting on a neighbor that is factored by construction at every cell (§2.3) — and fixed-row linear-time reduction for values already in radix (Proposition 4). Its census statistics are descriptive (§4) and motivate further study (§4.6). And the evidence has a boundary worth stating plainly: every prime reported here was proven, and its certificate re-checked, by this project's own implementations. Replay in a second system covers a sample of the catalogue, not all of it, and external recertification by an independent party has not been carried out. Apart from the two programs that prove the published terms of A400659 (Data and code availability), no proof archive or verifier is published.
Open problems.
Uniform reduction cost: with representation, modulus preprocessing and conversion costs specified, can reduction of products modulo be made with a constant independent of the row? Proposition 4 gives a schoolbook upper bound. A related implementation question is efficient radix- or weighted-transform arithmetic for large coefficients.
Covering systems: Lemma 2′ excludes periods 1 and 2 and no row is covered by the primes to , but whether any row is barren remains open. By (3) each prime excludes at most one class of exponents modulo , and the primes of order are the prime factors of the single number that do not divide , so the classes available to a covering with modulus are read off the factorization of .
Explicit seeds without search: can one specify, for each row, a trace rule that succeeds for every prime candidate in the one-ladder regime? Theorem 3 already permits exhaustive deterministic residue search, and reciprocity-based criteria give explicit seeds for particular families under additional hypotheses [13, 15, 18].
The and frontiers: the primorial-prime column is classical [7, 8]. Beyond the census domain, the smallest prime exponent of a row is known only where the index (§5.2) records every smaller exponent as decided; the first primes found beyond (§5.1) are not claimed to be the smallest.
Twin records within the family: both members of any twin cell admit deterministic certificates using their common factored neighbour. Which rows and exponent ranges should be searched for larger twins? The largest census pair has 476 digits per member (§4.4).
Scientific errata
This section records the corrections since Revision 1.0 that change a stated result or procedure; corrections of wording, or of a printed value that changes no conclusion, are not listed. The PDF of Revision 1.0, in its February 2025 edition, is preserved uncorrected and is not the current edition.
Revision 2.1 (September 2026).Six census cells recorded as composite are prime. A BPSW re-test of every cell of the 2024 census found and (35 and 36 digits; row 19 opens at ), , , and (3,563 to 4,761 digits) to be prime. All six are proven and counted in §4, which moves the minus-face census total from 476 to 482.
Revision 2.2 (September 2026).
Marginal survival factors were multiplied as if independent. Exponent periods modulo different primes share factors, so the product is not the joint survival density. §4.1 gives exact finite-sieve counts instead; the refined fits and -scores that rested on the product are withdrawn.
The order argument of §3 used a root ratio in place of a root. Modulo 7 with , while , so the ratio does not carry the argument; §3 now works with itself.
The seed-success fraction omitted the excluded traces. It is , not (proof of Theorem 3).
Revision 2.3 (September 2026).
Figure 4 is withdrawn. It plotted the per-row products of erratum 2.2.1 as prime-count constants; no limiting constant is established (§4.6).
The plus-face census total is 484, not 470. Fourteen plus-face primes of 1 to 5 digits at were missed: each is itself a prime below the sweep's sieve limit, and the exponent sieve discarded it as divisible by itself. None lies in the window of §4.5.
Revision 2.4 (September 2026).
The census domain has 163,294 cells per face, not 163,259, and , which is neither prime nor composite, had been counted as composite. The smaller figure was the 2024 sweep's stored extent, 1 to 3 exponents short of the cap on some rows.
The census composite verdicts were stated as settled. They rested on the 2024 sweep's classifications, six of which proved wrong (Revision 2.1). Since Revision 2.6 every cell of the domain on both faces, save , carries a prime certificate or a compositeness witness computed from its own coordinates, and the published index declares each verdict (§4).
PRP survivors were described as immediately proven. A survivor is a candidate until a criterion of §3 returns a certificate, which may need another seed or the multi-factor form; the grid supplies the factored neighbor, not every hypothesis of the criteria.
A rate-ratio interval was given 95% coverage and read as showing no exponent effect. The interval of §4.3 carries no coverage claim, and no conclusion about an exponent effect is drawn.
Revision 2.5 (September 2026).An irreproducible twin expectation is withdrawn. §4.4 compared the 22 twin cells with 27.2 expected, a figure from an unpublished July 2026 note whose model also gave row 1 about 3.5 pairs, where algebra allows one. The bounded sum (6), recomputable from its printed specification, replaces it: 24.31 against 21 at , and 3.07 against 3 in the window.
Revision 2.6 (September 2026).A campaign record was called the minus face's largest prime., of digits, was the largest minus-face prime of the July 2026 campaigns; larger ones were already catalogued.
Revision 2.8 (October 2026). Every mathematical statement of the paper was rechecked against its proof, its cited source or an independent computation. No primality verdict or census count changed, and Proposition 1, Lemmas 2 and 2′ and Theorem 3 stand as stated. Statistical comparisons that earlier revisions presented as fits are now stated as descriptive diagnostics (§4). Corrections:
Remark 3 lacked a shared discriminant. The multi-factor Lucas certificate needs one discriminant for all carried factors; read with an independent seed per factor, the earlier text passes the composite . The catalogue's certificates have always used one .
Theorem 3′ misstated which seeds it excludes. Its condition, a seed "that is not a -th power", concerns -th powers in the norm-one group, not the integer ; the theorem is now stated for admissible traces with .
Proposition 4 understated the reduction work. For inputs already in radix the fold costs bit operations by schoolbook division, with the bit length of ; the Montgomery form needs a bounded second fold and a final subtraction, so neither reduces a product with one multiplication by alone.
Appendix A ignored failed proofs. Algorithm 2 recorded a value as prime whatever its proof returned, and Algorithm 3 could report a passed-over exponent as the least; both now handle failed and inconclusive outcomes.
Counts. The abstract now counts the five Fermat primes of the plus face's first row among the proven cells. In §5.1 the 5,001–7,000-digit comparison covers six row-faces with 3.6 expected, not nine with 5.4.
Withdrawn. A fixed ratio of proof cost to Fermat-test cost; the statement in §1 that prime exponents give the interior no advantage; a geometric law for the first prime exponent of a row; the statements that the predictions of (4) and of the plus-face model preceded the searches; the yield forecast for larger twins; and the claim that the paper's listed consequences appear for the first time — row 2 is a case of Williams's family [12].
Methods of record. The forward campaigns proved their minus-face primes with the -sequence form of the Lucas criterion, not with Theorem 3's ladder, and Remark 5's ladder validation covered 376 of the 476 dataset primes and 17 of the 100 composite controls, not all of them.
What the claims below establish
Claim
Type and hypotheses
Support
What it does not establish
Maximal built-in sieve; least coefficient for its congruences
Theorem; positive coefficient, prime base,
Proposition 1 and §2.1
Minimality for coprimality alone: smaller coefficients can avoid the same primes, e.g.
Irreducibility in the exponent
Theorem; squarefree
Lemma 2, by Eisenstein
Absence of numerical coverings; infinitude of primes in a row
One-ladder certificate
Theorem; odd, , coprimality and the size bound
Theorem 3
Anything about a seed that fails (ii); the classical edge is separate
A runtime law for sequential seed search, which is not uniform
Finite sieve counts
Exact counts over a stated period or window
§4.1
An infinite prime-count constant
Row-count comparisons
Retrospective model diagnostics over a dated domain
§§4.1–4.5
A Poisson law; calibrated uncertainty under dependent exponents
Limiting prime counts
Open
§4.6
No limiting constant is claimed
Catalogue proof methods
Recorded computational outcomes
The published catalogue
A published proof archive, or complete independent recertification
Census domain verdicts
Complete enumeration of a fixed domain: a replayed certificate for each prime, a compositeness witness for every other cell but
§4, the published index
Anything outside the domain; checks of the witnesses by a party other than this project
Formal twin-model sums
Specified local-factor weights over the whole census interior and its digit window; row 1 excluded
§4.4, eq. (6)
A calibrated cell probability, yield forecast or uncertainty law
Catalogue and coverage
Versioned data releases, not restated in this paper
§5.2, the published files
Exhaustiveness beyond the ranges the index declares; a count of primes is not coverage
Data and code availability
What a reader can obtain today. The catalogue of proven primes is published at yagelnumbers.org/data/primes.json, giving for each prime its order, exponent, face, digit count and the criterion its proof used. The per-order primality index, which carries the settled exponent ranges behind the composite verdicts, is at yagelnumbers.org/data/index.json. Any individual value can be recomputed and looked up at yagelnumbers.org/datasets. Each file carries a version stamp. The catalogue and the index grow with every search, so this paper does not copy their totals; a figure taken from them should be cited with the version it was read from.
What is not published. The certificates themselves — the witness data for each proof — the compositeness witnesses, and the search, proving and analysis code are held with the project and are not distributed. Outside the sequence below, a reader therefore cannot re-run a proof from published material alone, and the results here rest on this project's own implementations. Appendix A specifies the algorithms in enough detail to reimplement them independently.
The first prime of each order. The least exponent at which is prime is OEIS A400659 [22] (the entry indexes by the order, so its letters are the reverse of this paper's). Two self-contained programs, one in PARI/GP and one in Python with its own arithmetic, are published at yagelnumbers.org/oeis/A400659. They need no project data: for each term they show every smaller exponent composite by an explicit witness — except that for the first term the only smaller exponent gives , which is neither prime nor composite — and prove the term prime by a Lucas test in the Brillhart–Lehmer–Selfridge form [1], using the factorization of that the construction supplies. The minus face itself, read by antidiagonals, is OEIS A401136 [23], whose is this paper's ; its terms involve no primality statement, and two programs at yagelnumbers.org/oeis/A401136 recompute them from the definition.
The paper (text and figures), the catalogue and the dataset are released under the Creative Commons Attribution 4.0 license (CC BY 4.0) — reuse freely with attribution.
Acknowledgments
This work was carried out with AI assistance throughout: in the computation, in the verification tooling, in drafting, and in review. Every computed quantity in this paper is backed by a script that recomputes it from the published data or from its stated specification; timings, test counts and other figures recorded by particular runs or quoted from earlier revisions are dated records, which no script recomputes. The mathematical responsibility for the results, and for the corrections recorded in the errata, is the author's.
Appendix A. Algorithms
The pseudocode below states the algorithms in general form; the implementations used Python with arbitrary-precision arithmetic via GMP. The searches of §5.1 proved minus-face candidates with the -sequence form of the Lucas criterion (Remark 3), not with the -ladder of Algorithm 1, which was used in the validation and timing runs of Remarks 5 and 6. The implementations themselves are not distributed — see Data and code availability — so this appendix is a specification to reimplement from, not a pointer to code a reader can obtain. V(c, P, N) denotes the -only Lucas ladder for : state over the bits of , with , . Initialize at and process all bits of : each bit uses one modular square and one modular product, as counted in Remark 4. The case returns 2 directly.
Algorithm 1 — one-ladder certificate for . Require integers , an odd prime , , odd , and . Unsupported inputs are not primality verdicts.
function OneLadder(h, p, n, seed_budget):
validate the preconditions above, otherwise return UNSUPPORTED
N <- h * p^n - 1
for P in 3, 4, ..., 2 + seed_budget:
D <- P^2 - 4
d <- gcd(2*D, N)
if 1 < d < N: return COMPOSITE with divisor d
if d != 1 or Jacobi(D, N) != -1: continue
s <- V(h, P, N)
repeat n times:
prev <- s
s <- V(p, s, N)
if s != 2 (mod N): return COMPOSITE with failed Lucas check
g <- gcd(prev - 2, N)
if g == 1: return PRIME with P and the checked hypotheses
if 1 < g < N: return COMPOSITE with divisor g
# g == N: inconclusive seed; try the next P
return INCONCLUSIVE
The budget counts scanned integers, including rejected traces. A timeout is inconclusive. For prime , a full residue period contains a successful trace, but no bounded-search runtime law is asserted. For , use the separate classical Lucas–Lehmer procedure: gives 1 (neither prime nor composite), gives the prime 3, and a divisor of composite with supplies the proper factor . For prime , start with 4, make exactly updates , and return PRIME exactly for ; otherwise return COMPOSITE with the failed classical test as witness. Below the one-ladder threshold for , use the shared-discriminant general- certificate of Remark 3. Carry whole prime-power factors of , possibly largest-first; add a factor only after its checks succeed. Use the same for all carried factors and require before returning PRIME. Seed failure or budget exhaustion alone returns INCONCLUSIVE.
Algorithm 2 — proven search over a row (§5; either face).
function HuntRow(k, n1, n2, sieve limit L, face e in {-1,+1}):
h <- p_{k-1}# ; p <- p_k
alive[n1..n2] <- true
for each prime q in (p_k, L]: # sieve: shifted APs (3)
t <- -e * h^{-1} mod q # p^n = t (mod q) => q | h p^n + e
r <- p^{n1} mod q
for n = n1..n2:
if r == t and h*p^n + e > L^2: alive[n] <- false
r <- r * p mod q
for n = n1..n2 where alive[n]:
N <- h * p^n + e
if 2^{N-1} != 1 (mod N): continue # Fermat, base 2
if not BPSW(N): continue # PRP confirmation
prove: e = -1 -> Algorithm 1 (N+1 side) # cost depends on witnesses and factor checks
e = +1 -> Pocklington on N-1 # per prime q | N-1 a base a_q with
# a_q^(N-1) = 1 (mod N), gcd(a_q^((N-1)/q) - 1, N) = 1
if PRIME: record proven prime (k, n, e) with its certificate
else if COMPOSITE: continue # the proof step found a witness
else: record (k, n, e) as undecided # never a verdict
Algorithm 3 — first prime of a row (§5): iterate with a single big-integer screen gcd(N, Q#) where Q# = product of all primes <= 10^5 in place of the sieve (a gcd strictly between 1 and is a compositeness witness; when the gcd equals itself, is a product of primes up to and is decided exactly), then proceed as in Algorithm 2. Stop at the first whose value is proven prime, or report the first whose proof is inconclusive as undecided. Every smaller exponent then carries a compositeness witness, except on the first kind's row , where gives , which is neither prime nor composite; so a proven value is the row's least prime exponent.
References
[1] J. Brillhart, D. H. Lehmer, J. L. Selfridge, New primality criteria and factorizations of , Math. Comp. 29 (1975), 620–647.
[2] H. Riesel, Prime Numbers and Computer Methods for Factorization, 2nd ed., Birkhäuser, 1994.
[3] M. A. Morrison, A note on primality testing using Lucas sequences, Math. Comp. 29 (1975), 181–182.
[4] H. C. Pocklington, The determination of the prime or composite nature of large numbers by Fermat's theorem, Proc. Cambridge Philos. Soc. 18 (1914–16), 29–30.
[5] Ö. J. Rödseth, A note on primality tests for , BIT 34 (1994), 451–454.
[6] S. S. Wagstaff, Jr., Divisors of Mersenne numbers, Math. Comp. 40 (1983), no. 161, 385–397.
[7] H. Dubner, Factorial and primorial primes, J. Recreational Math. 19 (1987), no. 3, 197–203.
[8] C. K. Caldwell, Y. Gallot, On the primality of and , Math. Comp. 71 (2002), no. 237, 441–448.
[10] G. H. Hardy, J. E. Littlewood, Some problems of 'Partitio numerorum'; III: On the expression of a number as a sum of primes, Acta Math. 44 (1923), 1–70.
[11] J. B. Rosser, L. Schoenfeld, Approximate formulas for some functions of prime numbers, Illinois J. Math. 6 (1962), 64–94.
[12] H. C. Williams, The primality of , Canad. Math. Bull. 15 (1972), 585–589.
[13] W. Bosma, Explicit primality criteria for , Math. Comp. 61 (1993), no. 203, 97–109.
[14] P. Berrizbeitia, T. G. Berry, Cubic reciprocity and generalised Lucas–Lehmer tests for primality of , Proc. Amer. Math. Soc. 127 (1999), no. 7, 1923–1925.
[15] P. Berrizbeitia, T. G. Berry, Biquadratic reciprocity and a Lucasian primality test, Math. Comp. 73 (2004), no. 247, 1559–1564.
[16] A. Stein, H. C. Williams, Explicit primality criteria for , Math. Comp. 69 (2000), no. 232, 1721–1734.
[17] J. M. Grau, A. M. Oller-Marcén, D. Sadornil, A primality test for numbers, Math. Comp. 84 (2015), no. 291, 505–512 (an earlier version by the first two authors is arXiv:1011.4836).
[18] Y. Deng, D. Huang, Explicit primality criteria for , J. Théor. Nombres Bordeaux 28 (2016), no. 1, 55–74 (arXiv:1306.4456).
[19] A. Jakhar, M. K. Ram, A primality test for numbers, arXiv:2604.18498 (April 2026).
[20] J. M. Grau, A. M. Oller-Marcén, D. Sadornil, A primality test for numbers, Monatsh. Math. 191 (2020), no. 1, 93–101.
[21] H. G. Diamond, J. Pintz, Oscillation of Mertens' product formula, J. Théor. Nombres Bordeaux 21 (2009), no. 3, 523–533.
[22] OEIS Foundation Inc., The On-Line Encyclopedia of Integer Sequences, sequence A400659, oeis.org/A400659.
[23] OEIS Foundation Inc., The On-Line Encyclopedia of Integer Sequences, sequence A401136, oeis.org/A401136.