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.

A049828 Triangular array T given by rows: T(n,k)=sum of remainders when Euclidean algorithm acts on n,k; for k=1,2,...,n; n >= 1.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 3, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 1, 4, 3, 1, 0, 0, 0, 3, 0, 6, 2, 1, 0, 0, 1, 0, 1, 5, 3, 3, 1, 0, 0, 0, 1, 2, 0, 6, 4, 2, 1, 0, 0, 1, 3, 4, 1, 6, 8, 6, 3, 1, 0, 0, 0, 0, 0, 3, 0, 8, 4, 3, 2, 1, 0, 0, 1, 1, 1, 6, 1, 7, 11, 5, 4, 3, 1, 0
Offset: 1

Views

Author

Keywords

Comments

For a fixed n, {(k,T(n,k)), k=1..n} is conjectured to be fractal in nature (see link). - Tiberiu Szocs-Mihai, Aug 17 2015

Examples

			Rows:
0;
0, 0;
0, 1, 0;
0, 0, 1, 0;
0, 1, 3, 1, 0;
0, 0, 0, 2, 1, 0;
0, 1, 1, 4, 3, 1, 0;
...
		

Crossrefs

Row sums are in A049829.

Programs

  • Maple
    T:=  proc(n,k) option remember;
    if n*k = 0 then 0 else (n mod k) + procname(k,n mod k) fi
    end proc:
    seq(seq(T(n,k),k=1..n), n=1..20); # Robert Israel, Aug 31 2015
  • Mathematica
    T[n_, k_] := T[n, k] = If[n*k == 0, 0, Mod[n, k] + T[k, Mod[n, k]]];
    Table[T[n, k], {n, 1, 20}, {k, 1, n}] // Flatten (* Jean-François Alcover, Feb 27 2019, after Robert Israel *)
  • PARI
    tabl(nn) = {for (n=1, nn, for (k=1, n, a = n; b = k; r = 1; s = 0; while (r, q = a\b; r = a - b*q; s +=r; a = b; b = r); print1(s, ", ");); print(););} \\ Michel Marcus, Aug 17 2015