Let's rewrite the given equality as follows:
p−1q−pq=pr−p+1r+p1⇔p(p−1)q=p(p+1)r+p1⇔p−1q=p+1r+1⇔q=p+1(p−1)r+p−1⇔q=p+r−1−p+12r(1)
Since p, q, r are prime, then the number p+12r is a positive integer. The number 2r has only four divisors: 1, 2, r and 2r. Since p+1≥3, then two cases are possible: p+1=r or p+1=2r.
1) Suppose that p+1=r which means p=r−1. p+1≥3, so the only pair of consecutive prime numbers is 2 and 3, and thus, p=2 and r=3. Then from (1) we find that q=2. After checking we make certain that p=q=2, r=3 is an answer.
2) Suppose that p+1=2r which means p=2r−1. Then from (1) we find that q=3r−3÷3, and since q is prime then q=3. Further, consistently find that r=2, p=3. Checking shows that p=q=3, r=2 is an answer as well.