Two Algorithms to Find Primes in Patterns
Let k> 1 be an integer, and let (f_1(x), ..., f_k(x) ) be k admissible linear polynomials over the integers. We present two algorithms that find all integers x where {f_i(x) }< n and all the f_i(x) are prime. Our first algorithm takes at most O(nk/( n)^k) arithmetic operations using O(k√(n)) space. Our second algorithm takes slightly more time, O(nk/( n)^k-1) arithmetic operations, but uses only O( n/ n) space. This result is unconditional for k>6; for 2<k< 6, the proof of its running time, but not the correctness of its output, relies on an unproven but reasonable conjecture due to Bach and Huelsbergen. We are unaware of any previous complexity results for this problem beyond the use of a prime sieve. We also implemented several parallel versions of our second algorithm to show it is viable in practice. In particular, we found some new Cunningham chains of length 15, and we found all quadruplet primes up to 10^17.
READ FULL TEXT