numtheory(deprecated)
nthconver
the nth convergent of simple or regular continued fraction
nthdenom
the nth denominator of simple or regular continued fraction
nthnumer
the nth numerator of simple or regular continued fraction
Calling Sequence
Parameters
Description
Examples
nthconver(cf, n)
nthdenom(cf, n)
nthnumer(cf, n)
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
Important: The numtheory package has been deprecated. Use the superseding commands NumberTheory[ContinuedFraction][Convergent], NumberTheory[ContinuedFraction][Denominator], and NumberTheory[ContinuedFraction][Numerator] instead.
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](..).
with⁡numtheory:
cf≔cfrac⁡π
cf≔3+17+115+11+1292+11+11+11+12+11+13+...
nthconver⁡cf,10
42729431360120
evalf⁡
3.141592654
nthdenom⁡cf,10
1360120
nthnumer⁡cf,10
4272943
cfrac⁡exp⁡x
1+x1−x2+x3−x2+x5−x2+x7−x2+x9−x2+...
nthnumer⁡,7
x4+16⁢x3+120⁢x2+480⁢x+840
nthdenom⁡,7
−4⁢x3+60⁢x2−360⁢x+840
nthconver⁡,7
x4+16⁢x3+120⁢x2+480⁢x+840−4⁢x3+60⁢x2−360⁢x+840
See Also
convert/confrac
numtheory(deprecated)[cfrac]
numtheory(deprecated)[cfracpol]
Download Help Document