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.

A049816 Triangular array T read by rows: T(n,k) = number of nonzero remainders when Euclidean algorithm acts on n and k, for k=1..n, n>=1.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 1, 0, 0, 0, 2, 0, 3, 1, 1, 0, 0, 1, 0, 1, 2, 1, 2, 1, 0, 0, 0, 1, 1, 0, 2, 2, 1, 1, 0, 0, 1, 2, 2, 1, 2, 3, 3, 2, 1, 0, 0, 0, 0, 0, 2, 0, 3, 1, 1, 1, 1, 0, 0, 1, 1, 1, 3, 1, 2, 4, 2, 2, 2, 1, 0
Offset: 1

Views

Author

Keywords

Examples

			Triangle begins:
0,
0, 0,
0, 1, 0,
0, 0, 1, 0,
0, 1, 2, 1, 0,
0, 0, 0, 1, 1, 0,
0, 1, 1, 2, 2, 1, 0,
0, 0, 2, 0, 3, 1, 1, 0,
0, 1, 0, 1, 2, 1, 2, 1, 0,
0, 0, 1, 1, 0, 2, 2, 1, 1, 0,
0, 1, 2, 2, 1, 2, 3, 3, 2, 1, 0,
0, 0, 0, 0, 2, 0, 3, 1, 1, 1, 1, 0,
0, 1, 1, 1, 3, 1, 2, 4, 2, 2, 2, 1, 0,
...
		

Crossrefs

Row sums give A049817.

Programs

  • Maple
    T:= proc(x, y) option remember;
          `if`(y=0, -1, 1+T(y, irem(x, y)))
        end:
    seq(seq(T(n, k), k=1..n), n=1..15);  # Alois P. Heinz, Nov 29 2023
  • Mathematica
    R[n_, k_] := R[n, k] = With[{r = Mod[n, k]}, If[r == 0, 1, R[k, r] + 1]];
    T[n_, k_] := R[n, k] - 1;
    Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* Jean-François Alcover, Apr 12 2019, after Robert Israel in A107435 *)