cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049826.
Cf. A130130 (central terms).

Programs

  • Haskell
    a051010 n k = snd $ until ((== 0) . snd . fst)
                        (\((x, y), i) -> ((y, mod x y), i + 1)) ((n, k), 0)
    a051010_row n = map (a051010 n) [0..n-1]
    a051010_tabl = map a051010_row [1..]
    -- Reinhard Zumkeller, Jun 27 2013
  • Mathematica
    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 *)

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

Original entry on oeis.org

1, 2, 1, 1, 5, 6, 7, 4, 9, 10, 11, 3, 13, 14, 15, 8, 17, 18, 19, 5, 21, 2, 23, 4, 25, 26, 9, 7, 29, 30, 31, 16, 11, 34, 35, 9, 37, 38, 13, 4, 41, 42, 43, 1, 15, 46, 47, 8, 49, 50, 51, 13, 53, 54, 55, 28, 19, 58, 59, 15, 61, 62, 63, 32, 65, 6, 67, 17, 69, 70, 71, 36, 73, 74, 75
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A034883, A051010, A051011 (numerators).

Programs

  • Haskell
    import Data.Ratio ((%), denominator)
    a051012 n = denominator $ (sum $ a051010_row n) % n
    -- Reinhard Zumkeller, Jun 27 2013
  • Mathematica
    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_] := Denominator[Sum[t[m, n], {m, 0, n}]/n]; Array[a, 100] (* Amiram Eldar, Apr 22 2022 after Jean-François Alcover at A051010 *)
Showing 1-2 of 2 results.