\documentclass{article}
\usepackage{stackengine,amsmath}
\stackMath
\begin{document}
\[
a_0 + \frac{1\kern6em}{\displaystyle
a_1 + \frac{1\kern5em}{\displaystyle
a_2 +\stackunder{}{\ddots\stackunder{}{\displaystyle
{}+ \frac{1}{\displaystyle
a_{n-1} + \frac{1}{a_n}}}
}}}
\]
\end{document}