Solution (source code)

= Solution

For each period set
$$
\widetilde\sigma_i=-\frac{m_i+\sigma_i^2/2}{\sigma_i}
$$
and define
$$
\frac{d\mathbb Q}{d\mathbb P}
=\prod_{i=1}^T
\exp\!\left(\widetilde\sigma_iZ_i-\frac12\widetilde\sigma_i^2\right).
$$
Independence of the $Z_i$ shows that this strictly positive density has expectation one. Under $\mathbb Q$, the conditional mean of each gross return is
$$
\mathbb E_{\mathbb Q}
\left[e^{\sigma_iZ_i+m_i}\mid\mathcal F_{i-1}\right]
=\exp\!\left(m_i+\frac12\sigma_i^2
+\sigma_i\widetilde\sigma_i\right)=1.
$$
Consequently
$$
\mathbb E_{\mathbb Q}[S_t^1\mid\mathcal F_{t-1}]=S_{t-1}^1,
$$
so the discounted price process is a $\mathbb Q$-martingale. This equivalent martingale measure rules out arbitrage.