OFFSET
0,1
LINKS
G. C. Greubel, Table of n, a(n) for the first 50 rows, flattened
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 0, 1;
1, 1, -1, 1;
1, 0, 0, -1, 1;
1, 1, 1, 0, 1, 1;
1, 0, -1, 0, -1, 1, 1;
1, 1, 0, 1, 0, -1, 1, 1;
1, 0, 1, -1, 0, 0, -1, 1, 1;
1, 1, -1, 0, 1, 0, -1, -1, 1, 1;
MATHEMATICA
T[n_, k_]:= If[Mod[n, k]/k<=2/9, 1, If[2/9<Mod[n, k]/k<=4/9, -1, 0]];
Table[T[n, k], {n, 12}, {k, n}]//Flatten
PROG
(Magma)
function A164381(n, k)
if (n mod k) le 2*k/9 then return 1;
elif 2*k/9 lt (n mod k) and (n mod k) le 4*k/9 then return -1;
else return 0;
end if; return A164381;
end function;
[A164381(n, k): k in [1..n], n in [1..12]]; // G. C. Greubel, Dec 03 2022
(SageMath)
def A164381(n, k):
if ((n%k)/k <= 2/9): return 1
elif (2/9 < (n%k)/k <= 4/9): return -1
else: return 0
flatten([[A164381(n, k) for k in range(1, n+1)] for n in range(1, 17)]) # G. C. Greubel, Dec 03 2022
CROSSREFS
KEYWORD
AUTHOR
Roger L. Bagula and Mats Granvik, Aug 14 2009
EXTENSIONS
Edited by G. C. Greubel, Dec 03 2022
STATUS
approved