Izvestiya : Mathematics 72:5 1023–1059 c 2008 RAS(DoM) and LMS Izvestiya RAN : Ser. Mat. 72:5 189–224 DOI 10.1070/IM2008v072n05ABEH002427 Asymptotic behaviour of the first and second moments for the number of steps in the Euclidean algorithm A. V. Ustinov Abstract. We prove asymptotic formulae with two significant terms for the expectation and variance of the random variable s(c/d) when the vari- ables c and d range over the set 1 c d R and R →∞, where s(c, d)= s(c/d) is the number of steps in the Euclidean algorithm applied to the numbers c and d. § 1. Notation The symbol [x 0 ; x 1 ,...,x s ] stands for the continued fraction x 0 + 1 x 1 + . . . + 1 x s of length s with formal variables x 0 ,x 1 ,...,x s . For rational r we use (if not otherwise stated) the canonical continued fraction expansion, r =[t 0 ; t 1 ,...,t s ], of length s = s(r), where t 0 =[r] (the integer part of r), t 1 ,...,t s are partial quotients (positive integers) and t s 2 for s 1. We denote by s 1 (r) the sum of the partial quotients of r: s 1 (r)= t 0 + t 1 + ··· + t s . If r is written as an irreducible fraction, then q(r) will stand for the denominator of this fraction. If A is some assertion, then [A] is equal to 1 if A is true; otherwise, it is equal to 0. For every positive integer q we denote by δ q (a) the characteristic function of divisibility by q: δ q (a)= a 0 (mod q) = 1 if a 0 (mod q), 0 if a 0 (mod q). The asterisk in a double sum n m ... means that the variables over which the sum is taken are subject to the supplemen- tary condition (m,n) = 1. This research was carried out with the financial support of the INTAS (grant no. 03-51-5070), the Russian Foundation for Basic Research (grant no. 07-01-00306), the project of the Far-Eastern Branch of the Russian Academy of Sciences 06-III-A-01-017 and the Russian Science Support Foundation. AMS 2000 Mathematics Subject Classification. 11K50, 11A55.