Primes in arithmetic progressions
Use character orthogonality to separate eligible residue classes and scope their prime-counting asymptotics.
On this page
The question for today
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 and with , let count primes at most congruent to modulo . 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 , equivalently to . Here the logarithmic integral can be taken from two to ; 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.
Orthogonality isolates a class
For a fixed unit class , sum over all characters modulo the value at an integer multiplied by the conjugate character value at . 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 as an average of the twisted counts . 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.
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 for each fixed positive , 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 , 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.
Work it through
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.
The primes in class one are , giving four. Those in class three are , giving five. The prime two is a nonunit modulo four and belongs to neither class.
The principal character sum over primes through thirty is nine, since it includes all the odd primes. The nonprincipal character sum is , because it assigns opposite signs to the two eligible classes.
Orthogonality gives the class-one count as and the class-three count as . 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 eligible classes have counts four and five; their difference is precisely the nonprincipal prime-character sum.
The living notebook
Explore the model
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.
- Residue r0
- 0
- Orbit period · m/gcd(m,a)
- 12
- Distinct residues visited
- 1 of 12
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.
Pause & reason
Check your understanding
Your turn
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 , so its count is three. Class two contains , so its count is six. Excluding three leaves nine primes for the principal sum. The nonprincipal sum is . Thus the two counts are and . 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.
Keep the idea
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.