
2. Suppose $p$ is a prime greater than 3 . Find all pairs of integers $(a, b)$ satisfying the equation

$$
a^{2}+3 a b+2 p(a+b)+p^{2}=0
$$


Solution: We write the equation in the form

$$
a^{2}+2 a p+p^{2}+b(3 a+2 p)=0
$$

Hence

$$
b=\frac{-(a+p)^{2}}{3 a+2 p}
$$

is an integer. This shows that $3 a+2 p$ divides $(a+p)^{2}$ and hence also divides $(3 a+3 p)^{2}$. But, we have

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

It follows that $3 a+2 p$ divides $p^{2}$. Since $p$ is a prime, the only divisors of $p^{2}$ are $\pm 1, \pm p$ and $\pm p^{2}$. Since $p>3$, we also have $p=3 k+1$ or $3 k+2$.

Case 1: Suppose $p=3 k+1$. Obviously $3 a+2 p=1$ is not possible. Infact, we get $1=3 a+2 p=$ $3 a+2(3 k+1) \Rightarrow 3 a+6 k=-1$ which is impossible. On the other hand $3 a+2 p=-1$ gives $3 a=-2 p-1=-6 k-3 \Rightarrow a=-2 k-1$ and $a+p=-2 k-1+3 k+1=k$.

Thus $b=\frac{-(a+p)^{2}}{(3 k+2 p)}=k^{2}$. Thus $(a, b)=\left(-2 k-1, k^{2}\right)$ when $p=3 k+1$. Similarly, $3 a+2 p=p \Rightarrow$ $3 a=-p$ which is not possible. Considering $3 a+2 p=-p$, we get $3 a=-3 p$ or $a=-p \Rightarrow b=0$. Hence $(a, b)=(-3 k-1,0)$ where $p=3 k+1$.

Let us consider $3 a+2 p=p^{2}$. Hence $3 a=p^{2}-2 p=p(p-2)$ and neither $p$ nor $p-2$ is divisible by 3 . If $3 a+2 p=-p^{2}$, then $3 a=-p(p+2) \Rightarrow a=-(3 k+1)(k+1)$.

Hence $a+p=(3 k+1)(-k-1+1)=-(3 k+1) k$. This gives $b=k^{2}$. Again $(a, b)=(-(k+$ 1) $\left.(3 k+1), k^{2}\right)$ when $p=3 k+1$.

Case 2: Suppose $p=3 k-1$. If $3 a+2 p=1$, then $3 a=-6 k+3$ or $a=-2 k+1$. We also get

$$
b=\frac{-(a+p)^{2}}{1}=\frac{-(-2 k+1+3 k-1)^{2}}{1}=-k^{2}
$$

and we get the solution $(a, b)=\left(-2 k+1, k^{2}\right)$. On the other hand $3 a+2 p=-1$ does not have any solution integral solution for $a$. Similarly, there is no solution in the case $3 a+2 p=p$. Taking $3 a+2 p=-p$, we get $a=-p$ and hence $b=0$. We get the solution $(a, b)=(-3 k+1,0)$. If $3 a+2 p=p^{2}$, then $3 a=p(p-2)=(3 k-1)(3 k-3)$ giving $a=(3 k-1)(k-1)$ and hence $a+p=(3 k-1)(1+k-1)=k(3 k-1)$. This gives $b=-k^{2}$ and hence $(a, b)=\left(3 k-1,-k^{2}\right)$. Finally $3 a+2 p=-p^{2}$ does not have any solution.
