TITLE: Poles from the Continued Fraction Expansion of the Tangent Function?
QUESTION [18 upvotes]: Consider the well known continued fraction expansion
$$ z \tan z = \frac{z^2}{1 - \cfrac{z^2}{3- \cfrac{z^2}{5 - \ldots}}} $$
of the tangent function going back to Euler and Lambert (Lambert used
it for showing that $\tan z$ is irrational for rational nonzero values 
of $z$, which implies the irrationality of $\pi$; Legendre later observed
that the same proof gives the irrationality of $\pi^2$). Wall. in his 
book on continued fractions, claims that the formula is valid "for all $z$".
Is there a nice way of determining the poles of $\tan z$ from looking at the
right hand side of this expansion?

REPLY [4 votes]: This verifies Henri Cohen's comment. Since the function is even, it is simpler to look at  $\sqrt{x}tan(\sqrt{x})$, the $Q_n(x)$ is given by
$[1,3-x,15-6x,x^2-45x+105,15x^2-420x+945,...]$. Since $deg(Q_n)=\lfloor n/2 \rfloor$, one should look at $p_n(x)=Q_{2n}(x)$, the roots are all real and distinct and interlace so that for each $k>0$ the $k$th smallest root decrease monotononically, the values of the roots
divided by $(\pi/2)^2$ are given by 
$$1  [1.215854203708053257326553558]$$
$$2  [1.000556567684670043780569921, 17.23725648793612881611773345]$$
$$3  [1.000000264021497302735160628, 9.243071092446397955245651578, 74.86672290309583275487793689]$$
$$4  [1.000000000033926859936132129, 9.003785153434677150307469375, 27.94131378418484607770210908, 217.3842838410377339506305367]$$
$$5  [1.000000000000001649799381439, 9.000019418957686887495315571, 25.17287514526503834031255350, 62.70166691403289751607854631, 503.9732693572307379829582146]$$
$$6  [1.000000000000000000036873888, 9.000000041594544789352719498, 25.00432366956189670320729176, 50.59590302069961836345079636, 121.9182580673728203679597413, 1009.551573112532430359872689]$$
$$7  [1.000000000000000000000000430, 9.000000000044261664894057822, 25.00004695103961704597815305, 49.10575115766100355065900035, 88.08889135341595365433652728, 215.8656260646040985633268236, 1824.794335221891993855132913]$$
$$8  [1.000000000000000000000000000, 9.000000000000026169987166719, 25.00000026069484992294309458, 49.00327767012444219447267331, 81.88750001909035955812019217, 142.0164417098733597317941152, 356.4649305639281633307802602, 3056.141713122931766511156386]$$
which gives very fast convergence to $(2k-1)^2$. 
One can also find the zeros by looking at roots of $p_n(x)=P_{2n}(x)$ or $P_{2n+1}(x)$.
 In fact for any real $\alpha$, if $P_n/Q_n$ are the convergents to $x tan(x)$,  the roots of 
$P_{2n}(x)-\alpha xQ_{2n}(x)$ will still be real and distinct and converge monotonically to the root of $tan(x)=\alpha$.