login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A051010 Triangle T(m,n) giving of number of steps in the Euclidean algorithm for gcd(m,n) with 0<=m<n. 11

%I #21 Feb 23 2017 16:11:26

%S 0,0,1,0,1,2,0,1,1,2,0,1,2,3,2,0,1,1,1,2,2,0,1,2,2,3,3,2,0,1,1,3,1,4,

%T 2,2,0,1,2,1,2,3,2,3,2,0,1,1,2,2,1,3,3,2,2,0,1,2,3,3,2,3,4,4,3,2,0,1,

%U 1,1,1,3,1,4,2,2,2,2,0,1,2,2,2,4,2,3,5,3,3,3,2,0,1,1,3,2,3,2,1,3,4,3

%N Triangle T(m,n) giving of number of steps in the Euclidean algorithm for gcd(m,n) with 0<=m<n.

%H T. D. Noe, <a href="/A051010/b051010.txt">Rows n=1..100 of triangle, flattened</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]]]; Table[ t[m, n] , {n, 1, 14}, {m, 0, n-1}] // Flatten (* _Jean-François Alcover_, Oct 25 2012 *)

%o (Haskell)

%o a051010 n k = snd $ until ((== 0) . snd . fst)

%o (\((x, y), i) -> ((y, mod x y), i + 1)) ((n, k), 0)

%o a051010_row n = map (a051010 n) [0..n-1]

%o a051010_tabl = map a051010_row [1..]

%o -- _Reinhard Zumkeller_, Jun 27 2013

%Y Cf. A034883, A051011, A051012.

%Y Cf. A049826.

%Y Cf. A130130 (central terms).

%K nonn,nice,tabl

%O 1,6

%A _Eric W. Weisstein_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)