login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 08:32 EDT 2024. Contains 372207 sequences. (Running on oeis4.)