3. Let $p, q, r$ be natural numbers less than 100 such that $p^{2}+q^{2}=r^{2}$. By adding the same non-zero digit to the left of $p, q, r$, the numbers $a, b, c$ are obtained respectively. Find $p, q, r$ if $a^{2}+b^{2}=c^{2}$.
Solution. If the numbers $p, q, r$ are single-digit, then $a=10 k+p, b=10 k+q$, $c=10 k+r$, where $1 \leq k \leq 9$. From $a^{2}+b^{2}=c^{2}$ and $p^{2}+q^{2}=r^{2}$, it follows that $5 k+p+q=r$. Squaring this equation, we get

$$
25 k^{2}+p^{2}+q^{2}+10 k p+10 k q+2 p q=r^{2}
$$

i.e.

$$
25 k^{2}+10 k p+10 k q+2 p q=0
$$

which is not possible. Therefore, $p, q, r$ cannot be single-digit. We arrive at the same contradiction if we assume that $p, q, r$ are two-digit.

If $p$ and $q$ are single-digit and $r$ is two-digit, then $a=10 k+p, b=10 k+q$,

$$
\begin{gathered}
c=100 k+r \text {, for } 1 \leq k \leq 9 . \text { From } a^{2}+b^{2}=c^{2} \text { and } p^{2}+q^{2}=r^{2}, \text { it follows that } \\
9800 k^{2}+200 r k=20 p k+20 q k,
\end{gathered}
$$

i.e.

$$
4900 k+100 r=p+q
$$

which is not possible, since $p$ and $q$ are single-digit numbers.

If $p$ is single-digit and $q$ and $r$ are two-digit, then $a=10 k+p, b=100 k+q$, $c=100 k+r$. From $a^{2}+b^{2}=c^{2}$ and $p^{2}+q^{2}=r^{2}$, it follows that $5 k+p+10 q=10 r$. Therefore, $p$ must be divisible by 5, i.e., $p=5$, since $p$ is single-digit. According to this, $p^{2}=25=r^{2}-q^{2}=(r-q)(r+q)$. Since $q, r \geq 10$, it is not possible that $q+r=5$ or $q+r=1$, which means $q+r=25$ and $r-q=1$, i.e., $r=13, q=12$.

If $q$ is single-digit and $p$ and $r$ are two-digit, then, as above, we get that $q=5, r=13, p=12$. Therefore, the required numbers are: $p=5, q=12, r=13$ or $p=12, q=5, r=13$.