TITLE: Natural density of set of numbers not divisible by any prime in an infinite subset
QUESTION [10 upvotes]: Suppose $S$ is a subset of the primes with natural density $0 < \alpha < 1$ within the primes. If
$$D(X) := \{n \leq X \mid p \not \mid n \text{ for all } p \in S \}$$
(so $D(X)$ is numbers at most $X$ not divisible by any $p \in S$),
then is there a nice form for the asymptotic value of $D(X)$ as a function of $X$?
I'm guessing this might be a standard result in analytic number theory but I unfortunately don't yet know much about the area.

At least when $S$ is the inverse image of a union of Frobenius classes of $\text{Gal}(K/\mathbb{Q})$ for some number field $K$ under the Artin map, I have reason to believe that the answer is $\frac{X}{\log^{\alpha} X}$, but I don't know how to prove this either. I'm guessing the result holds in more generality though, hence the more general form of the question above - this specific case below the line reduces to the general question via Chebotarev density.

REPLY [3 votes]: Under a very slight strengthening of the hypothesis, this can be done by elementary methods, namely the "Wirsing–Odoni method". The following version is Proposition 4 in this paper of mine with Finch and Sebah (I'm simplifying the hypotheses for clarity here):
Let $f$ be a multiplicative function satisfying $0\le f(n)\le 1$ for all $n$.
Suppose that there exist real numbers $\xi>0$ and $0<\beta<1$ such that
$$
\sum_{p<P}f(p)=\xi \frac P{\log P}+O\bigg( \frac P{(\log P)^{1+\beta}}\bigg) \tag{1}
$$
as $P\rightarrow \infty$. Then the product over all primes
$$
C_f=\frac1{\Gamma(\xi)} \prod_{p} \bigg( 1+\frac{f(p)}p+\frac{f(p^2)}{p^2}+\frac{f(p^3)}{p^3}+\cdots \bigg) \bigg( 1-\frac1p \bigg)^\xi
$$
converges (hence is positive), and
$$
\sum_{n<N}f(n)=C_fN(\log N)^{\xi -1}+O_f\big( N(\log N)^{\xi -1-\beta}\big) 
$$
as $N\rightarrow \infty $.
In this case, $f(p^r)$ equals $1$ if $p\notin S$ and equals $0$ if $p\in S$; then $\xi=1-\alpha$ by the assumption of the natural relative density of $S$ (we see that we need a slightly quantitative statement of that density in terms of the error term in $(1)$). In this case
$$
C_f=\frac1{\Gamma(1-\alpha)} \prod_{p} \bigg( 1-\frac{1-1_S(p)}p\bigg)^{-1} \bigg( 1-\frac1p \bigg)^{1-\alpha},
$$
where $1_S(p)$ equals $1$ if $p\in S$ and equals $0$ if $p\notin S$. Notice that this is completely independent of any algebraic properties of $S$.