IMO 1991 SL 14

Let a, b, c be integers and p an odd prime number. Prove that

IMO 1991 SL 14

Origin: POL

Problem

Let a, b, c be integers and p an odd prime number. Prove that if f(x) = ax2 + bx + c is a perfect square for 2p −1 consecutive integer values of x, then p divides b2 −4ac.

Solution

Suppose that f(x0), f(x0 + 1), . . . , f(x0 + 2p −2) are squares. If p | a and p ∤b, then f(x) \equivbx+c (mod p) for x = x0, . . . , x0+p−1 form a complete system of residues modulo p. However, a square is always congruent to exactly one of the p+1 numbers 0, 12, 22, . . . , ( p−1 2 )2 and thus cannot give every residue modulo p. Also, if p | a and p | b, then p | b2 −4ac. We now assume p ∤a. The following identities hold for any quadric poly- nomial: 4a \cdot f(x) = (2ax + b)2 −(b2 −4ac) (1) and f(x + p) −f(x) = p(2ax + b) + p2a. (2) Suppose that there is an y, x0 \leqy \leqx0 +p−2, for which f(y) is divisible by p. Then both f(y) and f(y+p) are squares divisible by p, and therefore both are divisible by p2. But relation (2) implies that p | 2ay+b, and hence by (1) b2 −4ac is divisible by p as well. Therefore it suffices to show that such an y exists, and for that aim we prove that there are two such y in [x0, x0 + p −1]. Assume the opposite. Since for x = x0, x0+1, . . . , x0+p−1 f(x) is congruent modulo p to one of the p−1 numbers 12, 22, . . . ,  p−1 2, it follows by the pigeon-hole principle that for some mutually distinct u, v, w \in{x0, . . . , x0 + p −1} we have f(u) \equivf(v) \equivf(w) (mod p). Consequently the difference f(u) −f(v) = (u −v)(a(u + v) + b) is divisible by p, but it is clear that p ∤u −v, hence a(u + v) \equiv−b (mod p). Similarly a(u + w) \equiv−b (mod p), which together with the previous congruence yields p | a(v −w) ⇒p | v −w which is clearly impossible. It follows that p | f(y1) for at least one y1, x0 \leqy1 < x0 + p. If y2, x0 \leqy2 < x0 + p is such that a(y1 + y2) + b \equiv0 (mod p), we have p | f(y1) −f(y2) ⇒p | f(y2). If y1 = y2, then by (1) p | b2 −4ac. Otherwise, among y1, y2 one belongs to [x0, x0 + p −2] as required. Second solution. Using Legendre’s symbols  a p

for quadratic residues we can prove a stronger statement for p \geq5. It can be shown that p−1  x=0 ax2 + bx + c p  = − a p  if p ∤b2 −4ac,

hence for at most p+3 values of x between x0 and x0 + p −1 inclusive, ax2 + bx + c is a quadratic residue or 0 modulo p. Therefore, if p \geq5 and f(x) is a square for p+5 consecutive values, then p | b2 −4ac.