WOLFRAM|DEMONSTRATIONS PROJECT

Gaussian Prime Spirals

​
plot range
10
20
30
40
50
60
70
80
90
100
110
120
capture path
show primes
Start a loop with a point having integer coordinates in the complex plane (called a Gaussian integer) and trace a path as follows:
• Move right until a Gaussian prime
p
is encountered, then turn left 90°.
• Continue, always moving straight in the current direction until a Gaussian prime is encountered, and again turn left 90°.
The loop ends when the path returns to
p
, facing right.
For this Demonstration, the first point in the cycle is taken to be the first Gaussian prime to the right of the Gaussian integer nearest the locator. From that point, the path goes right and is colored red; the path eventually ends at the start, again colored red. Because the path can overlap itself, the colors can be hidden.
Drag the locator to change the starting position, but note that if the locator is outside the circle of radius 40, it is moved by radial shrinking to a Gaussian integer near that circle.