3. (2002 Australian National Mathematics Olympiad) Find all prime numbers $p, q, r$ such that $p^{q}+p^{r}$ is a perfect square.
3. If $q=r$ then $p^{q}+p^{r}=2 p^{q}$, so $p=2, q$ is an odd prime. Therefore, $(2, q, q)$ is a triplet of prime numbers that satisfies the condition, where the prime number $q \geqslant 3$.
If $q \neq r$, without loss of generality, let $q<r$, then $p^{q}+p^{r}=p^{q}\left(1+p^{r}\right)$ where $s=r-q \geqslant 1$.
Since $p^{q}$ and $1+p^{s}$ are coprime, both $p^{q}$ and $1+p^{s}$ must be perfect squares, hence $q=2$.
Let $1+p^{s}=u^{2}$, i.e., $p^{s}=u^{2}-1=(u+1)(u-1)$, and the greatest common divisor of $u+1$ and $u-1$ is 1 or 2. When the greatest common divisor is 2, $u$ is odd, and $p$ is even. So $p=2$, and both $u-1$ and $u+1$ are powers of 2. Thus, $u=3$. Therefore, $1+2^{s}=3^{2}$, so $s=3$. $r=q+s=2+3=5$.
Hence, the triplet of prime numbers that satisfies the condition is $(2,2,5)$ and $(2,5,2)$.
When $u+1$ and $u-1$ are coprime, $u$ is even. $u-1$ must be 1, otherwise $u-1$ and $u+1$ can be expressed as the product of different odd primes, so it cannot be an integer power of a prime, thus $u=2$.
$p^{s}=3 \Rightarrow p=3, s=1, r=q+s=3$. Therefore, $(3,2,3)$ and $(3,3,2)$ also satisfy the condition.
In summary, $(2,2,5),(2,5,2),(3,2,3),(3,3,2),(2, q, q)$, where $q \geqslant 3$ are the solutions.