How accurately must I compute the twin prime constant to get the twin prime density?

128 Views Asked by At

Let $\pi _{2}(x)$ denote the number of primes $p\leq x$ such that $p+2$ is also prime. Hardy and Littlewood conjectured that

$$ {\displaystyle \pi _{2}(x)\sim 2C_{2}{\frac {x}{(\ln x)^{2}}}\sim 2C_{2}\int _{2}^{x}{dt \over (\ln t)^{2}}}, $$

where

$$ {\displaystyle C_{2}=\prod _{\textstyle {p\;{\rm {prime}} \atop p\geq 3}}\left(1-{\frac {1}{(p-1)^{2}}}\right)\approx 0.660161815846869573927812110014\dots }. $$

I want to numerically study this density, so I implemented some C++ code that computes the above value for $\pi_2(x)$. However, before launching any computations I want to make sure that I set everything up correctly. In particular, I am unsure about what precision I should use for $C_2$, i.e., the twin-prime constant, in function of my input $x$.

In other words, how many primes should I include within the product for $C_2$ so that I get the correct expected conjectured density for $\pi_2(x)$? For example, if I want to calculate the conjectured density for $\pi_2(10^5)$, should I include all primes $\leq 10^5$ in the product for $C_2$?

1

There are 1 best solutions below

11
On BEST ANSWER

Calculations using Wolfram Alpha give $$C_2(1000)=0.66017,\quad C_2(10000) = 0.660162,\quad C_2(100000) = 0.660162.$$ I think this gives information about accuracy.

On the other hand, $$\int_2^x \dfrac{dt}{\ln^2 t} = \mathrm{li}(x) - \mathrm{li}(2) - \dfrac x{\ln x} + \dfrac 2{\ln2}$$ (see also Wolfram Alpha).