# Short version

If we define $$f(n) = \prod_{2 < p \le n} \left( 1 - \frac{1}{p-1}\right)$$ where the product is over prime numbers $p$, then is it true that asymptotically $$f(n) \sim \frac{c}{\log n}$$ and if so for what value of $c$? Or if not, can we get an asymptotic formula for $f(n)$?

# Longer version

Define $f(n)$ as above; for example \begin{align} f(3) &= \left(1 - \frac{1}{2}\right) &&= \frac{1}{2} \\ f(5) &= \left(1 - \frac{1}{2}\right) \left(1 - \frac{1}{4}\right) &&= \frac{3}{8} \\ f(7) &= \left(1 - \frac{1}{2}\right) \left(1 - \frac{1}{4}\right) \left(1 - \frac{1}{6}\right) &&= \frac{5}{16} \\ f(11) &= \left(1 - \frac{1}{2}\right) \left(1 - \frac{1}{4}\right) \left(1 - \frac{1}{6}\right) \left(1 - \frac{1}{10}\right) &&= \frac{9}{32} \\ \end{align} and so on. In code (Python):

from fractions import Fraction
import math
def isprime(n):
return n > 1 and all(n % d != 0 for d in range(2, min(n, int(math.sqrt(n))+5)))
n = 2
f = {}
cf = Fraction(1, 1)
while True:
n += 1
if not isprime(n): continue
cf *= (1 - Fraction(1, n - 1))
f[n] = cf
print(n, f[n] * math.log(n))


If we let this run for up to $n = 100000$, we see output like:

(99881, 0.7410660117923158)
(99901, 0.7410714826009325)
(99907, 0.7410679310376648)
(99923, 0.7410708229998296)
(99929, 0.7410672721476895)
(99961, 0.7410804687613776)
(99971, 0.7410794950190189)
(99989, 0.7410836723109864)
(99991, 0.7410775482554816)


so $f(n) \log n$ does seem to approach a value around $0.74$.

Note that the third theorem of Mertens says that the similar product $$\prod_{p \le n}\left(1 - \frac{1}{p}\right) \sim \frac{e^{-\gamma}}{\log n}$$ where $\gamma \approx 0.577$ is Euler's constant. This is my reason for trying to see whether $$f(n) = \prod_{2 < p \le n} \left( 1 - \frac{1}{p-1}\right) \sim \frac{c}{\log n}$$ as well, for some other $c$.

# What I've tried

(Obviously not successfully, so it may be best to ignore everything that follows.)

Taking logs, we can write $$\log f(n) = \sum_{2 < p \le n} \log\left(1 - \frac{1}{p-1}\right). \tag{1}\label{one}$$ We can try to relate this to the theorem of Mertens that $$\sum_{p \le x} \log\left(1 - \frac{1}{p}\right) = -\log\log x - \gamma + o(1)$$ or (peeling off the $p=2$ term) $$\sum_{2 < p \le n} \log\left(1 - \frac{1}{p}\right) = -\log\log n - \gamma + \log 2 + o(1) \tag{2}\label{two}$$ To try to relate $\eqref{one}$ to $\eqref{two}$, we can write $\log\left(1 - \frac{1}{p-1}\right)$ in terms of $\log\left(1 - \frac{1}{p}\right)$: for $p>2$ we have \begin{align} -\log\left(1 - \frac{1}{p-1}\right) &= \frac{1}{p} + \frac{3}{2p^2} + \frac{7}{3p^3} + \frac{15}{4p^4} + \frac{31}{5p^5} + \frac{63}{6p^6} + \frac{127}{7p^7} + \dots \\ &= -\log\left(1 - \frac1p\right) + \left(\frac{2}{2p^2} + \frac{6}{3p^3} + \frac{14}{4p^4} + \frac{30}{5p^5} + \frac{62}{6p^6} + \cdots \right) \end{align} where the second term is $\log\left(\frac{(p - 1)^2}{p(p-2)}\right)$. So, summing the above over $2 < p \le n$, \begin{align} -\log f(n) &= -\sum_{2 < p \le n}\log\left(1 - \frac{1}{p-1}\right) \\ &= -\sum_{2 < p \le n}{\log\left(1 - \frac1p\right)} + \sum_{2 < p \le n}\left(\frac{2}{2p^2} + \frac{6}{3p^3} + \frac{14}{4p^4} + \frac{30}{5p^5} + \frac{62}{6p^6} + \cdots \right) \tag{3}\label{three}\\ &\approx \log\log n + \gamma - \log 2 + \frac{2}{2}\left(P(2)-\frac{1}{2^2}\right) + \frac{6}{3}\left(P(3)-\frac{1}{2^3}\right) + \frac{14}{4}\left(P(4)-\frac{1}{2^4}\right) + \dots \end{align} where $P(k) = \sum_{p} \frac{1}{p^k}$ denotes the prime zeta function. On the face of it, this seems like it may give an expression of the form $-\log f(n) = \log\log n + c + o(1)$ for some constant $c$, and therefore $\log f(n) = -c - \log\log n + o(1)$ or $$f(n) \sim \frac{e^{-c}}{\log n}$$ which is what we wanted. The problem with this is that, in addition to the $\approx$ on the last line of $\eqref{three}$ being sloppy, it appears that in fact the subtracted term $\left(\frac{2}{2\cdot2^2} + \frac{6}{3\cdot2^3} + \frac{14}{4\cdot2^4} + \frac{30}{5\cdot2^5} + \frac{62}{6\cdot2^6} + \cdots \right)$ diverges! So it's not clear whether $\eqref{three}$ is meaningful in any way (and even if it were, whether this is a “proper” way to express the constant $c$).

