## Task 5 - 231235

Determine all pairs $(a ; b)$ of prime numbers $a$ and $b$ for which the following holds:

$$
3 a^{2}+a=b^{2}+b
$$
We first note that the following holds:

$$
2 a^{2}=b^{2}+b-a^{2}-a=(b-a)(b+a+1)
$$

Here, $b-a=1$ cannot hold, because from this, due to the prime property of $a$ and $b$, it would immediately follow that $a=2$ and $b=3$, which is not a solution to our equation here. It also cannot be that $a \mid b-a$, because from $b=k a$ for some $k \in \mathbb{N}^{*}$, it would immediately follow that $b=(k+1) a$, again contradicting the primality of $b$. Therefore, it must be that $b-a=2$, i.e., $b=a+2$. Substituting this into (*) then leads to

$$
2 a^{2}=2(2 a+3)
$$

and after a simple transformation, further to

$$
(a-1)^{2}=4
$$

Since $a>1$, it must then be that $a=3$ and thus $b=a+2=5$, which indeed is the only pair of prime numbers that solves the problem here.