<s>[INST] If $p$ is prime, then $x^2 +5y^2 = p \iff p\equiv 1,9 $ mod $(20)$. Let $p\neq 2,5$ be prime. I wish to show that: $x^2 +5y^2 = p \Leftrightarrow p\equiv 1,9 $ mod $(20)$.
I proved to $\Rightarrow$ part, means $x^2 +5y^2=p \Rightarrow p\equiv 1,9 $ mod $(20)$.
For $\Leftarrow$ , $p\equiv 1,9(20) \Rightarrow p\equiv 1(4)$ , $p\equiv1 ,4 (5)$ thus $(\frac{4}{p})=1,(\frac{-1}{p}) =1$ (using legendre symbols) , also $(\frac{5}{p})=_{p\equiv1(4)}(\frac{p}{5})$ and $p\equiv1(5)$ so  $(\frac{5}{p})=1$ , so $(\frac{-20}{p})=(\frac{5}{p})(\frac{4}{p})(\frac{-1}{p}) = 1$. So $-20$ is a quadratic residue mod $p$.
Yet I don't succeed to go on from this point (I don't know even if its possible to do so).  
 [/INST] Let $p\equiv1$ or $9\pmod{20}$. Then $-5$ is a quadratic residue modulo $p$,
so there are integers $r$ and $s$ with $$r^2+ps=-5.$$
This means that the integer quadratic form
$$f(X,Y)=pX^2+2rXY+sY^2$$
has discriminant $-20$ and is also positive definite. Then $p$
is represented by $f$. Now $f$ is equivalent to a reduced form. There
are two reduced forms of discriminant $-20$: $g_1(X,Y)=X^2+5Y^2$
and $g_2(X,Y)=2X^2+2XY+3Y^2$. But $g_2$ cannot represent any number
congruent to $1$ or $9$ modulo $20$. Therefore $g_1$ represents $p$.
</s>