# E070: Primes in residue classes: pi(x; q, a). ```{figure} ../_static/experiments/e070_hero.png :width: 80% :alt: Preview figure for E070 ``` **Tags:** `number-theory`, `quantitative-exploration`, `visualization`, `aps` ## Highlights - Counts primes in residue classes a mod q for several a. - Compares empirical counts to the first-order prediction li(x)/φ(q). - Tracks a simple error proxy across x to visualize deviation patterns. ## What this experiment does This experiment counts primes in selected reduced residue classes modulo q: The implementation focuses on a compact, reproducible numerical workflow: deterministic parameter defaults, structured output folders, and one or more figures saved for the gallery. ## Outputs This experiment writes into `out/e070/`: - `figures/fig_01_pi_x_q_a.png` ## How to run ```bash make run EXP=e070 ``` ## Notes - The gallery preview figure shipped with the documentation uses conservative cutoffs so builds stay fast. If you run the experiment locally, increase the cutoffs to see the asymptotic regime more clearly. - Prime-race plots depend on the chosen sampling of `x` (linear vs. log grid). The qualitative “who leads” picture can change when you zoom in. ## Published run snapshot If this experiment is included in the docs gallery, include the published snapshot (report + params). ```{include} ../reports/e070.md :start-after: "" :end-before: "" ``` ::: {dropdown} params.json (snapshot) :open: ```{literalinclude} ../params/e070.json :language: json ``` ::: ## References {cite:t}`apostol1976introanalyticnumbertheory, davenport2000multiplicativenumbertheory` ## Related experiments - {doc}`e113` (E113: First prime in each residue class) - {doc}`e023` (Residue class distribution mod q) - {doc}`e071` (PNT(AP) numerics: pi(x;q,a) - Li(x)/phi(q).) - {doc}`e072` (Prime race mod 4: pi(x;4,3) vs. pi(x;4,1).) - {doc}`e073` (Prime race mod 3: pi(x;3,2) vs. pi(x;3,1).)