show/hide this revision's text 2 added 997 characters in body

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 very difficult result, but I do believe that this 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 just now been proved proven unconditionally by Jason Sneed that $\pi(x;q,a) - \pi(x;q,b)$ changes sign infinitely often for all $q \leq 100$, but it this is yet to appear in print (see this paper for a discussion).

Before this, all that was known was that the function $\pi(x;8,1) - \pi(x;8,5)$ changes sign infinitely often if

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); this is , then one can say a corollary of the work of lot more. Rubinstein and Sarnak 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.

show/hide this revision's text 1

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 very difficult result, but I do believe that this has just been proved unconditionally by Jason Sneed, but it is yet to appear in print (see this paper for a discussion).

Before this, all that was known was that the function $\pi(x;8,1) - \pi(x;8,5)$ changes sign infinitely often 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); this is a corollary of the work of Rubinstein and Sarnak on Chebyshev's bias.

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.

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]$?