Computing the Prime Wave: A complete guide for the rest of us.






Introduction: From Arithmetic to Geometry—Reframing the Integers

I. The Failure of Arithmetic Ontology

The natural numbers—1, 2, 3, 4, 5, …—have been studied for millennia. Yet despite their seeming simplicity, no aspect of number theory has evaded explanation more persistently than the behavior of prime numbers. These indivisible entities form the atomic core of all integers, and yet their distribution has eluded deterministic generation for centuries.

Traditional number theory relies on arithmetic constructs:

  • Division

  • Modular congruence

  • Sieve-based algorithms (e.g. Eratosthenes, Atkin, or Miller-Rabin)

  • Abstract analytic continuation (e.g. ζ(s), Dirichlet L-functions)

All of these techniques, while ingenious, suffer from the same core limitation: they test numbers for primality—they do not explain why primes arise at specific locations.

This manual introduces a new lens through which to view the integers—not as static entries in a sequence, but as rotational harmonic fields.

In this view:

  • Every integer induces a curvature field over a closed domain.

  • Divisibility becomes interference: the more divisors an integer has, the more it bends the field.

  • A prime number is a node of total cancellation—the only integer for which the field remains flat across all angular positions.

This is not numerology. It is not metaphor.

It is a shift from arithmetic symbolism to geometric behavior. And it is implemented, tested, and visualized through Python.


II. The Geometry of Divisors: Curvature Fields on the Circle

We begin with a redefinition.

Let the angular variable θ[0,2π)\theta \in [0, 2\pi) parameterize a circle. We interpret each integer nZ+n \in \mathbb{Z}^+ as a wave-bearing object, not a point. Each of its nontrivial divisors (those not equal to 1 or nn) imposes a rotational harmonic onto the circle.

Definition: The Divisor Curvature Field

For an integer nn, define:

Dn(θ)=2dn1<d<ncos(dθ)\mathcal{D}_n(\theta) = -2 \sum_{\substack{d \mid n \\ 1 < d < n}} \cos(d\theta)

This is the curvature field induced by the internal structure of nn. It represents the superposition of cosine waves at each divisor frequency dd.

  • If nn is prime, the sum is empty. Thus:

Dp(θ)=0θ\mathcal{D}_p(\theta) = 0 \quad \forall \theta
  • If nn is composite, this field contains standing-wave deformation nodes—constructive and destructive interference patterns created by the divisors.

Interpretation:
This field measures the bending of the circular domain caused by an integer’s divisor structure. The more divisors, the more complex the wave. Only primes leave the circle unbent.


III. Measuring the Field: Energy, Cancellation, and Silence

A field is not fully characterized by its shape. We require a measure of how much deformation it holds—its total energy.

Definition: The Total Curvature Energy

En(θ)=Dn2(θ)+(dDndθ)2E_n(\theta) = \mathcal{D}_n^2(\theta) + \left( \frac{d\mathcal{D}_n}{d\theta} \right)^2

This expression combines:

  • The in-phase deformation: Dn(θ)2\mathcal{D}_n(\theta)^2

  • The quadrature deformation: the derivative squared, capturing slope and turning points.

Together, this forms the angular energy density associated with the field.

But energy includes both structure and background bias. We must isolate interference patterns only.

Definition: Grounded Curvature Energy

To remove the DC (mean) component, define:

Enref(θ)=En(θ)12π02πEn(ϕ)dϕE_n^{\text{ref}}(\theta) = E_n(\theta) - \frac{1}{2\pi} \int_0^{2\pi} E_n(\phi) \, d\phi

This “grounds” the energy. It cancels uniform offset, leaving only relative curvature variation.

Now the test becomes exact:

  • If Enref(θ)=0E_n^{\text{ref}}(\theta) = 0, the integer is prime

  • Otherwise, it's composite

This is a functional test for primality—deterministic, geometrically grounded, and free of division or remainder tests.


IV. From Curvature to Spectrum: Factorization as Frequency Content

The divisor structure of nn is hidden in the frequencies used in the curvature field.

A cosine term cos(dθ)\cos(d\theta) for divisor dd introduces energy at frequency dd.

Thus, to see the divisor structure, we use:

Definition: Spectral Signature

Fn(f)=FFT(Enref(θ))F_n(f) = |\text{FFT}(E_n^{\text{ref}}(\theta))|

Here, the Fast Fourier Transform reveals energy spikes at the exact divisor frequencies.

Implication:

  • If nn is composite, the spectrum is nonzero.

  • If nn is prime, the spectrum is entirely flat—no frequencies appear.


V. The Curvature Zeta Function

From this energy-based model, we define a new zeta analog:

Definition: Curvature Zeta Function

