# Natural density

In number theory, natural density (or asymptotic density or arithmetic density) is one of the possibilities to measure how large a subset of the set of natural numbers is.

Intuitively, it is thought that there are more positive integers than perfect squares, since every perfect square is already positive, and many other positive integers exist besides. However, the set of positive integers is not in fact larger than the set of perfect squares: both sets are infinite and countable and can therefore be put in one-to-one correspondence. Nevertheless if one goes through the natural numbers, the squares become increasingly scarce. The notion of natural density makes this intuition precise.

If an integer is randomly selected from the interval [1, n], then the probability that it belongs to A is the ratio of the number of elements of A in [1, n] to the total number of elements in [1, n]. If this probability tends to some limit as n tends to infinity, then this limit is referred to as the asymptotic density of A. This notion can be understood as a kind of probability of choosing a number from the set A. Indeed, the asymptotic density (as well as some other types of densities) is studied in probabilistic number theory.

Asymptotic density contrasts, for example, with the Schnirelmann density. One drawback of asymptotic density is that it is not defined for all subsets of ${\displaystyle \mathbb {N} }$.

## Definition

A subset A of positive integers has natural density (or asymptotic density) α if the proportion of elements of A among all natural numbers from 1 to n is asymptotic to α as n tends to infinity.

More explicitly, if one defines for any natural number n the counting function a(n) as the number of elements of A less than or equal to n, then the natural density of A being α exactly means that[1]

a(n)/n → α as n → +∞.

It follows from the definition that if a set A has natural density α then 0 ≤ α ≤ 1.

### Upper and lower asymptotic density

Let ${\displaystyle A}$ be a subset of the set of natural numbers ${\displaystyle \mathbb {N} =\{1,2,\ldots \}.}$ For any ${\displaystyle n\in \mathbb {N} }$ put ${\displaystyle A(n)=\{1,2,\ldots ,n\}\cap A.}$ and ${\displaystyle a(n)=|A(n)|}$.

Define the upper asymptotic density ${\displaystyle {\overline {d}}(A)}$ of ${\displaystyle A}$ by

${\displaystyle {\overline {d}}(A)=\limsup _{n\rightarrow \infty }{\frac {a(n)}{n}}}$

where lim sup is the limit superior. ${\displaystyle {\overline {d}}(A)}$ is also known simply as the upper density of ${\displaystyle A.}$

Similarly, ${\displaystyle {\underline {d}}(A)}$, the lower asymptotic density of ${\displaystyle A}$, is defined by

${\displaystyle {\underline {d}}(A)=\liminf _{n\rightarrow \infty }{\frac {a(n)}{n}}}$

One may say ${\displaystyle A}$ has asymptotic density ${\displaystyle d(A)}$ if ${\displaystyle {\underline {d}}(A)={\overline {d}}(A)}$, in which case ${\displaystyle d(A)}$ is equal to this common value.

This definition can be restated in the following way:

${\displaystyle d(A)=\lim _{n\rightarrow \infty }{\frac {a(n)}{n}}}$

if the limit exists.[2]

It can be proven that the definitions imply that the following also holds. If one were to write a subset of ${\displaystyle \mathbb {N} }$ as an increasing sequence

