cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A154990 Triangle read by rows. Main diagonal is positive. The rest of the terms are negative.

Original entry on oeis.org

1, -1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, -1
Offset: 1

Views

Author

Mats Granvik, Jan 18 2009

Keywords

Comments

Triangle can be used in matrix inverses. Signs in columns as in A153881.
Iff n is a triangular number, a(n)=1; otherwise, a(n)=-1. (This is explicitly implemented in the second Mathematica program below.) - Harvey P. Dale, Apr 27 2014

Examples

			Table begins:
   1;
  -1,  1;
  -1, -1,  1;
  -1, -1, -1,  1;
  -1, -1, -1, -1,  1;
  -1, -1, -1, -1, -1,  1;
  -1, -1, -1, -1, -1, -1, 1;
		

Crossrefs

Programs

  • Magma
    [k eq n select 1 else -1: k in [1..n], n in [1..12]]; // G. C. Greubel, Mar 06 2021
  • Maple
    A154990 := proc(n,k)
        option remember;
        if k = n then
            1;
        elif k > n then
            0;
        else
            -1 ;
        end if;
    end proc:
    seq(seq(A154990(n,k),k=1..n),n=1..12) ; # R. J. Mathar, Sep 16 2017
  • Mathematica
    Flatten[Table[PadLeft[{1},n,-1],{n,15}]] (* or *) With[{tr=Accumulate[ Range[ 15]]}, Table[If[MemberQ[tr,n],1,-1],{n,Last[tr]}]] (* Harvey P. Dale, Apr 27 2014 *)
  • Sage
    flatten([[1 if k==n else -1 for k in (1..n)] for n in (1..12)]) # G. C. Greubel, Mar 06 2021
    

Formula

From G. C. Greubel, Mar 06 2021: (Start)
T(n, k) = -1 with T(n, n) = 1.
Sum_{k=1..n} T(n, k) = 2-n = -A023443(n-1) = -A023444(n). (End)