# Random Integers

## 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,\ldots,N\}
$$

and examine what happens as

$$
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,\ldots,N\}.
$$

Then one studies the limiting behavior as $N$ grows.

For example, we may ask:

What is the probability that a random integer is divisible by $2$?

Among the integers from $1$ to $N$, approximately half are divisible by $2$. Thus the limiting probability is

$$
\frac12.
$$

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

$$
\frac1p.
$$

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

## Divisibility Events

For a fixed prime $p$, define the event

$$
p\mid n.
$$

The density of integers divisible by $p$ is

$$
\frac1p.
$$

The density of integers divisible by $p^k$ is

$$
\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 $p$ appearing in the factorization of $n$ with probability about $1/p$.

## Coprimality

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

Choose integers $a$ and $b$ independently from

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

For a prime $p$, the probability that $p$ divides both $a$ and $b$ is approximately

$$
\frac1{p^2}.
$$

Therefore the probability that no prime divides both should be

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

Using Euler’s product for the zeta function,

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

we obtain

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

Since

$$
\zeta(2)=\frac{\pi^2}{6},
$$

the probability that two random integers are coprime is

$$
\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=2\cdot3\cdot5
$$

is squarefree, while

$$
12=2^2\cdot3
$$

is not.

For a prime $p$, the probability that $p^2$ divides a random integer is

$$
\frac1{p^2}.
$$

Therefore the probability that $p^2$ does not divide it is

$$
1-\frac1{p^2}.
$$

Assuming independence across primes gives the density

$$
\prod_p\left(1-\frac1{p^2}\right) =
\frac1{\zeta(2)} =
\frac6{\pi^2}.
$$

Thus the density of squarefree integers is also

$$
\frac6{\pi^2}.
$$

This agrees with rigorous results.

## Number of Prime Factors

Let

$$
\omega(n)
$$

denote the number of distinct prime factors of $n$.

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

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

A classical estimate gives

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

Thus a typical integer up to $N$ has about

$$
\log\log N
$$

distinct prime factors.

This grows very slowly. Even for very large $N$, 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,

$$
\frac{\omega(n)-\log\log n}{\sqrt{\log\log n}}
$$

behaves like a standard normal random variable for typical integers $n$.

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 $y$-smooth if all of its prime factors are at most $y$.

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 $x$ is $y$-smooth is a subtle function of

$$
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 $x$ is approximately

$$
\frac1{\log x}.
$$

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

$$
\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 $2$, 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 $p^2$ for every prime $p$.

Such probabilities often take the form

$$
\prod_p c_p,
$$

where $c_p$ is a local density at $p$.

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 Question | Probabilistic Input |
|---|---|
| Random prime generation | Density of primes near $x$ |
| Integer factorization | Probability of smooth values |
| Primality testing | Behavior of pseudoprimes |
| Cryptography | Distribution of large primes |
| Hashing to groups | Randomness 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

$$
\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.

