HomeCompanion pagesThe Prime Sieve as a Stack of Orthogonal Periodic Fields

The Prime Sieve as a Stack of Orthogonal Periodic Fields

An interactive essay on the periodic machinery underneath the primes: each prime emits an orthogonal exclusion field, their stacked product has primorial period, and CRT independence makes density multiplicative, entropy additive, and spectral support disjoint.

Open the interactive lab

The Prime Sieve as a Stack of Orthogonal Periodic Fields

I recently finished building an interactive page around the oldest nontrivial algorithm in mathematics, and the thing that kept surprising me is how much structure appears once you stop treating the sieve as a procedure and start treating it as an object. The page is not a library, not a benchmark, and not a new prime-finding tool; it is an interactive essay, intended for anyone who wants to see the periodic machinery underneath the primes rather than simply enumerate them.

What You Are Looking At

The central idea is that every prime p emits a perfectly periodic exclusion field Mp that kills exactly the multiples of p. When you stack the first k of these fields together, their combined period is the primorial

Lk = p1 p2 ··· pk.

The sieve is the pointwise product of the individual masks. The crucial part, and the part the visualization makes explicit, is that the genuinely new information contributed by prime pk is not its raw periodic field; it is the subset of multiples that no smaller prime would have killed anyway. I call that subset Ck, the orthogonal component of pk.

Because the primes are coprime, the Chinese Remainder Theorem turns each position into an independent tuple of residues — one coordinate per prime. From that single fact, several properties fall out cleanly: survivor density updates as a multiplicative attenuation, joint entropy of the per-prime indicators is exactly additive, and the finite Fourier decomposition of the sieve acquires a neat spectral anatomy.

The Interface at a Glance

The page is organized around a set of linked panels; almost every control feeds into more than one view, which is deliberate — the point is to build intuition by cross-reference rather than by reading a single plot.

A Brief Background

Eratosthenes' sieve is usually stated as a crossing-out recipe. That statement is complete, but it buries the fact that the combined pattern is exactly periodic at every stage, with a period that grows as the primorial of the primes already included. This periodicity is not an approximation; a block of length Lk repeats forever until a larger prime is installed to break the symmetry.

The pieces of this view are not new. The Mertens product for survivor density, the CRT factorization of the residue lattice, and Fourier expansions tied to divisibility all have long histories; wheel factorization in practical sieving is essentially the compact periodic representation described here. What the project attempts is a synthesis — to put the pieces in one place, link them through the same orthogonal-field language, and let the reader adjust the basis interactively.

Why This Is Interesting

The most useful thing here is not faster computation; it is conceptual unification. Four apparently different facts become one mechanism:

There is also something pleasantly honest about the display: it shows the primes as exceptions in an expanding periodic lattice, not as random points that merely happen to survive a messy procedure. Each new prime is a break in the current symmetry, but it immediately becomes a fresh generator of the next, larger symmetry.

Who Might Find It Useful

It is probably not the page for someone who needs a production prime generator; standard segmented sieves remain the right tool for bulk enumeration. The value here is architectural, and for that it is aimed at the reader who wants to understand rather than to optimize.

Honest Caveats

The visualization is a pedagogical object; it does not claim to compute primes faster than a segmented sieve, and the compact representation it reveals is essentially wheel factorization. The frequencies are rational points of ℚ/ℤ, not zeta zeros, and the underlying dynamical system is a zero-entropy profinite odometer; those are categorically different from the transcendental spectral objects that appear in Riemann Hypothesis-adjacent heuristics. In other words, the page is a clean way to see the periodic order of the primes, but it is not a secret path to the fine pseudorandomness of the primes.

More Soon

I'm curious whether this framing helps others see the primes as less random and more like an expanding lattice with predictable, locally broken symmetries. If the wave picture clicks for you, or if you find a control that should behave differently, I'd love to hear about it.