%I #19 Nov 29 2023 15:54:10
%S 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,
%T 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,
%U 0,0,2,0,3,1,1,1,1,0,0,1,1,1,3,1,2,4,2,2,2,1,0
%N 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.
%H Alois P. Heinz, <a href="/A049816/b049816.txt">Rows n = 1..200, flattened</a>
%e Triangle begins:
%e 0,
%e 0, 0,
%e 0, 1, 0,
%e 0, 0, 1, 0,
%e 0, 1, 2, 1, 0,
%e 0, 0, 0, 1, 1, 0,
%e 0, 1, 1, 2, 2, 1, 0,
%e 0, 0, 2, 0, 3, 1, 1, 0,
%e 0, 1, 0, 1, 2, 1, 2, 1, 0,
%e 0, 0, 1, 1, 0, 2, 2, 1, 1, 0,
%e 0, 1, 2, 2, 1, 2, 3, 3, 2, 1, 0,
%e 0, 0, 0, 0, 2, 0, 3, 1, 1, 1, 1, 0,
%e 0, 1, 1, 1, 3, 1, 2, 4, 2, 2, 2, 1, 0,
%e ...
%p T:= proc(x, y) option remember;
%p `if`(y=0, -1, 1+T(y, irem(x, y)))
%p end:
%p seq(seq(T(n, k), k=1..n), n=1..15); # _Alois P. Heinz_, Nov 29 2023
%t R[n_, k_] := R[n, k] = With[{r = Mod[n, k]}, If[r == 0, 1, R[k, r] + 1]];
%t T[n_, k_] := R[n, k] - 1;
%t Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Apr 12 2019, after _Robert Israel_ in A107435 *)
%Y Row sums give A049817.
%K nonn,tabl
%O 1,13
%A _Clark Kimberling_