6. A cone, whose height and radius of the base are both 7, contains four identical spheres. Each of them touches two others (externally), the base, and the lateral surface of the cone. A fifth sphere touches the lateral surface of the cone and all the identical spheres (externally). Find the radius of the fifth sphere.
Answer: $2 \sqrt{2}-1$.

Solution. Let $O_{1}, O_{2}, O_{3}, O_{4}, O_{5}$ be the centers of the spheres, $r$ and $x$ be the radii of the first and fifth spheres, respectively, $B O$ be the height of the cone, and $D$ be the projection of $O_{1}$ onto $B O$. In the diagram, part of the cross-section of the cone by the plane $B O O_{1}$ is shown. Note that $D O_{1}=r \sqrt{2}$ as half the diagonal of the square $O_{1} O_{2} O_{3} O_{4}$ with side length $2 r$. Additionally,

$$
C O_{1}=\sqrt{O_{1} O_{5}^{2}-C O_{5}^{2}}=\sqrt{(x+r)^{2}-(x-r)^{2}}=2 \sqrt{x r}
$$

Since $\angle O A B=\frac{\pi}{4}$, we get $\angle B O_{5} N=\pi-\angle N O_{5} D=\angle C O_{1} D=\frac{\pi}{4}$ and

$$
2 \sqrt{x r} \cos \frac{\pi}{4}+(x-r) \sin \frac{\pi}{4}=r \sqrt{2}
$$

(The left side is the sum of the projections of segments $O_{1} C$ and $O_{5} C$ onto $O_{1} D$, so this formula is valid even in the case $x<r$). Let $t=\sqrt{\frac{x}{r}}$. Then $t^{2}+2 t-3=0$, from which $t=1$ and $x=r$. It remains to note that

$$
7=A O=D O_{1}+r \operatorname{ctg} \frac{\pi}{8}=r \sqrt{2}+r \cdot \frac{1+\cos \frac{\pi}{4}}{\sin \frac{\pi}{4}}=r(2 \sqrt{2}+1) \Longrightarrow r=\frac{7}{2 \sqrt{2}+1}=2 \sqrt{2}-1
$$

## Variant 7