Analysis of the subtractive algorithm for greatest common divisors

The sum of all partial quotients in the regular continued fraction expansions of m/n, for 1 ≤m≤n, is shown to be 6Π<sup>-2</sup> n(ln n)<sup>2</sup>+ O(n log n(log log n)<sup>2</sup>). This result is applied to the analysis of what is perhaps the oldest nontrivial algorithm for number-theoretic computations.