Dirichlet's Theorem on Arithmetic Progressions

Are there infinitely many primes ending in 1? What about ending in 3? Look at the primes ending in 1: 11, 31, 41, 61, 71, \dots — they keep coming, as far as anyone has ever checked. What about primes of the form 4k + 3, or 100k + 7? Dirichlet's theorem, proved by Peter Gustav Lejeune Dirichlet in 1837, answers every question of this shape at once: pick any starting point and any step size that don't share a common factor, and the resulting list of numbers is guaranteed to contain infinitely many primes. Its proof also launched the entire field of analytic number theory — the art of attacking whole-number questions with the tools of calculus.

The statement

If a and m are coprime, then the arithmetic progression

a,\ a+m,\ a+2m,\ a+3m,\ \dots

contains infinitely many primes.

The coprimality condition is clearly necessary — if \gcd(a, m) = d > 1, every term is divisible by d and at most one can be prime. Dirichlet proved that this obvious obstruction is the only one: whenever the obstruction is absent, primes appear infinitely often. (Even more is true: the primes spread themselves out equally among the \varphi(m) valid residue classes — a fact called the prime number theorem for arithmetic progressions.)

Two worked progressions

Take m = 4. Since \gcd(1, 4) = 1 and \gcd(3, 4) = 1, the theorem guarantees both families below run on forever:

4k+1:\quad 5,\ 13,\ 17,\ 29,\ 37,\ 41,\ 53,\ 61,\ 73,\ 89,\ 97,\ 101,\ \dots 4k+3:\quad 3,\ 7,\ 11,\ 19,\ 23,\ 31,\ 43,\ 47,\ 59,\ 67,\ 71,\ 79,\ 83,\ \dots

List either family as far as you like — they never dry up, and (asymptotically) they appear about equally often, splitting the primes above 2 almost fifty-fifty between the two shapes.

Now see why the \gcd = 1 condition cannot be dropped. Take a = 4, m = 4, so \gcd(4,4) = 4:

4,\ 8,\ 12,\ 16,\ 20,\ 24,\ \dots

Every single term is a multiple of 4, so not one of them — not even the first — is prime. The progression contains zero primes, not just finitely many restricted to small terms. This is exactly the obstruction the coprimality hypothesis rules out.

Back to the opening question: last digits mod 10

This closes the loop on the question that opened the page. A prime's last digit (other than for the primes 2 and 5 themselves) can only be 1, 3, 7, or 9 — exactly the residues coprime to 10. Dirichlet's theorem guarantees all four families run on forever:

\dots1:\ 11,\ 31,\ 41,\ 61,\ 71,\ 101,\ 131,\ \dots \qquad \dots3:\ 3,\ 13,\ 23,\ 43,\ 53,\ 73,\ 83,\ \dots \dots7:\ 7,\ 17,\ 37,\ 47,\ 67,\ 97,\ 107,\ \dots \qquad \dots9:\ 19,\ 29,\ 59,\ 79,\ 89,\ 109,\ \dots

Every other last digit — 0, 2, 4, 5, 6, 8 — shares a factor with 10 (either 2, 5, or both), so numbers ending in those digits can contain at most the one small prime exception (2 or 5) and nothing more. Just from the last digit alone, coprimality with 10 completely separates the four ever-growing prime families from the six digits that can never host more than a single prime.

The idea of the proof

Dirichlet generalised the Euler product proof that there are infinitely many primes. He attached to each residue class a Dirichlet series twisted by a character \chi — a multiplicative function on residues — forming an L-function:

L(s, \chi) = \sum_{n=1}^{\infty} \frac{\chi(n)}{n^{s}} = \prod_{p} \frac{1}{1 - \chi(p) p^{-s}}.

For a concrete taste, take m = 4 and the non-trivial character \chi(n) = 1 if n \equiv 1 \pmod 4, \chi(n) = -1 if n \equiv 3 \pmod 4, and \chi(n) = 0 for even n. Its L-function is

