# Density of numbers whose prime factors all come from a fixed congruence class

Let $q$ be a positive integer greater than one, and let $a$ be an integer such that $\gcd(a,q) = 1$. Define $$D(a,q) = \{n \in \mathbb{N} : p | n \Rightarrow p \equiv a \pmod{q} \}.$$ Do we know the density of $D(a,q)$ as a subset of the natural numbers? More precisely, define $$D(a,q; x) = \{n \in \mathbb{N} : n \in D(a,q), n \leq x\}.$$ What is the limit of $$\lim_{x \rightarrow \infty} \frac{\#D(a,q;x)}{x}?$$ More generally, let $\mathfrak{P}$ denote a subset of the primes with positive density. Define $$D(\mathfrak{P}) = \{n \in \mathbb{N} : p | n \Rightarrow p \in \mathfrak{P}\}.$$ Can we compute the density of $D(\mathfrak{P})$ as a subset of the natural numbers, given the relative density of $\mathfrak{P}$ in the primes?

• I would recommend looking at the paper of Granville, Koukoulopoulos, and Matomaki at arxiv.org/abs/1205.0413 for the state of the art on the latter question. It looks like $D(a,q;x)$ should be something like $x \log^{1/\phi(q) - 1} x$. – Terry Tao Mar 2 '15 at 18:05
• Taken literally, the question is not really interesting: if $\mathfrak P$ has (upper) relative density $< 1$ (which is the case for $D(a,q)$), then the density of $D(\mathfrak P)$ is at most $\prod_{p\notin\mathfrak P}(1-p^{-1})=0$, whereas if $\mathfrak P$ has relative density $1$, the density of $D(\mathfrak P)$ can be most anything. – Emil Jeřábek supports Monica Mar 2 '15 at 19:03
• In the definition of $D(a,q)$ did you mean to assert that $p\mid n$ is a prime? – gen Mar 26 at 10:35