Preprint
Article

This version is not peer-reviewed.

Layers of Prime Gaps and Spectral Inheritance of Noise: An Analytic–Computational Study

Submitted:

21 November 2025

Posted:

25 November 2025

You are already at the latest version

Abstract
This paper presents an analytic and computational framework to study noise in the distribution of prime numbers through layers based on multi-step prime gaps. Given the n-th prime pn, we consider the differences g(k,n) := p(n+k) − p(n), group these distances for different values of k and normalize them by an appropriate logarithmic scale. This produces, for each k, a discrete-time signal that can be analysed with tools from signal processing and control theory (Fourier analysis, resonators, RMS sweeps, and linear combinations). The main conceptual point is that all these layers should inherit the same underlying “noise” coming from the nontrivial zeros of the Riemann zeta function, up to deterministic filtering factors depending on k. We make this idea precise in a heuristic spectral inheritance hypothesis, motivated by the explicit formula and the change of variables t = log x. We then implement the construction computationally for hundreds of thousands of primes and several layers k, and we measure the response of bandpass resonators as a function of their central frequency. The numerical results show three phenomena: (i) the magnitude spectra of the layers share prominent peaks at the same frequencies, (ii) the RMS responses of resonators for different layers display aligned “hills” in the frequency domain, and (iii) a nearly perfect flattening is obtained by taking an appropriate linear combination of layers obtained via singular value decomposition. These findings support the picture that the same spectral content is present across layers and that the differences lie mainly in deterministic gain factors. The framework is deliberately modest from the point of view of number theory: we do not attempt to prove new theorems about primes, but rather to provide a coherent signal- processing view in which standard tools from electrical engineering can be used to explore the noisy side of the prime distribution in a structured way.
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

The distribution of prime numbers encodes deep arithmetic information and has been studied from many perspectives: analytic number theory, probabilistic models, computational experiments, and more recently connections with quantum chaos and random matrices. A central role is played by the Riemann zeta function ζ ( s ) and its nontrivial zeros; through the explicit formulas, these zeros appear as frequencies in oscillatory terms that correct the main asymptotic behaviour.
From the viewpoint of signal processing, it is natural to interpret these oscillatory terms as a kind of noise superimposed on a smooth trend. This has inspired several approaches where one studies the Fourier transform of arithmetic functions, the response of resonators, or the autocorrelation of prime-related sequences. The present work fits into this general philosophy, but focuses on a specific class of observables based on layers of prime gaps.
Given the sequence of primes ( p n ) n 1 , the simplest distance observable is the one-step gap g 1 , n = p n + 1 p n . It is well known that, on average, one has g 1 , n log p n , but the fluctuations around this trend are highly irregular and carry arithmetical information. Instead of looking only at g 1 , n , we consider k–step gaps
g k , n : = p n + k p n
for k = 1 , 2 , 3 , . We refer to the collection { g k , n } n for fixed k as the layer of order k. Intuitively, each layer measures aggregated distances between primes over different scales: k = 1 captures immediate neighbours, k = 2 looks two steps ahead, and so on.
The central idea of this paper is that, after an appropriate normalization based on logarithms, the fluctuations of these layers should all be driven by the same underlying noise, which in turn is governed by the nontrivial zeros of ζ ( s ) . The role of k is then to act as a parameter that changes the effective filter applied to this noise, but not the noise itself. This leads to the notion of spectral inheritance: different layers inherit the same spectral content with different deterministic gains.
Our goal is twofold:
1.
To formulate a precise heuristic framework for spectral inheritance based on the explicit formula and the change of variables t = log x , which is natural from the point of view of the prime number theorem and its refinements.
2.
To implement this framework computationally and examine the spectral properties of several layers via Fourier transforms and resonator sweeps, with particular attention to the alignment of peaks and the possibility of cancelling the noise by linear combinations of layers.
The rest of the paper is organised as follows. Section 2 recalls the explicit formula for the Chebyshev function ψ ( x ) and explains how the zeros of ζ ( s ) appear as frequencies in a variable t = log x . Section 3 introduces the definition of layers, their logarithmic normalization and the resulting discrete-time observables. Section 4 describes the spectral inheritance hypothesis and its interpretation in terms of linear systems and frequency responses. Section 5 presents the numerical methodology (grids in t, FFTs, resonators, and RMS sweeps) and the main experimental results. Finally, Section 6 discusses the limitations of the approach and possible extensions.

