login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A176079 Triangle T(n,k) read by rows: If k divides n then k-1, otherwise -1. 5
0, 0, 1, 0, -1, 2, 0, 1, -1, 3, 0, -1, -1, -1, 4, 0, 1, 2, -1, -1, 5, 0, -1, -1, -1, -1, -1, 6, 0, 1, -1, 3, -1, -1, -1, 7, 0, -1, 2, -1, -1, -1, -1, -1, 8, 0, 1, -1, -1, 4, -1, -1, -1, -1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 0, 1, 2, 3, -1, 5, -1, -1, -1, -1, -1, 11 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,6

LINKS

G. C. Greubel, Rows n = 1..100 of triangle, flattened

FORMULA

T(n,k) = -A191904(n,k) for n >= k.

Sum_{k=1..n} T(n,k) = A001065(n). - Jon E. Schoenfield, Nov 29 2019

EXAMPLE

Table begins:

  0;

  0,  1;

  0, -1,  2;

  0,  1, -1,  3;

  0, -1, -1, -1,  4;

  0,  1,  2, -1, -1,  5;

  0, -1, -1, -1, -1, -1,  6;

  0,  1, -1,  3, -1, -1, -1,  7;

  0, -1,  2, -1, -1, -1, -1, -1,  8;

  0,  1, -1, -1,  4, -1, -1, -1, -1, 9;

MAPLE

seq(seq( `if`(mod(n, k)=0, k-1, -1) , k=1..n), n=1..15); # G. C. Greubel, Nov 27 2019

MATHEMATICA

Table[If[Divisible[n, k], k-1, -1], {n, 15}, {k, n}]//Flatten (* Harvey P. Dale, May 20 2016 *)

PROG

(PARI) T(n, k)= if(Mod(n, k)==0, k-1, -1); \\ G. C. Greubel, Nov 27 2019

(MAGMA) [(n mod k) eq 0 select k-1 else -1: k in [1..n], n in [1..15]]; // G. C. Greubel, Nov 27 2019

(Sage)

def T(n, k):

    if (mod(n, k)==0): return k-1

    else: return -1

[[T(n, k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Nov 27 2019

(GAP)

T:= function(n, k)

    if (n mod k = 0) then return k-1;

    else return -1;

    fi; end;

Flat(List([1..15], n-> List([1..n], k-> T(n, k) ))); # G. C. Greubel, Nov 27 2019

CROSSREFS

Cf. A001065 (row sums), A191904.

Sequence in context: A064918 A323076 A286471 * A067586 A078879 A082859

Adjacent sequences:  A176076 A176077 A176078 * A176080 A176081 A176082

KEYWORD

sign,tabl

AUTHOR

Mats Granvik, Apr 08 2010

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 21 19:57 EDT 2020. Contains 337273 sequences. (Running on oeis4.)