PATTERN EXISTS Experiments

Experiment 01

Prime Rhythm

Every prime is a ring that turns one slice per beat. A number is prime exactly when nothing touches the gate.

2
 
 
 
1×

 

2 beats/s

beats per second · a tap starts playing

Beat
2
Primes so far (silences)
1
Rings p ≤ √n (deciders)
0

Space play / pause · ← → step · + − zoom · 0 reset view

How the machine works

Every prime p is a ring cut into p slices, with one marker. On every beat all the rings turn one slice clockwise, so ring p's marker comes back to the top, to the gate, every p beats: exactly on the beats that p divides.

Number n arrives on beat n and tries to pass the gate.

Why the chain never crosses the gate

The markers are joined in ring order, centre → 2 → 3 → 5 → 7 → …, like the rods of a steam engine. Each link is drawn with its angle measured clockwise from the gate, from 0 up to one full turn, and that angle is never wrapped around. A link sweeps from one marker's angle to the next one's, so where a straight rod would cut across 12 o'clock, the link goes around the back instead.

A link can only reach the gate at one of its ends, where a marker sits on the gate. So the chain touches the gate exactly at the rings of n's prime factors, and on a prime beat it does not touch the gate at all: the prime slips through.

The arcs simply move with the rings. A marker comes up to the gate from the back, with its links wrapped around the back; on the beat its ring divides, it sits on the gate and blocks it, and from that beat on its angle counts from 0 again, so its links leave the gate to the front. Nothing ever turns backwards. On a prime beat no marker is on the gate: the gate line points into empty space and the number passes. Switch on Straight rods to compare: straight rods cut across the gate on most beats, so a rod touching the gate would no longer mean that a ring sits on it.

BeatRings on the gateLinks standing straight up the gate
302 · 3 · 53
2102 · 3 · 5 · 74
2 3102 · 3 · 5 · 7 · 115
30 0302 · 3 · 5 · 7 · 11 · 136
510 5102 · 3 · 5 · 7 · 11 · 13 · 177

The inner rings decide everything

A composite number can be written as n = a × b with a ≤ b, so a ≤ √n: its smallest prime factor is at most √n. One of the inner rings, p ≤ √n, is always on the gate when n is composite. Up to 100 000 only the 65 rings p ≤ 316 ever decide. Whenever one of the other 9 527 rings blocks a number below 100 000, an inner ring blocks it too.

With thousands of rings the inner ones are too small to see, so switch on the Deciders lens: the rings p ≤ √n spread over most of the machine and all the others are squeezed into the outer band. Then zoom in (up to 400×): drag to move, scroll or pinch to zoom, double-click or double-tap to see the whole machine again. More ring names appear as the rings move apart.

At scale: a spiral with loops

Ring p's marker sits at the fraction n/p of a full turn (only the part after the decimal point counts). For the large rings this changes slowly from one ring to the next, so their markers line up into a spiral arm and their links join into a smooth spiral. Where the arm meets the gate, near the rings p ≈ n, n/2, n/3, …, the chain has to loop all the way around the back.

It is the sieve of Eratosthenes, played as a rhythm

Each ring marks its own multiples, one beat at a time, which is what the sieve of Eratosthenes does when it crosses out multiples. Nothing here predicts where the next prime will be: the machine shows the sieve at work, and the silences are the primes.

Up toPrimes (silences)Deciding rings p ≤ √n
100254
1 00016811
10 0001 22925
100 0009 59265
1 000 00078 498168

Sound

Sound stays off until you switch it on. A soft heartbeat marks every beat and every ring on the gate plays a soft chime; a prime beat has no chime. The notes come from a fixed chord progression, not from the primes, like the composed music of the videos. Above 8 beats per second the beat sounds are muted.

Share a state

The address bar follows the machine, so you can copy it. For example ?n=99991&lens=1 opens the last prime below 100 000 with the lens on. Parameters: n, speed, lens, rods, chain (all, 1000, 100, sqrt, 0), play and the view: z (zoom), x and y (the point in the middle, in machine radii from the centre).

← All experiments