Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
py-mathx-lab documentation
Light Logo Dark Logo

Guide

  • Mathematical experimentation
  • Getting started
  • Development

Experiments

  • Valid Tags
  • Experiments Gallery
    • E001: Taylor Error Landscapes
    • E002: Even Perfect Numbers — Generator and Growth
    • E003: Abundancy Index Landscape
    • E004: Computing \(\sigma(n)\) at Scale — Sieve vs. Factorization
    • E005: Odd Perfect Numbers — Constraint Filter Pipeline
    • E006: Near Misses to Perfection
    • E007: Mersenne growth (bits and digits)
    • E008: Lucas–Lehmer scan (prime exponents)
    • E009: Small-factor scan for Mersenne numbers
    • E010: Even perfect numbers from Mersenne primes
    • E011: Heuristic rarity of Mersenne primes
    • E012: Fermat pseudoprimes and Carmichael numbers (counterexamples)
    • E013: Prime-polynomial counterexamples (Euler’s \(n^2 + n + 41\))
    • E014: Primorial ± 1 counterexamples
    • E015: Wilson test infeasibility
    • E016: Trial division vs. Miller–Rabin scaling
    • E017: Sieve memory blow-up vs. segmented sieve
    • E018: Miller–Rabin base choice counterexamples
    • E019: Prime counting and a PNT baseline
    • E020: Compare pi(x) to li(x) numerically
    • E021: Explicit bounds sanity checks
    • E022: Prime race modulo 4
    • E023: Residue class distribution mod q
    • E024: Ulam spiral structure
    • E025: Prime gaps are not monotone
    • E026: Normalized prime gaps
    • E027: Record prime gaps vs. log^2 heuristic
    • E028: Jumping champions (most frequent gaps)
    • E029: Twin primes: observed vs. heuristic
    • E030: Cousin and sexy prime pairs
    • E031: Admissibility and modular obstructions
    • E032: Prime triplets and quadruplets
    • E033: Bounded gaps vs. twin primes (not the same)
    • E034: Twin primes in sliding windows
    • E035: Primes in arithmetic progressions mod q
    • E036: Prime arithmetic progressions (small search)
    • E037: Prime-free intervals via factorial construction
    • E038: Bertrand’s postulate (computational verification)
    • E039: Sophie Germain and safe primes
    • E040: Palindromic primes and the ‘11 trap’
    • E041: Fermat numbers: not all prime
    • E042: Repunit primes (small k scan)
    • E043: Pollard rho runtime variability
    • E044: Solovay–Strassen vs. Miller–Rabin (liars)
    • E045: Deterministic 64-bit MR base sets
    • E046: Prime-testing pipeline and tuning pitfalls
    • E047: Fermat numbers: Pépin test + factor witnesses
    • E048: Carmichael numbers: Korselt scan + Fermat counterexamples
    • E049: Wieferich primes (base 2): scan and quotient visualization
    • E050: Primorials and Euclid numbers: \(p\#\pm 1\) are usually composite
    • E051: Semiprimes: balanced vs. unbalanced factorization timing
    • E052: Totient ratio landscape
    • E053: Inverse totient multiplicities
    • E054: Squarefree density via Möbius
    • E055: Mertens function walk
    • E056: Liouville vs. Möbius walks
    • E057: Erdős–Kac in practice
    • E058: Divisor-count record highs
    • E059: Abundancy index landscape
    • E060: Jordan totients
    • E061: Chebyshev ψ(x) and prime powers
    • E062: Carmichael λ(n) vs. φ(n)
    • E063: Dirichlet convolution playground
    • E064: Dirichlet character tables (phase view).
    • E065: Orthogonality matrix for Dirichlet characters.
    • E066: Character partial sums: cancellation profiles.
    • E067: Gauss sums: magnitude vs. sqrt(q).
    • E068: Dirichlet L(s,χ): series vs. Euler product (partial approximations).
    • E069: L(1,χ): slow convergence and smoothing.
    • E070: Primes in residue classes: pi(x; q, a).
    • E071: PNT(AP) numerics: pi(x;q,a) - Li(x)/phi(q).
    • E072: Prime race mod 4: pi(x;4,3) vs. pi(x;4,1).
    • E073: Prime race mod 3: pi(x;3,2) vs. pi(x;3,1).
    • E074: Prime race mod 8: leaderboard among 1,3,5,7.
    • E075: Prime race statistic: distribution on a log-grid.
    • E076: Chebyshev θ(x;q,a): weighted prime counts in progressions.
    • E077: Indicator via character orthogonality (sanity check).
    • E078: Max partial sums across characters.
    • E079: Primitive vs. imprimitive characters: conductors.
    • E080: Chebyshev bias: leader fraction vs. x.
    • E081: Prime race sign changes: first crossings table.
    • E082: Zeta(s) series convergence
    • E083: Series vs. Euler product (ζ)
    • E084: |ζ(1/2+it)| growth snapshots
    • E085: Dirichlet eta acceleration for ζ(s)
    • E086: Hardy Z(t) near zeros
    • E087: Gram points and spacing
    • E088: Zero counting via Riemann–von Mangoldt
    • E089: log|ζ(s)| heatmap
    • E090: Functional equation residual heatmap
    • E091: Partial Euler products on the critical line
    • E092: 1/ζ(s) via the Möbius Dirichlet series
    • E093: −ζ′(s)/ζ(s) via the von Mangoldt series
    • E094: ω(n) vs. Ω(n): Erdős–Kac normalization
    • E095: Squarefree filter: ω(n)=Ω(n) when μ(n)≠0
    • E096: Record-holders for τ(n)
    • E097: σ(n)/n landscape: deficient, perfect, abundant
    • E098: Maximizers of σ(n)/n^α across α
    • E099: Jordan totients J_k: identities and ratios
    • E100: Carmichael λ(n) vs. Euler φ(n)
    • E101: Reduced residues modulo q: concrete structure
    • E102: Dirichlet convolution identity zoo
    • E103: Chebyshev ψ(x): prime powers drive jumps
    • E104: von Mangoldt Λ(n): support and statistics
    • E105: Mertens M(x): scaling views
    • E106: Character gallery: real vs. complex
    • E107: Conductor: primitive vs. induced characters
    • E108: Orthogonality heatmap for characters
    • E109: Gauss sums: magnitude patterns
    • E110: Dirichlet L-series partial sums at s=1 and s=1/2
    • E111: Euler product vs. Dirichlet series for L(s,χ)
    • E112: Prime race: π(x;q,a) − π(x;q,b)
    • E113: First prime in each residue class
    • E114: ζ via η: stability map on the critical line
    • E115: Hardy Z: sign changes and zero bracketing
    • E116: Gram points and zero-counting heuristics
    • E117: Prime-counting approximations: li(x) and friends
    • E118: Chebyshev bias: lead-time statistics
    • E119: Summatory totient Φ(x) scaling check
    • E120: Liouville λ(n): partial sums and parity
    • E121: Möbius inversion as convolution undo
    • E122: Character averages over primes
    • E123: π(x;q,a) vs. a simple baseline
    • E124: Klauber triangle structure
    • E125: Sacks spiral structure
    • E126: Hexagonal number spiral structure
    • E127: Quadratic prime-run atlas (\(n^2 + a n + b\))
    • E128: Quadratic modular obstructions (Euler-type)
    • E129: Euler lucky constants for \(n^2 + n + b\)
  • Experiment Status

Background

  • Background
    • Cheat sheet
    • Arithmetic functions refresher
    • Average orders and the Erdős–Kac viewpoint
    • Carmichael numbers
    • Carmichael’s \(\lambda(n)\) function refresher
    • Dirichlet characters refresher
    • Dirichlet convolution refresher
    • Dirichlet eta function η(s)
    • Dirichlet \(L\)-functions refresher
    • Divisibility and modular arithmetic (Phase 2 core)
    • Divisor functions \(d(n)\) and \(\sigma_k(n)\) refresher
    • Euler’s prime-generating polynomial refresher
    • Euler’s totient function \(\varphi(n)\) refresher
    • Explicit formulas: primes ↔ zeros
    • Exploratory visualizations for arithmetic functions
    • Factorization pipelines (trial division + Pollard rho)
    • Fermat numbers
    • Gauss sums refresher
    • Gram points and zero counting
    • Hardy’s Z-function and the critical line
    • Heegner numbers
    • Jordan totient \(J_k(n)\) refresher
    • Landau’s problems refresher
    • Liouville function \(\lambda(n)\) refresher
    • Mersenne numbers and primes refresher
    • Möbius function \(\mu(n)\) and Mertens function \(M(x)\) refresher
    • Partition function \(p(n)\) refresher
    • Perfect numbers refresher
    • Pretentious number theory refresher
    • Primality testing: guarantees, error bounds, and what to report
    • Prime counting approximations: π(x), Li(x), and R(x)
    • Prime counting: explicit bounds (not just asymptotics)
    • Prime-factor counting: \(\omega(n)\) and \(\Omega(n)\) refresher
    • Prime number races refresher
    • Prime numbers refresher
    • Dirichlet’s theorem and PNT(AP) in the form used by the experiments
    • Primorials
    • Quadratic polynomials (algebraic) refresher
    • Riemann zeta function ζ(s)
    • Semiprimes
    • Taylor series refresher
    • von Mangoldt \(\Lambda(n)\) and Chebyshev functions refresher
    • Wieferich primes
  • References

Downloads

  • PDF download

API

  • API Reference
    • Experiment framework (mathxlab.exp)
      • mathxlab.exp.cli
      • mathxlab.exp.io
      • mathxlab.exp.logging
      • mathxlab.exp.logging_setup
      • mathxlab.exp.random
      • mathxlab.exp.reporting
      • mathxlab.exp.run_logging
      • mathxlab.exp.seeding
    • Experiment registry (mathxlab.experiments)
      • mathxlab.experiments
      • mathxlab.experiments.number_theory_suite
      • mathxlab.experiments.prime_suite
      • mathxlab.experiments.spiral_suite
    • Number theory (mathxlab.nt)
      • mathxlab.nt.arithmetic
      • mathxlab.nt.convolution
      • mathxlab.nt.dirichlet
      • mathxlab.nt.zeta
    • Numerics (mathxlab.num)
      • mathxlab.num.series
    • Plotting helpers (mathxlab.plots)
      • mathxlab.plots.helpers
    • Utilities (mathxlab.utils)
      • mathxlab.utils.plotting
    • Visualization backends (mathxlab.viz)
      • mathxlab.viz.mpl
  • Experiment framework (mathxlab.exp)
    • mathxlab.exp.cli
    • mathxlab.exp.io
    • mathxlab.exp.logging
    • mathxlab.exp.logging_setup
    • mathxlab.exp.random
    • mathxlab.exp.reporting
    • mathxlab.exp.run_logging
    • mathxlab.exp.seeding
  • Experiment registry (mathxlab.experiments)
    • mathxlab.experiments
    • mathxlab.experiments.number_theory_suite
    • mathxlab.experiments.prime_suite
    • mathxlab.experiments.spiral_suite
  • Number theory (mathxlab.nt)
    • mathxlab.nt.arithmetic
    • mathxlab.nt.convolution
    • mathxlab.nt.dirichlet
    • mathxlab.nt.zeta
  • Numerics (mathxlab.num)
    • mathxlab.num.series
  • Plotting helpers (mathxlab.plots)
    • mathxlab.plots.helpers
  • Utilities (mathxlab.utils)
    • mathxlab.utils.plotting
  • Visualization backends (mathxlab.viz)
    • mathxlab.viz.mpl
Back to top
View this page

E036: Prime arithmetic progressions (small search)¶

Preview figure for E036

Tags: number-theory, quantitative-exploration, visualization See: Valid Tags.

Highlights¶

  • This is a thin wrapper that follows the standard experiment template and delegates the actual computation to :mod:mathxlab.experiments.prime_suite.

  • Writes reproducible artifacts (params.json, report.md, and figures).

  • Designed to surface patterns and “looks-true-until-it-breaks” behavior.

Goal¶

This is a thin wrapper that follows the standard experiment template and delegates the actual computation to :mod:mathxlab.experiments.prime_suite.

Background (quick refresher)¶

  • Prime numbers refresher

Research question¶

Which prime-related claim, heuristic, or algorithm breaks first under a clean, controlled computational sweep, and what does the smallest or clearest counterexample (or deviation) look like?

Why this qualifies as a mathematical experiment¶

  • Finite procedure: run a bounded search / sweep with recorded parameters.

  • Observable(s): counts, gaps, residues, runtime scaling, or first counterexample witnesses.

  • Parameter space: vary bounds (and sometimes algorithmic choices).

  • Outcome: plots/tables + “witness objects” for failures.

  • Reproducibility: outputs saved to out/e036/ with a parameter snapshot.

Experiment design¶

  • Computation: bounded enumeration / sampling with explicit limits.

  • Outputs: figures and a short report.md summarizing what was found.

  • Artifacts written:

  • figures/fig_*.png

  • params.json

  • report.md

How to run¶

make run EXP=e036

or:

uv run python -m mathxlab.experiments.e036

Notes / pitfalls¶

  • “No counterexample found” only means “none found within the configured bounds”.

  • For probabilistic tests (when used), treat outcomes as evidence, not proof.

Extensions¶

  • Increase bounds and rerun (recording runtime and memory).

  • Compare alternative heuristics or algorithms on the same parameter grid.

  • Turn found deviations into new, tighter conjectures.

Published run snapshot¶

If this experiment is included in the docs gallery, include the published snapshot (report + params).

Reproduce:

make run EXP=e036

Parameters¶

  • n_max: 2000000

  • max_d: 5000

Notes¶

  • This is a finite search for short APs, not a proof of existence for arbitrary lengths.

  • Even small ranges contain many 3-term APs; 4-term APs are rarer but still appear.

Sample progressions¶

  • 3-term examples: [(3, 5, 7), (3, 7, 11), (3, 11, 19), (3, 13, 23), (3, 17, 31)]

  • 4-term examples: [(5, 11, 17, 23), (5, 17, 29, 41), (5, 23, 41, 59), (5, 47, 89, 131), (5, 53, 101, 149)]

params.json (snapshot)
{
  "max_d": 5000,
  "n_max": 2000000
}

References¶

See References.

Related experiments¶

  • E035: Primes in arithmetic progressions mod q (Primes in arithmetic progressions mod q)

  • E009: Small-factor scan for Mersenne numbers (Small-factor scan for Mersenne numbers)

  • E042: Repunit primes (small k scan) (Repunit primes (small k scan))

  • E076: Chebyshev θ(x;q,a): weighted prime counts in progressions. (Chebyshev θ(x;q,a): weighted prime counts in progressions.)

  • E002: Even Perfect Numbers — Generator and Growth (Even Perfect Numbers — Generator and Growth)

Next
E037: Prime-free intervals via factorial construction
Previous
E035: Primes in arithmetic progressions mod q
Copyright © 2025-2026, Walter Weinmann
Made with Sphinx and @pradyunsg's Furo
On this page
  • E036: Prime arithmetic progressions (small search)
    • Highlights
    • Goal
    • Background (quick refresher)
    • Research question
    • Why this qualifies as a mathematical experiment
    • Experiment design
    • How to run
    • Notes / pitfalls
    • Extensions
    • Published run snapshot
      • Parameters
      • Notes
    • Sample progressions
    • References
    • Related experiments