login
Triangular array T read by rows: T(n,k) = sum of numbers c in the form c = bq + r when Euclidean algorithm acts on n, k, for 1 <= k <= n, n >= 1.
3

%I #21 Mar 11 2019 04:12:01

%S 1,2,2,3,5,3,4,4,7,4,5,7,10,9,5,6,6,6,10,11,6,7,9,10,14,14,13,7,8,8,

%T 13,8,18,14,15,8,9,11,9,13,18,15,18,17,9,10,10,13,14,10,20,20,18,19,

%U 10,11,13,16,18,16,22,25,24,22,21,11,12,12,12,12,19,12,26,20,21,22,23,12

%N Triangular array T read by rows: T(n,k) = sum of numbers c in the form c = bq + r when Euclidean algorithm acts on n, k, for 1 <= k <= n, n >= 1.

%H G. C. Greubel, <a href="/A049840/b049840.txt">Rows n=1..100 of triangle, flattened</a>

%F T(n,0) = 0, T(n,k) = n + T(k, n mod k). - _Charlie Neder_, Mar 10 2019

%e Triangle begins with:

%e 1;

%e 2, 2;

%e 3, 5, 3;

%e 4, 4, 7, 4;

%e 5, 7, 10, 9, 5;

%e 6, 6, 6, 10, 11, 6; ...

%e Example: 5=1*3+2; 3=1*2+1; 2=2*1+0; so that T(5,3)=10.

%t T[n_, k_]:= If[k<=0 || k>=n+1, 0, n + T[k, Mod[n, k]]]; Table[T[n, k], {n, 1, 12}, {k, 1, n}] (* _G. C. Greubel_, Mar 10 2019 *)

%o (PARI) {T(n,k) = if(k<=0 || k>= n+1, 0, n + T(k, n % k))};

%o for(n=1,12, for(k=1,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Mar 10 2019

%o (Sage)

%o def T(n,k):

%o if (k==0): return 0

%o else: return n + T(n, mod(n,k))

%o [[T(n,k) for k in (1..n)] for n in (1..12)] # _G. C. Greubel_, Mar 10 2019

%Y Cf. A049841 (row sums), A049842 (rows max).

%K nonn,tabl

%O 1,2

%A _Clark Kimberling_

%E Terms a(70) onward added by _G. C. Greubel_, Mar 10 2019