Skip to content

rmathers502-byte/rhymes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Numerical Study of the Explicit Formula Error Term

N-Zero Approximations to ψ(x) and Consistency with the Riemann Hypothesis

Author: Robert Matherson
Version: 2.0.1
Date: May 2026
Preprint: rxiVerse:2605.0015 (superseded by this version)
Archive: Zenodo DOI: 10.5281/zenodo.20113604


Overview

This repository contains the code, data, and results for a numerical study of Riemann's explicit formula for the Chebyshev prime-counting function ψ(x).

The explicit formula expresses ψ(x) as a sum over the non-trivial zeros of the Riemann zeta function ζ(s). Under the assumption that all zeros lie on the critical line Re(s) = 1/2 — the Riemann Hypothesis — each zero pair contributes an equal-amplitude wave in log-space. This study measures how well an N-zero approximation tracks the exact ψ(x) as N increases from 30 to 100,000 across four orders of magnitude from x = 10^5 to x = 10^8.

This is a numerical study, not a proof of the Riemann Hypothesis.
All claims are explicitly bounded and compared against the known conditional result of Schoenfeld (1976).


Key Results

With N = 100,000 zero pairs across x = 10^5 to x = 10^8:

x Max abs error Global max/sqrt(x) Interior max/sqrt(x) Mean drift Schoenfeld on psi(x)-x
10^5 8.68 0.3678 at x=7 0.1089 at x=1013 0.0049 45.4
10^6 28.45 0.3678 at x=7 0.1089 at x=1013 0.0052 58.7
10^7 99.86 0.3678 at x=7 0.1089 at x=1013 0.0053 74.5
10^8 301.61 0.3678 at x=7 0.1089 at x=1013 0.0053 92.1

The headline result is the mean drift: 0.005 ± 0.0004 stable across four orders of magnitude.

The global maximum of 0.3678 and interior maximum of 0.1089 are anchored to fixed small-x points (x=7 and x=1,013) due to the known slow convergence of the explicit formula at small arguments — not a global interior property.

The absolute error grows as sqrt(x) with decade ratio 3.27 — within 3% of the theoretical sqrt(10) = 3.162 — confirming O(sqrt(x)) scaling consistent with RH. All values lie well within the Schoenfeld conditional ceiling throughout.


The Formula

The N-zero approximation is derived directly from the von Mangoldt explicit formula:

psi_N(x) = x - log(2pi) - (1/2)log(1 - x^{-2})
           - sum_{n=1}^{N} [2sqrt(x) / (1/4 + gamma_n^2)]
             * [(1/2)cos(gamma_n log x) + gamma_n sin(gamma_n log x)]

where gamma_n are the imaginary parts of the non-trivial zeros of zeta(s) from Odlyzko (2024). Every parameter is derived — nothing is chosen heuristically.


Repository Structure

RH_Numerical_Study_Matherson_2026/
|
+-- README.md
+-- CITATION.cff
+-- LICENSE.md
|
+-- paper/
|   +-- RH_Numerical_Study_Matherson_2026.pdf
|   +-- RH_Numerical_Study_Matherson_2026.tex
|
+-- code/
|   +-- main.py
|
+-- data/
|   +-- zeros.txt
|   +-- results/
|       +-- run_N30_x1e5.txt
|       +-- run_N1000_x1e5.txt
|       +-- run_N100000_x1e5.txt
|       +-- run_N100000_x1e6.txt
|       +-- run_N100000_x1e7.txt
|       +-- run_N100000_x1e8.txt
|
+-- figures/
    +-- graph_N30_x1e5.png
    +-- graph_N1000_x1e5.png
    +-- graph_N100000_x1e5.png
    +-- graph_N100000_x1e6.png
    +-- graph_N100000_x1e7.png
    +-- graph_N100000_x1e8.png

How to Run

Requirements

pip install numpy matplotlib numba

Parameters

Set these two values at the bottom of main.py:

x_target = 10**5    # x range upper limit
N_ZEROS  = 100_000  # number of zero pairs

Then run:

python main.py

Reproducing the paper experiments

Run N_ZEROS x_target Expected mean drift Notes
1 30 10^5 0.087 Global max at x=88788
2 1,000 10^5 0.030 Global max shifts to x=7
3 100,000 10^5 0.005 Interior max at x=1013
4 100,000 10^6 0.005 Mean drift stable
5 100,000 10^7 0.005 Mean drift stable
6 100,000 10^8 0.005 Mean drift stable

Estimated execution times (Mac Mini, optimised code): runs 1-3 under 30 sec, run 4 ~4 min, run 5 ~40 min, run 6 ~12 hours.

zeros.txt

Contains the imaginary parts gamma_n of the first 100,000 non-trivial zeros of zeta(s), one per line, sourced from:

A. Odlyzko. Tables of zeros of the Riemann zeta function.
http://www.dtc.umn.edu/~odlyzko/zeta_tables/ (2024)

What This Does and Does Not Show

Demonstrated:

  • The N-zero approximation converges to psi(x) as N increases, mean drift falling from 0.087 to 0.005
  • Mean normalised drift stable at 0.005 ± 0.0004 across four orders of magnitude — the primary stability result
  • Absolute error grows as sqrt(x) with decade ratio 3.27, consistent with O(sqrt(x)) predicted by RH
  • Global max of 0.3678 and interior max of 0.1089 are anchored to fixed small-x points (x=7 and x=1,013) due to known slow convergence of the explicit formula at small arguments
  • All values well within the Schoenfeld conditional ceiling throughout

Not demonstrated:

  • That the Riemann Hypothesis is true
  • That E(x) converges to a constant — Littlewood (1914) proved it oscillates infinitely
  • That numerical consistency constitutes independent evidence for RH
  • That the 0.3678 ceiling reflects interior stability — it is a small-x boundary artefact

Version History

Version Date Description
1.0.0 2026-05-03 Initial preprint — rxiVerse:2605.0015
2.0.1 2026-05-11 Corrected framing, correct explicit formula, four-decade results, honest error analysis

The original preprint (v1.0.0) used a heuristic interference model not derived from the explicit formula and made claims beyond what the numerical evidence supported. Version 2.0.1 replaces this with a correctly derived model and honest framing. The rxiVerse timestamp of 2026-05-03 establishes the author's prior engagement with the problem.


References

  1. B. Riemann. On the Number of Prime Numbers less than a Given Quantity. 1859.
  2. H. M. Edwards. Riemann's Zeta Function. Academic Press, 1974.
  3. J. E. Littlewood. Sur la distribution des nombres premiers. Comptes Rendus, 158, 1914.
  4. L. Schoenfeld. Sharper bounds for the Chebyshev functions theta(x) and psi(x), II. Mathematics of Computation, 30(134), 1976.
  5. H. L. Montgomery. The pair correlation of zeros of the zeta function. Analytic Number Theory, 1973.
  6. A. Odlyzko. Tables of zeros of the Riemann zeta function. http://www.dtc.umn.edu/~odlyzko/zeta_tables/, 2024.

Citation

@misc{matherson2026,
  author = {Matherson, Robert},
  title  = {A Numerical Study of the Explicit Formula Error Term:
            N-Zero Approximations to psi(x) and Consistency with
            the Riemann Hypothesis},
  year   = {2026},
  doi    = {10.5281/zenodo.20113604},
  url    = {https://github.com/rmathers502-byte/rhymes},
  note   = {Version 2.0.1}
}

License

Code: MIT License Paper and figures: CC BY 4.0 See LICENSE.md for full terms.