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.

A155102 Triangle T(n,k) read by rows. If n=k then T(n,k)=1, elseif n=2*k then T(n,k)=-(k+1), else T(n,k)=0.

Original entry on oeis.org

1, -2, 1, 0, 0, 1, 0, -3, 0, 1, 0, 0, 0, 0, 1, 0, 0, -4, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -5, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, -6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, 0
Offset: 1

Views

Author

Mats Granvik, Jan 20 2009

Keywords

Comments

Matrix inverse of this triangle is A155103.

Examples

			Table begins:
1,
-2,1,
0,0,1,
0,-3,0,1,
0,0,0,0,1,
0,0,-4,0,0,1,
0,0,0,0,0,0,1,
0,0,0,-5,0,0,0,1,
		

Crossrefs

Cf. A155103.

Programs

  • Excel
    =if(row()=column();1;if(and(row()>=column()*2;row()<=column()*2);-1;0))*(row()-column()+1)
  • Mathematica
    t[n_, k_] := Which[n == k, 1, n == 2k, -k - 1, True, 0]; Flatten[ Table[t[n, k], {n, 1, 14}, {k, 1, n}]] (* Jean-François Alcover, Jul 19 2012 *)
  • PARI
    T(n,k)=if(n==k,1,if(n==2*k,-(k+1))); for(n=1,20,for(k=1,n,print1(T(n,k),", "));print())
    

Extensions

Definition clarified by Mats Granvik, Dec 05 2010