Understanding a proof about the Broccard problem I was reading the paper by Berndt and Galway,"The Brocard–Ramanujan diophantine equation $n!=m^2$. And I got stuck in the part when it says:
(1)$$n!+1=m^2$$
(2)$$\left ( \frac{n!+1}{p} \right)=1 \text{ or }0$$
Let us say that we have a “solution” if (2) holds for each of the ﬁrst 40 primes
p after 10^9. Computations were performed modulo p: Except for the known cases
n = 4;5;7; we found no further “solutions” of (2). It follows that (1) also has 
no further solutions up to 10^9

Why do they know that they have a "solution" if it holds for each of the first $40$ primes after $10^9?$ It is not detailed anywhere and I would like to know it, any help on understanding this is greatly appreciated.
 A: By the symbol $\left( \dfrac{a}{p} \right)$, they mean the Legendre symbol, which is $1$ if $a$ is a square $\mod p$, $-1$ if $a$ is not a square $\mod p$, and $0$ if $p$ divides $a$ (we don't call $0$ a square).
Any square number will always be a square mod any prime $p$, unless that prime happens to divide that square (in which case, the Legendre symbol evaluates to $0$). So saying that $\left( \dfrac{n! + 1}{p} \right) = 1 \text{ or } 0$ for many primes is saying that $n! + 1$ behaves essentially like a square. They chose the number $40$ out of a hat (or perhaps $39$ was insufficient, which I highly doubt). I suppose they think that they think that being a square mod 40 large primes is very unlikely, unless you are actually a square. I do not know if there is an established expectation of the likelihood that a not-actual-square is a quadratic residue mod many consecutive primes - that seems like an interesting question to me. 
But this doesn't matter in this case. Their 'solutions' might pick up false positive (i.e. not-squares that look like squares) but won't pick up any false negatives. And they don't find any 'solutions' except the known ones. Note that they only have to check a finite number of cases, since they're checking the value of the Legendre symbol up to approximately $10^9$ 40 times. Since they found no 'solution,' there cannot be an actual solution either.
