login
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).
4
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,2
FORMULA
T(n, 0) = A213636(n).
T(n, n-1) = (-1)^(n-1).
EXAMPLE
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
PROG
(PARI) T(n, k) = { for (m = 2, oo, my (d = (n%m) - (k%m)); if (d, return (d); ); ); }
CROSSREFS
KEYWORD
sign,base,easy,tabl
AUTHOR
Rémy Sigrist, Jul 07 2024
STATUS
approved