MakarovSuites
English
EnglishDeutschРусскийУкраїнськаFrançaisEspañolItalianoPolski
Contact & licences

Math

Prime spirals

The numbers laid on a square spiral, the primes lit: diagonals appear that should not be there, four times the density of the square, and with 41 at the centre Euler's n² + n + 41 runs down one of them; the Sacks spiral, and π(N) against N/ln N as the spiral grows.

Prime spirals — Actual application image
Actual application image

What happens

Write 1 in the middle, 2 to its right, and keep going round in a square spiral - up, left, down, right, the arms growing by one every two turns - and light every prime. Stanisław Ulam did this on paper during a dull talk in 1963, and the diagonals appeared on their own. Here the spiral grows in front of you, a glowing head running the path, primes staying lit while composites fade to the dark of the square. Tick the diagonals and the five richest are drawn with their counts: on a 201 × 201 square the primes are 10.5 % of the numbers, but on the diagonal x + y = 58 they are 68 of 143 cells, 4.5 times as dense - and 323 of the 646 long diagonals hold not one prime, because the cells of a diagonal share the parity of their number and every other diagonal holds only even numbers. A diagonal is a quadratic polynomial in the step, and some quadratics are rich in primes and some are barren: put 41 at the centre and Euler's n² + n + 41 runs down the diagonal x = y, prime for every n from 0 to 39 and for 581 of the first thousand. Paint the twin primes, or the polynomial, and change the start number. The Sacks spiral, r = √n and θ = 2π√n, lines the perfect squares up on one ray and gives every quadratic its own curve, so the same structure reads as curves instead of lines. The chart keeps π(N) against N/ln N as the spiral grows: the ratio drifts toward 1 from above, the prime number theorem, measured here to a million.

Equations used in the module
Equations
sieve:  Eratosthenes to 10^6;  π(N) = 25, 168, 1229, 9592, 78498 at N = 10², 10³, 10⁴, 10⁵, 10⁶;  N/ln N = 21.7, 144.8, 1085.7, 8685.9, 72382;  li(N) = 30.1, 177.6, 1246.1, 9630.4, 78628;  π(N) / (N/ln N) → 1 from above (1.15, 1.16, 1.13, 1.10, 1.08)
Ulam:  1 at the origin, 2 at (1, 0), then up, left, down, right with arms 1, 1, 2, 2, 3, 3 …;  the odd squares (2m + 1)² sit at (m, −m);  9 → (1, −1), 25 → (2, −2), 100 → (−4, 5), 1000 → (9, 16)
diagonals:  x − y = c or x + y = c;  along one the number is a quadratic in the step;  the cells of a diagonal share the parity of their number, so every other diagonal holds only even numbers;  201 × 201 (40401 numbers, 4236 primes, density 0.1048): richest x + y = 58 with 68/143 (4.54 ×), x + y = 18 with 80/183, x − y = ±40 with 70/161;  323 of 646 long diagonals hold no prime; the poorest odd one, x + y = 1, holds 1 in 200
Euler:  n² + n + 41 prime for n = 0 … 39 (n = 40 gives 41²) and for 581 of n = 0 … 999;  on the spiral that starts at 41 its values sit at (k, k): the diagonal x = y;  on the spiral that starts at 1 they scatter
Sacks:  r = √n, θ = 2π√n;  the squares k² have θ = 2πk - one ray;  each n² + n + c is a curve of its own
prime number theorem:  π(N) ~ N/ln N ~ li(N);  the density of primes near N is 1/ln N;  Hardy–Littlewood: the density of primes among the values of a quadratic is a constant times 1/ln N, the constant depending on the polynomial - conjectured, not proved

Related experiments

Back to catalogue
Sunflower — Actual application image

Math

Sunflower

Vogel's sunflower grown seed by seed, r = √n and θ = n·α: sweep the angle by dragging across the disc and the spirals unwind, collapse onto rays, and lock in at the golden angle 137.508°, where the closest pair is 1.602 at any size and the families are Fibonacci numbers - the packing measured live, a task on the angle, and the chart of packing against angle.