The Ulam Spiral

Write the numbers from 41 to 440 in a square spiral:

ulam spiral

Remarkably, all the numbers on the red diagonal are prime — even when the spiral is continued into a 20 × 20 square.

No one’s quite sure what to make of this. Polish mathematician Stanislaw Ulam discovered the pattern while doodling at a scientific meeting in 1963.