This site is supported by donations to The OEIS Foundation.

# Density

There are many different mathematical definitions of density. The most common is asymptotic density, which does not exist for all sequences. Consequently a number of other densities have been developed to fill those gaps or to serve different purposes. Although some types may generalize further, this article is about densities on subsets of the natural numbers.

## Asymptotic density

Asymptotic density (or natural density) is a common way to measure the size of a subset of the natural numbers.

The lower asymptotic density ${\displaystyle \scriptstyle {\underline {d}}}$ of a set ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} }$ is defined as

${\displaystyle {\underline {d}}(A)=\liminf _{n\to \infty }{\frac {1}{n}}\sum _{i=1}^{n}\chi _{A}(i)=\liminf _{n\to \infty }\sum _{a\in A,\,1\leq a\leq n}{\frac {1}{n}},}$

and the upper asymptotic density ${\displaystyle \scriptstyle {\overline {d}}}$ of a set ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} }$ is defined as

${\displaystyle {\overline {d}}(A)=\limsup _{n\to \infty }{\frac {1}{n}}\sum _{i=1}^{n}\chi _{A}(i)=\limsup _{n\to \infty }\sum _{a\in A,\,1\leq a\leq n}{\frac {1}{n}},}$

where ${\displaystyle \scriptstyle \chi _{A}(i)}$ is the characteristic function of the set ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} }$.

Both exist for all sets ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} .}$ If the two are equal, the asymptotic density ${\displaystyle \scriptstyle d(A)}$ is said to exist and is equal to both.

The asymptotic density is finitely additive when it exists. In particular, for disjoint sets ${\displaystyle \scriptstyle A}$ and ${\displaystyle \scriptstyle B}$, we have

${\displaystyle {\underline {d}}(A)+{\underline {d}}(B)\leq {\underline {d}}(A\cup B)\leq {\underline {d}}(A)+{\overline {d}}(B)\leq {\overline {d}}(A\cup B)\leq {\overline {d}}(A)+{\overline {d}}(B).}$

Szemerédi's theorem[1] shows that if a set has positive upper asymptotic density, then it contains arbitrarily long arithmetic progressions.[2]

Let ${\displaystyle \scriptstyle R\,=\,\{a/b:\ a,\,b\,\in \,A\}}$ be the set of fractions of ${\displaystyle \scriptstyle A}$. If ${\displaystyle \scriptstyle A}$ has positive asymptotic density, then ${\displaystyle \scriptstyle R}$ is (topologically) dense in the positive reals. If ${\displaystyle \scriptstyle R}$ is not dense in the reals then ${\displaystyle \scriptstyle A}$ has lower asymptotic density less than 1/2 and upper asymptotic density less than 1; and any such lower or upper density is achievable.[3]

## Relative density

Sometimes it is natural to look not at the density compared to all natural numbers but to some base set. For example, the asymptotic density of the primes which are 1 mod 3 is 0 but it would be useful for this to be 1/2 in some sense. Relative density simply divides by the number of members of the base set up to ${\displaystyle \scriptstyle n}$ rather than by ${\displaystyle \scriptstyle n}$. It is thus a generalization of asymptotic density, the special case where the base set is ${\displaystyle \scriptstyle \mathbb {N} .}$ Most densities can be specialized in a natural way to a relative density of some kind, but when used without quantification "relative density" always means relative asymptotic density.

## Logarithmic density

Compared to asymptotic density, logarithmic density is less sensitive to certain perturbations and hence may exist when the asymptotic density does not. If the asymptotic density does exist, so does the logarithmic density and the two are equal.

The lower logarithmic density of a set ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} }$ is defined as

${\displaystyle {\underline {\delta }}(A)=\liminf _{n\to \infty }{\frac {1}{\log n}}\sum _{i=1}^{n}{\frac {\chi _{A}(i)}{i}}=\liminf _{n\to \infty }{\frac {1}{\log n}}\sum _{a\in A,\,a\leq n}{\frac {1}{a}},}$

where ${\displaystyle \scriptstyle \chi _{A}(i)}$ is the characteristic function of the set ${\displaystyle \scriptstyle A\,\subset \,\mathbb {N} }$.

The upper logarithmic density ${\displaystyle \scriptstyle {\overline {\delta }}(A)}$ is obtained analogously. If both exist then the logarithmic density ${\displaystyle \scriptstyle \delta (A)}$ exists and is equal to both.

Logarithmic density is related to asymptotic density by

${\displaystyle 0\leq {\underline {d}}(A)\leq {\underline {\delta }}(A)\leq {\overline {\delta }}(A)\leq {\overline {d}}(A)\leq 1.}$

There exist sequences which have any chosen values as the logarithmic and asymptotic densities, provided they meet these inequalities.[4]

Although the multiples of a set of positive integers may have no asymptotic density,[5] it has logarithmic density[6][7][8] equal to its lower asymptotic density. (This is of course positive if the set is nonempty.)

