連分数の2つの表示

§1.連分数の分数表示

Out[]=
​
mode
w1
w2
w1
30
w2
11
terms
1
30
11
=
{2, 1, 2, 1, 2}
≃
2

§2.連分数の図形的表示

Out[]=
​
mode
w1
w2
w1
30
w2
11
n
0

§3.コマンドライン

コマンドでは  toFractions[x, terms] と toRectangles[x] です.
xは 「実数」または「連分数のリスト表現」です.また toFractions[x]= toFractions[x, 10] です.
Mathematica のコマンドには ContinuedFraction,FromContinuedFraction などが有ります.
In[]:=
toFractions[30/11]​​toFractions[{1,{2,3}}]
Out[]=
2+
1
1+
1
2+
1
1+
1
2
Out[]=
1+
1
2+
1
3+
1
2+
1
3+
1
2+
1
3+
1
2+
1
3+
1
2
In[]:=
toRectangles[30/11]​​toRectangles[{1,{2,3}}]
Out[]=
Out[]=