3. find all natural numbers $n$ for which prime numbers $p, q$ exist such that

$$
p(p+1)+q(q+1)=n(n+1)
$$
Solution: We subtract $q(q+1)$ from both sides of the equation. Factorizing yields

$$
p(p+1)=(n-q)(n+q+1)
$$

If $p$ is a divisor of $n-q$, there is no solution, as $p+1$ is then smaller than $n+q+1$. Thus $p$ divides the term $n+q+1$. Analogous to the factorization above, we get that $q$ is a divisor of $n+p+1$. First we consider the possibility $p=q$. Then $2 p(p+1)=n(n+1) . p$ divides $n+1$. Thus $p+1$ is a divisor of $n$ and therefore 2 is a divisor of $n+1$. It follows that $2(n+1)=p$ and $p=n$, i.e. $p=2$. This gives us the solution $(p, q, n)=(2,2,3)$.

Now we can assume that $p$ is greater than $q$. Thus $p$ is greater than $n / 2-1$. Furthermore, $q$ is smaller than $n$. It follows that we must consider the three cases $p=n+q+1,2 p=n+q+1$ and $3 p=n+q+1$. In the first case, there is no solution as $p$ is smaller than $n$. In the second case, with $2 p-n-1=q$ and $q \mid n+p+1$, we get that $q$ is a divisor of $3 p$. Since $p$ is greater than $q$, the possibility $q=3$ remains. Inserting $q=3$ and $n=2 p-4$ yields the quadratic equation $3 p^{2}-15 p=0$ and thus the solution $(p, q, n)=(3,5,6)$. In the third case, with $3 p-n-1=q$ and $q \mid n+p+1$, we get that $q$ is a divisor of $4 p$. Since $p$ is greater than $q$, the case $q=2$ remains. Inserting $n=3 p-3$ shows that $p(8 p-16)=0$. However, the left-hand side is strictly positive for $p>q=2$, so we do not get a solution in this case.

This means that $(2,2,3)$ and $(3,5,6)$ are the only two solutions.