On the value of $a+b$ such that $a^2+b^2+3ab=2000$ where $a,b \in \mathbb{Z}^+$ 
Find the value of $a+b$ such that $a,b \in \mathbb{Z}^+$ such that $a^2+b^2+3ab=2000.$

On the outside, this seems like a very easy problem, but I'm not sure how to do this in a non-messy way. What I have so far is that $$a^2+b^2+3ab=(a+b)^2+ab= 2000\implies a+b = \sqrt{2000-ab}.$$ However, is there any way I can do this without trial and error on these values? Solving the quadratic $(a+b)^2 + ab - 2000=0$ wouldn't help a lot either. How should I proceed from this. Thanks in advance.
 A: One less messy way of doing this is to notice that

*

*if $a^2 + 3ab + b^2$ is even, then both $a, b$ must be even.

*if $a^2 + 3ab + b^2$ is a multiple of $25$, then both $a, b$ are multiples of $5$.

Thus $a^2 + 3ab + b^2 = 2000$ leads to $a = 20x, b = 20y$ with $x^2 + 3xy + y^2 = 5$.
Proof of 1:
We have $0\equiv a^2 + 3ab + b^2 \equiv ab + a + b \equiv (a + 1)(b + 1) + 1\bmod 2$. Therefore $a, b$ must be both even.
Proof of 2:
We have $(a - b)^2 + 5ab \equiv 0 \bmod 25$ and hence $a - b \equiv 0\mod 5$. Thus $5ab \equiv 0\bmod 25$ and one of $a, b$ is multiple of $5$. Hence both are multiples of $5$.
A: 20 cases isn't that many to test. It's a good approach to take esp since it doesn't require much more thinking.

Consider it as a quadratic in $b$, we have $ b = \frac{1}{2} ( -3a \pm \sqrt{ 5a^2 +8000} ) $.
So, we need  $ 5a^2 + 8000 = c^2 $, $ 5a^2 + 8000 > 9a^2 \Rightarrow  a < 45$ (for positivity), and verify that $b$ is an integer (by parity).
Clearly $ 5 \mid c$, so set $ c = 5 c_1$, which gives us $ a^2 + 1600 = 5c_1^2$.
Then $ 5 \mid a $ so set $ a = 5 a_1 $ which gives us $ 5a_1 ^2 + 320 = c_1^2$ with $a_1 < 9$.
Testing $a_1 $ from 1 to 9 gives us $ a_1 = 4 \Rightarrow a = 20, c = 100, b = 20$.

Note: Without the positive condition, we have infinitely many integer solutions.
A: This is only "less ugly".  ^_^  I agree that problems like this feel like they should be solved without solving for $a$ and $b$, but I did that here.

If both $a$ and $b$ were odd, then the LHS would be odd+odd+odd, which cannot be even.  Similarly, if one were even and the other were odd, there would be exactly one odd term on the LHS, which cannot equal 2000.  Therefore, both $a$ and $b$ are even.  Let us let $i$ and $j$ be positive integers such that $2i=a$ and $2j=b$.
$$(2i)^2+(2j)^2+3(2i)(2j)=2000\\4i^2+4j^2+12ij=2000\\i^2+j^2+3ij=500$$
For the same reason, we can conclude that both $i$ and $j$ are integers, so let us take $x$ and $y$ to be positive integers such that $2x=i$ and $2y=j$, which gives us $$x^2+y^2+3xy=125$$
This is far more tractable to brute force.  Without loss of generality, let us assume that $y$ is not smaller than $x$.  $y=11$ would be too large.

*

*$y=10$ gives us $x^2+30x-25=0$, which has no positive integer solutions

*$y=9$ gives us $x^2+27x-44=0$, nothing

*$y=8$ gives us $x^2+24x-61=0$, nothing

*$y=7$ gives us $x^2+21x-76=0$, nothing

*$y=6$ gives us $x^2+18x-89=0$, nothing

*$y=5$ gives us $x^2+15x-100=0$, which has the solution $x=5$.

That is clearly the only solution, because smaller values of $y$ would require values of $x$ that are larger than it.  This corresponds to $a=20, b=20$ as the only solution of the original equation, so $a+b=40$.
A: Here is an answer with a few try and error:
We have $(a+b)^2+ab=2000$ or $S^2+P=2000$ Where $S$ is sum of the numbers and $P$ is product of them.
From AM-GM inequality we know that if sum of two number is fixed then maximum value of the product happens when the numbers are equal to each other. Now start by $S=20$ maximum of $S^2+P$ is $400+10\times10=500<2000$, similarly for $S=30$ the maximum value is$1125<2000$. But for $S=40$ we get $1600+20\times20=2000$ hence $a=b=20$ is answer.
Also $S$ should be less than $45$ because $45^2=2025$. Now we left with few cases:
$(I) S=41$
$P=2000-1681=319=11\times29 \quad \color{red}{✗}$
$(II) S=42$
$P=2000-1764=236=4\times59 \quad \color{red}{✗}$
$(III) S=43$
$P=2000-1869=151\quad(\text{A prime number})\quad \color{red}{✗}$
$(IV) S=44$
$P=2000-1946=64=32\times2=16\times4=\cdots=1\times64\quad \color{red}{✗}$
Hence $a=b=20$ is the only solution.
