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
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
|
|