Mapleで連分数の計算
Mapleにおいて連分数展開を計算するためのコマンド。
convertコマンド
> convert(8/5, confrac); [1, 1, 1, 2] > convert(sqrt(2), confrac); [1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2] > convert(exp(1), confrac); [2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1] > convert(Pi, confrac); [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3]
連分数展開における最終項のインデックスを指定することもできます:
> convert(exp(1), confrac, 20); [2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, 1, 1, 12, 1, 1]
cfracコマンド
> with(numtheory); > cfrac(exp(1), 'quotients'); [2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, ...] > cfrac(exp(1), 20, 'quotients'); [2, 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1, 1, 10, 1, 1, 12, 1, 1, 14, ...]