If the fractions ${\displaystyle \scriptstyle \{a/b:\ a,\,b\,\in \,A\}}$ are not dense in the positive real numbers, ${\displaystyle \scriptstyle A}$ cannot have upper (or lower) logarithmic density greater than or equal to 1/2; for any ${\displaystyle \scriptstyle 0\,\leq \,r\,<\,1/2}$ there is such a set with logarithmic density (and hence lower and upper logarithmic density) equal to ${\displaystyle \scriptstyle r}$.[3]

## Generalized densities

Grekos[9] defines a family of densities by

${\displaystyle {\overline {d_{h}}}(A)=\limsup _{n\to \infty }{\frac {1}{h(n)}}h\left(\sum _{a\in A,\,a\leq n}1\right),}$

and as usual for ${\displaystyle \scriptstyle {\underline {d_{h}}}(A)}$ and ${\displaystyle \scriptstyle d_{h}(A),}$ where ${\displaystyle \scriptstyle h}$ is an unbounded increasing function on ${\displaystyle \scriptstyle [0,\,\infty ).}$

### Exponential density

This is the special case ${\displaystyle \scriptstyle h\,=\,\log }$. This density has the property that the ${\displaystyle \scriptstyle k}$-th powers have exponential density ${\displaystyle \scriptstyle 1/k}$, hence the name.

## Multiplicative density

The multiplicative density was defined by Davenport & Erdős[7] and is defined as

${\displaystyle \lim _{x\to \infty }\left(\prod _{p\leq x}\left(1-{\frac {1}{p}}\right)\right)\left(\sum _{k\in A,\,k\ x{\text{-smooth}}}{\frac {1}{k}}\right),}$

if this limit exists.

## Uniform density

The uniform density (or Banach density)[10] shows the extent of the variability of the sequence.

Define

