5. Find all pairs of positive integers $(m, n)$ such that
$$
m+n-\frac{3 m n}{m+n}=\frac{2011}{3}
$$
5. Answer: $(m, n)=(1144,377)$ or $(377,1144)$.

Let $m$ and $n$ be positive integers satisfying the given equation. That is $2011(m+$ $n)=3\left(m^{2}-m n+n^{2}\right)$. Since the equation is symmetric in $m$ and $n$, we may assume $m \geq n$. If $m=n$, then $m=n=4022 / 3$ which is not an integer. So we may further assume $m>n$. Let $p=m+n$ and $q=m-n>0$. Then $m=(p+q) / 2$ and $n=(p-q) / 2$, and the equation becomes $8044 p=3\left(p^{2}+3 q^{2}\right)$. Since 3 does not divide 8044 , it must divide $p$. By letting $p=3 r$, the above equation reduces to $8044 r=3\left(3 r^{2}+q^{2}\right)$. From this, 3 must divide $r$. By letting $r=3 s$, we get $8044 s=27 s^{2}+q^{2}$, or equivalently
$$
s(8044-27 s)=q^{2} .
$$

For $s$ between 1 and $\lfloor 8044 / 27\rfloor=297$, the number $s(8044-27 s)$ is a square only when $s=169$. To narrow down the values of $s$, we proceed as follow.

Let $s=2^{\alpha} u$, where $\alpha$ is a nonnegative integer and $u$ is an odd positive integer. Suppose $\alpha$ is odd and $\alpha \geq 3$. Then (*) becomes $2^{\alpha+2} u\left(2011-27 \times 2^{\alpha-2} u\right)=q^{2}$ which is a square. Since $\alpha+2$ is odd, 2 must divide $2011-27 \times 2^{\alpha-2} u$ implying 2 divides 2011 which is a contradiction. Next suppose $\alpha=1$. Then we have $u(2 \times 2011-27 u)=(q / 2)^{2}$. If $u$ is not a square, then there exists an odd prime factor $t$ of $u$ such that $t$ divides $2 \times 2011-27 u$. Thus $t$ divides $2 \times 2011$ so that $t$ must be 2011 since 2011 is a prime. But then $u \geq t=2011$ contradicting $2 \times 2011-27 u>0$. Therefore $u$ must be a square. This implies that $2 \times 2011-27 u$ is also a square. Taking mod 4 , we have $u \equiv 0$ or $1 .(\bmod 4)$ so that $2 \times 2011-27 u \equiv 2$ or $3(\bmod 4)$ which contradicts the fact that $2 \times 2011-27 u$ is a square. Thus $\alpha \neq 1$ too. Consequently $\alpha$ must be even. Then dividing both sides of $(*)$ by $2^{\alpha}$, we obtain $u\left(8044-27 \times 2^{\alpha} u\right)=q^{2} / 2^{\alpha}$ which is a square. Now suppose $u$ is not a square. Then there exists an odd prime factor $v$ of $u$ such that $v$ divides $8044-27 \times 2^{\alpha} u$. Then $v$ must divide 8044 so that $v=2011$. Thus $u \geq v=2011$. This again contradicts the fact that $8044-27 \times 2^{\alpha} u>0$. Therefore $u$ is a square. Consequently $s$ is also a square. Write $s=w^{2}$. Then ( $*$ ) becomes $w^{2}\left(8044-27 w^{2}\right)=q^{2} \geq 0$. From this $w \leq\left\lfloor(8044 / 27)^{\frac{1}{2}}\right\rfloor=17$. A direct verification shows that $8044-27 w^{2}$ is a square only when $w=13$. Thus $s=w^{2}=169$. Then $p=3 r=9 s=1521$, and by $(*) q=(169 \times(8044-27 \times 169))^{\frac{1}{2}}=767$. Lastly, $m=(p+q) / 2=1144$ and $n=(p-q) / 2=377$