# Primality testing with Gaussian periods

### Hendrik W. Lenstra, Jr.

Universiteit Leiden, Netherlands### Carl B. Pomerance

Dartmouth College, Hanover, USA

## Abstract

We exhibit a deterministic algorithm that, for some effectively computable real number $c$, decides whether a given integer $n>1$ is prime within time $logn)_{6}⋅(2+loggn)_{c}$. The same result, with 21/2 in place of $6$, was proved by Agrawal, Kayal, and Saxena. Our algorithm follows the same pattern as theirs, performing computations in an auxiliary ring extension of $Z/nZ$. We allow our rings to be generated by Gaussian periods rather than by roots of unity, which leaves us greater freedom in the selection of the auxiliary parameters and enables us to obtain a better run time estimate. The proof depends on results in analytic number theory and on the following theorem from additive number theory, which was provided by D. Bleichenbacher: if $t$ is a real number with $0<t≤1$, and $S$ is an open subset of the interval $(0,t)$ with $∫_{S}dx/x>t$, then each real number greater than or equal to 1 is in the additive semigroup generated by $S$. A byproduct of our main result is an improved algorithm for constructing finite fields of given characteristic and approximately given degree.

## Cite this article

Hendrik W. Lenstra, Jr., Carl B. Pomerance, Primality testing with Gaussian periods. J. Eur. Math. Soc. 21 (2019), no. 4, pp. 1229–1269

DOI 10.4171/JEMS/861