the nth convergent of simple or regular continued fraction - Maple Help

Home : Support : Online Help : Mathematics : Group Theory : Number Theory : numtheory/nthconver

numtheory[nthconver] - the nth convergent of simple or regular continued fraction

numtheory[nthdenom] - the nth denominator of simple or regular continued fraction

numtheory[nthnumer] - the nth numerator of simple or regular continued fraction

 Calling Sequence nthconver(cf, n) nthdenom(cf, n) nthnumer(cf, n)

Parameters

 cf - list of the first m ( > n) partial quotients (i.e. a simple continued fraction expansion: [a_0, a_1,a_2, ..., a_n, ...] or a regular continued fraction: [b_0, [a_1,b_1], [a_2,b_2],...,[a_n,b_n],...]) (in either list or fraction form) n - integer

Description

 • The nthconver function returns the nth convergent (p_n/q_n = [a_0, a_1,a_2, ..., a_n] of a simple continued fraction cf or p_n/q_n = [b_0, [a_1,b_1], [a_2,b_2],...,[a_n,b_n]] of a regular continued fraction cf).
 • The nthdenom function returns the nth denominator (q_n in p_n/q_n = [a_0, a_1,a_2, ..., a_n] of a simple continued fraction cf or q_n in p_n/q_n = [b_0, [a_1,b_1], [a_2,b_2],...,[a_n,b_n]] of a regular continued fraction cf).
 • The nthnumer function returns the nth numerator (p_n in p_n/q_n = [a_0, a_1,a_2, ..., a_n] of a simple continued fraction cf or p_n in p_n/q_n = [b_0, [a_1,b_1], [a_2,b_2],...,[a_n,b_n]] of a regular continued fraction cf).
 • These functions are part of the numtheory package, and so can be used in the form nthconver(..) only after performing the command with(numtheory) or with(numtheory,nthconver).  The function can always be accessed in the long form numtheory[nthconver](..).

Examples

 > $\mathrm{with}\left(\mathrm{numtheory}\right):$
 > $\mathrm{cf}:=\mathrm{cfrac}\left(\mathrm{π}\right)$
 ${\mathrm{cf}}{:=}{3}{+}\frac{{1}}{{7}{+}\frac{{1}}{{15}{+}\frac{{1}}{{1}{+}\frac{{1}}{{292}{+}\frac{{1}}{{1}{+}\frac{{1}}{{1}{+}\frac{{1}}{{1}{+}\frac{{1}}{{2}{+}\frac{{1}}{{1}{+}\frac{{1}}{{3}{+}{\mathrm{...}}}}}}}}}}}}$ (1)
 > $\mathrm{nthconver}\left(\mathrm{cf},10\right)$
 $\frac{{4272943}}{{1360120}}$ (2)
 > $\mathrm{evalf}\left(\right)$
 ${3.141592654}$ (3)
 > $\mathrm{nthdenom}\left(\mathrm{cf},10\right)$
 ${1360120}$ (4)
 > $\mathrm{nthnumer}\left(\mathrm{cf},10\right)$
 ${4272943}$ (5)
 > $\mathrm{cfrac}\left({ⅇ}^{x}\right)$
 ${1}{+}\frac{{x}}{{1}{-}\frac{{x}}{{2}{+}\frac{{x}}{{3}{-}\frac{{x}}{{2}{+}\frac{{x}}{{5}{-}\frac{{x}}{{2}{+}\frac{{x}}{{7}{-}\frac{{x}}{{2}{+}\frac{{x}}{{9}{-}\frac{{x}}{{2}{+}{\mathrm{...}}}}}}}}}}}}$ (6)
 > $\mathrm{nthnumer}\left(,7\right)$
 ${{x}}^{{4}}{+}{16}{}{{x}}^{{3}}{+}{120}{}{{x}}^{{2}}{+}{480}{}{x}{+}{840}$ (7)
 > $\mathrm{nthdenom}\left(,7\right)$
 ${-}{4}{}{{x}}^{{3}}{+}{60}{}{{x}}^{{2}}{-}{360}{}{x}{+}{840}$ (8)
 > $\mathrm{nthconver}\left(,7\right)$
 $\frac{{{x}}^{{4}}{+}{16}{}{{x}}^{{3}}{+}{120}{}{{x}}^{{2}}{+}{480}{}{x}{+}{840}}{{-}{4}{}{{x}}^{{3}}{+}{60}{}{{x}}^{{2}}{-}{360}{}{x}{+}{840}}$ (9)