How do I find all prime solutions $p, q, r$ of the equation $\displaystyle p(p+1)+q(q+1) = r(r+1)$? 
Find primes  $p, q, r$ of the equation $$p(p+1)+q(q+1)
= r(r+1)$$

I know that it has only one solution namely $p = q = 2,r = 3$. But i can't show that.
Thank you for any help 
 A: May this lead to a simple proof for your problem according to your unic example of solution . There is only one
solution, namely $p = q = 2,r = 3$. To see that, we shall find all solutions
of the equation $p(p+1)+q(q+1) = n(n+1)$ where $p$ and $q$ are primes and
$n$ is a positive integer. Our equation yields
$p(p+1) = n(n+1)-q(q+1) = (n-q)(n+q+1)$,
and we must have $n > q$. Since $p$ is a prime, we have either $p|n-q$ or
$p|n+q+1$. If $p|n-q$, then we have $p\leq n-q$, which implies $p(p+1)
\leq (n-q)(n-q+1)$, and therefore $n+q+1 \leq n-q+1$, which is impossible.
Thus we have $p|n+q+ 1$, which means that for some positive integer $k$
,$n+q+1 = kp$, which implies $p+1 = k(n-q)\tag1$.
If we had $k = 1$, then $n+q+ 1 = p$ and $p+ 1 = n-q$, which gives $p-q
= n+ 1$ and $p+q = n- 1$, which is impossible, because $(p+q)-(p-q)=2q>0$ and $(n-1)-(n+1)=-2<0$. Thus, $k > 1$. From $(1)$ we
easily obtain:
$$\begin{align}
2q &= (n+q)-(n-q) \\
&= kp-1-(n-q) \\
&= k[k(n-q)-1]-1-(n-q) \\
&= (k+1)[(k-1)(n-q)-1].
\end{align}$$
Since $k \geq 2$, we have $k+1 \geq 3$. The last equality, whose left-hand side has
positive integer divisors $1, 2, q$, and $2q$ only, implies that either $k+ 1 = q$
or $k+1 = 2q$. If $k+1 = q$, then $(k-1)(n-q) = 3$, hence $(q-2)(n-q) = 3$.
This leads to either $q-2 = 1$, $n-q = 3$, that is $q = 3, n = 6, k = q-1 = 2$,
and, in view of $(1)$, $p = 5$, or else, $q-2 = 3$, $n-q = 1$, which gives $q = 5,
n = 6, k = 4$, and in view of $(1)$, $p = 3$.
On the other hand, if $k+1 = 2q$, then $(k-1)(n-q) = 2$, hence
$2(q-1)(n-q) = 2$. This leads to $q-1 = 1$ and $n-q = 1$, or $q = 2, n = 3$,
and, in view of $(1)$, $p = 2$. Thus, for positive integer $ n$, we have the
following solutions in primes $p$ and $q$: 


*

*$(p = q = 2, n = 3; 2)$,

*$ (p = 5,
q = 3, n = 6)$, and

*$(p = 3, q = 5, n = 6)$.
Only in the first solution all
three numbers are primes.
Note: If we denote by $\displaystyle t_n = \frac{n(n+1)}{2}$ the nth triangular number,
then   the equation $t_p+t_q = t_r$
has only one solution in prime numbers, namely $p = q = 2, r = 3$.
A: From the given equation
$$p(p+1)+q(q+1)=r(r+1)$$
it follows that $p < r$ and $q < r$.

Next, another inequality which will be useful later . . .

Claim:$\;p+q > r$.

Proof:
\begin{align*}
&p(p+1)+q(q+1)=r(r+1)\\[4pt]
\implies\;&(p^2+q^2)+(p+q)=r(r+1)\\[4pt]
\implies\;&(p+q)^2+(p+q)>r(r+1)\\[4pt]
\implies\;&(p+q)(p+q+1)>r(r+1)\\[4pt]
\implies\;&p+q>r\\[4pt]
\end{align*}
as claimed.

Returning to the main problem . . .

First suppose $p=q$.

Then the given equation reduces to
$$2p(p+1)=r(r+1)$$
hence, since $r > p$, it follows that $r|(p+1)$.

