Prime number races in 2 dimensions Is the mapping $$f: \ \mathbb{N} \rightarrow \mathbb{Z}[i], \ \ \ n \ \mapsto
\sum_{2 < p \leq n \ {\rm prime}} e^{\frac{p-1}{4} \pi i}$$ surjective?
In 1999, when I was an undergraduate student, I thought about writing the thesis
for my first degree on this problem. I asked Jörg Brüdern about this, and what
he said was essentially that I could do this and could probably obtain some nice
partial results, but that an answer would most likely be out of reach. I decided
then rather to specialize in group theory.
Is it nowadays possible to say more on this question?
Plots of the images of the intervals
$\{1, \dots, \lfloor e^k \rfloor\}$ for $k \in \{11, \dots, 26\}$ scaled to the same size
look as follows:

Larger plots of the images of the intervals
$\{1, \dots, 10^k\}$ for $k \in \{7,8,9\}$ are shown below:
$k = 7$:

$k = 8$:

$k = 9$:

 A: This is not an answer, but rather an explanation of why this question is so difficult.
For positive coprime integers $a,q$, let
$$\pi(x;q,a) = \# \{p \leq x : p \equiv a \pmod{q}\}.$$
For $k \in \mathbb{Z}$, let
$$A_k = \{n \in \mathbb{N} : \pi(n;8,1) - \pi(n;8,5) = k\},$$
and let
$$B_k = \{\pi(n;8,3) - \pi(n;8,7) \in \mathbb{Z} : n \in A_k\}.$$
Then your conjecture that the function
$$f(n) = \sum_{p \leq n}{e^{\pi i(p - 1)/4}}$$
is surjective on $\mathbb{Z}[i]$ is equivalent to the conjecture that $B_k = \mathbb{Z}$ for each $k \in \mathbb{Z}$.
For this to happen, the set $A_k$ must be countably infinite; that is, the equality $\pi(n;8,1) = \pi(n;8,5)$ must occur infinitely often. This is a difficult result, but it is in fact known unconditionally: it is covered by Theorem 5.1 of "Comparative prime-number theory. II" by S. Knapowski, and P. Turán. Apparently, it has now been proven unconditionally by Jason Sneed that $\pi(x;q,a) - \pi(x;q,b)$ changes sign infinitely often for all $q \leq 100$, but this is yet to appear in print (see this paper for a discussion).
If one assumes two strong conjectures, the Grand Riemann hypothesis, and the Linear Independence hypothesis (namely that the imaginary parts of the nontrivial zeroes of all Dirichlet $L$-functions are linearly independent over the rationals), then one can say a lot more. Rubinstein and Sarnak's paper on Chebyshev's bias shows that not only are there infinitely many sign changes, but the function
$$\left(\frac{\log x}{\sqrt{x}} \left(\pi(x;q,a_1) - \mathrm{Li}(x)\right), \ldots, \frac{\log x}{\sqrt{x}} \left(\pi(x;q,a_r) - \mathrm{Li}(x)\right)\right)$$
has a limiting logarithmic distribution. In particular, they can say roughly how likely $(\log x / \sqrt{x}) \pi(x;8,1)$ and $(\log x / \sqrt{x}) \pi(x;8,5)$ are to be in particular regions; unfortunately, this doesn't really tell you anything about the set $A_k$ for each integer $k$.
Once you have that $A_k$ is countably infinite, you still need to ensure that there is no "conspiracy" happening, in that the other prime number race $\pi(x;8,3) - \pi(x;8,7)$ could avoid certain configurations whenever $x$ is a zero of the prime number race $\pi(x;8,1) - \pi(x;8,5)$. This seems extremely difficult, and I don't know how one might attempt to analyse this. That being said, questions peripherally related to this were studied by Knapowski and Turán, so it is possible that there might be something in the literature that can deal with this type of problem.
As an aside, one interesting modification of this conjecture is the following. Let $\chi$ be a Dirichlet character modulo $q$, so that $\chi$ is generated by some root of unity $\zeta_Q$. Is the function
$$f_{\chi}(n) = \sum_{p \leq n}{\chi(p)}$$
surjective on $\mathbb{Z}[\zeta_Q]$?