L(s,\chi) = 1 - \frac{1}{3^s} + \frac{1}{5^s} - \frac{1}{7^s} + \frac{1}{9^s} - \cdots,

and at s = 1 this is exactly the Leibniz series, known since the 1670s to sum to L(1,\chi) = \pi/4 — visibly, concretely non-zero. That single fact is precisely the ingredient Dirichlet needed to conclude that both the 4k+1 and 4k+3 families of primes go on forever.

Summing \log L(s,\chi) over all characters \chi mod m, weighted cleverly, makes every residue class except the target one cancel out — the characters act as filters that isolate a single progression. This trick works because characters are orthogonal: averaging \chi(n) over all characters \chi mod m gives 1 when n \equiv a \pmod m, and gives 0 for every other residue — exactly the behaviour of a filter that lets one progression through and blocks all the rest.

The crux, and the hard technical heart of the whole argument, is showing L(1, \chi) \ne 0 for every non-trivial character. If some L(1,\chi) vanished, the filter for that residue class would let through zero net contribution from the primes, and Dirichlet's whole argument for infinitude in that class would collapse. Ruling this out — one non-vanishing fact — is what guarantees the primes in the chosen class never run dry, in exact analogy with how ruling out a zeta zero on \Re(s)=1 underlies the ordinary Prime Number Theorem for all primes together.

Its significance

Dirichlet's theorem was the first triumph of applying continuous analysis — functions of a real or complex variable, limits, integrals — to a discrete, purely arithmetic question. Before 1837, number theory and analysis were largely separate worlds; Dirichlet's proof welded them together, and the L-functions he introduced are now central objects across mathematics, from elliptic curves to the Langlands program. Their own conjectured zero-free regions form a generalised Riemann Hypothesis, still open today.

The theorem also has very practical descendants. Software searching for a usable prime of a specific digit-length for a cryptographic key is, in effect, walking along an arithmetic progression looking for the first hit — Dirichlet's theorem is the reason such a search is guaranteed to eventually succeed rather than possibly running forever with nothing to find. A century and a half later, in 2004, Ben Green and Terence Tao proved a strikingly different but related-sounding result — that the primes themselves contain arbitrarily long arithmetic progressions — showing that questions in this neighbourhood are still very much alive today.

The condition \gcd(a, m) = 1 is not fine print — it is load-bearing, and skipping it is the single most common mistake when people first state this theorem. Forget it, and the claim becomes false: the progression 4, 8, 12, 16, \dots shown above has no primes at all, and in general any progression violating the coprimality condition has at most one prime term (whichever term, if any, happens to equal the shared factor itself). Before invoking Dirichlet's theorem on a progression, always check \gcd(a, m) = 1 first — the theorem promises nothing without it.

A related trap: coprimality guarantees infinitely many primes eventually, but says nothing about when the first one shows up. Some progressions keep you waiting a surprisingly long time before the first prime appears, even though infinitely many are certain to come. "Infinitely many" is a promise about the long run, not a promise that one is just around the corner.

It's a strange thing to say out loud: to prove a fact about which whole numbers are prime, Dirichlet reached for continuous functions, limits, and complex-valued sums — machinery built for smooth curves, not for the jagged, unpredictable primes. That was the genuinely radical move in 1837, and it worked so well that eighteen years later Bernhard Riemann pushed the same idea far further with his own zeta function, eventually producing the Prime Number Theorem. Together, Dirichlet's and Riemann's papers effectively founded analytic number theory as its own field — the ongoing, still very active project of using the tools of calculus to answer questions about whole numbers that stubbornly resist purely algebraic attack.

There's a nice irony in how Dirichlet got there. He wasn't primarily a number theorist by training — he was equally at home in mathematical physics and Fourier analysis, and it was exactly that background in continuous functions and convergence that let him see a way in where purely algebraic number theorists of his day had not. Sometimes the breakthrough on a stubborn problem comes from someone who arrives from a completely different direction.

See it explained