2. Find all such triples of prime numbers $p, q$ and $r$, that $\frac{p}{q}=\frac{4}{r+1}+1$.
Answer: $(7,3,2) ;(5,3,5) ;(3,2,7)$.

First solution. Rewrite the relation as

$$
4 q=(p-q)(r+1)
$$

If $q=2$, it becomes $8=(p-2)(r+1)$. Then $p-2$ is a power of two, so $p=3$ and $r=7$. If $r=2$, the relation $(*)$ becomes $4 q=3(p-q)$, from which $q=3$ and $p=7$. We will further assume that $q$ and $r$ are odd prime numbers. But then $p$ is also odd, otherwise the left side of $(*)$ is negative. Therefore, $r+1 \geqslant 4$ and $p-q$ are even numbers, so $p-q=2$ and $r+1=2 q$. If $q=3$, then $p=5$ and $r=5$. If $q>3$, since $p$ and $q$ are not divisible by 3 and $p=q+2$, $q$ has the form $3 k+2$, but then $r=2 q-1=6 k+3$, which is impossible.

Second solution. From the condition, it follows that $p>q$. Multiply by the denominators and rewrite the relation as $5 q-p=(p-q) r$. From this, in particular, we get that $5 q-p$ is divisible by $p-q$. Therefore, $4 q=(5 q-p)+(p-q)$ is also divisible by $p-q$. On the other hand, $4 p=(5 q-p)+5(p-q)$ is also divisible by $p-q$. Thus, the greatest common divisor of the numbers $4 p$ and $4 q$ is also divisible by $p-q$, but this divisor is equal to 4. Therefore, only three cases are possible: $p-q=1, p-q=2$, and $p-q=4$. Note immediately that in the second and third cases, $p \geqslant q+2 \geqslant 4$ and, in particular, $p$ is not divisible by three.

The first case is possible only when $p=3$ and $q=2$, and then $r=7$, which is the first solution.

In the second case, $p-q=2$ and then $r=\frac{1}{2}(5 q-p)=2 q-1=2 p-5$. If $r$ gives a remainder of 1 when divided by three, then $p$ will be divisible by three, which is impossible. If $r$ gives a remainder of 2 when divided by three, then $q$ will be divisible by three, so $q=3, p=5$ and $r=5$, which gives the second solution.

In the third case, $p-q=4$ and then $r=\frac{1}{4}(5 q-p)=q-1=p-5$. If $r$ gives a remainder of 1 when divided by three, then $p$ will be divisible by three, which is impossible. If $r$ gives a remainder of 2 when divided by three, then $q$ will be divisible by three, so $q=3, p=7$ and $r=2$, which is the third solution.