Primes
Turns
Curve
Number

More information about the number spiral

Number spiral

Wind the whole numbers round a spiral so that every turn ends on a perfect square: 1, 4, 9, 16 and all the squares after them line up on one straight ray. Then colour the primes. They do not scatter at random but crowd onto curves that sweep out from the centre, each curve the values of a quadratic such as Euler's x² + x + 41, which gives 40 primes in a row. Grow the spiral up to 100,000 numbers, colour the squares, pronic, triangular and Fibonacci numbers, trace a curve and count its primes, and point at any dot to see its number and its prime factors. Every whole number n sits on a spiral at radius √n, so each turn ends on a perfect square and the squares 1, 4, 9, 16 … line up on one ray. Choose how far the spiral goes and which numbers to colour: primes, squares, pronic numbers, triangular numbers or Fibonacci numbers. Curve draws the values of a quadratic such as Euler's x² + x + 41 and counts its primes. Point at a dot to see its number and its prime factors, click to keep it, and press Play to grow the spiral from 0.

How it works

  1. Choose how far the spiral goes, from 10 to 100,000 numbers; each turn ends on the next perfect square.
  2. Colour the primes, squares, pronic numbers, triangular numbers and Fibonacci numbers, each in its own colour.
  3. Pick a curve such as Euler's x² + x + 41, or your own x² + bx + c, and read how many of its values are prime.
  4. Point at a dot to see its number and prime factors, press Play to grow the spiral, and save the picture or open it in the editor in layers.

One square per turn

Number n sits at radius √n, √n full turns round from the start (an angle of 2π√n). When n is a perfect square, √n is a whole number, the angle is a whole number of turns, and the dot lands on the ray to the right of the centre: 0, 1, 4, 9, 16 and every square after them form one straight line. The numbers k² + k, called pronic numbers (2, 6, 12, 20 ...), sit halfway between two squares and line up on the ray to the left. Consecutive numbers are always about π apart along the spiral and the turns are one unit apart, so the dots are spread evenly, without the corners of Ulam's square spiral.

Why the primes fall onto curves

Numbers of the form x² + bx + c for x = 0, 1, 2 ... lie on one curve of the spiral: x² + c curves in towards the squares' ray, and x² + x + c towards the pronic ray. Whether a curve holds many primes depends on its formula. A curve such as x² + x + 41 cannot have a value divisible by 2, 3, 5 or any prime up to 37, so its values are far more often prime than ordinary numbers, and it shows as a bright arc. Other curves, such as the squares themselves, can never hold a prime. That contrast between rich and empty curves is the pattern the eye picks out.

Euler's prime curve

Leonhard Euler noticed in 1772 that x² + x + 41 is prime for every x from 0 to 39: 41, 43, 47, 53 ... up to 1,601. At x = 40 it gives 1,681 = 41², and at x = 41 it gives 41 × 43. Even beyond that it stays rich in primes: 86 of its first 100 values are prime. Choose it under Curve to see it on the spiral; the Curve tile counts its primes and the run of primes from the start. Try x² + x + 17 and x² + x + 11 for shorter runs, and x² + 1, whose values may or may not include infinitely many primes: nobody knows.

Frequently asked questions

What is the number spiral?

A way of drawing the whole numbers, published by Robert Sacks in 1994. Each number n is placed on an Archimedean spiral at radius √n and angle 2π√n, so the spiral makes one full turn from each perfect square to the next. All the squares lie on one ray to the right of the centre, and the primes form curves that sweep outwards.

How is it different from the Ulam spiral?

Ulam's spiral winds the numbers round a square grid, so its pattern is made of diagonal lines with sharp corners. Sacks' spiral is round and keeps every number the same distance from the next, so the same quadratic families appear as smooth curves instead of broken diagonals. Both show the same thing: primes gather on the values of some quadratics and avoid others.

Why do the squares lie on a straight line?

Because the angle of n is √n full turns. For a perfect square √n is a whole number, so the dot has turned a whole number of times and lands on the same ray. The pronic numbers k² + k lie halfway between two squares, about half a turn on, so they line up on the opposite ray.

What is Euler's x² + x + 41?

A quadratic that Leonhard Euler found in 1772: it is prime for every x from 0 to 39, from 41 up to 1,601. It fails at x = 40 (1,681 = 41²), but it remains unusually rich in primes, with 86 primes among its first 100 values. On the spiral it shows as one of the brightest curves.

Does x² + 1 give infinitely many primes?

Nobody knows. That is Landau's fourth problem, posed in 1912 and still open. The values 2, 5, 17, 37, 101 ... are prime often enough that most mathematicians expect infinitely many, and the spiral shows them as a thin curve hugging the squares' ray.

Can I use the picture?

Yes. Save gives a PNG, and the pencil opens the spiral in the PictorX photo editor with the spiral line, the other numbers, each coloured set, the curve and the written numbers on layers of their own. In the editor itself it is under Apps ▸ Science ▸ Number Theory ▸ Number Spiral. Everything is computed in your browser.

Number Spiral: how do I record a video?

Press the red Record button in the playback bar: it films what the stage shows. Press it again to stop, and the video is saved to your device. Recording is free; you only need to sign in. Without a subscription the video carries a small PictorX logo in a corner. The button beside Record opens the video options: the shape (as shown, square, story 9:16 or wide 16:9), the length (until you stop, or 5, 10, 15 or 30 seconds for social media) and the file: MP4, WebM or an animated GIF. You can add one of three music tracks: calm, bright or beat.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Go to Editor