Determine $(a_n)_n$ and $(b_n)_n$ such that $(S_n^2-a_nS_n-b_n)_{n \ge 0}$ is a martingale 
Consider the assymtric random walk $(S_n)_n$ on $\mathbb{Z}$. Determine $(a_n)_n$ and $(b_n)_n$ such that $(S_n^2-a_nS_n-b_n)_{n \ge 0}$ is a martingale.
Remark: In lecture I have already seen that $(S_n - n \mu)_{n \ge 0}$ with $\mu = \mathbb{E}[X_n]$ is a martingale.

I was trying to check the martingale property, i.e.
$$\mathbb{E}[S_{n+1}^2-a_{n+1}S_{n+1}-b_{n+1} \mid \mathcal{F}_n] = \mathbb{E}[S_{n+1}^2 \vert \mathcal{F}_n]-a_{n+1}\mathbb{E}[S_{n+1} \vert \mathcal{F}_n] - b_{n+1}$$
However, I do not see how to continue from here. Could you please give me a hint?
 A: $$\begin{align}
\mathbb{E}[S_{n+1}^2-a_{n+1}S_{n+1}-b_{n+1} \mid \mathcal{F}_n] &= \mathbb{E}[S_{n+1}^2 \vert \mathcal{F}_n]-a_{n+1}\mathbb{E}[S_{n+1} \vert \mathcal{F}_n] - b_{n+1}\\
&= \left(S_{n}^2 + 2S_{n}\mathbb{E}[(S_{n+1}-S_{n}) \vert \mathcal{F}_n] + \mathbb{E}[(S_{n+1}-S_{n})^2 \vert \mathcal{F}_n]\right) -a_{n+1}S_{n}- b_{n+1}\\
\end{align}$$
As $S_n$ martingale, then $S_{n+1}-S_{n}$ is independent to $\mathcal{F}_n$. In other words, we have
$$\mathbb{E}[(S_{n+1}-S_{n}) \vert \mathcal{F}_n] =\mathbb{E}[(S_{n+1}-S_{n}) \vert \mathcal{F}_0] = 0$$
and
$$\mathbb{E}[(S_{n+1}-S_{n})^2 \vert \mathcal{F}_n] = \mathbb{E}[(S_{n+1}-S_{n})^2 \vert \mathcal{F}_0] = \mathbb{E}[(S_{n+1}-S_{n})^2]$$
Then
$$\begin{align}
\mathbb{E}[S_{n+1}^2-a_{n+1}S_{n+1}-b_{n+1} \vert \mathcal{F}_n] &= \mathbb{E}[(S_{n+1}-S_{n})^2]+S_{n}^2 -a_{n+1}S_{n}- b_{n+1}\\
\end{align}$$
If $(S_n^2-a_nS_n-b_n)_{n \ge 0}$ is a martingale, we need to have
$$\mathbb{E}[(S_{n+1}-S_{n})^2]+S_{n}^2 -a_{n+1}S_{n}- b_{n+1} = S_n^2-a_nS_n-b_n$$
$$\Longleftrightarrow (a_{n+1}-a_n)S_n +(b_{n+1}-b_n - \mathbb{E}[(S_{n+1}-S_{n})^2]) = 0$$
We can choose
$$\color{red} {\begin{cases}
a_{n+1}=a_n\\
b_{n+1}=b_n + \mathbb{E}[(S_{n+1}-S_{n})^2]
\end{cases}}$$
such that $(S_n^2-a_nS_n-b_n)_{n \ge 0}$ is a martingale. Q.E.D