But then $p < r \le p+1$, so $r=p+1$, which implies $p=2$, and $r=3$.

It can be verified that the triple $(p,q,r)=(2,2,3)$ satisfies the given equation.

Next suppose $p,q$ are distinct.

Without loss of generality, assume $p < q$.

Suppose $\;p=2$.

Then from $p < q < r$, we get $q\ge 3$ and $r\ge 5$, hence
\begin{align*}
&p(p+1)+q(q+1)=r(r+1)\\[4pt]
\implies\;&(2)(2+1)+q(q+1)=r(r+1)\\[4pt]
\implies\;&r(r+1)-q(q+1)=6\\[4pt]
\implies\;&(r-q)(q+r+1)=6\\[4pt]
\implies\;&(q+r+1)\mid 6\\[4pt]
\implies\;&q+r+1\le 6\\[4pt]
\end{align*}
contradiction, since $q+r+1\ge 3+5+1=9$.

Hence we must have $p > 2$.

Since $p+q > r$, it follows that $p\not\mid r-q$, and $q\not\mid r-p$.
\begin{align*}
\text{Then}\;\;&p(p+1)+q(q+1)=r(r+1)\\[4pt]
\implies\;&p(p+1)=r(r+1)-q(q+1)\\[4pt]
\implies\;&p(p+1)=(q+r+1)(r-q)\\[4pt]
\implies\;&p\mid (q+r+1)\\[4pt]
\implies\;&p\mid (p+q+r+1)\\[12pt]
\text{and}\;\,&p(p+1)+q(q+1)=r(r+1)\\[4pt]
\implies\;&q(q+1)=r(r+1)-p(p+1)\\[4pt]
\implies\;&q(q+1)=(p+r+1)(r-p)\\[4pt]
\implies\;&q\mid (p+r+1)\\[4pt]
\implies\;&q\mid (p+q+r+1)\\[12pt]
\text{hence}\;\,&pq\mid (p+q+r+1)\\[4pt]
\implies\;&pq\le p+q+r+1\\[4pt]
\implies\;&pq < p+q+(p+q)+1\\[4pt]
\implies\;&pq-2p-2q < 1\\[4pt]
\implies\;&(p-2)(q-2) < 5\\[4pt]
\implies\;&q-2 < 5\\[4pt]
\implies\;&q < 7\\[4pt]
\implies\;&q\le 5\\[4pt]
\implies\;&(p,q)=(3,5)\\[4pt]
\implies\;&(3)(3+1)+(5)(5+1)=r(r+1)\\[4pt]
\implies\;&r=6\\[4pt]
\end{align*}
contradiction, since $6$ is not prime.

Therefore the only solution is $(p,q,r)=(2,2,3)$.
A: Case $p\ne q$: We can assume that $p>q$, then $$r^2+r \leq (p-1)^2+p^2+p-1+p=2p^2\implies  \boxed{r\leq p\sqrt{2}}$$
From:
$$p(p+1) =r^2- q^2+r-q =(r-q)(r+q+1)$$
we get
If $p\mid r-q$ then $r+q+1\mid p+1$, so $p\leq r-q<r$ and $r+q+1\leq p+1 \implies r<p$ a contradiction.
If $p\mid r+q+1$ then $r-q\mid p+1$. Since $r+q+1=kp$ for some integer $k\geq 1$ we have $$kp\leq p\sqrt{2}+(p-1)+1 \implies k\leq 2$$
Case 1: $k=2$ we get $r+q+1=2p$ and $p+1=2r-2q$ from where we get $3p=11$, no good.
Case 2: $k=1$ we get $r+q+1=p$ and $p+1=r-q$ so $q=-1$ again contradiction.

So $p=q$ and now we have to solve $$2p^2+2p = r^2+r$$ 
So $$2p(p+1)=r(r+1)\implies r\mid 2p(p+1)$$
If $r\mid 2$ then $r=2$ which is impossibile.
If $r\mid p$ then $r\leq p$ which is impossibile.
If $r\mid p+1$ then $r\leq p+1$ but then $r=p+1$ since $r>p$, so $r=3$ and $p=2$.
