WLOG, p≤q, clearly r>p. We can write:
p(p+1)=(r−q)(r+q+1).(1)
Since p is prime, then either r−q or r+q+1 is divisible by p. If p divides r−q, then r−q≥p,
p(p+1)≤(r−q)(r−q+1)<(r−q)(r+q+1),
which contradicts to (1).
Let suppose that r+q+1 is divisible by p. If p=2, then r+q+1 has to be even, which implies that r is odd, hence q is even, thus q=2 and r=3.
If p>2, let r+q+1=kp. Then r and q are odd and k is odd, k>1. Then p+1=k(r−q) and we get k2(r−q)=kp+k or r+q+1+k=k2r−k2q which is equivalent to
(k2+1)q=(k2−1)r−(k+1).
RHS is divisible by (k+1), thus LHS is divisible by the same number, since k is odd, then 2k2+1 is divisible by 2k+1. Observe, that
(2k2+1,2k+1)=(2k2+1−2(k−1)(k+1),2k+1)=(1,2k+1)=1.
2k2+1 and 2k+1 are coprime, so 2k+1 is divisible by q and since k>1, then 2k+1>1 and q=2k+1.
We get r=kp−q−1 and q=2k+1. Plugging in this into p+1=k(r−q) we get p+1=(kp−k−2)k. But the last equality is impossible because k≥3, p≥3 implies
(kp−k−2)k>kp−k−2=k(p−1)−2≥3(p−1)−2=p+(2p−5)≥p+1.
This completes the proof.