Update: On actually trying the final expression of $\eqref{three}$, it seems to match the numerical data. The following Sage program (using mpmath.primezeta, the equivalent of PrimeZetaP in Mathematica):

import mpmath
mpmath.mp.dps = 25 # Set precision to 25 decimal digits
ans = mpmath.euler - mpmath.log(2)
for k in range(2, 100):
ans += (2**k - 2) * (mpmath.primezeta(k) - 1/2**k) / k
print(ans)
print(mpmath.exp(-ans))


prints (compare the second output with the output from an earlier program above):

0.2993387828283008984224987
0.7413082243919210826540034


This is quite persuasive, so the main thing that's missing is a more rigorous proof of $\eqref{three}$ (I guess we need to say something about the rate of convergence, to justify the “$\approx$”), and (if it exists) a more concise expression for the constant (something that isn't itself an infinite sum). Or of course, a completely different alternative solution.

• What happens if you use the expansion $$\sum_{2<p \le n} \log\left(1 - \frac{1}{p}\right) =\log2+\sum_{p \le n} \log\left(1 - \frac{1}{p}\right) = -\log\log n - \gamma+\log2 + o(1)\ ?$$ – Did May 21 '18 at 9:24
• For each $k>1$, $$\sum_{p>2}\frac1{p^k}=P(k)-\frac1{2^k}$$ – Did May 21 '18 at 9:33
• @Did Thanks for your comments; I've mentioned them in the question — the problem is with the second term, where the $p=2$ term that is to be pulled out diverges (as far as I can tell). The funny thing is that with some combination of signs I was able to get something close to what seems a numerically correct value, but I was not able to justify the sign error… maybe it's just very late at night for me. :-) Thanks for any help… – ShreevatsaR May 21 '18 at 9:39

We can write that $$\bbox[lightyellow] { \prod\limits_{2\, \le \,p\, \le \,n} {\left( {1 - {1 \over p}} \right)} \le \prod\limits_{2\, \le \,p\, \le \,n - 1} {\left( {1 - {1 \over p}} \right)} < \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over {p - 1}}} \right)} < \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over p}} \right)} = 2\prod\limits_{2\, \le \,p\, \le \,n} {\left( {1 - {1 \over p}} \right)} }$$
Since all the products are non-increasing in $n$, and since for the third Merten's Theorem as you cited, it is $$\prod\limits_{\,\left( {2\, \le } \right)\,p\, \le \,n} {\left( {1 - {1 \over p}} \right)} \sim {{e^{\, - \gamma } } \over {\ln n}}$$ then we can tell that $$\bbox[lightyellow] { \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over {p - 1}}} \right)} \;{\sim}\;{{c\;e^{\, - \gamma } } \over {\ln n}}\quad \left| {\;1 < c < 2} \right. }$$
Concerning the actual value of $c$, the ratio $${{\prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over {p - 1}}} \right)} } \over {\prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over p}} \right)} }} = \prod\limits_{3\, \le \,p\, \le \,n} {\left( {{{p\left( {p - 2} \right)} \over {\left( {p - 1} \right)^2 }}} \right)} = \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over {\left( {p - 1} \right)^2 }}} \right)} = \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 - {1 \over {\left( {p - 1} \right)}}} \right)} \prod\limits_{3\, \le \,p\, \le \,n} {\left( {1 + {1 \over {\left( {p - 1} \right)}}} \right)}$$ tells us that $$\bbox[lightyellow] { c = 2\,\prod\limits_{3\, \le \,p\,} {\left( {1 - {1 \over {\left( {p - 1} \right)^2 }}} \right)} = 1.3203236... }$$ that is
$2$ times the Twin Primes Constant.