Prime Number Spiral
The User Manual, Part 2

2. Customization of the display

There are seven ways in which the display of the spiral can be customized:

  1. The spiral can be drawn beginning at 1 or at any number up to 2,147,208,022.
  2. The numbers on the spiral can be represented by circles or by squares.
  3. These can be displayed in eight different sizes, from 75 pixels to 1 pixel, in which case the graphics screen shows (respectively) from 49 to 275,675 numbers in the spiral.
  4. Display of numerals within the circles or squares can be enabled or disabled.
  5. A background grid can be displayed or not.
  6. The circles and squares can be colored in six different ways, or shown all in white (see upper drop-down menu at right).
  7. Instead of the prime numbers it is possible to show (i) random numbers, (ii) only square numbers, (iii) only triangular numbers or (iv) all numbers (see lower drop-down menu at right).

The distribution of numbers selected randomly is similar to the distribution of prime numbers (see below). Thus it is possible to compare the patterns generated by the prime numbers with random patterns, to ascertain whether there is a difference (there is).

Drop-down menu for Color primes by
Drop-down menu for Show

When the program is re-run it starts up in the same state as when the program last finished.

Examples will now be given of the display resulting from various combinations of these parameters, and the color schemes will be explained.


Color primes by cluster

Prime numbers which are adjacent to each other on the same diagonal (and which thus belong to a single cluster of primes) usually have the same color.

Color primes by cluster


Color primes by NW-SE diagonal
Here all numbers are shown. The NW-SE diagonals are colored starting with the central diagonal (the one which passes through the central number, 1 in this case) with color blue. Then diagonals to the NE or SW of this are colored successively as green, cyan, red, magenta and yellow, after which the color cycle begins again with blue, green ... The sequence of colors is shown at the bottom. Color primes by NW-SE diagonal

Color primes by SW-NE diagonal

This is the same as above except that numbers along diagonals running SW to NE have the same color. Color primes by SW-NE diagonal

The number of elements in the longest diagonal sequence of primes (or whatever is selected to be shown) is computed automatically, for both the NW-SE direction and for the SW-NE direction (whatever color scheme is in effect). For example:


Color primes by ring number

Ring 1 is the central number. Ring 2 consists of the eight numbers surrounding this, ring 3 consists of the 16 numbers surrounding ring 2, and so on. The colors of the rings cycle through the same colors as above: 6 colors

Color primes by ring number


Color primes by sequence color

The sequence colors simply cycle through the five (not six) colors: 5 colors

Color primes by sequence color

If the five colors above are numbered 0 through 4 then the nth number (where the central number is the 1st number) has sequence color (n-1) mod 5. Or in other words, the sequence color of the nth number is the ((n-1) mod 5)+1th of the five colors.


Color primes by Palmen color

The Palmen color of a number is explained in Karl Palmen's Colours of Numbers. All prime numbers are either red, green, blue or black.

Color primes by Palmen color

If (and only if) the central number is odd then each NW-SE diagonal either (i) contains only red or black primes or (ii) contains only blue or green primes.


No color (white only)

All white

The User Manual, Part 3
Prime Number Spiral Hermetic Systems Home Page