This is probably quite naïve, maybe even stackexchange-worthy.


Consider a quadratic form such as $Q(x,y) = 3x^2+y^2$. We know that, for primes $p \equiv 1 \pmod{3}$, there exist integer solutions to $Q(x,y)=p$. 


There are nontrivial algorithms to find such solutions $x,y$. But I am wondering: is there a "concise" formula to explicitly write down the solutions? I am willing to include characters in such a formula, if necessary.


I am not an expert, but algorithms I've found seem to use some guessing or, at best, iteration of some sequence of involutions.


Why do I care? Strange as it may sound, I am interested in cases where the solutions are themselves prime or one-off from a prime, and I suppose getting an explicit handle on solutions is my first attempt. I am not very optimistic, though.


Thank you in advance!



Representing primes explicitly with binary quadratic forms
The following result of Jacobi seems concise enough to qualify, although I share your pessimism about the application. 


It is known that for odd primes $p\equiv 1\pmod{3}$, there is a unique way of writing $4p = L^2 + 27M^2$, where $L\equiv 1\pmod{3}$. Jacobi showed that $L$ is the least absolute residue of $-\binom{2f}{f}$ modulo $p$, where $f:= \frac{p-1}{3}$. To take the example of $p=73$, we have $$4 \cdot 73 = 7^2 + 27\cdot 3^2,$$ which is consistent with $-\binom{48}{24}
\equiv 7\pmod{73}$.


There's an analogous result of Gauss for sums of two squares. For a discussion, see Chapter 9 of the book *Gauss and Jacobi Sums*, by Berndt, Evans, and Williams.


