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.

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

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Mats Granvik, Jun 19 2011

Keywords

Comments

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

Examples

			Triangle starts:
  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;
  0,  1, -1,  3, -1, -1, -1,  8;
  0, -1,  2, -1, -1, -1, -1, -1,  9;
		

Crossrefs

Programs

  • Maple
    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
  • Mathematica
    Clear[t];
    nn = 13;
    t[n_, k_] :=
      t[n, k] = If[n <= k, 1, 0] - If[Mod[n, k] == 0, (1 - k), 1];
    Flatten[Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]]
    (*The double limit for gamma:*)
    Clear[t];
    nn = 1000;
    kk = 60;
    t[n_, k_] :=
      t[n, k] = If[n <= k, 1, 0] - If[Mod[n, k] == 0, (1 - k), 1];
    a = Table[t[n, kk], {n, 1, nn}];
    MatrixForm[a];
    b = Range[nn];
    gamma = N[Total[a/b]]