2. Background: Explicit Formulas and Logarithmic Time

Let ψ ( x ) denote the Chebyshev function
ψ ( x ) : = p m x log p ,
where the sum runs over prime powers p m . A fundamental result in analytic number theory is that ψ ( x ) admits an explicit formula in terms of the zeros of ζ ( s ) . One convenient form is
ψ ( x ) = x ρ x ρ ρ ζ ( 0 ) ζ ( 0 ) 1 2 log ( 1 x 2 ) ,
where the sum runs over the nontrivial zeros ρ = β + i γ of ζ ( s ) . For our purposes, the key point is that the terms x ρ can be written as
x ρ = x β e i γ log x .
Thus, if we perform the change of variables
t : = log x ,
the oscillatory terms become exponentials e i γ t in the variable t. This suggests that it is natural to think of ψ ( e t ) as a signal in the time variable t, whose spectral content is supported at frequencies γ given by the imaginary parts of the zeros of ζ ( s ) .
More precisely, if we write
ψ ( e t ) = e t + ε ( t ) ,
then ε ( t ) can be expressed (formally) as a superposition of complex exponentials
ε ( t ) ρ e ρ t ρ = ρ e β t ρ e i γ t ,
plus smoother terms. Thus ε ( t ) behaves like a deterministic noise composed of oscillatory modes with frequencies γ , each modulated by an amplitude factor depending on t and on the real part β . If the Riemann hypothesis holds, then β = 1 / 2 for all nontrivial zeros, and the amplitudes decay as e t / 2 .
For our purposes, it suffices to retain the following heuristic picture:
  • There is a natural time variable t = log x in which prime-related quantities can be viewed as signals.
  • The nontrivial zeros of ζ ( s ) provide characteristic frequencies γ that appear in the spectral decomposition of these signals.
  • The smooth main term corresponds to a trend, and the deviations from this trend can be interpreted as noise with a rich frequency structure.
The layers we introduce in the next section are designed so that their fluctuations can be thought of as measurements of this underlying noise.

3. Layers of Prime Gaps and Logarithmic Normalization

Let ( p n ) n 1 be the sequence of prime numbers in increasing order. For each integer k 1 , we define the k–step gap
g k , n : = p n + k p n
for indices n such that p n + k exists in the range of primes we are studying. We call the collection { g k , n } n the layer of order k.
Heuristically, one expects g k , n to be of size k log p n on average, in accordance with the prime number theorem. However, this rule of thumb is not directly suited for spectral analysis, because it does not account for the growth of p n , and it does not provide a natural time parameter. To address this, we introduce a logarithmic normalization and a time variable as follows.
For each k and n we define
t k , n : = 1 k j = 1 k log p n + j ,
which is the logarithm of the geometric mean of the primes p n + 1 , , p n + k . This choice of time variable has two advantages:
  • It centres the measurement of g k , n around the primal mass of the block p n + 1 , , p n + k , rather than on a single endpoint.
  • It ensures that, when k is fixed and n varies, the time points t k , n are approximately equally spaced with respect to the natural density of primes in the logarithmic scale.
