Natural density Created 2026-10-05 Updated 2026-10-13
For a set of nonnegative integers, its natural density is the limiting proportion of the first nonnegative integers that belong to :
provided this limit exists. Write for the counting function. The numerator is a finite cardinality; the denominator is exactly , including zero. Every existing natural density lies between zero and one.
For the even nonnegative integers , there are elements below and below . Thus using the ceiling function, and . For the square numbers , the exact count for is
The floor function counts the allowed indices , and the extra one counts zero. At , the square numbers below ten are , so the proportion is ; at , it is . The count grows like the square root of , while the denominator grows like .
The prime numbers also have natural density zero. If is their set, the Prime number theorem gives , hence . The Prime number theorem is a substantial result about the count, rather than a consequence of the fact that there are infinitely many prime numbers. [ref]
Why use natural density when cardinality already measures size? The even nonnegative integers, the square numbers, and the prime numbers all have the same countably infinite cardinality, yet their proportions among large initial integer intervals differ. Natural density distinguishes frequent membership from sparse membership. Equivalently, under a uniform distribution on a finite set of possible nonnegative integers, is the probability of landing in . A set without natural density shows why this limiting proportion need not exist.
Figure 1.
Exact proportions below N: even integers, squares, and an alternating-block set
. Every point uses the count in divided by , with zero included among the even integers and square numbers. The right panel marks exact block-boundary counts for a set without natural density. Its low and high proportions approach and along different subsequences. Details.
Upper asymptotic density Created 2026-10-06 Updated 2026-10-14
For a subset of the positive integers, its upper asymptotic density is
The limit superior keeps the largest limiting proportion even when the running proportions oscillate. Because they lie in , this limit superior always exists in . If natural density exists, upper asymptotic density equals it.
The convention here uses , while natural density above uses . Replacing one interval by the other changes a count by at most one, so the proportions differ by at most and have the same limit superior. For the set without natural density above, the count in is six rather than five, because is included and zero is absent. Nevertheless its upper asymptotic density is exactly . The even positive integers have upper asymptotic density and the prime numbers have upper asymptotic density zero.
The useful feature is that a large proportion along arbitrarily large initial integer intervals already supplies structure. The Szemerédi theorem says that positive upper asymptotic density forces arithmetic progressions of every finite length, with positive common difference, even without an existing natural density. Szemerédi's 1975 paper resolved this general finite-length problem; it makes density a bridge from counting to additive structure. [ref]