English

Two Algorithms to Find Primes in Patterns

Number Theory 2021-05-31 v3 Data Structures and Algorithms

Abstract

Let k1k\ge 1 be an integer, and let P=(f1(x),,fk(x))P= (f_1(x), \ldots, f_k(x) ) be kk admissible linear polynomials over the integers, or \textit{the pattern}. We present two algorithms that find all integers xx where max{fi(x)}n\max{ \{f_i(x) \} } \le n and all the fi(x)f_i(x) are prime. Our first algorithm takes at most OP(n/(loglogn)k)O_P(n/(\log\log n)^k) arithmetic operations using O(kn)O(k\sqrt{n}) space. Our second algorithm takes slightly more time, OP(n/(loglogn)k1)O_P(n/(\log \log n)^{k-1}) arithmetic operations, but uses only n1/cn^{1/c} space for a constant c>2c>2. We prove correctness unconditionally, but the running time relies on two unproven but reasonable conjectures. 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 101710^{17}.

Keywords

Cite

@article{arxiv.1807.08777,
  title  = {Two Algorithms to Find Primes in Patterns},
  author = {Jonathan P. Sorenson and Jonathan Webster},
  journal= {arXiv preprint arXiv:1807.08777},
  year   = {2021}
}
R2 v1 2026-06-23T03:11:32.479Z