We then normalize g k , n by the factor k t k , n and define the dimensionless fluctuation
R k , n : = g k , n k t k , n 1 .
If the simple heuristic g k , n k log p n held exactly at the corresponding logarithmic scale, one would have g k , n k t k , n and hence R k , n 0 . Thus R k , n measures the relative deviation from the expected average behaviour in a scale-invariant way.
The collection { ( t k , n , R k , n ) } n can be viewed as a discrete-time signal for each k, sampled at irregular times t k , n . To perform spectral analysis in a consistent way across different values of k, we interpolate these samples on a common uniform grid in t, as described in Section 5.
The layer index k plays a role analogous to a scale parameter in multiresolution analysis:
  • For k = 1 , we are looking at immediate neighbour distances between consecutive primes.
  • For larger k, we aggregate gaps over longer stretches, which tends to smooth out local irregularities but can enhance the visibility of slower oscillations.
From the viewpoint of spectral inheritance, we expect all layers to be influenced by the same underlying noise, but with different effective frequency responses.

4. Spectral Inheritance and Linear Systems Viewpoint

The explicit formula suggests that many prime-related observables can be expressed, after suitable normalization and change of variables, as linear functionals of the same underlying noise process ε ( t ) . Concretely, we imagine a signal ε ( t ) of the form
ε ( t ) γ A γ ( t ) e i γ t ,
where the sum runs over the imaginary parts γ of the nontrivial zeros of ζ ( s ) and A γ ( t ) are slowly varying amplitudes.
In this picture, our layer signals R k ( t ) (obtained from interpolation) are given by
R k ( t ) h k ( t τ ) ε ( τ ) d τ ,
where h k is an effective kernel that encodes how the layer of order k responds to the underlying noise. This is reminiscent of a linear time-invariant system, although the dependence of A γ ( t ) on t means that the system is only approximately time-invariant over finite windows.
Taking Fourier transforms in t leads to
R k ^ ( ω ) H k ( ω ) ε ^ ( ω ) ,
where H k ( ω ) is the frequency response of the k–th layer. If the main spectral content of ε ( t ) is concentrated at frequencies γ corresponding to zeros of ζ ( s ) , then we expect that:
  • The spectra R k ^ ( ω ) for different k share pronounced peaks at the same frequencies.
  • The amplitudes of these peaks differ according to the gain factors H k ( γ ) .
  • Linear combinations of the R k can be used to enhance or suppress particular frequencies, similarly to the design of filters in electrical engineering.
We refer to this phenomenon as spectral inheritance: the layers inherit the same set of frequencies from the underlying noise, and the differences between layers are captured by deterministic filters.
From a practical standpoint, this viewpoint motivates the following numerical experiments:
1.
Compute the magnitude spectra of several layers R k via FFT on a common time grid and look for aligned peaks.
2.
Drive simple second-order resonators with R k ( t ) and measure the root mean square (RMS) output as a function of the resonator centre frequency, looking for aligned “hills”.
3.
Use singular value decomposition (SVD) to search for linear combinations of layers that produce nearly flat responses, indicating cancellation of the inherited noise.
These experiments are described in detail in the next section.

5. Numerical Methodology and Experiments

5.1. Data and Layers

We work with the first N primes p 1 , , p N , where N is chosen large enough to provide good frequency resolution while keeping the computational cost manageable. In the experiments reported here, we used values of N up to 10 5 , with most figures based on N = 10 4 to facilitate reproducibility.
For each k in a chosen set (typically k = 1 , 2 , 3 , 4 ), we compute the k–step gaps
g k , n = p n + k p n ,
the logarithmic times
t k , n = 1 k j = 1 k log p n + j ,
and the normalized deviations
R k , n = g k , n k t k , n 1 .
This yields, for each k, a cloud of points ( t k , n , R k , n ) .
Since the t k , n are not exactly equally spaced and the ranges of t k , n differ slightly with k, we proceed as follows:
  • We determine an interval [ t min , t max ] that is common to all considered layers by intersecting their ranges.
  • We construct a uniform grid t j = t min + j Δ t for j = 0 , , M 1 with M a power of two (to facilitate FFT).
  • For each k, we interpolate R k , n onto t j using simple linear interpolation, obtaining a sampled signal R k ( t j ) on the common grid.
