\documentclass{article}
% Very short document, which fails in version 1.2.1 and older due to material leaking out of math mode
\begin{document}
\[
a_i=b_i+c_i,
\]
where $i\in\mathbf N$.
\end{document}
