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.

A374381 Triangle T(n, k), n > 0, k = 0..n-1, read by rows; T(n, k) = (n mod m) - (k mod m) where m = A007978(n-k).

Original entry on oeis.org

1, 2, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, 2, 1, 2, -1, -2, -1, -1, -1, 1, 2, 1, 1, 1, -1, 1, 2, -1, -2, -1, 1, -1, 2, -1, 1, -1, 1, -2, 1, -2, 1, -1, 1, 1, -1, -1, -1, 2, -1, 1, -1, -1, -1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, -1, -2, -1, -1, -1, -2, -1, -2, -1, -1, -1
Offset: 1

Views

Author

Rémy Sigrist, Jul 07 2024

Keywords

Examples

			Triangle T(n, k) begins:
  n   n-th row
  --  ---------------------------------------------
   1  1
   2  2, -1
   3  1, -1, 1
   4  1, -1, -1, -1
   5  1, 1, 1, 2, 1
   6  2, -1, -2, -1, -1, -1
   7  1, 2, 1, 1, 1, -1, 1
   8  2, -1, -2, -1, 1, -1, 2, -1
   9  1, -1, 1, -2, 1, -2, 1, -1, 1
  10  1, -1, -1, -1, 2, -1, 1, -1, -1, -1
  11  1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1
  12  2, -1, -2, -1, -1, -1, -2, -1, -2, -1, -1, -1
		

Crossrefs

Programs

  • PARI
    T(n, k) = { for (m = 2, oo, my (d = (n%m) - (k%m)); if (d, return (d););); }

Formula

T(n, 0) = A213636(n).
T(n, n-1) = (-1)^(n-1).