24. (HUN 5) ${ }^{\text {IMO6 }}$ Father has left to his children several identical gold coins. According to his will, the oldest child receives one coin and one-seventh of the remaining coins, the next child receives two coins and one-seventh of the remaining coins, the third child receives three coins and one-seventh of the remaining coins, and so on through the youngest child. If every child inherits an integer number of coins, find the number of children and the number of coins.
24. Let the $k$ th child receive $x_{k}$ coins. By the condition of the problem, the number of coins that remain after him was $6\left(x_{k}-k\right)$. This gives us a recurrence relation 
$$ x_{k+1}=k+1+\frac{6\left(x_{k}-k\right)-k-1}{7}=\frac{6}{7} x_{k}+\frac{6}{7}, $$
which, together with the condition $x_{1}=1+(m-1) / 7$, yields 
$$ x_{k}=\frac{6^{k-1}}{7^{k}}(m-36)+6 \text { for } 1 \leq k \leq n . $$
Since we are given $x_{n}=n$, we obtain $6^{n-1}(m-36)=7^{n}(n-6)$. It follows that $6^{n-1} \mid n-6$, which is possible only for $n=6$. Hence, $n=6$ and $m=36$.