Function: contfracpnqn
Section: number_theoretical
C-Name: pnqn
Prototype: G
Help: contfracpnqn(x): [p_n,p_{n-1}; q_n,q_{n-1}] corresponding to the
 continued fraction x.
Doc: when $x$ is a vector or a one-row matrix, $x$
 is considered as the list of partial quotients $[a_0,a_1,\dots,a_n]$ of a
 rational number, and the result is the 2 by 2 matrix
 $[p_n,p_{n-1};q_n,q_{n-1}]$ in the standard notation of continued fractions,
 so $p_n/q_n=a_0+1/(a_1+\dots+1/a_n)$. If $x$ is a matrix with two rows
 $[b_0,b_1,\dots,b_n]$ and $[a_0,a_1,\dots,a_n]$, this is then considered as a
 generalized continued fraction and we have similarly
 $p_n/q_n=(1/b_0)(a_0+b_1/(a_1+\dots+b_n/a_n))$. Note that in this case one
 usually has $b_0=1$.
