4. How many ordered quadruples of natural numbers $(a, b, c, d)$ with a sum of 100 satisfy the equations

$$
(a+b)(c+d)=(b+c)(a+d)=(a+c)(b+d) ?
$$

(Patrik Bak)
SOLUTION. First, we will equivalently transform the first equation from the problem:

$$
\begin{aligned}
(a+b)(c+d) & =(b+c)(a+d), \\
a c+a d+b c+b d & =b a+b d+c a+c d, \\
a d+b c-a b-c d & =0, \\
a(d-b)-c(d-b) & =0, \\
(a-c)(d-b) & =0 .
\end{aligned}
$$

Similarly, we find that the second equation is equivalent to an equation, which we will write for clarity next to the modified first equation:

$$
(a-c)(d-b)=0, \quad(a-b)(d-c)=0 .
$$

According to which of the four factors in the derived equations are zero, all solutions $(a, b, c, d)$ of the given equations are quadruples of one of four types:

$$
\begin{aligned}
& \triangleright a-c=0 \text { and } a-b=0, \text { or } a=b=c \text { and } d \text { is arbitrary, } \\
& \triangleright a-c=0 \text { and } d-c=0 \text {, or } a=c=d \text { and } b \text { is arbitrary, } \\
& \triangleright d-b=0 \text { and } a-b=0 \text {, or } a=b=d \text { and } c \text { is arbitrary, } \\
& \triangleright d-b=0 \text { and } d-c=0 \text {, or } b=c=d \text { and } a \text { is arbitrary. }
\end{aligned}
$$

We have concluded that the equations from the problem hold precisely when at least three of the numbers $a$, $b, c, d$ are equal. We now distinguish whether the same numbers in the quadruple $(a, b, c, d)$ are four or three.

- If all four numbers are equal, the condition $a+b+c+d=100$ is satisfied by the single quadruple $a=b=c=d=25$.
- If three numbers have the same value $x$ and the fourth has a different value $y$, the condition $a+b+c+d=100$ becomes the equation $3 x+y=100$, which we consider in the domain of natural numbers satisfying the condition $x \neq y$. From the equivalent equation $y=100-3 x$, it follows that the number $y$ is positive only for $x=1,2, \ldots, 33$, and the condition $y \neq x$ is satisfied if $x \neq 25$. Thus, we have first $33-1=32$ options for choosing the number $x$ and then 4 options for which of the four numbers $a, b, c, d$ we assign the value $y=100-3 x$ (and the other three the value $x$). The number of quadruples $(a, b, c, d)$ with exactly three equal numbers is therefore $32 \cdot 4=128$.

The total number of quadruples satisfying the condition is thus $1+128$ or 129.

NOTE. Beyond the problem, we have found that 128 satisfying quadruples are of the form $(x, x, x, 100-3 x),(x, x, 100-3 x, x),(x, 100-3 x, x, x)$, or $(100-3 x, x, x, x)$, where $x=1,2, \ldots, 33$ except $x=25$, and the remaining 129th satisfying quadruple is $(25,25,25,25)$.

COMMENT. Working with the pair of equations

$$
(a+b)(c+d)=(b+c)(a+d) \quad \text { and } \quad(b+c)(a+d)=(a+c)(b+d)
$$

with the same sides $(b+c)(a+d)$ can be simplified by observing that the second equation is obtained from the first by swapping the letters $b, c$. Thus, once the first equation is transformed into the form $(a-c)(d-b)=0$ and the swap $b \leftrightarrow c$ is performed in it, we get the equivalent form $(a-b)(d-c)=0$ of the second equation without calculation.

## ADDITIONAL AND COMPLEMENTARY PROBLEMS:

N1. For natural numbers $a, b, c, d$ it holds that $a b+b c+c d+d a=77$. Determine all possible values of their sum. [The only value is 18. It holds that $77=a b+b c+c d+d a=(a+c)(b+d)$ and both factors $a+c$ and $b+d$ are greater than 1, so they are equal to the primes 7 and 11 in some order. Thus, $(a+c)+(b+d)=18$. It remains to provide some satisfying quadruple. One is, for example, $(a, b, c, d)=(1,1,6,10)$.]

N2. Suppose that the distinct real numbers $a, b, c, d$ satisfy the inequalities

$$
a b+c d>b c+a d>a c+b d .
$$

If $a$ is the largest of these four numbers, which of them is the smallest? [The number $c$. Transform the first given inequality into the form $(a-c)(b-d)>0$, the second into the form $(b-a)(c-d)>0$. If $a$ is the largest of the given four numbers, then $a-c>0$ and $b-a<0$, so $c-d>0$ and $c>d$. Thus, $b>d>c$.]

D1. Find all quadruples $a>b>c>d$ of integers with a sum of 71 that satisfy the equation

$$
(a-b)(c-d)+(a-d)(b-c)=26 .
$$

[Transform the left side into the product of two polynomials. Complete solution: 71-C-S-3.]

D2. Determine all possible values of the sum $a+b+c+d$, where $a, b, c, d$ are natural numbers satisfying the equation

$$
\left(a^{2}-b^{2}\right)\left(c^{2}-d^{2}\right)+\left(b^{2}-d^{2}\right)\left(c^{2}-a^{2}\right)=2021 .
$$

[Transform the left side into the product of four polynomials. Complete solution: 71-C-I-6.]

D3. On each face of a cube, a natural number is written. At each vertex, the product of the three numbers on the adjacent faces is written. The sum of the eight numbers at the vertices is 1001. Determine all possible values of the sum of the numbers on the faces. [31. If $a, b$ are the numbers on the front and back faces, $c, d$ are the numbers on the top and bottom faces, and finally $e, f$ are the numbers on the left and right faces, then by expanding the product $(a+b)(c+d)(e+f)$, we get eight addends, which are precisely the numbers written at the vertices of the cube (at each vertex, three faces meet, one from each of the three pairs of faces). According to the problem, the product of the three numbers $a+b, c+d$, and $e+f$, all greater than 1, is equal to the number 1001, which is the product of the three primes 7, 11, and 13. Thus, $\{a+b, c+d, e+f\}=\{7,11,13\}$, so $a+b+c+d+e+f=7+11+13=31$.]

D4. Determine the number of all triples of natural numbers $a, b, c$ for which $a+a b+a b c+a c+c=2017$. [Add the number 1 to both sides of the equation so that you can then factor the left side into the product of two polynomials. Complete solution: $67-\mathrm{B}-\mathrm{I}-4$.]