${\displaystyle {\overline {u}}(A)=\lim _{s}\limsup _{n\to \infty }\sum _{a\in A,\,n
${\displaystyle {\underline {u}}(A)=\lim _{s}\liminf _{n\to \infty }\sum _{a\in A,\,n

While logarithmic density is less sensitive than asymptotic density, uniform density is more sensitive; the three are related by

${\displaystyle 0\leq {\underline {u}}(A)\leq {\underline {d}}(A)\leq {\underline {\delta }}(A)\leq {\overline {\delta }}(A)\leq {\overline {d}}(A)\leq {\overline {u}}(A)\leq 1.}$

Of course if the uniform density ${\displaystyle \scriptstyle {\underline {u}}(A)\,=\,u(A)\,=\,{\overline {u}}(A)}$ exists it is equal to the asymptotic and logarithmic densities.

## Schnirelmann density

Schnirelmann introduced a concept of density useful in additive combinatorics. The Schnirelmann density ${\displaystyle \scriptstyle \sigma }$ is defined as

${\displaystyle \sigma (A)=\inf _{n\to \infty }\sum _{a\in A,\,a\leq n}{\frac {1}{n}},}$

and the upper Schnirelmann density ${\displaystyle \scriptstyle {\overline {\sigma }}}$ can be defined analogously as

${\displaystyle {\overline {\sigma }}(A)=\sup _{n\to \infty }\sum _{a\in A,\,a\leq n}{\frac {1}{n}},}$

though this is rarely used. Note that the two are never equal: ${\displaystyle \scriptstyle 0\leq \sigma (A)<{\overline {\sigma }}(A)\leq 1}$. Further, the asymptotic densities are bounds:

${\displaystyle \sigma (A)\leq {\underline {d}}(A)\leq {\overline {d}}(A)\leq {\overline {\sigma }}(A)}$ (at least one of the inequalities being strict).

Mann's theorem states that[11]

${\displaystyle \sigma (A+B)\geq \min(\sigma (A)+\sigma (B),\,1).}$

Here the + on the left denotes Minkowski addition. Lepson[12] shows that this is the best possible result in that equality can be obtained for any choice of ${\displaystyle \scriptstyle \sigma (A),\,\sigma (B).}$

Niven[13] shows that

${\displaystyle \sigma (\{b_{a_{i}}\})\geq \sigma (\{a_{i}\})\sigma (\{b_{i}\})}$.

## Dirichlet density

Also known as the analytic density, the Dirichlet density is commonly used in multiplicative number theory where it is often more convenient to calculate than other densities. It is defined as

${\displaystyle \lim _{\sigma \to 1^{+}}\zeta (\sigma )^{-1}\sum _{a\in A}a^{-\sigma },}$

or equivalently as

${\displaystyle \lim _{\sigma \to 1^{+}}(\sigma -1)\sum _{a\in A}a^{-\sigma },}$

with upper and lower Dirichlet densities defined as usual by replacing the limit with the limit superior and limit inferior, respectively.

The Dirichlet density exists (that is, the limit superior equals the limit inferior) precisely when the logarithmic density of the sequence exists.

## Divisor density

A subset S of the positive integers has divisor density[14] z if for almost all n it holds that

${\displaystyle {\frac {\sum _{d|n,d\in S}1}{\sum _{d|n}1}}\sim z}$

(where ~ is as n increases without bound).

For any ${\displaystyle \scriptstyle \alpha \in [0,1]}$ and any ${\displaystyle \scriptstyle \beta \in [0,1]}$ there is a set S with divisor density α and logarithmic density β, and this remains true if one or both are replaced with "undefined".

## Other densities

• Lacunary density[15]
• Mean density, Abel density, Poisson density, logarithmic block density[16]
• Ψ-density[17]

## Properties

It seems reasonable to require that for any density ${\displaystyle \scriptstyle D,\,D(A)\,\leq \,D(B)}$ when ${\displaystyle \scriptstyle A\,\subseteq \,B.}$ Further, ${\displaystyle \scriptstyle D(\emptyset )=0}$ and ${\displaystyle \scriptstyle D(\mathbb {N} )\,=\,1.}$

Grekos[9] suggests four properties which may be desirable:

1. Translation invariance: ${\displaystyle \scriptstyle D(A)\,=\,D(A+\{k\})}$ for any ${\displaystyle \scriptstyle k}$, where + is the Minkowski sum.
2. Homogeneity: ${\displaystyle \scriptstyle D(A)\,=\,k\,\cdot \,D(kA)}$, where ${\displaystyle \scriptstyle nS}$ denotes ${\displaystyle \scriptstyle \{ns:\ s\,\in \,S\}.}$
3. Finiteness: If ${\displaystyle \scriptstyle A}$ is finite, then ${\displaystyle \scriptstyle D(A)\,=\,0.}$
4. Finite additivity: If ${\displaystyle \scriptstyle A}$ and ${\displaystyle \scriptstyle B}$ are disjoint then ${\displaystyle \scriptstyle D(A)+D(B)\,=\,D(A\,\cup \,B).}$

I also suggest

3a. If the symmetric difference ${\displaystyle \scriptstyle (A\setminus B)\,\cup \,(B\setminus A)}$ is finite, then ${\displaystyle \scriptstyle D(A)\,=\,D(B).}$

which, in the presence of the 'reasonable' requirement ${\displaystyle \scriptstyle D(\emptyset )=0}$, is a strengthening of #3. Note that sigma additivity, a strengthening of #4, is not possible in this setting: densities are not measures.

Axioms 1 and 2 mean that homothetic transformations have the expected densities. If they are replaced with

1a. ${\displaystyle D(A\cap B)=\min(D(A),\,D(B))}$

then the result is a nonprincipal ultrafilter.

## Notes

1. Endre Szemerédi, On sets of integers containing no k elements in arithmetic progression, Acta Arithmetica 27 (1975), pp. 199–245.
2. Note that the converse is not true: if a set contains arbitrarily long arithmetic progressions, it may have null upper asymptotic density. The Green–Tao theorem, proved by Ben Green and Terence Tao in 2004, states that the sequence of prime numbers (which have null upper asymptotic density) contains arbitrarily long arithmetic progressions. In other words there exist arithmetic progressions of primes, with ${\displaystyle k}$ terms, where ${\displaystyle k}$ can be any natural number. The proof is an extension of Szemerédi's theorem.
3. Ladislav Mišík and János T. Tóth, Logarithmic density of a sequence of integers and density of its ratio set, Journal de théorie des nombres de Bordeaux 15:1 (2003), pp. 309–318, doi: 10.5802/jtnb.404
4. Ladislav Mišík, Sets of positive integers with prescribed values of densities, Mathematica Slovaca 52:3 (2002), pp. 289–296.
5. A. S. Besicovitch, On the density of certain sequences of integers, Mathematische Annalen 110 (1934), pp. 336–341.
6. H. Davenport and P. Erdős, On sequences of positive integers, Acta Arithmetica 2 (1936), pp. 147-151.
7. H. Davenport and P. Erdős, On sequences of positive integers, J. Indian Math. Soc. 15 (1951), pp. 19–24.
8. Vilius Stakėnas, On the densities of rational multiples, Lith. Math. J. 50:4 (2010), pp. 459–473. arXiv:1002.3808
9. Georges Grekos, On various definitions of density (survey), Tatra Mt. Math. Publ. 31 (2005), pp. 17–27.
10. Georges Grekos, Vladimír Toma, and Jana Tomanová, A note on uniform or Banach density, Annales mathématiques Blaise Pascal 17:1 (2010), pp. 153–163, doi: 10.5802/ambp.280.
11. Henry B. Mann, A proof of the fundamental theorem on the density of sums of sets of positive integers, Annals of Mathematics. Second Series 43:3 (1942), pp. 523–527.
12. Benjamin Lepson, Certain best possible results in the theory of Schnirelmann density, Proc. Amer. Math. Soc. 1 (1950), pp. 592–594.
13. Ivan Niven, The asymptotic density of sequences, Bull. Amer. Math. Soc. 57:6 (1951), pp. 420–434.
14. R. R. Hall, The divisor density of integer sequences
15. T. C. Brown and A. R. Freedman, Arithmetic progressions in lacunary sets, Rocky Mountain J. Math. 17:3 (1987), pp. 587–596.
16. L. A. Rubel, Necessary and sufficient conditions for Carlson's theorem, Transactions of the American Mathematical Society 83 (1956), pp. 417–429.
17. K. G. Binmore, A density theorem with an application to gap power series, Transactions of the American Mathematical Society 148:2 (1970), pp. 367–384.