This is from an answer by Robert to this question When are $n!+1$ and $(n+2)!+1$ coprime?
"The roots of $x^2 + 3x + 1$ are $(-3 \pm \sqrt{5})/2$, so $5$ must be a square mod $p$, which says (if $p > 5$) $p \equiv 1$ or $4 \mod 5$."
Can anyone elaborate on how this is derived or point me somewhere where I can read up on it. Thanks.