Prime numbers lie at the core of mathematics and modern cryptography. While every natural number can be expressed as a product of primes, their distribution remains one of the most mysterious patterns in mathematics.
Despite centuries of study, prime numbers appear irregular and unpredictable. This apparent randomness raises a deeper question: is there an underlying structure behind their distribution?
In this work, we explore prime numbers not as static elements, but as an emergent phenomenon arising from periodic motion and synchronization.
A Mechanical View of Prime Numbers
Instead of testing numbers for divisibility or checking potential factors, we construct a simple dynamical system:
- A set of concentric circles
- All rotating with the same linear speed
- Each circle starting from the same reference point
The smallest circle acts as a clock. Every time it completes a full rotation, a counter increases by one. Larger circles complete their rotations more slowly, according to their radius.
At specific moments, multiple circles reach the reference point simultaneously. At other moments, only the smallest circle does. And then this happens:
Whenever only the first circle completes a rotation, the counter corresponds to a prime number.
No division, no trial factors or checks of whether a number “fits” inside another. The system does not even know what a prime number is. Prime numbers simply emerge from the synchronization -or lack of it- between periodic motions.
An Algorithm Without Arithmetic Checks
From an algorithmic standpoint, the process is remarkably simple:
Cyclic Prime Emergence Algorithm
- Start with two concentric circles of radius r and 2r
- Rotate them with constant linear speed from the same starting point
- Each time the first circle completes a rotation:
- Increase a counter
- If no other circle finishes at the same time, the counter value n is prime.
- If the counter value n is prime then add a new circle whose radius is nr.
What is striking is that the algorithm does not rely on the numerical definition of primality. Instead, primality is encoded implicitly in periodicity and relative ratios.
These are the four first steps of the algorithm:
Key Differences from the Sieve of Eratosthenes
At a purely mathematical level, the Cyclic Prime Emergence Algorithm represents a geometric reformulation of the Sieve of Eratosthenes, as both methods rely on identifying the multiples of prime numbers. However, its algorithmic implementation introduces fundamental shifts:
- Zero Divisions (Resonance over Arithmetic): Primality is determined through geometric resonance and phase alignment rather than arithmetic division ( n ( mod d ) ). The state of each "cycle" is updated autonomously, without any centralized mathematical operations.
- Infinite Streaming: Unlike the static, batch-by-batch operation of the traditional Sieve, this approach follows an incremental streaming process. No predetermined upper bound is required, and prime numbers emerge continuously as the system flow evolves.
- Inherent Parallelism with Zero RAM Dependencies: Shifting the paradigm from static memory lookup tables (RAM) to autonomous, periodic entities allows the algorithm to execute fully in parallel within digital logic (FPGA), entirely bypassing hardware lookup constraints.
Read more in the article: From Circles to Silicon: Implementing the Cyclic Prime Emergence Algorithm on an FPGA
Relation to Incremental (Segmented) Sieves
Although incremental sieves allow for prime generation without a predetermined upper bound N, they rely on processing data in sequential memory segments and require maintaining a dynamic list of previously discovered primes. Conversely, the Cyclic Prime Emergence Algorithm completely eliminates the need for memory buffers, indexing, or address calculation. Past information is never stored; instead, it is intrinsically embedded within the dynamic state and phase of the autonomous cycles, shifting the problem from memory lookups to a continuous progression in the time domain.
Periodicity, Not Circles
It is important to emphasize that the circles themselves are not essential.
Τhe phenomenon relies on periodic motion -not on geometry as such. Circles merely provide the most intuitive and symmetric way for the human mind to visualize periodicity. In principle, any system capable of producing stable, repeating periods could replace the circles.
What matters are the relative periods and their synchronization -or lack thereof. In this sense, prime numbers appear not as purely numerical objects, but as consequences of timing.
A Connection to π
The circles reveal something else as well: the number π.
Each rotation inherently involves π, linking prime numbers to periodicity through geometry in a direct and visual way. This echoes Euler’s famous result, where an infinite product over prime numbers unexpectedly reveals π. Here, that connection becomes tangible.
Prime numbers are no longer abstract symbols, they are motions, rotations, and rhythms.
From Algorithm to Phenomenon
The longer the system runs, the less it feels like an algorithm and the more it resembles a physical process. We are not watching a computation, we are watching a phenomenon unfold. There is no defined stopping point. The process can continue indefinitely, limited only by time and resources.
This perspective does not replace the classical definition of prime numbers. Instead, it complements it -revealing that beneath divisibility lies a deeper structure based on periodicity and emergence.
Try It Yourself
An open-source implementation of this system is available, along with an interactive application used for the visualizations.
You can find the source code at Github: PrimesWithCircle or you can download directly the app from here.
The application runs in Windows 10 or later. Just extract the ZIP file and run PrimesWithCircles.exe from the folder.
You can also watch a presentation of the algorithm here: