## Task 22/82

Nina and Sascha have collected mushrooms. Nina says to Sascha: "Half of my mushrooms are porcini, the other half are fly agarics and birch boletes. What is mathematically interesting, however, is that the product of the number of porcini, the number of fly agarics, and the number of birch boletes is equal to the square of the sum."

To which Sascha replies: "That is strange - the same is true for me. Only I have one more fly agaric than you."

How many mushrooms of each type do the two children have?
We denote with $x$ the number of porcini mushrooms in Nina's basket, with $y$ the number of fly agarics, and with $z$ the number of birch boletes. Then, according to Nina's statements, the following Diophantine system of equations holds:

$$
x=y+z \quad ; \quad x y z=(x+y+z)^{2}
$$

$(x ; y ; z \in N)$, which, by substitution, reduces to the equation

$$
(y+z) y z=[2(y+z)]^{2}
$$

Due to $y+z \neq 0$, this equation is equivalent to $y z=4 y+4 z$. Solving for $y$, we get, because $z \neq 4$ (as one can verify by substitution),

$$
y=\frac{4 z}{z-4}=4+\frac{16}{z-4}
$$

This equation yields the following triples:

| $z$ | $y$ | $x$ | $z$ | $y$ | $x$ |
| :---: | :---: | :---: | :---: | :---: | :---: |
| 0 | 0 | 0 (excluded) | 5 | 20 | 25 |
| 6 | 12 | 18 | 8 | 8 | 16 |
| 12 | 6 | 18 | 20 | 5 | 25 |

Since Sascha has one more fly agaric than Nina, Nina must have 5 fly agarics and Sascha 6. Consequently, Nina has 20 birch boletes and 25 porcini mushrooms (a total of 50 mushrooms), while Sascha has 12 birch boletes and 18 porcini mushrooms (a total of 36).