Maths Olympiad Prep

Library / /12 of 17

Algebra Difficulty 6.0 National olympiad Prove it Croatia

Find all pairs (p,q)(p, q) of prime integers such that the solutions of the quadratic equation x2+px+q=0x^2 + px + q = 0 are two distinct integers.

Solution

Let the roots of x2+px+q=0x^2 + px + q = 0 be rr and ss, with rsr \neq s and both integers.

By Vieta's formulas:
r+s=pr + s = -p
rs=qrs = q

Since pp and qq are primes, p-p is the sum of two distinct integers, and qq is their product.

Let rr and ss be distinct integers. Since qq is prime, rs=qrs = q implies that one of rr or ss is 11 and the other is qq, or one is 1-1 and the other is q-q.

Case 1: r=1r = 1, s=qs = q (with qq prime, q1q \neq 1)
Then r+s=1+q=p    p=(1+q)r + s = 1 + q = -p \implies p = -(1 + q)
But pp must be prime, so (1+q)-(1 + q) is prime. Since qq is prime 2\geq 2, 1+q31 + q \geq 3, so (1+q)-(1 + q) is negative and prime. The only negative primes are 2,3,5,-2, -3, -5, \ldots
So 1+q=2    q=11 + q = 2 \implies q = 1 (not prime), 1+q=3    q=21 + q = 3 \implies q = 2, 1+q=5    q=41 + q = 5 \implies q = 4 (not prime), 1+q=7    q=61 + q = 7 \implies q = 6 (not prime), etc.
So only q=2q = 2 gives p=3p = -3 (which is prime).

Check: x2+(3)x+2=x23x+2=(x1)(x2)x^2 + (-3)x + 2 = x^2 - 3x + 2 = (x - 1)(x - 2), roots 11 and 22 (distinct integers).

Case 2: r=1r = -1, s=qs = -q (with qq prime, q1q \neq 1)
Then r+s=1q=p    p=1+qr + s = -1 - q = -p \implies p = 1 + q
pp must be prime, so 1+q1 + q is prime. Try q=2q = 2, p=3p = 3 (prime), q=3q = 3, p=4p = 4 (not prime), q=5q = 5, p=6p = 6 (not prime), q=7q = 7, p=8p = 8 (not prime), etc.
So only q=2q = 2 gives p=3p = 3 (prime).

Check: x2+3x+2=(x+1)(x+2)x^2 + 3x + 2 = (x + 1)(x + 2), roots 1-1 and 2-2 (distinct integers).

Case 3: r=qr = q, s=1s = 1 (already considered in Case 1).
Case 4: r=qr = -q, s=1s = -1 (already considered in Case 2).

Therefore, the only pairs (p,q)(p, q) of prime integers such that the solutions of x2+px+q=0x^2 + px + q = 0 are two distinct integers are:
(p,q)=(3,2) and (p,q)=(3,2)(p, q) = (3, 2) \text{ and } (p, q) = (-3, 2)

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.