Abstract: We develop an algebraic framework over arbitrary quadratic fields L=Q(D) to generalize the Miller-Rabin primality test. Consequently, we present a deterministic primality test for integers of the form N=cDkp<sup>ℓ</sup>−1 that requires only a single modular exponentiation and achieves a computational complexity of O~(log<sup>2</sup>N). Furthermore, we also establish an analogue of Korselt's criterion within this setting. Finally, computational data generated using SageMath confirm its efficiency, successfully establishing the primality of numbers in the associated quadratic field within milliseconds.
The paper presents a deterministic primality test for Kpℓ-1 numbers, generalizing classical tests through quadratic field methods.
It leverages group structures and cyclotomic criteria to certify primality and detect pseudoprime and Carmichael properties.
Algorithmic results, including SageMath implementations, demonstrate scalability and extend Lucas-Lehmer and Proth test methodologies.
Deterministic Primality Testing for Numbers of the Form Kpℓ−1 via Quadratic Fields
Introduction and Motivation
The development of efficient deterministic algorithms for primality testing remains a pivotal concern in computational number theory, particularly for integers of special algebraic forms. While the Miller-Rabin test provides a probabilistic framework and the Lucas-Lehmer test gives deterministic criteria for Mersenne numbers, extending deterministic primality tests to more general families is of sustained interest. The present paper introduces a deterministic primality test for integers of the form N=cDkpℓ−1, leveraging the structure of unitary groups over arbitrary quadratic fields L=Q(D).
The approach generalizes previous results that focus on specific forms such as Apn−1 and Kpn+1, encompassing classical Lucas-Lehmer, Proth, and Lucasian-type tests, and substantially enlarges the algebraic toolkit available for primality assessments by allowing arbitrary quadratic base fields and composite multipliers. The results also produce analogues of classical criteria (Korselt's criterion) for Carmichael numbers in the new setting.
Algebraic Framework and Group Structure
A central innovation is constructing the group GN(D) associated to the ring of integers in L modulo N:
For D≡2,3(mod4), Gn(D)={a+bD:a2−Db2≡1(modn)}.
For N=cDkpℓ−10, N=cDkpℓ−11 with N=cDkpℓ−12.
The order of N=cDkpℓ−13 (with N=cDkpℓ−14 prime) is shown to be N=cDkpℓ−15, where the Legendre symbol controls the value. Notably, for primes N=cDkpℓ−16 with N=cDkpℓ−17, the group is cyclic of order N=cDkpℓ−18; this fact underpins the subsequent cyclotomic criterion for primality.
An analogue of Euler's totient function (N=cDkpℓ−19) is exploited to study pseudoprimality, Carmichael characteristics, and Korselt-type criteria.
Main Results: Cyclotomic Primality Criterion
The paper’s principal theorem states: For L=Q(D)0 with appropriate coprimality and quadratic residue conditions, L=Q(D)1 is prime if and only if for some L=Q(D)2,
L=Q(D)3
where L=Q(D)4 is the L=Q(D)5-th cyclotomic polynomial.
A strengthened version (Generalized Lucasian Certificate) provides a sufficient condition: If there exists L=Q(D)6 with
L=Q(D)7,
L=Q(D)8,
then L=Q(D)9 is provably prime.
These theorems extend the logic of the classical Lucas-Lehmer and Proth tests: the cyclotomic condition extracts the existence of a primitive element of suitable order, but now inside a quadratic extension ring rather than simply the multiplicative group modulo Apn−10.
A quadratic field analogue of the Miller-Rabin criterion is also proved: for odd prime Apn−11 with Apn−12, Apn−13 or Apn−14 for some Apn−15. Failure of these conditions certifies compositeness.
Algorithmic Realization and Complexity
Algorithm 1 implements this approach, replacing the search for primitive roots in finite fields by elements of order Apn−16 in Apn−17. Noteworthy algorithmic features:
Base selection: For prime Apn−18, an invertible element Apn−19 can be generated efficiently via random Kpn+10, using Kpn+11.
Cyclotomic check: Reduces to checking Kpn+12 with Kpn+13 for some Kpn+14.
Complexity: For fixed Kpn+15 and Kpn+16, the algorithm is deterministic and has bit complexity Kpn+17, leveraging fast modular exponentiation and group operations in the quotient ring.
Extensions: Pseudoprimes, Carmichael Numbers, and Korselt's Criterion
Defining Kpn+18-pseudoprimes and Kpn+19-Carmichael numbers generalizes the familiar concepts:
GN(D)0 is a GN(D)1-Carmichael number if and only if it is square-free and for every GN(D)2, GN(D)3.
These generalizations have concrete compositeness-detecting power: failure of the appropriate group identity for any base GN(D)4 implies GN(D)5 is composite.
Numerical Results
Implementation in SageMath demonstrates practical feasibility. The deterministic test primes instances up to several hundred bits for a range of quadratic fields (GN(D)6) in milliseconds, illustrating scalability and broad applicability to GN(D)7 sequences.
Theoretical Implications and Future Directions
The results illustrate that quadratic field methods and cyclotomic polynomials induce a framework rich enough to:
Extend fast deterministic primality certificates to large classes well beyond Mersenne and Fermat numbers.
Clarify the algebraic structure behind existing ad hoc Lucas-Lehmer-type approaches through group-theoretic and field-theoretic analysis.
Offer a pathway for analogous criteria for higher-degree fields (bicubic, etc.) by generalizing the notion of the group GN(D)8.
Potential applications may arise in cryptographic key generation, primality proving for primes of special forms used in discrete logarithm cryptosystems, and theoretical analysis of pseudoprime distributions with respect to quadratic field units.
Further work may include:
Extending the technique to arbitrary Galois extensions and multi-variate recurrence sequences.
Studying the distribution and density of GN(D)9-Carmichael numbers.
Integrating these criteria with fast compositeness-proving filters for cryptographic pipelines.
Conclusion
The paper provides a rigorous extension of deterministic primality tests for numbers of the form L0, utilizing group structures in quadratic fields. By encapsulating the test in a unitary group and employing cyclotomic criteria, the authors present an approach that unifies and generalizes prior Lucasian and Proth-type results, supports efficient implementation, and opens avenues for further theoretical and algorithmic developments in algebraic primality testing and its applications.