advanced28 min studyLesson 587 in Mathematics

Primes in arithmetic progressions

Use character orthogonality to separate eligible residue classes and scope their prime-counting asymptotics.

On this page

What you’ll understand

  • Express an eligible residue-class indicator through all Dirichlet characters.
  • Distinguish infinitude from an asymptotic counting theorem.
  • Keep fixed-modulus conclusions separate from uniform growing-modulus estimates.

Primes cannot distribute equally among every residue class: most classes modulo an integer share a common factor with that modulus. Among the invertible classes, however, there is a precise asymptotic equality when the modulus is fixed. Character orthogonality turns a particular residue class into a combination of multiplicative weights, allowing the analytic behavior of L-functions to control its prime count.

Which progressions are eligible?

For integers q≥2q\geq2 and aa with gcd⁡(a,q)=1\gcd(a,q)=1, let π(x;q,a)\pi(x;q,a) count primes at most xx congruent to aa modulo qq. Dirichlet’s theorem states that every such progression contains infinitely many primes. The coprimality condition is structural: if a class has a fixed common divisor with the modulus, every integer in it shares that divisor. Only primes dividing the modulus can then occur, giving at most finitely many exceptional primes rather than an infinite progression of primes.

Infinitude says nothing by itself about relative frequency or the size of the first prime. The prime number theorem for arithmetic progressions is stronger: for a fixed eligible class, the count is asymptotic to Li⁡(x)/φ(q)\operatorname{Li}(x)/\varphi(q), equivalently to x/(φ(q)log⁡x)x/(\varphi(q)\log x). Here the logarithmic integral can be taken from two to xx; any fixed lower-limit convention changes only a bounded constant. Asymptotic equivalence means the ratio tends to one, not that finite counts become exactly equal.

π(x;q,a)∼Li⁡(x)φ(q)∼xφ(q)log⁡x(x→∞; q,a fixed, (a,q)=1).\pi(x;q,a)\sim\frac{\operatorname{Li}(x)}{\varphi(q)}\sim\frac{x}{\varphi(q)\log x}\qquad(x\to\infty;\ q,a\text{ fixed},\ (a,q)=1).
There are phi(q) eligible classes. The displayed limit fixes the modulus before sending the endpoint to infinity.↔ Scroll wide equations horizontally.

Orthogonality isolates a class

For a fixed unit class aa, sum over all characters modulo qq the value at an integer multiplied by the conjugate character value at aa. On units, finite-group orthogonality makes this sum equal to the group order when the two classes agree and zero otherwise. On nonunits every character vanishes, which agrees with the desired indicator because an eligible class contains only units. The complex conjugate is essential: omitting it generally selects an inverse class rather than the stated class.

Multiply that exact indicator by von Mangoldt weights and sum through a finite endpoint. This expresses the weighted count ψ(x;q,a)\psi(x;q,a) as an average of the twisted counts ψ(x,χ)=∑n≤xΛ(n)χ(n)\psi(x,\chi)=\sum_{n\leq x}\Lambda(n)\chi(n). The principal character produces the main term, with the finitely many prime divisors of the modulus excluded. Nonprincipal terms are controlled through their L-functions. Nonvanishing on the line of real part one, together with an appropriate analytic argument, yields a remainder small compared with the endpoint for each fixed modulus.

ψ(x;q,a)=1φ(q)∑χ mod qχ(a)‾ ψ(x,χ),ψ(x,χ)=∑n≤xΛ(n)χ(n).\psi(x;q,a)=\frac1{\varphi(q)}\sum_{\chi\bmod q}\overline{\chi(a)}\,\psi(x,\chi),\qquad \psi(x,\chi)=\sum_{n\leq x}\Lambda(n)\chi(n).
The finite orthogonality identity is exact; asymptotic estimates enter only when bounding the individual twisted counts.↔ Scroll wide equations horizontally.

Quantifiers determine the strength

