E070: Primes in residue classes: pi(x; q, a).

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

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).

  • q: 10

  • phi(q): 4

  • residues: [1, 3, 7, 9]

  • x_max: 1000000

Figure:

  • fig_01_pi_x_q_a.png

Notes:

  • Curves should be close for large x (equidistribution among reduced residue classes).

params.json (snapshot)
{
  "n_points": 700,
  "q": 10,
  "residues": [
    1,
    3,
    7,
    9
  ],
  "x_max": 1000000
}

References

Apostol [1976], Davenport [2000]