7. There are $n$ ellipses centered at the origin with the coordinate axes as axes of symmetry, and the directrices of all ellipses are $x=1$. If the eccentricity of the $k$-th $(k=1,2, \cdots, n)$ ellipse is $e_{k}=2^{-k}$, then the sum of the major axes of these $n$ ellipses is $\qquad$
$7.2-2^{1-n}$.
Let the semi-major axis of the $k$-th ellipse be $a_{k}$, and the focal distance be $c_{k}$. Then, by the problem statement, we have
$$
\frac{a_{k}^{2}}{c_{k}}=1, e_{k}=\frac{c_{k}}{a_{k}}=2^{-k} \text {. }
$$

Thus, $a_{k}=2^{-k}$.
Therefore, $a_{1}+a_{2}+\cdots+a_{n}$
$$
=2^{-1}+2^{-2}+\cdots+2^{-n}=1-2^{-n} \text {. }
$$

Hence, the sum of the major axes of these $n$ ellipses is
$$
2\left(1-2^{-n}\right)=2-2^{1-n} .
$$