$a^{2} + b^{2}+ ab = c^{2} + d^{2} + cd$. Is it possible that $a+b+c+d$ be prime number? Let $a,b,c,d$ be natural numbers such that $a^{2} + b^{2}+ ab = c^{2} + d^{2} + cd$. Is it possible that $a+b+c+d$ be prime number?

Now assume that $a+b+c+d = p > 2$ for some choice of $a,b,c,d$. Notice that we cannot have $a=b=c=d$. Also notice that $(a+b+c+d)^{2}$ must be odd and only have three factors: $1, p, p^{2}$.
$$ p^{2} = a^{2} + b^{2} + c^{2} + d^{2} + 2(ab+ac+ad + bc+bd + cd) $$
$$ = 2(c^{2}+d^{2}+ac+ad++bc+bd) + (ab + 3cd) $$
$$ =2(c^{2}+d^{2}+ac+ad++bc+bd + cd) + (ab + cd) $$
So $(ab+cd)$ must be odd.
Now if $a+b+c+d$ is prime $>2$ then either 3 of them is odd and 1 is even, or 3 of them is even and one is odd. 
$WLOG$, let $a,b,c$ be even and $d$ is odd, then $a^{2} + b^{2}+ ab$ is even and $c^{2} + d^{2}+ cd$ is odd, so we can't have 3 even and 1 odd.
But it is possible for 3 odd and 1 even. 
 A: We work in the principal ideal domain $\mathbb Z [\omega]$, where $\omega = \frac{-1 + \sqrt3 i}{2}$ (which we view as an element of $\mathbb C$).
Without loss of generality, assume that $a \geq b$ and $c \geq d$, and that we don't have equality at the same time.
Write the equation as $(a + b \omega)(a + b\overline\omega) = (c + d \omega)(c + d\overline\omega)$. Let $u$ be the greatest common divisor of $a + b\omega$ and $c + d\omega$. It is well defined up to multiplication by a sixth root of unity, i.e. $\pm 1, \pm \omega, \pm \omega^2$.
Write $a + b\omega = u v$ and $c + d\omega = u v'$, with $v, v'$ coprime. We then have $v\overline v = v' \overline {v'}$, which implies (since $v, v'$ coprime) that $v \mid \overline{v'}$ and $v'\mid \overline v$. But taking complex conjugation gives $\overline{v'}\mid v$, hence $v' = \varepsilon v$ for some sixth root of unity $\varepsilon$.
We therefore have $a + b\omega = uv$, $c + d\omega = u\overline v \varepsilon$. By replacing $u, v, \varepsilon$ with $u\delta^{-1}, v\delta, \varepsilon\delta^2$ for some sixth root of unity $\delta$, we may assume without loss of generality that $\varepsilon = \pm 1$.

Case 1: $\varepsilon = 1$.
We have $a + b\omega = uv$. Taking complex conjugation gives $a + b\overline \omega = \overline u\overline v$. Solving this linear equation, we get $a + b = -\omega u v - \overline \omega \overline u \overline v$.
Similarly, we get $c + d = -\omega u \overline v - \overline \omega \overline u v$.
Hence in the end $a + b + c + d = -(\omega u + \overline {\omega u})(v + \overline v)$.
Since both $(\omega u + \overline {\omega u})$ and $v + \overline v$ are integers, if the product is prime, then one of them must be $\pm 1$.
Now observe the fact that, for any element $x \in \mathbb Z[\omega]$, $x + \overline x = \pm 1$ will imply that $\arg x$ lies in either $[60^\circ, 120^\circ]$ or $[-120^\circ, -60^\circ]$.
It follows that $v + \overline v$ cannot be $\pm 1$. This is because both $a + b\omega$ and $c + d\omega$ lives in the region $\{z \in \mathbb C: 0 < \arg z \leq 60^\circ\}$, hence the number $v/\overline v$, being their quotient, must have $\arg$ in the range $(-60^\circ, 60^\circ)$.
But $\omega u + \overline{\omega u}$ cannot be $\pm 1$ either. The reasoning is similar: since $a + b\omega$ and $c + d\omega$ cannot both attain $60^\circ$ of $\arg$, the number $u^2 v \overline v$, being their product, must have $\arg$ in the range$(0^\circ, 120^\circ)$. This means $u$ must have $\arg$ in the range $(0^\circ, 60^\circ)$ or $(-180^\circ, -120^\circ)$, hence $\omega u$ has $\arg$ in the range $(120^\circ, 180^\circ)$ or $(-60^\circ, 0^\circ)$.
This completes the proof that $a + b + c + d$ cannot be a prime number in the case $\varepsilon = 1$.

Case 2: $\varepsilon = -1$.
Same as above, we work out the formula $a + b + c + d = -(v - \overline v)(\omega u - \overline{\omega u})$.
This case is now significantly easier, since the product must be a multiple of $3$. So if it is a prime, then we have $a + b + c + d = 3$ and it's already impossible.
A: If $ \{ a, b \} = \{c, d \}$ then $a+b+c+d = 2(a+b)$ is not a prime.    
Henceforth, we have distinct pairs. If $ a = c$, then $b \neq d$ are roots to $x^2 + ax + a^2 = 0$, so $b+d = -a$ contradicting the requirement that all of the terms are positive.
WLOG, $ a > c \geq d > b$.   
Observe that $$ -(a-b+c-d)(a-b-c+d) = -\left((a-b)^2 - (c-d)^2\right) = 3(ab-cd) = 3\left( (a+b)^2 - (c+d)^2\right) = 3 (a+b-c-d)(a+b+c+d).$$
Since $ a+b+c+d > a-b+c-d \geq a-b-c+d > 0$, we can rewrite the above as a product of positive integers, 
$$  (a-b+c-d)(a-b-c+d)= 3 (c+d-a-b)(a+b+c+d)$$
If $a+b+c+d$ is prime, then the LHS can never be a multiple of $a+b+c+d$ since both terms are smaller, hence we have a contradiction. So $ a+b+c+d$ is composite. 

Notes:    


*

*This problem/solution is very reminiscent of 2001/6 IMO. There we had $a^2+ab+b^2 = c^2 -cd+d^2$.    

*I do not know a direct way to show that $cd > ab$. Any thoughts? This seems obvious.   

*This being a contest problem suggests that there is a non "abstract algebra approach", even though it is very tempting. E.g. The equation in my solution can also be derived from WhatsUp's characterization (which is a stronger requirement). 

A: Another solution, whose approach is distinct from the rest.
Suppose that for some prime $ p \geq 4$,  $ a + b + c + d = p$.
Then $ a+ b \equiv - (c+d) \pmod{p}$,
$ a^2 + 2ab + b^2 \equiv c^2 + 2cd + d^2 \pmod{p}$,
$ab \equiv cd \pmod{p}$.
$a^2 - 2ab + b^2 \equiv c^2 - 2cd + d^2 \pmod{p}$
WLOG $ a - b \equiv c - d \pmod{p}$
Hence $ 2a \equiv (a-b) + (a+b) \equiv (c-d)  - (c-d) \equiv - 2d \pmod{p}$.
Since $ p \neq 2$, so $ a + d \equiv 0 \pmod{p}$.
Then, $ a + b + c + d > a + d \geq p $ which is a contradiction.
