login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A164381
Triangle T(n,k) read by rows: T(n,k) = 1 if (n mod k) <= 2*k/9, -1 if 2*k/9 < (n mod k) <= 4*k/9, otherwise 0.
1
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, 1, 0, 0, 0, 1, 0, 0, -1, 1, 1, 1, 1, 1, 1, 1, -1, 1, 0, 0, -1, 1, 1, 1, 1, 0, -1, -1, 0, 1, 0, 0, -1, -1, 1, 1, 1
OFFSET
0,1
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
Cf. A051731.
Sequence in context: A047999 A323378 A054431 * A106470 A106465 A071027
KEYWORD
sign,less,tabl
AUTHOR
Roger L. Bagula and Mats Granvik, Aug 14 2009
EXTENSIONS
Edited by G. C. Greubel, Dec 03 2022
STATUS
approved