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.

A115952 Expansion of (1-x+x*y)/(1-x^2*y^2) - x^2/(1-x^2*y).

Original entry on oeis.org

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

Views

Author

Paul Barry, Feb 02 2006

Keywords

Comments

Row sums are A000007. Diagonal sums are A115953. Inverse is A115954.

Examples

			Triangle begins
   1,
  -1,  1,
  -1,  0,  1,
   0,  0, -1,  1,
   0, -1,  0,  0,  1,
   0,  0,  0,  0, -1,  1,
   0,  0, -1,  0,  0,  0,  1,
   0,  0,  0,  0,  0,  0, -1,  1,
   0,  0,  0, -1,  0,  0,  0,  0,  1,
   0,  0,  0,  0,  0,  0,  0,  0, -1,  1,
   0,  0,  0,  0, -1,  0,  0,  0,  0,  0,  1,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  1,
   0,  0,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  1,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  1,
   0,  0,  0,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0,  1,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  1
		

Crossrefs

Cf. A115524.

Programs

  • Magma
    [[n eq k select 1 else n eq k+1 select -(1+(-1)^k)/2 else n eq 2*(k+1) select -1 else 0: k in [0..n]]: n in [0..15]]; // G. C. Greubel, May 06 2019
    
  • Mathematica
    T[n_, k_]:= If[n==k, 1, If[n==k+1, -(1+(-1)^k)/2, If[n==2*k+2, -1, 0]]];
    Table[T[n, k], {n, 0, 15}, {k, 0, n}]//Flatten (* G. C. Greubel, May 06 2019 *)
  • PARI
    {T(n,k) = if(n==k, 1, if(n==k+1, -(1+(-1)^k)/2, if(n==2*k+2, -1, 0)))}; \\ G. C. Greubel, May 06 2019
    
  • Sage
    def T(n, k):
        if (n==k): return 1
        elif (n==k+1): return -(1+(-1)^k)/2
        elif (n==2*(k+1)): return -1
        else: return 0
    [[T(n, k) for k in (0..n)] for n in (0..15)] # G. C. Greubel, May 06 2019

Formula

Number triangle T(n,k)=if(n=k,1,0) OR if(n=2k+2,-1,0) OR if(n=k+1,-(1+(-1)^k)/2,0).