Maths Olympiad Prep

Library / /20 of 44

Number theory Difficulty 5.3 AIME, harder Prove it Slovenia

Find all pairs of primes pp and qq, such that p+qp+q and p+4qp+4q are perfect squares.

Solution

Let p+q=x2p+q = x^2 and p+4q=y2p+4q = y^2 for some positive integers xx and yy. Subtracting the equations we get 3q=y2x2=(yx)(y+x)3q = y^2 - x^2 = (y-x)(y+x). Since qq is a prime and x+y2x+y \ge 2 we have the following possibilities:

1. yx=1y - x = 1 and y+x=3qy + x = 3q. From the first equation we get y=x+1y = x + 1. Plugging this into the second equation we see that 2x+1=3q2x + 1 = 3q. This implies that qq is odd, so we may write q=2m+1q = 2m + 1 for some positive integer mm. Now, x=3m+1x = 3m + 1 and p=x2q=9m2+4m=m(9m+4)p = x^2 - q = 9m^2 + 4m = m(9m + 4). Since pp is a prime, we conclude that m=1m = 1. Thus, p=13p = 13 and q=3q = 3, which are indeed prime.

2. yx=3y - x = 3 and y+x=qy + x = q. From the first equation we get y=x+3y = x + 3. Plugging this into the second equation we see that 2x+3=q2x + 3 = q. The initial equality then implies p=x2p=x2q=x22x3=(x+1)(x3)p = x^2 - p = x^2 - q = x^2 - 2x - 3 = (x + 1)(x - 3). Since pp is a prime we have x=4x = 4. Thus, p=5p = 5 and q=11q = 11, which are indeed prime.

3. yx=qy - x = q and y+x=3y + x = 3. Since xx and yy are positive integers and y>xy > x, we get y=2y = 2 and x=1x = 1, which is a contradiction since it immediately follows that q=1q = 1.

The two solutions are (5,11)(5, 11) and (13,3)(13, 3).

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 reproduced verbatim; metadata (topic, difficulty) added by this project.