I consider the following gaming system: Start with 1 dollar and always bet on head (coin tossing). You always double your stake until the first head appears. Maximum rounds: $n$
I formulated it as a random walk: $S_n=\sum_{k=1}^{n}X_k$ with $\mathbb P(X_k=1)=\mathbb P(X_k=-1)=1/2$ and stopping time $T:=\min\{1\le k\le n : X_k=+1\}$
First I would like to rewrite $V_k$ (=stake in round $k$) with an indicator function as a function of the stopping time $T$, I would guess it is $2^T \mathbb {1}_{\{k\in T\}}$
In the second step I want to calculate the distribution of the gains $(V*S)_n=\sum_{k=1}^{n}V_k X_k$ of the gaming system: What is the probability to lose money?
For every $k\geqslant 1$, the stake at round $k$ is $V_k=2^{k-1}\mathbf 1_{T\geqslant k}$. To wit, one bets at round $k$ if and only if $T\geqslant k$ and, if one bets, the bet is $2^{k-1}$.
The (algebraic) gain $G_n$ after round $n$ is $+1$ if $T\leqslant n$ and $-(2^n-1)$ if $T\gt n$. To wit, if $T\leqslant n$, one recovered all one's stakes $+1$ at time $T$ then one stopped betting, while if $T\gt n$, one lost $n$ times, betting $1$, $2$, $4$, ..., $2^{n-1}$, hence one lost a total of $2^n-1$. Thus, $G_n=1-2^n\mathbf 1_{T\gt n}=1-V_{n+1}$.
Since $[G_n\lt0]=[T\gt n]=[X_1=\cdots=X_n=-1]$ and the random variables $(X_k)$ are i.i.d., one loses money at time $n$ with probability $P[G_n\lt0]=P[X_1=-1]^n=(1/2)^n$.
Thus, the distribution of $G_n$ is characterized by $P[G_n=1]=1-(1/2)^n$ and $P[G_n=1-2^n]=(1/2)^n$.