A theorem for every fixed modulus does not automatically remain true when the modulus grows with the endpoint. Constants and the threshold after which an error is small may depend on that fixed modulus. Uniform results must specify a range and how the error depends on both variables. For example, the classical Siegel–Walfisz theorem provides uniform asymptotics when q≤(log⁡x)Aq\leq(\log x)^A for each fixed positive AA, with constants that may depend on that parameter and with ineffective constants in the strongest usual formulation.

Real zeros near one explain why uniform error estimates require special care. If a real character has such a zero, its explicit formula contains a slowly decaying term of the form −xβ/β-x^\beta/\beta, and orthogonality transfers that term to residue counts with a character-dependent sign. This describes a conditional mechanism, not an assertion that an exceptional zero exists. Partial summation converts logarithmically weighted prime counts to ordinary counts; contributions from higher prime powers must also be bounded. Neither step licenses replacing a quantified theorem by a claim of perfect finite balance.

Finite imbalance modulo four

Count the primes through thirty in each eligible class modulo four, then recover those counts from the principal and nonprincipal character sums over primes.

  1. The primes in class one are 5,13,17,295,13,17,29, giving four. Those in class three are 3,7,11,19,233,7,11,19,23, giving five. The prime two is a nonunit modulo four and belongs to neither class.

  2. The principal character sum over primes through thirty is nine, since it includes all the odd primes. The nonprincipal character sum is 4−5=−14-5=-1, because it assigns opposite signs to the two eligible classes.

  3. Orthogonality gives the class-one count as (9+(−1))/2=4(9+(-1))/2=4 and the class-three count as (9−(−1))/2=5(9-(-1))/2=5. These are exact unweighted finite identities. The asymptotic theorem predicts their relative discrepancy becomes small at large endpoints, not that this discrepancy must vanish now.

The result

The eligible classes have counts four and five; their difference is precisely the nonprincipal prime-character sum.

Explore the model

Interactive lab

Interactive lab · modular

Inspect eligible positions, then apply an arithmetic filter

Pause/Reset and set modulus 4 and step 1. Step through one complete additive period and identify residues 1 and 3 as units. For a fresh comparison Pause/Reset, set both modulus 6 and step 1; the eligible residues are 1 and 5. Changing a control retains the clock, so reset before comparing.

Inspect eligible positions, then apply an arithmetic filterAddition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Current readings: Residue r0: 0; Orbit period · m/gcd(m,a): 12; Distinct residues visited: 1 of 12. All parameters are adjustable with the labeled controls below.Repeated addition modulo 12: the current residue is 0, and the orbit period is 12.01234567891011+ 5mod 12An additive orbitn = 0rₙ = 0Period = 12Cycle starts at 0:0 → 5 → 10 → 3 →8 → 1 → 6 → 11 →4 → 9 → 2 → 7 → 0Exact residues · two additions per second
Additive orbitCurrent residue / next edge
Residue r0
0
Orbit period · m/gcd(m,a)
12
Distinct residues visited
1 of 12
t = 0 s

Addition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forEligible classes are determined by coprimality. This orbit enumerates residues equally by construction; it neither tests primality nor supplies evidence for prime equidistribution.

Check your understanding

Which assertion correctly handles the coprimality condition in Dirichlet’s theorem?

Try it yourself

Count primes through thirty in the two eligible classes modulo three. Compute the nonprincipal prime-character sum and use it with the principal sum to recover both counts.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Exclude the prime three. The real nonprincipal character is one on residue one and minus one on residue two.

Compare with the solution

Class one contains 7,13,197,13,19, so its count is three. Class two contains 2,5,11,17,23,292,5,11,17,23,29, so its count is six. Excluding three leaves nine primes for the principal sum. The nonprincipal sum is 3−6=−33-6=-3. Thus the two counts are (9−3)/2=3(9-3)/2=3 and (9+3)/2=6(9+3)/2=6. Their substantial small-endpoint imbalance is compatible with a fixed-modulus asymptotic, which concerns the limiting ratio as the endpoint grows rather than an exact equality at thirty.

Take it with you

  • Only classes coprime to the modulus support Dirichlet’s infinitude theorem.
  • Character orthogonality is an exact finite identity before any analytic estimates enter.
  • Fixed-modulus and uniform growing-modulus results have different quantifiers and error requirements.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.