It seems that Gauss states the following theorem in his first paper on biquadratic residues(Werke vol. II pp. 67-92). I cannot read Latin, but I have a Japanese translation of the paper. However, it is difficult to decipher the paper even in Japanese. Is the theorem right? If yes, how do you prove it?


**Theorem** Let $p$ be a prime of the form $p = 4n+1$. Let $g$ be a primitive root mod $p$. Let $f\equiv g^{(p−1)/4}$ (mod $p$). Then $f^2\equiv −1$ (mod $p$). It is well known that $p=x^2+y^2$ has an integer solution $(a,b)$. Suppose $a$ is odd and $b$ is even. $a$ is uniquely determined by the condition $a\equiv 1$ (mod $4$). $b$ is uniquely determined by the condition $b\equiv af$ (mod $p$). Suppose $2\equiv g^\lambda$ (mod $p$). Then $\lambda\equiv b/2$ (mod $4$).


**Remark**
I asked the same question in Math StackExchange.
Since nobody answered it so far and it seems that the question is highly non-trivial, I post this question here.
Since I was suspended recently there, I'd appreciate if somebody would kindly add the link of this question to my question there.


<https://math.stackexchange.com/questions/471023/the-biquadratic-character-of-2-mod-p-for-a-prime-of-the-form-p-4n-1>


This is a related question in MSE:
<https://math.stackexchange.com/questions/470976/the-number-of-solutions-of-ax4-by4-equiv-1-mod-p-for-a-prime-of-the-f>



The biquadratic character of $2$ mod $p$ for a prime of the form $p=4n+1$
Yes, this theorem is correct.


From quartic reciprocity we obtain $(2/p)\_4 = i^{ab/2}$, or in other words, $2^{(p-1)/4} \equiv f^{ab/2} \pmod p$. (There is an elementary proof of this fact due to Dirichlet: see Exercise 4.24 in Cox, "Primes of the Form $x^2+ny^2$.) So if $2 \equiv g^\lambda \pmod p$, then $f^{ab/2} \equiv g^{\lambda(p-1)/4} \equiv f^\lambda \pmod p$, and consequently $\lambda - ab/2 \equiv 0 \pmod 4$.


