login
Triangle read by rows: T(n,n)=n; T(n,k) = k-1 if k divides n and k < n, otherwise -1.
2

%I #23 Mar 05 2019 01:43:54

%S 1,0,2,0,-1,3,0,1,-1,4,0,-1,-1,-1,5,0,1,2,-1,-1,6,0,-1,-1,-1,-1,-1,7,

%T 0,1,-1,3,-1,-1,-1,8,0,-1,2,-1,-1,-1,-1,-1,9,0,1,-1,-1,4,-1,-1,-1,-1,

%U 10,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,0,1,2,3,-1,5,-1,-1,-1,-1,-1,12,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,13

%N Triangle read by rows: T(n,n)=n; T(n,k) = k-1 if k divides n and k < n, otherwise -1.

%C The double limit lim_{k->infinity} (lim_{m->infinity} (Sum_{n=1..m} T(n,k)/n)) equals the Euler-Mascheroni constant A001620.

%e Triangle starts:

%e 1;

%e 0, 2;

%e 0, -1, 3;

%e 0, 1, -1, 4;

%e 0, -1, -1, -1, 5;

%e 0, 1, 2, -1, -1, 6;

%e 0, -1, -1, -1, -1, -1, 7;

%e 0, 1, -1, 3, -1, -1, -1, 8;

%e 0, -1, 2, -1, -1, -1, -1, -1, 9;

%p A191910 := proc(n,k) if n = k then n; elif modp(n,k) = 0 then k-1 ; else -1; end if; end proc: seq(seq(A191910(n,k),k=1..n),n=1..20); # _R. J. Mathar_, Aug 03 2011

%t Clear[t];

%t nn = 13;

%t t[n_, k_] :=

%t t[n, k] = If[n <= k, 1, 0] - If[Mod[n, k] == 0, (1 - k), 1];

%t Flatten[Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]]

%t (*The double limit for gamma:*)

%t Clear[t];

%t nn = 1000;

%t kk = 60;

%t t[n_, k_] :=

%t t[n, k] = If[n <= k, 1, 0] - If[Mod[n, k] == 0, (1 - k), 1];

%t a = Table[t[n, kk], {n, 1, nn}];

%t MatrixForm[a];

%t b = Range[nn];

%t gamma = N[Total[a/b]]

%Y Cf. A001620, A191907.

%K sign,tabl,easy

%O 1,3

%A _Mats Granvik_, Jun 19 2011