TITLE: Gaussian prime spirals
QUESTION [141 upvotes]: Imagine a particle in the complex plane, starting at $c_0$, a Gaussian integer,
moving initially $\pm$ in the horizontal
or vertical directions.  When it hits a Gaussian prime, it turns left $90^\circ$.
For example, starting at $12 - 7 i$, moving initially $+x$, this closed circuit results:
     
Instead, starting at $3+5 i$, again $+x$, this (pleasingly symmetric!) closed cycle results:
     
Here's another (added later), starting at $5+23 i$:
     
(Gaussian primes $a+bi$ off-axes have $a^2+b^2$ prime; on axis, $\pm(4n+3)$ prime.)
My question is,

Q0.What's going on?

More specifically,

Q1. Does the spiral always form a cycle?
Q2. Have these spirals been investigated previously?

(I am about to step on a plane; apologies for not acknowledging responses!)
...Later:

Q3. Under what conditions is the spiral (assuming it closes) symmetric w.r.t. reflection in a
horizontal (as is $12-7 i$), or reflection in a vertical (as is $5 + 23 i$),
or reflection in both (as is $3 + 5i$)?

REPLY [3 votes]: I wanted to report on a variation, Gaussian prime random walks.
As before
start with any point in the complex plane $c_0$. Walk in the $+x$ direction
until you hit a Gaussian prime.
Unlike the original question, which requires a $90^\circ$ counterclockwise turn,
turn left or right by $90^\circ$ with equal probability. Continue turning randomly $\pm 90^\circ$ at every Gaussian prime hit, until some Gaussian prime is hit for a
second time. Call that a Gaussian prime loop.
Below is an example:

          


     

Green: start at $c=100 + 2i$. Red: looped at $197 + 22 i$. Yellow: Gaussian prime turn.


Although this
runs into the same open-problem impediment
cited by @FrançoisBrunault,*
it appears that, for a random starting $c_0$ within some fixed distance of the origin,
the probability of eventually looping might be $1$.
Looping is much "easier" to achieve than is spiral cycling, which requires
revisiting $c_0$ from the left,
whereas looping just needs to revisit some prime twice.


*
"It's unknown whether there are infinitely many Gaussian primes of the form $n+i$ with $n \in \mathbb{Z}$. So starting at $N+i$ and moving $+x$, we cannot exclude the possibility of hitting no prime."