Let $p$ be prime and $\left(\frac{-3}p\right)=1$. Prove that $p$ is of the form $p=a^2+3b^2$ 
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.

$(\frac{p}{3})=(\frac{-3}{p})(\frac{p}{3})=(\frac{-1}{p})(\frac{3}{p})(\frac{p}{3})=(-1)^{\frac{p-1}{2}}(\frac{3}{p})(\frac{p}{3})=(-1)^{\frac{p-1}{2}}(-1)^{\frac{p-1}{2}\frac{3-1}{2}} = 1$
Hence,$(\frac{-3}{p})=1$ iff, $p\equiv1\mod3$.
Since, there is $u \in \mathbb{Z}$ such that, $-3\equiv u^2\pmod{p}$
Consider the lattice defined by $L=\{(a,b)\in\mathbb{Z}^2\, : \,a\equiv ub\pmod p\}$ generated by $(u,1)$ and $(0,p)$. $L$ has index $p$ in $\mathbb{Z}^2$, and area of its fundamental domain is $p$. Now, consider an ellipse $E_n$ defined by $x^2+3y^2=n$, then the area of $E_n=\frac{\pi n}{\sqrt3}>1.8n$
Choose, $n=2.3 p$, then Area of $E_{n}>4p$ and $E_n\cap L$ has a non zero point $(a,b)$.
Now, $a^2+3b^2\equiv(ub)^2+3b^2\equiv b^2(u^2+3)\equiv0 \pmod p$.
Since, $(a,b)\in E_n \implies a^2+3b^2<2.3p$ we have $a^2+3b^2=p,2p$.
But, $a^2+3b^2=2p \implies a^2\equiv 2p \pmod 3 \equiv 2 \pmod 3$ contradiction !!
Therefore, $a^2+3b^2=p$.