${\displaystyle A=\{a_{1}

then

${\displaystyle {\underline {d}}(A)=\liminf _{n\rightarrow \infty }{\frac {n}{a_{n}}},}$
${\displaystyle {\overline {d}}(A)=\limsup _{n\rightarrow \infty }{\frac {n}{a_{n}}}}$

and ${\displaystyle d(A)=\lim _{n\rightarrow \infty }{\frac {n}{a_{n}}}}$ if the limit exists.

### Remark

A somewhat weaker notion of density is upper Banach density; given a set ${\displaystyle A\subseteq \mathbb {N} }$, define ${\displaystyle d^{*}(A)}$ as

${\displaystyle d^{*}(A)=\limsup _{N-M\rightarrow \infty }{\frac {|A\bigcap \{M,M+1,\ldots ,N\}|}{N-M+1}}}$

## Properties and examples

• If d(A) exists for some set A, then for the complement set we have d(Ac) = 1 − d(A).
• If ${\displaystyle d(A)}$, ${\displaystyle d(B)}$, and ${\displaystyle d(A\cup B)}$ exist, then ${\displaystyle \max\{d(A),d(B)\}\leq d(A\cup B)\leq \min\{d(A)+d(B),1\}}$.
• For any two sets A, B we have ${\displaystyle {\underline {d}}(A)+{\overline {d}}(B)\leq {\overline {d}}(A\cup B)\leq {\overline {d}}(A)+{\overline {d}}(B)}$.
• The density d(N) of the entire set of natural numbers is equal to 1.
• For any finite set F of positive integers, d(F) = 0.
• If ${\displaystyle A=\{n^{2};n\in \mathbb {N} \}}$ is the set of all squares, then d(A) = 0.
• If ${\displaystyle A=\{2n;n\in \mathbb {N} \}}$ is the set of all even numbers, then d(A) = 0.5 . Similarly, for any arithmetical progression ${\displaystyle A=\{an+b;n\in \mathbb {N} \}}$ we get d(A) = 1/a.
• For the set P of all primes we get from the prime number theorem d(P) = 0.
• The set of all square-free integers has density ${\displaystyle {\tfrac {6}{\pi ^{2}}}}$
• The set of abundant numbers has non-zero density.[3] Marc Deléglise showed in 1998 that the density of the set of abundant numbers and perfect numbers is between 0.2474 and 0.2480.[4]
• The set ${\displaystyle A=\bigcup \limits _{n=0}^{\infty }\{2^{2n},\ldots ,2^{2n+1}-1\}}$ of numbers whose binary expansion contains an odd number of digits is an example of a set which does not have an asymptotic density, since the upper density of this set is
${\displaystyle {\overline {d}}(A)=\lim _{m\rightarrow \infty }{\frac {1+2^{2}+\cdots +2^{2m}}{2^{2m+1}-1}}=\lim _{m\rightarrow \infty }{\frac {2^{2m+2}-1}{3(2^{2m+1}-1)}}={\frac {2}{3}}\,,}$
whereas its lower density is
${\displaystyle {\underline {d}}(A)=\lim _{m\rightarrow \infty }{\frac {1+2^{2}+\cdots +2^{2m}}{2^{2m+2}-1}}=\lim _{m\rightarrow \infty }{\frac {2^{2m+2}-1}{3(2^{2m+2}-1)}}={\frac {1}{3}}\,.}$
• The set of numbers whose decimal expansion begins with the digit 1 similarly has no natural density: the lower density is 1/9 and the upper density is 5/9.[1]
• Consider an equidistributed sequence ${\displaystyle \{\alpha _{n}\}_{n\in \mathbb {N} }}$ in ${\displaystyle [0,1]}$ and define a monotone family ${\displaystyle \{A_{x}\}_{x\in [0,1]}}$ of sets :
${\displaystyle A_{x}:=\{n\in \mathbb {N} \,:\,\alpha _{n}
Then, by definition, ${\displaystyle d(A_{x})=x}$ for all ${\displaystyle x}$.

## Other density functions

Other density functions on subsets of the natural numbers may be defined analogously. For example, the logarithmic density of a set A is defined as the limit (if it exists)

${\displaystyle \mathbf {\delta } (A)=\lim _{x\rightarrow \infty }{\frac {1}{\log x}}\sum _{n\in A,n\leq x}{\frac {1}{n}}\ .}$

Upper and lower logarithmic densities are defined analogously as well.

## Notes

1. ^ a b Tenenbaum (1995) p.261
2. ^ Nathanson (2000) pp.256–257
3. ^ Hall, Richard R.; Tenenbaum, Gérald (1988). Divisors. Cambridge Tracts in Mathematics. 90. Cambridge: Cambridge University Press. p. 95. ISBN 0-521-34056-X. Zbl 0653.10001.
4. ^ Deléglise, Marc (1998). "Bounds for the density of abundant integers". Experimental Mathematics. 7 (2): 137–143. doi:10.1080/10586458.1998.10504363. ISSN 1058-6458. MR 1677091. Zbl 0923.11127.