Skip to content

Random Integers

Number theory often studies exact statements about individual integers. For example, one may ask whether a given integer is prime, squarefree, smooth, or representable as a...

Arithmetic as a Probabilistic Object

Number theory often studies exact statements about individual integers. For example, one may ask whether a given integer is prime, squarefree, smooth, or representable as a sum of squares.

Probabilistic number theory asks a different kind of question:

what does a typical integer look like?

Instead of studying one integer at a time, we study large intervals such as

{1,2,,N} \{1,2,\ldots,N\}

and examine what happens as

N. N\to\infty.

This viewpoint turns arithmetic into a statistical subject.

Random Integer Model

A basic model chooses an integer uniformly at random from

{1,2,,N}. \{1,2,\ldots,N\}.

Then one studies the limiting behavior as NN grows.

For example, we may ask:

What is the probability that a random integer is divisible by 22?

Among the integers from 11 to NN, approximately half are divisible by 22. Thus the limiting probability is

12. \frac12.

Similarly, the probability that a random integer is divisible by a prime pp is

1p. \frac1p.

This simple observation is the starting point for many probabilistic models in number theory.

Divisibility Events

For a fixed prime pp, define the event

pn. p\mid n.

The density of integers divisible by pp is

1p. \frac1p.

The density of integers divisible by pkp^k is

1pk. \frac1{p^k}.

Thus higher powers of a prime become progressively rarer.

This leads naturally to the idea that prime divisibility behaves somewhat like a collection of random events, with prime pp appearing in the factorization of nn with probability about 1/p1/p.

Coprimality

A classical example concerns the probability that two random integers are coprime.

Choose integers aa and bb independently from

{1,,N}. \{1,\ldots,N\}.

For a prime pp, the probability that pp divides both aa and bb is approximately

1p2. \frac1{p^2}.

Therefore the probability that no prime divides both should be

p(11p2). \prod_p\left(1-\frac1{p^2}\right).

Using Euler’s product for the zeta function,

ζ(2)=p(11p2)1, \zeta(2)=\prod_p\left(1-\frac1{p^2}\right)^{-1},

we obtain

p(11p2)=1ζ(2). \prod_p\left(1-\frac1{p^2}\right)=\frac1{\zeta(2)}.

Since

ζ(2)=π26, \zeta(2)=\frac{\pi^2}{6},

the probability that two random integers are coprime is

6π2. \frac6{\pi^2}.

This result is one of the simplest and most beautiful examples of probabilistic reasoning in arithmetic.

Squarefree Integers

An integer is squarefree if no prime square divides it.

For example,

30=235 30=2\cdot3\cdot5

is squarefree, while

12=223 12=2^2\cdot3

is not.

For a prime pp, the probability that p2p^2 divides a random integer is

1p2. \frac1{p^2}.

Therefore the probability that p2p^2 does not divide it is

11p2. 1-\frac1{p^2}.

Assuming independence across primes gives the density

p(11p2)=1ζ(2)=6π2. \prod_p\left(1-\frac1{p^2}\right) = \frac1{\zeta(2)} = \frac6{\pi^2}.

Thus the density of squarefree integers is also

6π2. \frac6{\pi^2}.

This agrees with rigorous results.

Number of Prime Factors

Let

ω(n) \omega(n)

denote the number of distinct prime factors of nn.

For a random integer nNn\leq N, the expected value of ω(n)\omega(n) is roughly

pN1p. \sum_{p\leq N}\frac1p.

A classical estimate gives

pN1ploglogN. \sum_{p\leq N}\frac1p \sim \log\log N.

Thus a typical integer up to NN has about

loglogN \log\log N

distinct prime factors.

This grows very slowly. Even for very large NN, most integers have relatively few prime factors.

Erdős-Kac Theorem

The Erdős-Kac theorem is one of the central results of probabilistic number theory.

It states that the number of prime factors of a random integer is normally distributed after suitable normalization.

More precisely,

ω(n)loglognloglogn \frac{\omega(n)-\log\log n}{\sqrt{\log\log n}}

behaves like a standard normal random variable for typical integers nn.

This theorem shows that prime factors of random integers obey a version of the central limit theorem.

It is a striking example of probability emerging from deterministic arithmetic.

Smooth Numbers

An integer is called yy-smooth if all of its prime factors are at most yy.

Smooth numbers are important in computational number theory, especially in factorization algorithms.

For example, the quadratic sieve and number field sieve depend on finding many integers whose prime factors are all small.

The probability that a random integer near xx is yy-smooth is a subtle function of

u=logxlogy. u=\frac{\log x}{\log y}.

This probability is governed by the Dickman function.

Smoothness therefore provides a bridge between probabilistic number theory and practical algorithms.

Randomness and Primes

Prime numbers are deterministic, but their distribution often appears random.

The prime number theorem says that the density of primes near xx is approximately

1logx. \frac1{\log x}.

Thus one may heuristically model a large integer nn as prime with probability

1logn. \frac1{\log n}.

This model is imperfect but powerful. It leads to plausible predictions about:

  • prime gaps,
  • twin primes,
  • primes in short intervals,
  • prime values of polynomials.

Many conjectures in analytic number theory arise from refined probabilistic models of primes.

Limitations of Random Models

Random models are useful, but they must be treated carefully.

Arithmetic events are not truly independent. For example, divisibility by different primes behaves almost independently in many settings, but congruence restrictions can create strong dependencies.

A simple example is parity. Except for 22, all primes are odd. Therefore a naive random model that ignores congruences will badly mispredict patterns involving adjacent primes.

Good probabilistic models must respect local arithmetic constraints.

Local Conditions

Many number-theoretic probabilities are products of local factors.

A local condition is a condition modulo a prime power.

For example, the probability that an integer is squarefree comes from avoiding divisibility by p2p^2 for every prime pp.

Such probabilities often take the form

pcp, \prod_p c_p,

where cpc_p is a local density at pp.

This local-to-global structure appears throughout modern number theory, from elementary density problems to the Hardy-Littlewood conjectures and the arithmetic of algebraic varieties.

Random Integers in Algorithms

Random integer models are not only theoretical. They also guide algorithm design.

For example:

Algorithmic QuestionProbabilistic Input
Random prime generationDensity of primes near xx
Integer factorizationProbability of smooth values
Primality testingBehavior of pseudoprimes
CryptographyDistribution of large primes
Hashing to groupsRandomness over finite structures

Many algorithms rely on the fact that certain useful integers occur with predictable frequency.

Typical and Exceptional Behavior

Probabilistic number theory distinguishes typical behavior from exceptional behavior.

For example, a typical integer has about

loglogn \log\log n

prime factors, but some integers have far more or far fewer.

A prime has exactly one prime factor. A highly composite number has many small factors.

Number theory often studies both sides:

  • the normal behavior of most integers,
  • the rare behavior of exceptional integers.

Both are important.

Conceptual Importance

Random integers provide a probabilistic lens on arithmetic.

They allow us to ask what divisibility, factorization, primality, and smoothness look like on average.

This viewpoint explains why many arithmetic phenomena have statistical regularities despite being completely deterministic.

Probabilistic number theory therefore connects elementary divisibility with probability theory, analytic estimates, computational algorithms, and modern conjectures about primes.