Maths Olympiad Prep

Library / USAMO /30 of 156

USAMO

Number theory Difficulty 7.0 National Olympiad, round 2 Find the answer

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

Since q(p−1)q(p-1) is a perfect square and qq is prime, we should have p−1=qb2p - 1 = qb^2 for some positive integer bb . Let a2=p−qa^2 = p - q . Therefore, q=p−a2q = p - a^2 , and substituting that into the p−1=qb2p - 1 = qb^2 and solving for pp gives p=a2b2−1b2−1=(ab−1)(ab+1)b2−1.p = \frac{a^2b^2 - 1}{b^2 - 1} = \frac{(ab - 1)(ab + 1)}{b^2 - 1}. Notice that we also have p=a2b2−1b2−1=a2+a2−1b2−1p = \frac{a^2b^2 - 1}{b^2 - 1} = a^2 + \frac{a^2 - 1}{b^2 - 1} and so b2−1∣a2−1b^2 - 1 | a^2 - 1 . We run through the cases
: Then so , which works. : This means , so , a contradiction. : This means that . Since can be split up into two factors such that and , we get
p=ab−1F1⋅ab+1F2p = \frac{ab - 1}{F_1} \cdot \frac{ab + 1}{F_2} and each factor is greater than 11 , contradicting the primality of pp .
Thus, the only solution is (p,q)=(3,2)(p, q) = (3, 2) .

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.