Maths Olympiad Prep

Library / /2 of 34

Number theory Difficulty 6.2 National olympiad Find the answer

Problem
Find all pairs of primes (p,q)(p,q) for which pqp-q and pqqpq-q are both perfect squares.

A number or a short expression. Spacing and $ signs are ignored.

Solution

We first consider the case where one of p,qp,q is even. If p=2p=2 , pq=0p-q=0 and pqq=2pq-q=2 which doesn't satisfy the problem restraints. If q=2q=2 , we can set p2=x2p-2=x^2 and 2p2=y22p-2=y^2 giving us p=y2x2=(y+x)(yx)p=y^2-x^2=(y+x)(y-x) . This forces yx=1y-x=1 so p=2x+12x+1=x2+2x=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 pq=x2p-q=x^2 and pqq=y2pq-q=y^2 so (pqq)(pq)=y2x2p(q1)(pq-q)-(p-q)=y^2-x^2 \rightarrow p(q-1) =(y+x)(yx)=(y+x)(y-x) . Since y+x>yxy+x>y-x , p(x+y)p | (x+y) . Note that q1q-1 is an even integer and since y+xy+x and yxy-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>pq=x2p>xp>p-q=x^2 \rightarrow p>x and p2p>pqq=y2p>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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.