The choice of M controls the frequency resolution; in the figures, we typically take M = 4096 or M = 8192 .

5.2. Spectral Estimation via FFT

Given a sampled signal R k ( t j ) on the grid t j , we subtract its empirical mean to focus on fluctuations and apply a Hann window to reduce spectral leakage:
X k [ j ] = R k ( t j ) R ¯ k w j ,
where w j = 1 2 1 cos ( 2 π j / ( M 1 ) ) . We then compute the discrete Fourier transform
F k [ ] = j = 0 M 1 X k [ j ] e i ω t j ,
with frequencies ω = 2 π / ( M Δ t ) for = 0 , , M 1 .
In practice, we use the real-to-complex FFT provided by standard libraries and retain only the nonnegative frequencies. The magnitude spectrum is given by | F k [ ] | , and we interpret | F k ( ω ) | as a discrete approximation to the frequency response of the k–th layer.
Figure 1 shows the magnitude spectra for k = 1 , 2 , 3 , 4 up to a certain cutoff in ω , highlighting the presence of common peaks.

5.3. Resonator Sweeps and RMS Response

While FFTs provide a global view of the spectral content, it is also informative to probe the layers with simple bandpass filters and measure their output energy as a function of the central frequency. This is analogous to sweeping a resonator across frequencies and monitoring its RMS response.
We consider a family of discrete-time second-order resonators parameterised by a central frequency ω 0 and a damping factor 0 < r < 1 . A simple model is given by the difference equation
y [ j ] = 2 r cos ( ω 0 Δ t ) y [ j 1 ] r 2 y [ j 2 ] + x [ j ] ,
where x [ j ] is the input signal (in our case, X k [ j ] ) and y [ j ] is the output. For each ω 0 in a chosen range, we iterate this filter and compute the RMS value of y [ j ] after discarding an initial transient:
RMS k ( ω 0 ) = 1 J j y [ j ] 2 .
This procedure yields, for each layer k, a function ω 0 RMS k ( ω 0 ) that indicates how strongly the layer excites the resonator at each frequency. If the underlying noise has peaks at frequencies γ , we expect the RMS curves for different layers to exhibit bumps or “hills” centred near these frequencies.
Figure 2 shows the RMS sweeps for k = 1 , 2 , 3 , 4 over a range of ω 0 . The curves share several aligned features, with overall amplitude decreasing as k increases.

5.4. Difference of Layers and Near-Flat Linear Combinations

To probe the coherence of the inherited noise across layers, we consider two related constructions.
First, we examine the simple difference of RMS responses between layers, for instance
Δ 1 , 2 ( ω 0 ) : = RMS 1 ( ω 0 ) RMS 2 ( ω 0 ) .
If the layers inherit the same spectral content with different amplitudes, we expect Δ 1 , 2 to exhibit a smoother profile than the individual RMS curves, although not perfectly flat because of amplitude mismatches and residual differences.
Figure 3 shows RMS 1 ( ω 0 ) , RMS 2 ( ω 0 ) , and their difference Δ 1 , 2 ( ω 0 ) . The difference curve has significantly reduced amplitude compared to the individual RMS curves, indicating partial cancellation of the common noise.
Second, we search for linear combinations of RMS curves that are as flat as possible. Concretely, let K be the number of layers considered, and let X denote the L × K matrix whose columns are the sampled RMS curves RMS k ( ω 0 ) over L frequency points. We then look for a vector of coefficients c such that X c is nearly constant (or nearly zero) as a function of ω 0 .
A convenient way to implement this is via singular value decomposition (SVD) applied to the centred matrix
X ˜ = X 1 m ,
where m is the vector of column means and 1 is a vector of ones. The right singular vector corresponding to the smallest singular value provides a candidate coefficient vector c that minimizes the variance of X c .
Figure 4 shows one such almost-flat combination obtained from four layers. The resulting curve is very close to zero across the explored frequency range, providing strong evidence that the layers share a common spectral structure that can be cancelled by an appropriate linear combination.

