<s>[INST] A remarkable Continued Fraction for $\pi$ How to analyze the Continued Fraction $3+\cfrac{\color{red}1^2}{5+\cfrac{\color{blue}4^2}{7+\cfrac{\color{red}3^2}{9+\cfrac{\color{blue}6^2}{11+\cfrac{\color{red}5^2}{13+\cfrac{\color{blue}8^2}{15+\cfrac{\color{red}7^2}{17+\ddots}}}}}}}$
Numerically, it seems to evaluate to $\pi$. But why?
This remarkable Continued Fraction was sent to me by Paul Levrie.
The pattern in the nominators and denominators is obvious. Alternating $\color{red}3,\color{red}5,\color{red}7,\color{red}9,\color{red}{11}$ etc and $\color{blue}4^2,\color{blue}6^2,\color{blue}8^2,\color{blue}{10}^2$ etc.
Because of the appearance of squares, Euler's Differential Method can not be used. A clever trick is required here! Any idea's?
 [/INST] The difference between the even and odd squared coefficients is similar to that of the continued fraction of the ratio of two hypergeometric functions (DLMF):
\begin{equation}
 \frac{\mathbf{F}\left(a,b;c;z\right)}{\mathbf{F}\left(a,b+1;c+1;z\right)}=t_{0
}-\cfrac{u_{1}z}{t_{1}-\cfrac{u_{2}z}{t_{2}-\cfrac{u_{3}z}{t_{3}-\cdots}}}
\end{equation}
where
\begin{align}
 t_n&=c+n\\
 u_{2n+1}&=(a+n)(c-b+n)\\
 u_{2n}&=(b+n)(c-a+n)
\end{align}
where $\mathbf{F}$ are regularized hypergeometric functions.
The continued fraction is adapted to this representation
\begin{align}
 \mathcal J=&3+\cfrac{1^2}{5+\cfrac{4^2}{7+\cfrac{3^2}{9+\cfrac{6^2}{11+\cdots}}}}\\
 \frac12 \mathcal J&=3/2+\cfrac{1^2/4}{5/2+\cfrac{4^2/4}{7/2+\cfrac{3^2/4}{9/2+\cfrac{6^2/4}{11/2+\cdots}}}}
\end{align}
It can be checked that $a=1/2,b=1,c=3/2,z=-1$ satisfies the recurrence relations, then
\begin{align}
 \mathcal J&=\frac{2\,\mathbf{F}\left(1/2,1;3/2;-1\right)}{\mathbf{F}\left(1/2,2;5/2;-1\right)}\\
 &=\frac{2\Gamma(5/2)}{\Gamma(3/2)}\,\frac{{}_2F_1\left(1/2,1;3/2;-1\right)}{{}_2F_1
\left(1/2,2;5/2;-1\right)}\\
&=3\,\frac{{}_2F_1\left(1/2,1;3/2;-1\right)}{{}_2F_1
\left(1/2,2;5/2;-1\right)}
\end{align}
From here and here
\begin{align}
 {}_2F_1\left(1/2,1;3/2;-z\right)&=\frac{\tan^{-1}\sqrt{z}}{\sqrt{z}}\\
 {}_2F_1\left(1/2,2;5/2;-z\right)&=\frac34\frac{(z-1)\tan^{-1}\sqrt{z}+\sqrt{z}}{z^{3/2}}
\end{align}
then
\begin{equation}
 \mathcal J=\pi
\end{equation}
</s>