11

6

When I input
$$
\prod _{p=2}^{\infty } \text{If}\left[\text{PrimeQ}[p],\frac{p^2+1}{p^2-1},1\right]
$$
in *Mathematica 12.0*, it gives out the value $1$.

The result is ridiculous, for that according to numerical evaluation we have

In fact, after some analysis we can find out the analytical result $\displaystyle \prod_p \frac{1+p^{-s}}{1-p^{-s}}=\frac{\zeta(s)^2}{\zeta(2s)}$, so that $ \displaystyle \prod_p \frac{1+p^{-2}}{1-p^{-2}}=\frac{\zeta(2)^2}{\zeta(4)}=\frac{\left (\frac{\pi^2}{6}\right )^2}{\frac{\pi^4}{90}}=\frac{5}{2}$

I am wondering that if it is my fault (e.g. wrong input method) or a **bug** in *mathematica 12.0*.

it seems to have to do with the upper limit being $\infty$. Since doing something like

`Product[If[PrimeQ[p], (p^2 + 1)/(p^2 - 1), 1], {p, 2, 100000}] // N`

gives`2.5`

which is the limit. ps. it would be better to post your Mathematica code also in plain text to make it easier to copy and user. Eliminates mistakes. – Nasser – 2019-06-14T04:49:44.4802Don't know why what you wrote doesn't work but the following does work:

`Product[(Prime[n]^2 + 1)/(Prime[n]^2 - 1), {n, 1, \[Infinity]}]`

. – JimB – 2019-06-14T04:56:47.917@JimB is it possible Mathematica knew about these special cases and just did a lookup for the result? Any other ones not in a lookup table, should not work if the upper limit is infinity, according to help? – Nasser – 2019-06-14T05:04:32.077

@Nasser Good inference. It does appear that the lower limit is recognized in whatever lookup is used as using

`{n, 3, \[Infinity]}`

also gives an appropriate answer. – JimB – 2019-06-14T05:11:40.4831Per Michael E2's comment/answer I'm not sure this is a bug, so I removed the tag. We try to be very careful about having only bugs confirmed by WRI or the community when using it. – b3m2a1 – 2019-06-14T06:13:44.017

2Please don't use the [tag:bugs] tag when posting new questions. See the tag description for why. – Szabolcs – 2019-06-14T06:33:02.853