5.5. Summary of Numerical Steps

For clarity and reproducibility, we summarise here the main steps of the numerical pipeline as pseudocode.
In the final version of the paper we plan to include a code repository (e.g. on GitHub) with the scripts used.

Basic pseudocode.

Preprints 186218 i001
Preprints 186218 i002
To compare observed spectral peaks with the imaginary parts of zeros of ζ ( s ) , we proceed as follows:
1.
Estimate the position of the main spectral peaks (e.g. via local parabolic interpolation around the discrete maximum).
2.
Record the observed frequency ω obs .
3.
Compare it with a known zero γ j and compute the relative error
err rel : = | ω obs γ j | γ j .
For N = 10 4 primes and layers k = 1 , 2 , 3 , 4 , the most prominent peaks of the spectra | F k ( ω ) | in the range ω 50 appear at frequencies ω obs 14.11 , 21.16 , 33.34 , and 37.83 . When these values are compared with the imaginary parts γ j of the first nontrivial zeros of ζ ( s ) , we obtain the correspondence shown in Table 1. The relative errors | ω obs γ j | / γ j lie between 2 × 10 3 and 1.3 × 10 2 , which is compatible with the finite-length resolution of the window in t and the discretization of the frequency grid.
This quantitative agreement is consistent with the qualitative picture of Section 2: the layer observables act as linear functionals of the same underlying noise ε ( t ) , and therefore they inherit the same set of frequencies γ j . What changes from one layer to another are the filtering factors (determined by the corresponding windows), which modulate the amplitudes but do not create new frequencies. These peaks occur in the same bands where Figure 1 and Figure 2 display the most pronounced structures, reinforcing the interpretation of a common background spectrum shared by all layers.

5.6. Resonator sweeps by layer

The sweeps ω 0 RMS k ( ω 0 ) for k = 1 , 2 , 3 , 4 share the following features:
  • A pronounced maximum at low frequencies (for instance around ω 0 5 ).
  • “Hills” or bumps in intervals of ω 0 that align across layers.
  • Relative amplitudes that decrease with k, roughly in a way compatible with the normalisation by k t k , n .
These observations are consistent with the interpretation that all layers inherit the same spectral content with different gain factors.

6. Discussion and Outlook

The experiments reported here support the spectral inheritance picture for layers of prime gaps. The magnitude spectra of the normalized deviations R k exhibit common peaks at frequencies compatible with the imaginary parts of nontrivial zeros of ζ ( s ) . The resonator sweeps show aligned hills across layers and a clear decrease of overall amplitude with k. The construction of nearly flat linear combinations via SVD provides a striking visual confirmation that the layers share a coherent noise component that can be cancelled.
From the standpoint of number theory, these findings are heuristic and do not prove new theorems about primes. However, they offer a structured way to view the noisy part of prime distributions through the lens of linear systems and signal processing. Several directions for further work suggest themselves:
  • Refining the normalisation and time parameter to better match rigorous asymptotics from the explicit formula.
  • Extending the analysis to other arithmetic sequences, such as prime pairs, prime k–tuples, or values of Λ ( n ) in short intervals.
  • Designing resonators tuned to specific hypothetical zeros and studying how the RMS response changes under perturbations of the zero set.
  • Exploring connections with random matrix models by comparing the empirical spectra of layers with those of suitable ensembles.
More broadly, the methodology illustrates how a toolbox from electrical engineering—Fourier analysis, windowing, resonators, RMS measurements, and SVD—can be fruitfully applied to classical problems in analytic number theory. Even if the ultimate questions (such as the Riemann hypothesis) remain out of reach, such interdisciplinary views can provide new intuitions and suggest novel quantitative conjectures.

Acknowledgments

The author thanks the mathematical and engineering communities for the many freely available resources (textbooks, lecture notes, software libraries) that make this kind of cross-disciplinary experiment possible.

