King Pan was distributing ducats to his sons. He gave a certain number of ducats to his eldest son, one ducat less to the next younger son, and continued this pattern until he reached the youngest. Then he returned to the eldest son, giving him one ducat less than he had just given to the youngest, and continued distributing in the same manner as in the first round. In this round, the youngest son received one ducat. The eldest son received a total of 21 ducats.

Determine how many sons the king had and how many ducats he distributed in total.

(K. Pazourek)

Hint. How many ducats would the eldest son receive if the king distributed them in the same manner to, for example, four sons?
For a specific number of sons, one can vividly test the king's method of distributing ducats. It's enough to proceed from the back: the youngest received one ducat in the second round, the second youngest received two ducats, etc. For example, for two, three, and four sons, the number of ducats in individual rounds would look as follows (arranged from top to bottom according to rounds, from left to right according to age):

![](https://cdn.mathpix.com/cropped/2024_04_17_feaf7e66a17237709e22g-3.jpg?height=129&width=566&top_left_y=1289&top_left_x=745)

The eldest son would receive 6 ducats in the first case, 9 ducats in the second case, and 12 ducats in the third case. In this way, one can gradually find the situation where the eldest son received 21 ducats:

$$
\begin{array}{rrrrrrr}
14 & 13 & 12 & 11 & 10 & 9 & 8 \\
\hline 7 & 6 & 5 & 4 & 3 & 2 & 1
\end{array}
$$

Thus, the king had 7 sons and distributed a total of 105 ducats to them.

Notes. Instead of trial and error, one can notice that the following follows from the problem statement: the eldest son will receive exactly as many ducats in the second round as there are sons, and in the first round, twice as many, making a total of three times the number of sons. For this number to be 21, there must be 7 sons, and the total number of ducats is \(1+2+\ldots+14=105\).

The sum of the distributed ducats can be determined in various ways, see for example the following shortcut:

$$
(1+14)+(2+13)+\ldots+(7+8)=7 \cdot 15=105
$$