← All projects / Primes as Angles
Give a prime a dial with that many spokes. Every binary place becomes a turn of the dial, and every number is the sum of the turns of its 1s. Where the walk ends is the remainder. A multiple of the prime is a walk that ends back at the top. The echo, the right angle and the pentagon from the last pages are all this one picture.
Pick a dial and a number. The number is written in binary, and each 1 turns the dial by its place's angle. The last stop is the number's remainder.
The top spoke, in orange, is remainder 0. A prime other than the dial's own never stops there.
Mark where each place lands: 1, 2, 4, 8 and so on. They hop round the dial and come back to the start. The number of hops before it repeats is the dial's echo length, and joining the hops in order draws a star. The numbers inside the rim are the places, and the numbers outside are the spokes.
Every prime below a million, dropped on its spoke. The bars are how many landed on each one. They come out almost level, and the top spoke holds exactly one prime: the dial's own.
Which spokes stay a nose ahead is The Race.
On The Gap of 3, changing one place from an even value to an odd one turned the lean by exactly a right angle and rescaled it. The rescale is always the tangent of one of the dial's half-angles, so the two arrows are always two sides of a slice of the dial's own polygon: from the centre to the middle of a side, then along the side to a corner.
The grey side is the arrow before the change and the green side is the arrow after it. For the dial of 5 the slice has angles 36, 54 and 90 degrees.
360 parts to a circle is a habit, not a fact. A dial's spokes only fall on whole marks when the dial's prime divides the number of parts, and 360 is 2 × 2 × 2 × 3 × 3 × 5, so it fits the dials of 2, 3 and 5 and no others. Pick a different number of parts and see which dials it fits, and where primes can land on it.
A mark is closed when it shares a factor with the number of parts: nothing prime can land there except the factor itself. Green bars are the open marks, as long as the number of primes below a million on each.
363 is 3 × 11 × 11, so it fits only the dials of 3 and 11, and 61% of its marks stay open. 360 closes all but 27%. The best circles multiply the first few primes together once each: 6, 30, 210, 2310. Each new prime closes more marks.
To fit every prime's dial, the number of parts would have to be a multiple of every prime, and there's no such number. So there's no perfect resolution. The way out is to stop counting parts and use fractions of a turn: spoke 3 on the dial of 5 is exactly 3/5 of a turn, with nothing rounded.
A circle of 30 or 210 parts with the closed marks skipped is called a wheel, and fast prime sieves use one. With 210 parts, every prime above 7 lands on one of just 48 marks, so 77% of all numbers are never looked at.
Each dial has its own exact numbers in place of rounded sines and cosines. For 5 they're built from the golden ratio: the cosine of a fifth of a turn is (√5 − 1) ÷ 4. For 17 they need only square roots, which is why Gauss could draw a 17-sided polygon with ruler and compass. Among primes that works only for the Fermat primes, and the known ones are 3, 5, 17, 257 and 65,537, the same five that sit in the second slot on The Gap of 3. For 7 it takes solving a cubic equation, which ruler and compass can't do.
The gap between spokes as a fraction of a turn, the echo length, and how much of the dial the places visit. A short echo means the places keep landing on the same few spokes, which is what makes a lean strong. The Mersenne primes have the shortest echoes of all. Touch a row to put it on the dials.
Doubling a number doubles its angle on the dial. So the places 1, 2, 4, 8 sit at one turn, two, four, eight, and a number's angle is the sum of the angles of its 1s. Whole turns don't count, which is the same as taking a remainder.
A number is a multiple of the dial's prime exactly when its turns add up to whole circles. For 5, 15 is 1111: 72 + 144 + 288 + 216 = 720 degrees, two full turns.
2p − 1 has an echo of only p places, the shortest a dial that size can have. 7 uses 3 of its 6 spokes, 31 uses 5 of 30, 127 uses 7 of 126. Few spokes means the same turns keep repeating, so patterns in the places pile up instead of washing out.
Each extra place shrinks the lean a little. Long numbers have gone round the echo many times, and by about 150 bits nothing is left. The dial explains small numbers exactly and says nothing special about huge ones.