Notebook 6 · Patterns: the spiral and cellular automata
6.1 Build the spiral
Interactive 12 min
Write the numbers on a spiral, mark the primes, highlight the polynomial n² + n + 41, and then explore with your own settings.
Try this. In the last step, start the spiral at 41. Then try other starting numbers. Which starting numbers make the diagonals clearest?
Text version of this interactive
Write the numbers on a spiral
Put 1 in the middle and write the whole numbers outwards in a square spiral: right, up, left, down, and on. Here are 1 to 100; nothing is marked yet. Click a number, or press the arrow keys on the picture, to move from number to number.
Mark the primes
A prime has exactly two divisors, 1 and itself. The blue squares are the primes among the first 2,500 numbers, found with the sieve of Eratosthenes. Notice how many of them fall on diagonal lines.
A diagonal full of primes
The polynomial n² + n + 41 gives a prime for every n from 0 to 39. Start the spiral at 41 and its values, outlined in red, fall on one diagonal: forty values in a row, and every one is prime.
Explore the spiral
Change how many numbers are shown (up to 40,000), the number the spiral starts with, and what is marked. Try starting at 41, then at other numbers. Which settings show the clearest diagonal lines? Click or use the arrow keys to read any number.