[math-fun] single mover Hurwitz numbers
Sometime around 18 Nov 2010, Julian derived the general closed form for the continued fraction a,c,d,...,z,a+b,c,d,...,z,a+2b,..., but we (or a disk crash) seem to have misplaced it, despite my nagging false(?) memory that I reported it here. This, derived in a possibly different way, makes a nice toy. fromcf[optional preamble,quasiperiod,variable or {variable, nonzero starting value}] In[481]:= fromcf[{1, 2*k, 1}, k] Out[481]= E In[487]:= fromcf[{2}, {1, 2*k, 1}, {k, 1}] Out[487]= E In[473]:= fromcf[{2*n + 1}, n] Out[473]= Coth[1] In[484]:= fromcf[{4*k, 1}, k] Out[484]= -1 + Cot[1/2] In[486]:= fromcf[{Sqrt[2] - 1, -1/Sqrt[2], Sqrt[2] - 1}, {4*n/3 + 2/3}, n] Out[486]= E^3 Code: In[106]:= cfmat[cf_List] := {Numerator /@ #, Denominator /@ #} &@ Convergents[cf][[{-1, -2}]] In[107]:= cfmat[{a_}] := {{a, 1}, {1, 0}} In[108]:= cfmat[{}] = IdentityMatrix[2] Out[108]= {{1, 0}, {0, 1}} Clear[fromcf]; fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0}, {v_Symbol, lo_: 0}] := fromcf[pre, {a, c1*v + c1*lo + c0}, v] /; FreeQ[{a}, v] In[103]:= fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0, b__}, {v_Symbol, lo_: 0}] := fromcf[Join[pre, {a, c1*lo + c0}], {b, a, c1*v + c0 + c1}, {v, lo}] /; FreeQ[{a, b}, v] In[104]:= fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0, b__}, v_Symbol] := fromcf[Join[pre, {a, c0}], {b, a, c1*v + c0 + c1}, v] /; FreeQ[{a, b}, v] fromcf[pre_List, {a___, (c1_: 1)*v_ + c0_: 0}, v_] := Block[{M = cfmat[{a}], A, B, C, D, det}, det = Det[{{A, B}, {C, D}} = M]; FromContinuedFraction[ Append[pre, A/(C + (det Hypergeometric0F1[1 + (B + C + A c0)/(A c1), det/( A^2 c1^2)])/((B + C + A c0) Hypergeometric0F1[( B + C + A c0)/(A c1), det/(A^2 c1^2)]))]]] /; FreeQ[{a}, v] --rwg
The highly organized George Andrews is believably sure I sent no such mail near this date, which, based on private emails, is the only candidate. So you'll have to take my word that Julian beat me to this by nearly two years. He also points out that, if you allow rational terms, any five consecutive, a,b,c,d,e, can be condensed to three: (a b + (a + (1 + a b) c) d)/(b + (1 + b c) d), b + (1 + b c) d, (b c + (b + (1 + b c) d) e)/(b + (1 + b c) d) This allows <linear>,b,c,d,<linear> to become <linear>,e,<linear>. On Fri, Sep 21, 2012 at 4:24 AM, Bill Gosper <billgosper@gmail.com> wrote:
Sometime around 18 Nov 2010, Julian derived the general closed form for the continued fraction a,c,d,...,z,a+b,c,d,...,z,a+2b,..., but we (or a disk crash) seem to have misplaced it, despite my nagging false(?) memory that I reported it here.
This, derived in a possibly different way, makes a nice toy. fromcf[optional preamble,quasiperiod,variable or {variable, nonzero starting value}] In[481]:= fromcf[{1, 2*k, 1}, k]
Out[481]= E
In[487]:= fromcf[{2}, {1, 2*k, 1}, {k, 1}]
Out[487]= E
In[473]:= fromcf[{2*n + 1}, n]
Out[473]= Coth[1]
In[484]:= fromcf[{4*k, 1}, k]
Out[484]= -1 + Cot[1/2]
In[486]:= fromcf[{Sqrt[2] - 1, -1/Sqrt[2], Sqrt[2] - 1}, {4*n/3 + 2/3}, n]
Out[486]= E^3
Code: In[106]:= cfmat[cf_List] := {Numerator /@ #, Denominator /@ #} &@ Convergents[cf][[{-1, -2}]]
In[107]:= cfmat[{a_}] := {{a, 1}, {1, 0}}
In[108]:= cfmat[{}] = IdentityMatrix[2]
Out[108]= {{1, 0}, {0, 1}}
Clear[fromcf]; fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0}, {v_Symbol, lo_: 0}] := fromcf[pre, {a, c1*v + c1*lo + c0}, v] /; FreeQ[{a}, v]
In[103]:= fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0, b__}, {v_Symbol, lo_: 0}] := fromcf[Join[pre, {a, c1*lo + c0}], {b, a, c1*v + c0 + c1}, {v, lo}] /; FreeQ[{a, b}, v]
In[104]:= fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0, b__}, v_Symbol] := fromcf[Join[pre, {a, c0}], {b, a, c1*v + c0 + c1}, v] /; FreeQ[{a, b}, v]
fromcf[pre_List, {a___, (c1_: 1)*v_ + c0_: 0}, v_] := Block[{M = cfmat[{a}], A, B, C, D, det}, det = Det[{{A, B}, {C, D}} = M]; FromContinuedFraction[ Append[pre, A/(C + (det Hypergeometric0F1[1 + (B + C + A c0)/(A c1), det/( A^2 c1^2)])/((B + C + A c0) Hypergeometric0F1[( B + C + A c0)/(A c1), det/(A^2 c1^2)]))]]] /; FreeQ[{a}, v] --rwg
Oops, this gives 0/0 instead of In[196]:= fromcf[{k}, k] Out[196]= BesselI[1, 2]/BesselI[0, 2] for this simplest case. Fix: fromcf[pre_List: {}, {a___, (c1_: 1)*v_ + c0_: 0}, v_] := Simplify[FunctionExpand[ Block[{M = cfmat[{a}], A, B, C, D, det}, det = Det[{{A, B}, {C, D}} = M]; FromContinuedFraction[ Append[pre, A/(C + (det Hypergeometric0F1[1 + (B + C + A c0)/(A c1), det/( A^2 c1^2)])/( A c1 ((B + C + A c0)/(A c1))! Hypergeometric0F1Regularized[( B + C + A c0)/(A c1), det/(A^2 c1^2)]))]]]]] /; FreeQ[{a}, v] Then, e.g., In[107]:= fromcf[{2*k + 1, 1}, k] Out[107]= -(Cos[1]/(Cos[1] - Sin[1])) Now, what about *two* movers? --rwg
participants (1)
-
Bill Gosper