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.

Showing 1-1 of 1 results.

A155031 Triangle T(n, k) = 0 if n==0 (mod k) otherwise -1 with T(n, n) = 1 and T(n, 0) = 0, read by rows.

Original entry on oeis.org

1, 0, 1, 0, -1, 1, 0, 0, -1, 1, 0, -1, -1, -1, 1, 0, 0, 0, -1, -1, 1, 0, -1, -1, -1, -1, -1, 1, 0, 0, -1, 0, -1, -1, -1, 1, 0, -1, 0, -1, -1, -1, -1, -1, 1, 0, 0, -1, -1, 0, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0, 0, 0, -1, 0, -1, -1, -1, -1, -1, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1
Offset: 1

Views

Author

Mats Granvik, Jan 19 2009

Keywords

Examples

			Table begins:
  1;
  0,  1;
  0, -1,  1;
  0,  0, -1,  1;
  0, -1, -1, -1,  1;
  0,  0,  0, -1, -1,  1;
  0, -1, -1, -1, -1, -1,  1;
  0,  0, -1,  0, -1, -1, -1,  1;
  0, -1,  0, -1, -1, -1, -1, -1, 1;
		

Crossrefs

Programs

  • Magma
    [k eq n select 1 else (k eq 1 or n mod k eq 0) select 0 else -1: k in [1..n], n in [1..12]]; // G. C. Greubel, Mar 08 2021
  • Mathematica
    T[n_, k_]:= If[k==n, 1, If[k==1 || Mod[n, k]==0, 0, -1]];
    Table[T[n, k], {n, 12}, {k, n}] //Flatten (* G. C. Greubel, Mar 08 2021 *)
  • Sage
    flatten([[1 if k==n else 0 if (k==1 or n%k==0) else -1 for k in [1..n]] for n in [1..12]]) # G. C. Greubel, Mar 08 2021
    

Formula

T(n, k) = A154990(n, k) * A155029(n, k).
T(n, k) = 0 if n==0 (mod k) otherwise -1 with T(n, n) = 1 and T(n, 0) = 0.
Showing 1-1 of 1 results.