Maths Olympiad Prep

Library / USAJMO /2 of 29

USAJMO

Number theory Difficulty 6.2 National Olympiad Find the answer

Problem
Find all pairs of primes (p,q)(p,q) for which p−qp-q and pq−qpq-q are both perfect squares.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

We first consider the case where one of p,qp,q is even. If p=2p=2 , p−q=0p-q=0 and pq−q=2pq-q=2 which doesn't satisfy the problem restraints. If q=2q=2 , we can set p−2=x2p-2=x^2 and 2p−2=y22p-2=y^2 giving us p=y2−x2=(y+x)(y−x)p=y^2-x^2=(y+x)(y-x) . This forces y−x=1y-x=1 so p=2x+1→2x+1=x2+2→x=1p=2x+1\rightarrow 2x+1=x^2+2 \rightarrow x=1 giving us the solution (p,q)=(3,2)(p,q)=(3,2) .
Now assume that p,qp,q are both odd primes. Set p−q=x2p-q=x^2 and pq−q=y2pq-q=y^2 so (pq−q)−(p−q)=y2−x2→p(q−1)(pq-q)-(p-q)=y^2-x^2 \rightarrow p(q-1) =(y+x)(y−x)=(y+x)(y-x) . Since y+x>y−xy+x>y-x , p∣(x+y)p | (x+y) . Note that q−1q-1 is an even integer and since y+xy+x and y−xy-x have the same parity, they both must be even. Therefore, x+y=pkx+y=pk for some positive even integer kk . On the other hand, p>p−q=x2→p>xp>p-q=x^2 \rightarrow p>x and p2−p>pq−q=y2→p>yp^2-p>pq-q=y^2 \rightarrow p>y . Therefore, 2p>x+y2p>x+y so x+y=px+y=p , giving us a contradiction.
Therefore, the only solution to this problem is (p,q)=(3,2)(p,q)=(3,2) .
~BennettHuang

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

Source: Omni-MATH, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.