Consider n!. We know that it cannot be a perfect square since, by Bertrand’s Postulate, there is a prime p between n/2 and n. The power of p dividing n! is then 1. Brocard’s problem asks for values of n and m such that n! + 1 = m^2. So far only three pairs of numbers (n, m) are known to satisfy Brocard’s problem, namely, (4,5), (5,11), and (7,71). Such numbers are called Brown numbers. It has been conjectured that these are the only Brown numbers and this has been verified numerically up to a large value of n.

A variant on Brocard’s problem asks whether, for any fixed integer A, there are solutions (n, m) to the equation n! + A = m^2. If the abc-conjecture is true then there are only finitely many solutions for each fixed A.

Suppose A = -B^2 for some B > 0. Then n! = B^2 + x^2 is a sum of two squares. This is only possible if the power of each prime congruent to 3 (mod 4) dividing n! is even. However, Erdos proved that there is a prime p: n/2 < p < n and p = 3 (mod 4). The power of p dividing n! must be 1. Hence if A = – B^2, there are no solutions to the equation n! + A = m^2.

If A is not a square, then there is a monotonically increasing function f and a prime p <= f(A), such that A is a not a quadratic residue mod p. For this value of A and prime p, if the equation n! + A = m^2 has a solution (n, m), n must be < p; otherwise A = m^2 mod p which is impossible since A is not a quadratic residue mod p. Then, n < p <= f(A), which implies A >= f^{-1}(n) since f is increasing. In summary, if m is an integer, either m^2 – n! >= f^{-1} (n), or m^2 – n! is a perfect square.