Hi everybody.


In "M. B. Nathanson - Elementary Methods in Number Theory" is shown (Theorem 7.14) that if $A$ is a set of positive integers such that $\sum\_{a \in A} 1 / a$ converges then the set of multiples of $A$ has a natural density (a set of positive integers $S$ has a natural density if exists $\lim\_{x \to \infty} |S \cap [1,x]| / x$).
Equivalently, the set of positive integers $n$ such that $a \nmid n$ for all $a \in A$ has a natural density. 


I'm looking for a generalization of this kind:


Let $M$ be a set of positive integers and $N\_m \subseteq \mathbb{Z} / m \mathbb{Z}$ for all $m \in M$. If [some conditions on $|N\_m| / m$, maybe that $\sum\_{m \in M} |N\_m| / m$ converges] then the set of positive integers $n$ such that $n \not \equiv r \mod m$ for all $m \in M$ and $r \in N\_m$ has a natural density.


Thank you for any reference :-)



Natural density of a set of positive integers not in certain congruence classes
Here is an amplification of @Greg Martin's answer. 


Let $S$ be any set whose upper density and lower density differ. Let the upper and lower densities be $\alpha$ and $\beta$ respectively. Write $S(N)$ for $|S\cap[1,N]|$. Let $a\_1 < a\_2 < \ldots $ be the increasing enumeration of $S^c$. Let $\delta<\alpha-\beta$.


Let $m\_1 < m\_2 < \ldots$ be a sequence satisfying the following:


* $m\_i>a\_i$;
* $\sum\_{i=1}^\infty 1/m\_i \lt \delta $;
* $S(m\_i)/m\_i\to\alpha$.


Set $N\_{m\_i}=\{a\_i\}$. Let $\tilde S$ be the set of integers $n$ such that $n\bmod m\_i\not\in N\_{m\_i}$ for each $i$. Clearly $\tilde S\subset S$, so that the lower density of $\tilde S$ is at most $\beta$. On the other hand 


$$
(S\setminus\tilde S) \cap [1,m\_j] \subset \left(\bigcup\_{i < j} (a\_i+m\_i\mathbb N)\cap [1,m\_j]\right),
$$
where $\mathbb N$ is the set of *strictly positive* integers.


Hence we see that $(S\setminus\tilde S) \cap [1,m\_j]$ has at most $m\_j(1/m\_1+\ldots+1/m\_{j-1}) < \delta 
m\_j$ elements. So $\limsup\_{j\to\infty}\tilde S(m\_j)/m\_j \gt \alpha-\delta > \beta $, and $\tilde S$ does not have a density.


