OFFSET
1,13
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
LINKS
Robert Israel, Table of n, a(n) for n = 1..10011 (rows 1 to 141, flattened)
Tiberiu Szocs-Mihai, Euclidean fractal (conjectured), Math Ticks Blog, January 2011.
Tiberiu Szocs-Mihai, Euclidean fractal candidate description, Math Ticks Blog, January 2011.
Eric Weisstein's World of Mathematics, Euclidean Algorithm.
EXAMPLE
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;
...
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
STATUS
approved