Grandpa prepared a pile of hazelnuts for his six grandchildren, asking them to divide them somehow. First, Adam came, counted half for himself, took one more nut, and left. The second, Bob, the third, Cyril, the fourth, Dan, and the fifth, Eda, all did the same. Only Franta sadly looked at the empty table; no nuts were left for him.

How many nuts were there in the pile originally?

(M. Volfová)

Hint. How many nuts did Eda take?
We will proceed from the back:

When Eda took half of the nuts that were left for him after Dan, and one more, nothing was left. This half, therefore, consisted of one nut. After Dan, two nuts were left.

Dan also took half of the nuts that were left for him after Cyril, and one more. This half, therefore, consisted of those two nuts plus one more. After Cyril, six nuts were left.

Similarly, with the others. Half of the nuts that were left for Cyril after Bob consisted of the previous six nuts plus one more. After Bob, 14 nuts were left.

Half of the nuts that were left for Bob after Adam consisted of the previous 14 nuts plus one more. After Adam, 30 nuts were left.

These 30 nuts plus one more made up half of all the nuts that were prepared for distribution. Originally, there were 62 nuts on the pile.

Note. If $z$ represents the number of nuts left after one of the boys took some, then before that, there were $2(z+1)$ nuts on the pile. This is a shortened notation for the recurring idea in the previous solution.

Conversely, if $n$ represents the number of nuts on the pile before a boy started taking, then he took $\frac{n}{2}+1$ nuts, and after him, $\frac{n}{2}-1$ nuts were left. By repeating this step, we get the sequence of remainders

$$
n, \quad \frac{n}{2}-1, \quad \frac{n}{4}-\frac{3}{2}, \quad \frac{n}{8}-\frac{7}{4}, \quad \frac{n}{16}-\frac{15}{8}, \quad \frac{n}{32}-\frac{31}{16}, \ldots
$$

If $n$ was the original number of nuts, then the remainder after Eda would be $\frac{n}{32}-\frac{31}{16}$. This expression equals zero precisely when $n=62$.