I'd like to compute, to at least a few digits of accuracy, the constants that arise in Hardy-Littlewood conjecture F / Bateman-Horn conjecture, in particular for just a single quadratic polynomial.
Specifically, consider (for instance) the following number, which arises when studying primes in the polynomial $n^2 + n + 1$:
$$ \begin{align} C_{1} &= \frac{2}{1} \frac{2}{2} \frac{5}{4} \frac{5}{6} \frac{11}{10} \frac{11}{12} \frac{17}{16} \frac{17}{18} \frac{23}{22} \frac{29}{28} \frac{29}{30} \frac{35}{36} \frac{41}{40} \cdots \\ &= \prod_{p \equiv 1 \pmod3}\left(\frac{p - 2}{p - 1}\right) \prod_{p \equiv 2 \pmod3}\left(\frac{p}{p - 1}\right) \\ &= \prod_{p \equiv 1 \pmod3}\left(\frac{1 - 2/p}{1 - 1/p}\right) \prod_{p \equiv 2 \pmod3}\left(\frac{1}{1 - 1/p}\right) \\ \end{align}$$ where the products run over all primes that leave remainder $1$ and $2$ when divided by $3$, respectively. (Note: we cannot really write it as two separate infinite products; the order matters, so excuse the notation.)
Now, if I try to compute this the naive way:
#include <cstdio>
#include "FJ64_16k.h" // For a fast `is_prime` function: http://ceur-ws.org/Vol-1326/020-Forisek.pdf
int main() {
double ans = 0.5;
for (uint64_t p = 0; ; ++p) {
if (p % 1000000 == 0) {
printf("%lld %.9f\n", p, ans);
}
if (!is_prime(p)) continue;
if (p % 3 == 1) ans *= (p - 2.0) / (p - 1.0);
if (p % 3 == 2) ans *= p / (p - 1.0);
}
}
Then even after computing with primes up to 100 million, we seem to have only have about four decimal digits of accuracy:
99000000 1.120724721
100000000 1.120725012
101000000 1.120727310
For another example, if we start with the polynomial $n^2 + 5n + 1$ (discriminant $21$), then we need to compute (something like) the constant $$C_2 = \prod_{p \in P_1 \cap Q_1 \cup P_2 \cap Q_2} \frac{(p-2)}{(p-1)} \prod_{p \in P_1 \cap Q_2 \cup P_2 \cap Q_1} \frac{p}{(p-1)} $$ where $P_1 = \{p \equiv 1 \pmod 3\}$, $P_2 = \{p \equiv 2 \pmod 3\}$, $Q_1 = \{p \equiv \text{$1$, $2$, or $4$}\pmod 7\}$, $Q_2 = \{p \equiv \text{$3$, $5$ or $6$}\pmod 7\}$ which is messier: we do one thing for $p \equiv 1, 4, 5, 16, 17, 20\pmod 21$ and another for $p \equiv 2, 8, 10, 11, 13, 19$.
Question: How can we compute these constants reasonably quickly?
I have seen the related questions on MathOverflow, and tried to read their answers and some of the mentioned references:
Calculating the infinite product from the Hardy-Littlewood Conjecture F (2010)
Calculating the constant in the Bateman-Horn-Stemmler conjecture (2011)
High precision computation of Hardy-Littlewood constants (DVI) by Henri Cohen
Some Constants from Number Theory (2001?) (PS) by Pascal Sebah and Xavier Gourdon
Approximation of singular series and automata (2001), by Pieter Moree
New quadratic polynomials with high densities of prime values (2003), by Jacobson and Williams
Quadratic Polynomials which have a High Density of Prime Values (1990) by Fung and Williams
On the Conjecture of Hardy & Littlewood concerning the Number of Primes of the $n^2 + a$ (1960), by Shanks
Supplementary data and remarks concerning a Hardy-Littlewood conjecture (1963), by Shanks
The calculation of certain Dirichlet series (1963), by Shanks and Wrench
Note on the number of primes of the form $n^2 + 1$ (1922) by A. E. Western
Some problems of ‘Partitio numerorum’; III: On the expression of a number as a sum of primes (1923), Hardy and Littlewood (the source of Conjecture F)
But the papers take quite a lot of effort for me to follow (I've never encountered Dirichlet L-series before, for example), and I keep suspecting there should be something simpler, if we don't want so much. (The older papers are simpler, but Western's paper simply says “by the use of a transformation suggested by Mr. Littlewood” without a reference or explaining anything.) In particular, I don't care about getting thousands of digits, I'll be happy if I can get, say six (ten would be fantastic). (Or even 4 digits, if they can be computed a lot faster.) And I don't care about computing such series that arise out of really large numbers; like the $3$ and $7$ in the second example above I might have at most two-digit factors.
With these looser constraints, is there something simpler that suffices, to compute these constants? What I'm looking for is either:
- ideally, a method of computation with sufficient detail, and which can be translated into a few lines of code that compute it from scratch (as in the program above) (after some reasonable amount of work on paper if necessary),
- or, the same, but it's ok to rely on certain constants (like $\zeta(2)$ say) that I can just look up and hard-code into the program, or on some existing functions (such as the logarithmic integral say), if they are well-known functions commonly available (in software libraries that are easy to install or have an online interface).
I'm looking for an elementary exposition at undergraduate level, say. For instance, the answer by KConrad makes sense (though it's not clear how good the convergence is), but I don't know how to compute $L(1,\chi_D)$.