Let $A\in N+$. Let $(X_n)_{n\ge 1}$ be a sequence of i.i.d. random variables such that
$P(X_1=1)=1-P(X_1=-1)=p$
$p \in (0, \frac{1}{2})$
Consider a random walk $S_n=\sum_{i=0}^n X_i$
Let $\mathcal{F}_n=\sigma(X_1,....,X_n)$ and define the stopping time $\tau$ such that
$\tau = \min [n \in \mathbb{N}:S_n=0]$
Define
$W_n=(S_n -A-(2p-1)n)^2 - n(1-(2p-1)^2)$
I need to show that $(W_n,\mathcal{F}_n)$ is a martingale
Proof until now: I have tried to show this starting from $n=0$ and $n=1$ and eventually going true a proof through induction but, when I substitute the values in $n$, I find out that $E(W_0)=A^2$ while $E(W_1)=A^2-1+(2p-1)^2$ since I considered $E(S_1)=(2p-1)$ and it gets deleted by the same negative term in the first bracket.