Skip to content

Prime Number Races and Chebyshev’s Bias

  • Updated: September 1, 2026
📌

Complete guide: Prime Number Patterns

A prime number race compares how many primes have appeared in different reduced residue classes by a moving cutoff x. The best-known example compares primes congruent to 3 modulo 4 with primes congruent to 1 modulo 4. Both classes receive the same asymptotic share of the primes, yet the 3 modulo 4 class leads for an unexpectedly large proportion of the race. This persistent imbalance is called Chebyshev’s bias.

Direct Answer

Chebyshev’s bias does not mean that one eligible residue class contains more primes in the limit. It means that the cumulative count for one class is ahead much more often than a symmetric model might suggest. In the modulo 4 race, primes of the form 4n + 3 usually lead primes of the form 4n + 1, even though their counting functions are asymptotically equal.

How a Prime Number Race Is Defined

For integers q and a with gcd(a, q) = 1, the notation π(x; q, a) counts primes p ≤ x that satisfy p ≡ a (mod q). A two-way race compares π(x; q, a) and π(x; q, b). A multiway race orders several such counting functions at the same cutoff.

Race Difference

D(x; q, a, b) = π(x; q, a) − π(x; q, b)

If D is positive, class a leads. If D is negative, class b leads. If D equals zero, the race is tied.

Modulus

The number q that determines the residue classes.

Reduced Residue

A class a with gcd(a, q) = 1, so it can contain infinitely many primes.

Cutoff

The value x up to which the prime counts are compared.

Leader

The residue class with the larger cumulative prime count at x.

The Modulo 4 Race

Every odd prime is congruent to either 1 or 3 modulo 4. The prime 2 is excluded from this comparison because it is not coprime to 4. The two competitors therefore begin as follows:

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

The 3 modulo 4 class starts ahead and usually remains ahead. It does not lead at every cutoff, however. The 1 modulo 4 class first moves ahead at x = 26,861, where the counts are 1,473 and 1,472.

Selected checkpoints in the race between primes congruent to 1 and 3 modulo 4.
xπ(x; 4, 1)π(x; 4, 3)Leader
10011133 mod 4 by 2
1,00080873 mod 4 by 7
10,0006096193 mod 4 by 10
26,8611,4731,4721 mod 4 by 1
100,0004,7834,8083 mod 4 by 25

Why the Bias Does Not Contradict Equidistribution

The prime number theorem for arithmetic progressions says that eligible residue classes modulo q receive equal asymptotic shares. For the modulo 4 race, this gives:

Equal Asymptotic Share

π(x; 4, 1) ~ π(x; 4, 3) ~ ½ li(x)

The symbol “~” describes a ratio tending to 1. It does not require the two counting functions to be equal, nor does it require each class to lead equally often. A difference can be small compared with the total count while still having the same sign across long ranges.

Equal prime density and race leadership answer different questions.
StatementWhat It DescribesWhat It Does Not Imply
π(x; q, a) ~ π(x; q, b)The counts have the same main growth rate.The counts are equal at most cutoffs.
D(x; q, a, b) changes signEach class takes the lead at some cutoffs.The classes lead equally often.
A logarithmic density is near 1One ordering occupies most logarithmic scale.The favored class wins at every x.

How the Strength of a Race Is Measured

Ordinary density is often poorly suited to prime races because the meaningful oscillations occur across multiplicative scales. Analytic number theory therefore uses logarithmic density. It gives comparable influence to intervals such as [10, 100] and [1,000, 10,000], since each spans the same factor of ten.

Logarithmic Density

δ(S) = limX→∞ (1 / log X) ∫t∈S, 2≤t≤X dt / t

For the set of cutoffs where π(x; 4, 3) > π(x; 4, 1), the standard conditional analysis gives a logarithmic density of about 0.9959. This is commonly described as a 99.59% bias toward the 3 modulo 4 class. The value depends on assumptions about zeros of Dirichlet L-functions, including the Generalized Riemann Hypothesis and a linear-independence condition.

Density Is Not a Random Prime Experiment

The 0.9959 figure is not the probability that a randomly chosen prime is 3 modulo 4. Asymptotically, half of the odd primes lie in each class. The figure measures how often one cumulative counting function is ahead when cutoffs are weighted logarithmically.

