3B. A boy needs to pass through three doors to reach the desired goal. At each door, there stands a guard. The boy carries a certain number of apples with him. To the first guard, he must give half of that number and another half apple. To the second guard, he must give half of the remainder and another half apple, and to the third guard, he must give half of the remainder and another half apple. Find the smallest number of apples the boy should carry with him to reach the desired goal without cutting any apple.
Solution. Let $x$ be the number of apples the boy is carrying. To the first guard, he needs to give $\frac{x}{2}+\frac{1}{2}=\frac{x+1}{2}$ apples. He is left with $x-\frac{x+1}{2}=\frac{x-1}{2}$ apples. To the second guard, he needs to give $\frac{x-1}{4}+\frac{1}{2}=\frac{x+1}{4}$ apples. He is left with $\frac{x-1}{2}-\frac{x+1}{4}=\frac{x-3}{4}$ apples. And to the third guard, he needs to give $\frac{x-3}{8}+\frac{1}{2}=\frac{x+1}{8}$ apples. Since cutting apples is not allowed, the numbers $\frac{x+1}{2}, \frac{x+1}{4}$, and $\frac{x+1}{8}$ must be natural numbers. Therefore, the number $x+1$ must be divisible by 8. The smallest natural number $x$ for which this is true is $x=7$.