Let $f(n ) = \sum_{d \mid p_n\#}(-1)^{\omega(d)} \dfrac{1}{d}$ where $p_n$ is the $n$th prime number and $p_n\# = p_n p_{n-1} \cdots p_1$.
I'm looking for a way to make a simple estimate of (upper / lower bound) $f(n)$. Can it be done?
For example, $n = 3$ gives: $$f(3) = 1 - \dfrac{1}{2} - \dfrac{1}{3} - \dfrac{1}{5} + \dfrac{1}{6} + \dfrac{1}{10} + \dfrac{1}{15} - \dfrac{1}{30} = 0.2\overline{6}$$
Here is some code that will print the first few values:
from sympy import *
import matplotlib.pyplot as plt
from functools import reduce
N = 500
x_points = []
y_points = []
def powerset(s):
x = len(s)
masks = [1 << i for i in range(x)]
for i in range(1 << x):
yield [ss for mask, ss in zip(masks, s) if i & mask]
for n in range(1, N):
P = list(primerange(2, prime(n) + 1))
Q = powerset(P)
sum = 0
for q in Q:
if q:
prod_q = reduce(lambda x,y: x*y, q)
sum += (-1)**(len(q)) * (1 / prod_q)
else:
sum += 1
print(n, sum)
Prints:
1 0.5
2 0.33333333333333337
3 0.2666666666666667
4 0.22857142857142865
5 0.20779220779220786
6 0.19180819180819186
7 0.1805253569959452
8 0.17102402241721126
9 0.16358819535559335
10 0.15794722310195236
11 0.15285215138898603
12 0.14872101216225675
13 0.14509367040220184
14 0.14171939899750013
15 0.1387040926358517
16 0.13608703428422966
As you can see this number apparently wants to go to $0$, but I would like estimates of its actual value, not what it converges to.
$f(n)$ is exactly equal to $\prod_{p\le p_n} \bigl( 1-\frac1p \bigr)$, where the product runs over primes $p$. By Mertens's (third) theorem, this product is asymptotic to $1/(e^\gamma\log p_n) \sim 1/(e^\gamma\log n)$, where $\gamma$ is the Euler–Mascheroni constant. Explicit upper and lower bounds can be found in Rosser & Schoenfeld's paper.