For the generalized continued fraction 1 + 2 ------ 3 + 4 -- 5
the desired terms are 1 1 + 2 -- 3 1 + 2 ------ 3 + 4 -- 5 that is, 0 2 4 cf 1 3 5x 1 5r3 29r19 we can get this with 1 0 1 0 1 # 1 , 1 + %`+/\ 2 3 4 5x 1 5r3 29r19 Why are these the "desired" terms? It is because of their connection with associated linear fractional transformations t1 =: 2 % 3 + ] and t2 =: 4 % 5 + ] . The three terms are 1 and 1 + t1 0 and 1 + t1 t2 0 . --Kip Murray Sent from my iPad > On Feb 23, 2014, at 6:03 PM, Roger Hui <rogerhui.can...@gmail.com> wrote: > > Sometimes %`+/ and %`+/\ are the expressions, depending on circumstances. > For example: > > x=: ?. 0 > x > 0.038363 > %`+/ x,,(1+2*i.20),.*:x > 0.0383442 > 7 o. x > 0.0383442 > > Gauss, 1812, according to C.D. Olds, Continued Fractions, MAA, 1963. > > > > > On Sun, Feb 23, 2014 at 3:55 PM, Roger Hui <rogerhui.can...@gmail.com>wrote: > >> +`%/ and +`%/\ are the expressions you seek. For example: >> >> +`%/3,20$4 6 >> 3.60555 >> %: 13 >> 3.60555 >> >> >> >> >>> On Sun, Feb 23, 2014 at 2:17 PM, km <k...@math.uh.edu> wrote: >>> >>> The generalized continued fraction >>> >>> b0 + a1 >>> --------- >>> b1 + a2 >>> --------- >>> b2 + a3 >>> -------- >>> b3 + ... >>> >>> is the infinite sequence >>> >>> b0 , b0 + a1%b1 , b0 + a1%b1 + a2%b2 , b0 + a1%b1 + a2%b2 + a3%b3 , ... >>> >>> where between the commas I am assuming J's right-to-left evaluation. The >>> nth term would be >>> >>> b0 + a1%b1 + a2%b2 + a3%b3 + ... + an%bn (still using right to left >>> evaluation). >>> >>> What is a good way to calculate this nth term in J? >>> >>> >>> For a half-page introduction to generalized continued fractions see >>> >>> http://people.math.sfu.ca/~cbm/aands/page_19.htm >>> >>> Continued fractions for ln(1+z) and ln((1+z)%(1-z)) are given here >>> >>> http://people.math.sfu.ca/~cbm/aands/page_68.htm >>> >>> >>> --Kip Murray >>> >>> Sent from my iPad >>> >>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm