<s>[INST] Closed expression for a continued fraction Does anyone know a closed expression for the following continued fraction?
$$G(x) = \cfrac{1}{x+1+\cfrac{1}{x+3+\cfrac{4}{x+5+\cfrac{9}{x+7+\cfrac{16}{x+9+\cdots}}}}}$$
All I know is that $G(0) = \frac{\pi}{4}$ and $G(x)$ converges for $x \geq 0$, while also $G(x) \sim \frac{1}{x} \ (x \to \infty)$.
The equation $G(0) = \frac{\pi}{4}$ follows from a well-known continued fraction expansion for $\arctan$.  However, the expansion above is different.  It came up in my research, and I can't find it in any continued fraction tables.
 [/INST] The form of the coefficients of the proposed continued fraction is rather similar to that of the ratio of two hypergeometric functions tabulated  here:
\begin{equation}
 \frac{\mathbf{F}\left(a,b;c;z\right)}{\mathbf{F}\left(a+1,b+1;c+1;z\right)}={x
_{0}+\cfrac{y_{1}}{x_{1}+\cfrac{y_{2}}{x_{2}+\cfrac{y_{3}}{x_{3}+\cdots}}}}
\end{equation}
where
\begin{align}
 x_{n}&=c+n-(a+b+2n+1)z\\
 y_{n}&=(a+n)(b+n)z(1-z)
\end{align}
and $\mathbf{F}$ are regularized hypergeometric functions.
In the following, the continued fraction is adapted to this representation by finding a parameter $\alpha$ to fit the above formula:
\begin{align}
 G(x) &= \cfrac{1}{x+1+\cfrac{1}{x+3+\cfrac{4}{x+5+\cfrac{9}{x+7+\cfrac{16}{x+9+\cdots}}}}}\\
 \frac{\alpha}{G(x)}&=\alpha(x+1)+\cfrac{1^2\alpha^2}{\alpha(x+3)+\cfrac{2^2\alpha^2}{\alpha(x+5)+\cfrac{3^2\alpha^2}{\alpha(x+7)+\cfrac{4^2\alpha^2}{\alpha(x+9)+\cdots}}}}
\end{align}
then we have
\begin{align}
    x_n&=\alpha(x+2n+1)\\
 y_n&=n^2\alpha^2
\end{align}
From the $y_n$ definition, we must have $a=b=0$ and $z(1-z)=\alpha^2$. Then, from $x_n$, we find $c=1/2+\alpha x$ and $\alpha=1/2-z$.  The compatibiliy condition for the parameter $z$ are
\begin{align}
 \alpha^2&=z(1-z)\\
 \alpha&=\frac12-z
\end{align}
and thus $z=(1-1/\sqrt{2})/2$ and $\alpha=2^{-3/2}$ which imposes $c=(1+x/\sqrt{2})/2$. (The root corresponding to $\left|z\right|<1$ was chosen to avoid possible divergence of the hypergeometric functions). With these parameters,
\begin{align}
 \frac{2^{-3/2}}{G(x)}&=\frac{\mathbf{F}\left(0,0;(1+x/\sqrt{2})/2;(1-1/\sqrt{2})/2\right)}{\mathbf{F}\left(1,1;(3+x/\sqrt{2})/2;(1-1/\sqrt{2})/2\right)}\\
 &=\frac{(1+x/\sqrt{2})/2}{{}_2F_1\left(1,1;(3+x/\sqrt{2})/2;(1-1/\sqrt{2})/2\right)}
\end{align}
Finally,
\begin{equation}
 G(x)=\frac{{}_2F_1\left(1,1;(3+x/\sqrt{2})/2;(1-1/\sqrt{2})/2\right)}{x+\sqrt{2}}
\end{equation}
From $\sin \pi/8=\sqrt{2-\sqrt{2}}/2$, it comes
\begin{equation}
 G(x)=\frac{{}_2F_1\left(1,1;(3+x/\sqrt{2})/2;\sin^2\pi/8\right)}{x+\sqrt{2}}
\end{equation}
which seems to be numerically correct.
For $x=0$, we have from here
\begin{align}
 {}_2F_1\left(1,1;3/2;s\right)=\frac{\sin^{-1}\sqrt{s}}{\sqrt{1-s}\sqrt{s}}
\end{align}
and thus $G(0)=\pi/4$ as expected. Other special cases can be deduced for $x=p\sqrt{2}$ or $x=p/\sqrt2$ where $p$ is an integer, as sevral explicit expressions for the hypergeometric function ${}_2F_1(1,1;c;s)$ are known. For example
\begin{equation}
 G(\sqrt{2})=\frac{1+\sqrt{2}}{2}\ln\left( \frac{8}{3+2\sqrt{2}} \right)
\end{equation}
</s>