New in Wolfram Mathematica 7: Discrete Calculus  previous | next 
Compute Symbolic Continued Fractions
Compute continued fractions symbolically.
In[1]:=

Click for copyable input
problems = {HoldForm[ContinuedFractionK[Cos[n], Sin[n], {n, 3}]], 

   HoldForm[ContinuedFractionK[1, n + 1, {n, 1, a}]], 

   HoldForm[ContinuedFractionK[1, 1, {n, 1, Infinity}]], 

   HoldForm[ContinuedFractionK[n, n, {n, 1, Infinity}]], 

   HoldForm[ContinuedFractionK[n^2, 2*n + 1, {n, 1, Infinity}]], 

   HoldForm[ContinuedFractionK[1 + Mod[n, 2], {n, 1, Infinity}]]};
In[2]:=

Click for copyable input
FormulaGallery[forms_List] := 

 Module[{vals = ParallelMap[ReleaseHold, forms]}, 

  Text@TraditionalForm@

    Grid[Table[{forms[[i]], "==", vals[[i]]}, {i, Length[forms]}], 

     Dividers -> {{True, False, False, True}, All}, 

     Alignment -> {{Right, Center, Left}, Baseline}, 

     Background -> LightYellow, Spacings -> {Automatic, 2}]]
In[3]:=

Click for copyable input
FormulaGallery[problems]
Out[3]=