Let $\mathcal{A} \subset \mathbb{N}$ be an infinite sequence with positive density, in the sense that $$ \tag{1} \lim_{x\to\infty} \frac{|\mathcal{A} \cap x|}{x} = c > 0, $$ and define the remainder term $r_p(x)$ by $$ r_p(x) = \sum_{\substack{n\leq x\\ n\in \mathcal{A}\\ p\mid n}} 1 - \frac{|\mathcal{A}\cap x|}{p}. $$ What can be said about $r_p(x)$ on average, assuming only the hypothesis (1)? In particular, can one obtain an estimate of the form $$ \tag{2} \sum_{p\leq Q} |r_p(x)| \ll \frac{x}{\log x} $$ in a large range of $Q$, potentially as large as $Q \leq x$? It seems to me that the positive density of the sequence $\mathcal{A}$ should preclude the possibility that $\mathcal{A}$ "misses" many primes, in the sense that $r_p(x)$ is large for many $p$. However, perhaps there is a way to construct such a sequence via a clever use of the Chinese Remainder Theorem. Any comments/references are most appreciated.

**Edit.** The estimate (2) is false in general, as one need only consider the case when $\mathcal{A}$ is an arithmetic progression. As a concrete example, if $\mathcal{A} = \left\{4n+1: n\geq 0\right\}$ and $p=2$, then
$$
|r_2(x)| = \frac{|\mathcal{A}|}{2} = \frac{x}{8}+O(1),
$$
since the sum is empty. For a general arithmetic progression $a\mod{q}$, this kind of thing happens for at most finitely many primes (the divisors of the modulus $q$). For the application I have in mind, I really only need something like
$$
\sum_{y < p\leq Q} |r_p(x)| \ll \frac{x}{\log x},
$$
where $y$ is a parameter that grows with $x$, and so a finite number of large $r_p(x)$ is acceptable. This also allows for sets $\mathcal{A}$ where the density of integers divisible by a prime $p$ is only asymptotically $\frac{1}{p}$. For instance, if $\mathcal{A}$ is the set of squarefree numbers, then one expects
$$
\sum_{\substack{n\leq x\\p\mid n}} \mu^2(n) \sim \frac{|\mathcal{A}\cap x|}{p+1}.
$$