Problem 7.8. The king and queen had three sons and several daughters (at least one). On September 1st of a certain year, the king and queen noticed that they were both 35 years old, and moreover, the total age of their children also amounted to 35 years. On September 1st several years later, the king and queen noticed that their combined age was equal to the combined age of all their children. (No new children were born during this time; no family members died during this period.)

How many children does the royal couple have, given that there are no more than 20? List all possible options.
Answer: 7 or 9.

Solution. Let the king and queen have $d \geqslant 1$ daughters. Let also $n$ years have passed between the two described moments in time.

Initially, the difference between the total age of the parents and the total age of the children was $35+35-35=35$ years, and after $n$ years, it became 0. Since each year this difference decreased by $(d+3)-2=d+1$ years (since each of the $d+3$ children and each of the 2 parents gets 1 year older), then

$$
35=n(d+1)
$$

The number 35 can be represented as the product of two natural numbers $n$ and $d+1 \geqslant 2$, so we only need to consider three cases.

Let $n=1, d+1=35$. Then $d=34$ - this contradicts the fact that there are no more than 20 children in total.

Let $n=7, d+1=5$. Then $d=4$, and the total number of children was $4+3=7$. This case is possible, for example, if in the first moment of time the three sons were $2,3,4$ years old, and the four daughters were $5,6,7,8$ years old. Then the total age of the children was $2+3+4+5+6+7+8=35$ years - the same as the king and queen. After 7 years, their total age became $9+10+$ $11+12+13+14+15=84=42+42$ - the same as the total age of the king and queen.

Let $n=5, d+1=7$. Then $d=6$, and the total number of children was $6+3=9$. This case is possible, for example, if in the first moment of time the three sons were $1,2,4$ years old, and the six daughters were $1,2,4,6,7,8$ years old. Then the total age of the children was $1+2+4+1+2+4+6+$ $7+8=35$ years - the same as the king and queen. After 5 years, their total age became $6+7+9+6+7+9+11+12+13=80=40+40-$ the same as the total age of the king and queen.

## 8th grade