
NT9 Let $p$ be a prime number. Find all positive integers $a$ and $b$ such that:

$$
\frac{4 a+p}{b}+\frac{4 b+p}{a}
$$

and

$$
\frac{a^{2}}{b}+\frac{b^{2}}{a}
$$

are integers.


## Solution

Since $a$ and $b$ are symmetric we can assume that $a \leq b$. Let $d=(a, b), a=d u, b=d v$ and $(u, v)=1$. Then we have:

$$
\frac{a^{2}}{b}+\frac{b^{2}}{a}=\frac{d\left(u^{3}+v^{3}\right)}{u v}
$$

Since,

$$
\left(u^{3}+v^{3}, u\right)=\left(u^{3}+v^{3}, v\right)=1
$$

we deduce that $u \mid d$ and $v \mid d$. But as $(u, v)=1$, it follows that $u v \mid d$.

Now, let $d=u v t$. Furthermore,

$$
\frac{4 a+p}{b}+\frac{4 b+p}{a}=\frac{4\left(a^{2}+b^{2}\right)+p(a+b)}{a b}=\frac{4 u v t\left(u^{2}+v^{2}\right)+p(u+v)}{u^{2} v^{2} t}
$$

This implies,

$$
u v \mid p(u+v)
$$

But from our assumption $1=(u, v)=(u, u+v)=(v, u+v)$ we conclude $u v \mid p$. Therefore, we have three cases $\{u=v=1\},\{u=1, v=p\},\{u=p, v=1\}$. We assumed that $a \leq b$, and this implies $u \leq v$.

If $a=b$, we need $\frac{4 a+p}{a}+\frac{4 a+p}{a} \in \mathbb{N}$, i.e. $a \mid 2 p$. Then $a \in\{1,2, p, 2 p\}$. The other condition being fulfilled, we obtain the solutions $(1,1),(2,2),(p, p)$ and $(2 p, 2 p)$.

Now, we have only one case to investigate, $u=1, v=p$. The last equation is transformed into:

$$
\frac{4 a+p}{b}+\frac{4 b+p}{a}=\frac{4 p t\left(1+p^{2}\right)+p(p+1)}{p^{2} t}=\frac{4 t+1+p(1+4 p t)}{p t}
$$

From the last equation we derive

$$
p \mid(4 t+1)
$$

Let $4 t+1=p q$. From here we derive

$$
\frac{4 t+1+p(1+4 p t)}{p t}=\frac{q+1+4 p t}{t}
$$

Now, we have

$$
t \mid(q+1)
$$

or

$$
q+1=\text { st. }
$$

Therefore,

$$
p=\frac{4 t+1}{q}=\frac{4 t+1}{s t-1}
$$

Since $p$ is a prime number, we deduce

$$
\frac{4 t+1}{s t-1} \geq 2
$$

or

$$
s \leq \frac{4 t+3}{2 t}=2+\frac{3}{2 t}<4
$$

Case 1: $s=1, p=\frac{4 t+1}{t-1}=4+\frac{5}{t-1}$. We conclude $t=2$ or $t=6$. But when $t=2$, we have $p=9$, not a prime. When $t=6, p=5, a=30, b=150$.

Case 2: $s=2, p=\frac{4 t+1}{2 t-1}=2+\frac{3}{2 t-1}$. We conclude $t=1, p=5, a=5, b=25$ or $t=2, p=3, a=6, b=18$.

Case 3: $s=3, p=\frac{4 t+1}{3 t-1}$ or $3 p=4+\frac{7}{3 t-1}$. As 7 does not have any divisors of the form $3 t-1$, in this case we have no solutions.

So, the solutions are

$$
(a, b)=\{(1,1),(2,2),(p, p),(2 p, 2 p),(5,25),(6,18),(18,6),(25,5),(30,150),(150,30)\}
$$