ζcurv(s)=n=1AnnswhereAn=02πEnref(θ)dθ\zeta_{\text{curv}}(s) = \sum_{n=1}^{\infty} \frac{A_n}{n^s} \quad \text{where} \quad A_n = \int_0^{2\pi} E_n^{\text{ref}}(\theta) \, d\theta

This sum mirrors the Riemann zeta function, but replaces the unit coefficients 11 with physically computed curvature energies.

  • For primes, Ap=0A_p = 0

  • For composites, An>0A_n > 0

Hence, only composites contribute to the curvature zeta function.

This formalism gives geometric meaning to prime distribution and prepares the ground for a wave-propagated prime discovery mechanism.


VI. From Static Fields to Prime Propagation

The true innovation is not detecting primes—it’s predicting them.

Each prime cancels the interference of the past. That cancellation has a signature—a field residue. By inverting and projecting this residue forward, we define a prime wave that deterministically identifies the next null curvature node.

This is the foundation of recursive prime generation:

  • Each prime emits a cancellation wave.

  • The next prime is where that wave interferes with future divisor fields and silences the energy again.


VII. Why Python?

This is not just theory—it is computation. Python allows us to simulate and see every step:

  • The deformation field

  • Its energy and grounding

  • The spectrum of divisors

  • The recursive structure of primes

Each function in this teaching aid corresponds to a formal component of the theory. No part is metaphorical.

We do not guess primes. We reveal them through their geometry.


Getting Started

Use the following workflow:

  1. Analyze any integer with analyze_integer(n, plot=True)
    → View its curvature field, spectrum, and total energy.

  2. Visualize composite interference
    → Watch how deformation arises from multiple divisors.

  3. Backtrace and mirror the field
    → Understand how one prime leads to the next.

  4. Walk the prime wave
    → Build a prime propagator that finds primes by cancellation, not testing.

All code is included in the full Python notebook.


Final Note

What you are about to use is not a toolkit for number theory.

It is a new coordinate system for the integers.

This manual is your map. The field is your terrain. And the prime wave is the river that runs through it.

Let’s begin.


We propose a geometric view of number theory in which every integer is a standing wave over a circular domain. Instead of examining numbers as static algebraic values, we treat them as harmonic fields. In this formulation:

  • Primes are the only integers whose divisor-induced field is perfectly flat.

  • Composites exhibit curvature and interference due to their internal factors.

  • Primality, then, is not exclusion—but cancellation.

Let’s simulate this using Python.


Step 1: Define the Curvature Field

We model the integer’s internal divisor structure as a sum of cosine waves—one for each nontrivial divisor. This creates a deformation field over the circle:

python

import numpy as np def curvature_field(n, theta_res=4096): """ Computes the divisor-induced curvature field for integer n. Returns theta and the curvature field D_n(θ). """ theta = np.linspace(0, 2 * np.pi, theta_res, endpoint=False) D_n = np.zeros_like(theta) for d in range(2, n): # skip 1 and n if n % d == 0: D_n += np.cos(d * theta) return theta, -2 * D_n # Factor from Lagrangian-Hamiltonian formulation

If D_n(θ) is identically zero, n is prime. Otherwise, it's composite. This is our new test for primality.


Step 2: Compute the Field’s Energy

We calculate the total energy of the field using a Pythagorean formula: amplitude squared plus derivative squared.

python

def curvature_energy(D_n, theta): """ Computes E_n(θ) = D_n² + (dD_n/dθ)². """ D_prime = np.gradient(D_n, theta) return D_n**2 + D_prime**2

This energy reveals where curvature accumulates. For primes, this entire field is zero.


Step 3: Remove Static Bias (Grounding)

We subtract the mean (DC offset) to isolate interference-only behavior.

python

def grounded_energy(E_n): """ Subtracts the average energy over the circle to get AC-only field. """ return E_n - np.mean(E_n)

This grounded energy isolates the resonant wave content—the signature of internal divisors.


Step 4: Spectral Decomposition (FFT)

We now perform a Fast Fourier Transform to reveal the divisor frequencies.

python

