login
Numerator of average of number of steps in Euclidean algorithm for all gcd(m,n) with 0<=m<n.
3

%I #19 Apr 22 2022 05:31:27

%S 0,1,1,1,8,7,13,7,16,17,27,5,32,31,31,17,46,41,55,11,50,5,73,9,68,73,

%T 25,18,96,71,101,45,32,105,101,23,124,119,41,11,146,113,155,3,44,151,

%U 177,23,164,161,169,41,204,167,183,83,64,201,231,44,240,223,209,109

%N Numerator of average of number of steps in Euclidean algorithm for all gcd(m,n) with 0<=m<n.

%H Reinhard Zumkeller, <a href="/A051011/b051011.txt">Table of n, a(n) for n = 1..1000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/EuclideanAlgorithm.html">Euclidean Algorithm</a>.

%t t[m_, n_] := For[r[-1]=m; r[0]=n; k=1, True, k++, r[k] = Mod[r[k-2], r[k-1]]; If[r[k] == 0, Return[k-1]]]; a[n_] := Numerator[Sum[t[m, n], {m, 0, n}]/n]; Array[a, 100] (* _Amiram Eldar_, Apr 22 2022 after _Jean-François Alcover_ at A051010 *)

%o (Haskell)

%o import Data.Ratio ((%), numerator)

%o a051011 n = numerator $ (sum $ a051010_row n) % n

%o -- _Reinhard Zumkeller_, Jun 27 2013

%Y Cf. A034883, A051010, A051012 (denominators).

%K nonn,frac

%O 1,5

%A _Eric W. Weisstein_