4

I want to calculate the following product : $$\prod_{p\ prime\ ,\ p\le 10^{10}} 1-\frac{1}{p}$$

I know the approximation formula $$\frac{e^{-\gamma}}{\ln(10^{10})}$$ where $\gamma$ is the Euler-Mascheroni-constant. The result should be good to $12$ decimal digits.

Is there an efficient way (not brute force by determining all primes, which takes long with PARI/GP) to calculate this product with high precision ?

Peter
  • 84,454
  • 1
    http://mathworld.wolfram.com/MertensTheorem.html – Peter Apr 03 '18 at 21:24
  • 1
    https://math.stackexchange.com/questions/630902/is-there-a-good-preferably-comprehensive-list-of-which-conjectures-imply-the-r/630970#630970 – Will Jagy Apr 03 '18 at 22:49

1 Answers1

-1

Call the product $P$, and take logs to get $\log(P)=\sum_{i=1}^n\log(1-1/p_i)=-\sum_{i=1}^n\frac{1}{p_i}-\frac{1}{2}\sum_{i=1}^n\frac{1}{p^2_i}+...\approx-\sum_{i=1}^n\frac{1}{p_i}-\gamma$

So to get a good approximation, use ever-better approximations of $\sum_{i=1}^n\frac{1}{p_i}$. As an example, the Meissel Merten constant is defined as $M:=\lim_{n\rightarrow\infty}\sum_{i=1}^n1/p_i-\ln\ln(n)\approx 0.26149$.

If you're still getting error, you can look into the error for finite sum approximations of $\gamma=\sum_{m=2}^\infty (-1)^m\frac{\zeta(m)}{m}$.

Alex R.
  • 32,771
  • 2
    I do not get good approximations this way for $n=\pi(10^6)$. Please work out examples, perhaps I missed something. Additionally, the sum requires also the primes because the convergence towards Merten's constant is very very slow. – Peter Apr 03 '18 at 21:46
  • You can find a detailed discussion on how to better approximate $B$ to any accuracy here: https://pdfs.semanticscholar.org/0ff0/0f98eb25cbd076cf7a18f85ae51e4b95f618.pdf – Alex R. Apr 03 '18 at 21:54