The nonsensical continued fraction I got for 1/(1-Tan[x]) should be 0 for x→π/2. Instead I got (4 + Pi^2)/(2*Pi + 2*Pi^2) + (Pi*ContinuedFractionK[(-(-1 - 2*k + Pi))*(3 - 2*k + Pi), (-2 + 8*k^2 - 4*k*Pi)/Pi, {k, 1, Infinity}])/(2*(-1 + Pi)*(1 + Pi)), which Plouffe's new Inverter (and ries) positively identify as (3 - 2/π)/(π^2 - 1). It seems to blow up obediently at x→π/4. But Plouffe & ries boggle for other values of x. I have a general formula for ContinuedFractionK[quadratic,linear,...], but not ...[quadratic,quadratic]. This may wind up requiring Mozart, a fish, a shower, and massive amounts of Stash Double Bergamot. --rwg On Fri, Jun 8, 2018 at 3:01 PM Bill Gosper <billgosper@gmail.com> wrote:
On Mon, Jun 4, 2018 at 12:44 PM Bill Gosper <billgosper@gmail.com> wrote:
https://books.google.com/books?id=oYGz3S_WTHUC&pg=PA261&lpg=PA261&dq=NYU+Com... pp 267-268. This is the formula which I've used regularly to convert an arbitrary composition of homographic functions (e.g., a sum) to a (non regular) continued fraction. To my bewilderment and distress, it just stopped working, even after I rederived it. The rarely used terminating case went undetected. Empirically, the final term should be x = c[m+1](y + d[m]/c[m]), not c[m+1](y + d[m]/d[m+1]). --rwg
It converted the sum 1 0 1 0 ( ) Product[ , {n, ∞}] == x x E 0 - 1 n to a CF: 1 + x + ContinuedFractionK[x (1 - n), n + x, {n, 2, ∞}] ==
x 1 + x - --------------------------------------------- 2 x 2 + x - ------------------------------------- 3 x 3 + x - ----------------------------- 4 x 4 + x - --------------------- 5 x 5 + x - ------------- 6 x 6 + x - ----- . . . == x E^x/(E^x - 1) I.e., the factorial generating function for BernoulliB[k,1], as the Bernoulli numbers *should* have been defined. (Wikipedia notates Subsuperscript[B,k,+].)
But given a 2x2 product for Tan x,
Product[ -1 + 2 k , {k, ∞}] -1 + -------- z 1
-1 + 2 k -2 + -------- z 1
1 == ---------- 1 - Tan[x]
In[281]:= Dot @@ Table[%215[[1]], {k, 5}] // FullSimplify
Out[281]= {{(945 - z (105 + z (420 + z (-45 + (-15 + z) z))))/z^5, 1 + 105/z^4 - 45/z^2}, {(945 + z (-1050 + z (-315 + z (150 + (5 - 2 z) z))))/z^5, (105 + z (-105 + z (-45 + z (10 + z))))/z^4}}
In[283]:= Series[Divide @@ %% - 1/(1 - Tan@z), {z, 0, 5}]
Out[283]= {O[z]^6,O[z]^6}
it gives a nonsensical continued fraction. --rwg This problem arose trying to work around Mathematica's K notation, which lacks provision for terms with an alternating formula. I recently saw the notation
a(k) --------- K b(k) + c(k) k ----- d(k)
for a period 2, e.g.. Maybe it's time to just deprecate nonregular CFs in favor of ∏ Matrix[k], with some way to specify which elements to divide as k→∞, when the product doesn't converge elementwise. Julian & I once sought unsuccessfully an f[k]^-1 M[k] f[k+1] transformation that would assure elementwise convergence. (Which would do something weird to regular CFs.)