Where Chebyshev’s Bias Comes From

The leading terms for eligible residue classes are equal, so the bias appears in lower-order terms. These terms are exposed by explicit formulas that connect prime counts in arithmetic progressions with zeros of Dirichlet L-functions.

A useful first explanation comes from prime powers. For every odd prime p, the square p² is congruent to 1 modulo 4. Weighted counting functions that include prime powers therefore receive a systematic contribution in the 1 modulo 4 class. When the contribution of prime squares is separated from the count of primes themselves, it produces an offset that tends to favor the non-square class 3 modulo 4 in the prime-only race.

Quadratic Residues and Nonresidues

Modulo 4, the class 1 is a quadratic residue and the class 3 is a quadratic nonresidue. In many two-way races, nonresidue classes tend to lead residue classes. This is a tendency shaped by the modulus and the relevant characters, not a rule that determines every race ordering.

The remaining fluctuations come from oscillatory terms associated with L-function zeros. Their phases and sizes determine when the lead narrows, when a tie occurs, and when another class briefly moves ahead. This is why prime number races combine modular arithmetic, prime distribution, harmonic analysis, and probability distributions.

Leader Changes and Inclusive Races

Chebyshev’s bias is persistent, but it is not permanent. In the two-way races modulo 3 and modulo 4, each competitor takes the lead for arbitrarily large cutoffs. Equivalently, the difference between the two prime-counting functions changes sign infinitely often.

For races with several residue classes, mathematicians ask whether every possible ordering occurs. A race is called inclusive when every ordering has a positive logarithmic density. Conditional results show this behavior broadly under hypotheses concerning Dirichlet L-function zeros. Later work has reduced the strength of the required linear-independence assumptions while retaining the Generalized Riemann Hypothesis.

Common Mistake

A class that leads 99.59% of the time does not eventually stay ahead forever. A strong bias and infinitely many lead changes can occur together because the losing intervals may be rare on a logarithmic scale but still extend to arbitrarily large values.

Other Prime Number Races

The modulo 4 example is only the simplest race. Similar comparisons can be formed whenever the contestants are reduced residue classes modulo q.

Modulo 3

Primes congruent to 2 modulo 3 race against primes congruent to 1 modulo 3.

Modulo 8

The eligible classes 1, 3, 5, and 7 create a four-way race with several possible orderings.

Modulo 10

Primes greater than 5 occupy the classes 1, 3, 7, and 9, producing another four-way race.

Weighted Races

Variants use functions such as θ(x; q, a) or ψ(x; q, a), which weight primes or include prime powers.

Multiway races can display asymmetries even when all competitors are quadratic residues or all are nonresidues. The ordering probabilities depend on correlations among the relevant characters and L-function zeros, so a simple residue-versus-nonresidue explanation does not capture every case.

Related Concepts

Frequently Asked Questions

What Is Chebyshev’s Bias?

Chebyshev’s bias is the tendency for certain residue classes to lead others in cumulative prime counts far more often than an even race would suggest. The standard example favors primes congruent to 3 modulo 4 over primes congruent to 1 modulo 4.

Are There More Primes of the Form 4n + 3?

Not in asymptotic proportion. Primes of the forms 4n + 1 and 4n + 3 each make up half of the odd primes in the limit. The bias concerns which cumulative count is ahead, not a different limiting share.

Does the 3 Modulo 4 Class Always Lead?

No. The 1 modulo 4 class first leads at x = 26,861, and further reversals occur. The 3 modulo 4 class is favored strongly, but the lead changes infinitely often.

Why Is Logarithmic Density Used?

Logarithmic density weights cutoffs by dt/t, giving equal emphasis to equal multiplicative ranges. This fits oscillations that unfold across increasingly large scales better than counting cutoffs with uniform additive weight.

Is the 99.59% Figure Proved Without Assumptions?

The standard value is obtained within a conditional framework involving the Generalized Riemann Hypothesis and assumptions about linear independence among ordinates of Dirichlet L-function zeros.

Can a Race Be Biased If Every Ordering Occurs?

Yes. Every ordering may occur for arbitrarily large x while one ordering has much greater logarithmic density than the others. Inclusiveness concerns whether orderings occur with positive density; bias concerns how unequal those densities are.