# Diophantine equations of three variables

If $$M,N,P$$ are positive integers such that $$\begin{cases}M+N+P&=2024\\MNP&=2020^2\end{cases},$$

Show that $$(M,N,P)=(4,1010,1010)$$ is the only solution up to permutation.

I've got this problem from another problem, and I prove this by using brute-force. I assume $$M\leq N\leq P$$ to deduce that $$M\leq \sqrt{2020^2}<160$$, so the divisors of $$2020^2$$ bounded by $$160$$ are $$M=1,2,4,5,8,10,16,20,25,40,50,80,100,101.$$ Then, I put each $$M$$ to obtain $$\begin{cases}N+P=2024-M\\NP=2020^2/M\end{cases}$$ which $$N,P$$ are the two roots of a quadratic equation, and $$N,P$$ will be positive integers only if the discriminant of the quadratic equation is a perfect square. At this step I've used programming to verify that, besides $$M=4$$, other discriminants are not perfect squares.

I'm wondering is there any mathematical way to prove this. More generally, it will be natural to conjecture that if $$K\geq 1$$ is a positive integer, then the only positive integer solutions $$M,N,P$$ to $$\begin{cases}M+N+P&=2K+4\\MNP&=4K^2\end{cases}$$ are $$(M,N,P)=(4,K,K)$$ up to permutation. A proof for this conjecture will also be appreciated.

$$M, N, P$$ must contain a total of two factors of $$101$$ in their prime factorization, and they must be less than $$101^2$$ to satisfy the sum equation. Therefore two of them must he multiples of $$101$$. Wlog call those two $$N, P$$. Then the sum equation forces $$M\equiv 4\bmod 101$$ and $$M$$ has to be a divisor of $$2020^2$$. Only $$M=4$$ meets both requirements. A number that is not a multiple of $$101$$ and divides $$2020^2$$ must divide $$20^2=400$$, and out of $$\{4,105,206,307\}$$, only $$4$$ does so.
Once $$M=4$$ is proved, $$N$$ and $$P$$ are easily shown to be the roots of $$x^2-2020x+1010^2=0$$ forcing both to be $$1010$$.
• Following your argument, $N,P$ are multiples of $101$ it no longer is immediate that $M$ is the smallest of the three and therefore the checking that $M$ is the only $4 \mod 101$ divisor of $2020^2$ may require brute force as well. Mar 15, 2020 at 2:59
• But I do not assume $M\le N\le P$. Mar 15, 2020 at 8:59
• The question is whether one can bypass the need to check all those values of $M$ by finding a faster way to prove that $M=4$. If you don't assume $M$ is the least of the three, then checking that $M \equiv 4 \mod 101$ and $M | 2020^2$ won't be faster. Mar 15, 2020 at 9:15