References

  1. H. M. Edwards, Riemann’s Zeta Function, Dover Publications, 2001.
  2. A. Ivić, The Riemann Zeta-Function, Dover Publications, 2003.
  3. H. L. Montgomery and R. C. Vaughan, Multiplicative Number Theory I: Classical Theory, Cambridge Studies in Advanced Mathematics, Cambridge University Press, 2007.
  4. A. M. Odlyzko, The 1020-th zero of the Riemann zeta function and 175 million of its neighbors, preprint, available from the author’s webpage.
  5. T. Tao, Various blog posts on the distribution of primes and the Riemann zeta function, https://terrytao.wordpress.com.
Figure 1. Magnitude spectra | F k ( ω ) | for layers k = 1 , 2 , 3 , 4 , computed from normalized deviations R k , n interpolated onto a common grid in t = log x , windowed with a Hann window, and transformed via FFT. The main peaks appear at essentially the same frequencies for all layers, with amplitudes decreasing with k.
Figure 1. Magnitude spectra | F k ( ω ) | for layers k = 1 , 2 , 3 , 4 , computed from normalized deviations R k , n interpolated onto a common grid in t = log x , windowed with a Hann window, and transformed via FFT. The main peaks appear at essentially the same frequencies for all layers, with amplitudes decreasing with k.
Preprints 186218 g001
Figure 2. Resonator sweeps ω 0 RMS k ( ω 0 ) for layers k = 1 , 2 , 3 , 4 , obtained by driving a second-order bandpass filter with the windowed signals X k [ j ] . The curves share common “hills” at similar values of ω 0 , while the overall amplitude decreases with k.
Figure 2. Resonator sweeps ω 0 RMS k ( ω 0 ) for layers k = 1 , 2 , 3 , 4 , obtained by driving a second-order bandpass filter with the windowed signals X k [ j ] . The curves share common “hills” at similar values of ω 0 , while the overall amplitude decreases with k.
Preprints 186218 g002
Figure 3. Resonator sweeps for layers k = 1 and k = 2 , and their difference Δ 1 , 2 ( ω 0 ) = RMS 1 ( ω 0 ) RMS 2 ( ω 0 ) . The difference curve has substantially lower amplitude, reflecting partial cancellation of the inherited spectral content.
Figure 3. Resonator sweeps for layers k = 1 and k = 2 , and their difference Δ 1 , 2 ( ω 0 ) = RMS 1 ( ω 0 ) RMS 2 ( ω 0 ) . The difference curve has substantially lower amplitude, reflecting partial cancellation of the inherited spectral content.
Preprints 186218 g003
Figure 4. Resonator sweeps RMS k ( ω 0 ) for layers k = 1 , 2 , 3 , 4 (thin curves) and a nearly flat linear combination (thick curve) obtained via SVD on the centred RMS matrix. The near cancellation supports the idea of a common inherited noise across layers.
Figure 4. Resonator sweeps RMS k ( ω 0 ) for layers k = 1 , 2 , 3 , 4 (thin curves) and a nearly flat linear combination (thick curve) obtained via SVD on the centred RMS matrix. The near cancellation supports the idea of a common inherited noise across layers.
Preprints 186218 g004
Table 1. Correspondence between main observed frequencies in the layer spectra and the imaginary parts γ j of nontrivial zeros of ζ ( s ) , for N = 10 4 primes and M = 4096 grid points in the variable t = log x .
Table 1. Correspondence between main observed frequencies in the layer spectra and the imaginary parts γ j of nontrivial zeros of ζ ( s ) , for N = 10 4 primes and M = 4096 grid points in the variable t = log x .
Peak Observed frequency ω obs Zeta zero γ j Relative error | ω obs γ j | / γ j
1 14.11 γ 1 14.13 1.9 × 10 3
2 21.16 γ 2 21.02 6.6 × 10 3
3 33.34 γ 5 32.94 1.24 × 10 2
4 37.83 γ 6 37.59 6.6 × 10 3
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated