E071: PNT(AP) numerics: pi(x;q,a) - Li(x)/phi(q).

Preview figure for E071

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

The prime number theorem in arithmetic progressions suggests:

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/e071/:

  • figures/fig_01_error_terms.png

How to run

make run EXP=e071

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

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

  • x_max: 1000000

  • li_step: 200

Figure:

  • fig_01_error_terms.png

Notes:

  • The errors oscillate; their fine behavior is linked to zeros of Dirichlet L-functions.

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

References

Apostol [1976], Davenport [2000]