Can Mathematica Sum or Multiply over the set of all primes?
I can get an estimate of my question in the title with:
Product[1 + 1/p^2, {p, Prime[Range[1000]]}] // N
Can Mathematica return the exact value?
Answer of Wolfgang
I place my answer here, as it was not given in the reference quoted and there is no other entry space.
The answer in your case is yes: simply write down what you want
Product[1 + 1/Prime[k]^s, {k, 1, \[Infinity]}]
(* Out[2]= Zeta[s]/Zeta[2 s] *)
And, specifically, for s = 2 we have
Zeta[2]/Zeta[4]
(*
Out[154]= 15/\[Pi]^2
*)
% // N
(*
Out[153]= 1.51982
*)
Your Approximation
Product[1 + 1/p^2, {p, Prime[Range[1000]]}] // N
(*
Out[146]= 1.5198
*)
is close to the exact value.
If you wish, you can prove the formula for the product analytically.
Let
$\eta (s)=\prod _{p} \left(1+\frac{1}{p^s}\right)$
and consider the Riemann zeta function Zeta[s], defined by
$\zeta (s)=\prod _p \frac{1}{1-\frac{1}{p^s}}$
Hence
$\frac{\eta (s)}{\zeta (s)}=\prod _p \left(1+\frac{1}{p^s}\right) \left(1-\frac{1}{p^s}\right)=\prod _p \left(1-\frac{1}{p^{2 s}}\right)=\frac{1}{\zeta (2 s)}$
Whence
$\eta (s)=\frac{\zeta (s)}{\zeta (2 s)}$