Prime sieves using binary quadratic forms

From MaRDI portal





The problem of listing all the prime numbers up to a fixed bound \(N\) is very old going back, at least, to the classic sieve of Eratostenes. \textit{P. Pritchard} [J. Algorithms 4, 332--344 (1983; Zbl 0546.10004)] posed the question of the existence of an algorithm able to find such a listing using \(o(N)\) operations (loads, stores, comparisons, additions and subtractions of \(O(\log N))\) - bits integers) and \(O(N^{\alpha})\) bits of memory for some \(\alpha < 1\). The present paper gives an affirmative answer to this question. The tool used is the enumeration of the values taken by certain integral binary quadratic forms. As the authors point out, in the language of quadratic forms, the sieve of Eratosthenes can be interpreted as the enumeration of the natural numbers represented by the reducible quadratic form \(xy\). They consider instead some irreducible binary quadratic forms. More concretely they consider the three following quadratic forms: \(4x^2+y^2\) for the primes \(p\equiv 1 \bmod 4\), \(3x^2+y^2\) for the primes \(p\equiv 7 \bmod 12\)\, and \(3x^2+y^2\) for the primes \(p\equiv 11 \bmod 12\)\, (as the authors point out many other choices are possible). The algorithm uses the propriety that, in the three cases, a natural number \(n\) is prime if and only if the number of positive representations \((x,y)\) of \(n\) (and \(x>y>0\) in the third case) is odd. The resulting algorithm uses \(O(N/\log\log N)\) operations and \(N^{1/2+o(1)}\) bits of memory. The authors also point out a later improvement of W. F. Galway that needs only \(N^{1/3+o(1)}\) bits of memory.




Cited in
(28)








This page was built for publication: Prime sieves using binary quadratic forms

Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q4452178)