The Ulam spiral or prime spiral is a graphical depiction of the set of prime numbers, constructed by writing the positive integers in a square spiral and specially marking the prime numbers.

The Ulam spiral is constructed by writing the positive integers in a spiral arrangement on a square lattice:

ulam spiral

and then marking the prime numbers:

ulam spiral of primes