Problem

Source: USAMO 2022/4, JMO 2022/5

Tags: number theory, Diophantine equation, prime numbers, xtimmyGgettingflamed



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