from scipy.fft import fft, fftfreq def spectral_signature(E_ref, theta): """ Returns the FFT spectrum of the grounded energy field. """ N = len(theta) fft_vals = np.abs(fft(E_ref)) freqs = fftfreq(N, d=(theta[1] - theta[0])) return freqs[:N//2], fft_vals[:N//2]

Each peak in the spectrum corresponds to a nontrivial divisor. If there are no peaks, then the number is prime.


Step 5: Calculate Total Field Energy Aₙ

We use this integral to define the coefficient of the curvature zeta function, ζ₍curv₎(s).

python

def total_curvature_energy(E_ref, theta): """ Computes A_n = ∫ E_ref(θ) dθ. """ return np.trapz(E_ref, theta)

When A_n = 0, the number is a null curvature field—a prime.


Step 6: Package the Pipeline

python

def analyze_integer(n, theta_res=4096, plot=False): theta, D_n = curvature_field(n, theta_res) E_n = curvature_energy(D_n, theta) E_ref = grounded_energy(E_n) freqs, spectrum = spectral_signature(E_ref, theta) A_n = total_curvature_energy(E_ref, theta) if plot: import matplotlib.pyplot as plt plt.figure(figsize=(12, 4)) plt.subplot(1, 2, 1) plt.plot(theta, E_ref) plt.title(f"Grounded Energy Field for n = {n}") plt.subplot(1, 2, 2) plt.plot(freqs, spectrum) plt.title(f"FFT Spectrum for n = {n}") plt.tight_layout() plt.show() return A_n, freqs, spectrum

This one function tells you everything:

  • Is it a prime?

  • What frequencies dominate?

  • What is its wave signature?


Step 7: Prime Wave Recursion

We define a backward field by summing the curvature fields from previous integers. We then mirror that field forward to predict the next prime.

python

def backtrace_wave(p0, N): """ Reconstructs the curvature field from p0-N to p0-1. """ theta, _ = curvature_field(p0) total = np.zeros_like(theta) for n in range(p0 - N, p0): _, D_n = curvature_field(n) total += D_n return theta, total def mirror_wave(phi): """ Reverses the phase to emit a forward field. """ return np.roll(-phi, len(phi) // 2)

This is how the prime wave propagates: the next prime occurs when the field cancels again.


Conclusion: The Numbers as Fields

This Python notebook doesn’t simulate primes.

It reveals them.

Through these functions, we learn that:

  • Prime numbers are not scattered randomly.

  • They occur exactly where a curvature field, embedded in a circular domain, cancels itself completely.

  • The absence of interference is not trivial. It is deterministic, spectral, and recursive.

This theory redefines what an integer is. No longer a static symbol, it is a rotating harmonic signal in a compact field.

Primes are not generated. They emerge.

And now, through these simulations, so can understanding.




Aside: What Is the Zeta Function—Really?

At its core, the Riemann Zeta function is just a way to add up information about numbers in a very particular way. Traditionally, it's defined as:

ζ(s)=n=11ns\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s}

where ss is a complex number.

When ss is a real number greater than 1, this just means:

  • Take the reciprocal of every number (like 1, 1/2, 1/3, 1/4, …),

  • Raise it to the power of ss,

  • Then add them all together.

But something strange happens when you start extending this to complex numbers—and then asking: where does this infinite sum become zero?

Those zeros (called the nontrivial zeros) are the heart of the Riemann Hypothesis.


Why It Matters

The reason the zeta function is famous is because it encodes deep truths about the primes:

  • Euler discovered that you could factor the zeta function into primes:

ζ(s)=p prime11ps\zeta(s) = \prod_{p\ \text{prime}} \frac{1}{1 - p^{-s}}

This equation connects every number to the primes through an infinite product.

So instead of testing every number one at a time, the zeta function compresses information about all primes into one continuous object.


But Here's the Problem

The traditional zeta function doesn’t tell us why the primes are spaced the way they are. It reacts to prime distribution—it doesn’t generate it.

Even worse, when you look at the zeros of ζ(s)\zeta(s), you find beautiful patterns, but no physical reason they should exist at all. It's like seeing stars align without understanding the gravity that moves them.


Our New Approach

Instead of using:

ζ(s)=1ns\zeta(s) = \sum \frac{1}{n^s}

we use:

ζcurv(s)=Anns\zeta_{\text{curv}}(s) = \sum \frac{A_n}{n^s}

Where AnA_n is the total deformation energy from our curvature field model.

Now:

  • Primes contribute zero.

  • Composites contribute energy based on their divisors.

This isn't just a clever modification—it's a physical interpretation. We're not summing over abstract reciprocals anymore. We're summing over measurable wave interference, and the primes vanish not by magic, but because they carry no internal curvature.


So What Is the Zeta Function?

In this new model:

The zeta function is no longer a trick to test primes.

It is a resonance detector.

It tells us where the interference collapses, and where primes—those nodes of silence—emerge from the field.

It’s not about divergence or continuation.

It’s about conservation.

And that’s what makes it different.



Popular posts from this blog

"The Infinite Push: Closed-Loop Pulse Propulsion and the Physics of Self-Sustaining Motion."

After Primes: A New Way of Seeing Numbers

Hacking Primes: Every Conserved Quantity Reveals a Symmetry