Let $p$ be prime and $\left(\frac{-3}p\right)=1$, where $\left(\frac{-3}p\right)$ is Legendre symbol. Prove that $p$ is of the form $p=a^2+3b^2$.
My progress:
$\left(\frac{-3}p\right)=1 \Rightarrow$ $\left(\frac{-3}p\right)=\left(\frac{-1}p\right)\left(\frac{3}p\right)=(-1)^{\frac{p-1}2}(-1)^{\left\lfloor\frac{p+1}6\right\rfloor}=1 \Rightarrow$ $\frac{p-1}2+\left\lfloor\frac{p+1}6\right\rfloor=2k$
I'm stuck here. This is probably not the way to prove that.
Also tried this way:
$\left(\frac{-3}p\right)=1$, thus $-3\equiv x^2\pmod{p} \Rightarrow$ $p|x^2+3 \Rightarrow$ $x^2+3=p\cdot k$
stuck here too.
Any help would be appreciated.