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.

Showing 1-2 of 2 results.

A118400 Triangle T, read by rows, where all columns of T are different and yet all columns of the matrix square T^2 (A118401) are equal; a signed version of triangle A087698.

Original entry on oeis.org

1, 1, -1, 1, 0, 1, -1, -1, -1, -1, 1, 2, 2, 2, 1, -1, -3, -4, -4, -3, -1, 1, 4, 7, 8, 7, 4, 1, -1, -5, -11, -15, -15, -11, -5, -1, 1, 6, 16, 26, 30, 26, 16, 6, 1, -1, -7, -22, -42, -56, -56, -42, -22, -7, -1, 1, 8, 29, 64, 98, 112, 98, 64, 29, 8, 1, -1, -9, -37, -93, -162, -210, -210, -162, -93, -37, -9, -1
Offset: 0

Views

Author

Paul D. Hanna, Apr 27 2006

Keywords

Comments

Matrix inverse equals A118404. Row sums equal A084633. Signed version of: A087698 = maximum number of Boolean inputs at Hamming distance 2 for symmetric Boolean functions. This is an example of the fact that special matrices (cf. A118401) can have more than 2 signed matrix square-roots if the main diagonal is allowed to be signed.

Examples

			Triangle T begins:
1;
1,-1;
1, 0, 1;
-1,-1,-1,-1;
1, 2, 2, 2, 1;
-1,-3,-4,-4,-3,-1;
1, 4, 7, 8, 7, 4, 1;
-1,-5,-11,-15,-15,-11,-5,-1;
1, 6, 16, 26, 30, 26, 16, 6, 1;
-1,-7,-22,-42,-56,-56,-42,-22,-7,-1;
1, 8, 29, 64, 98, 112, 98, 64, 29, 8, 1;
-1,-9,-37,-93,-162,-210,-210,-162,-93,-37,-9,-1; ...
The matrix square is A118401:
1;
0, 1;
2, 0, 1;
-2, 2, 0, 1;
4,-2, 2, 0, 1;
-6, 4,-2, 2, 0, 1;
8,-6, 4,-2, 2, 0, 1;
-10, 8,-6, 4,-2, 2, 0, 1;
12,-10, 8,-6, 4,-2, 2, 0, 1; ...
in which all columns are equal.
		

Crossrefs

Cf. A118401 (matrix square), A084633 (row sums), A087698 (unsigned version); A118404 (matrix inverse).

Programs

  • PARI
    T(n,k)=polcoeff(polcoeff((1+2*x+2*x^2)/(1+x+x*y+x*O(x^n)),n,x)+y*O(y^k),k,y)
    
  • PARI
    T(n,k)=if(n==1&k==0,1,(-1)^n*(binomial(n,k)-2*binomial(n-2,k-1)))

Formula

G.f.: A(x,y) = (1+2*x+2*x^2)/(1+x+x*y). G.f. of column k = (-1)^k*(1+2*x+2*x^2)/(1+x)^(k+1) for k>=0. T(n,k) = (-1)^n*[C(n,k) - 2*C(n-2,k-1)] for n>=k>=0 except that T(1,0)=1.

A159853 Riordan array ((1-2*x+2*x^2)/(1-x), x/(1-x)).

Original entry on oeis.org

1, -1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 3, 4, 4, 3, 1, 1, 4, 7, 8, 7, 4, 1, 1, 5, 11, 15, 15, 11, 5, 1, 1, 6, 16, 26, 30, 26, 16, 6, 1, 1, 7, 22, 42, 56, 56, 42, 22, 7, 1, 1, 8, 29, 64, 98, 112, 98, 64, 29, 8, 1, 1, 9, 37, 93, 162, 210, 210, 162, 93, 37, 9, 1, 1, 10, 46, 130, 255
Offset: 0

Views

Author

Philippe Deléham, Apr 24 2009

Keywords

Comments

Essentially the same as A087698.

Examples

			Triangle begins:
   1;
  -1, 1;
   1, 0, 1;
   1, 1, 1, 1;
   1, 2, 2, 2, 1;
   1, 3, 4, 4, 3, 1;
   ...
		

Crossrefs

Cf. A087698.

Programs

  • GAP
    Flat(List([0..12],n->List([0..n],k->Binomial(n,k)-2*Binomial(n-1,n-k-1)+2*Binomial(n-2,n-k-2)))); # Muniru A Asiru, Mar 22 2018
    
  • Magma
    /* As triangle */ [[Binomial(n, n-k)-2*Binomial(n-1, n-k-1)+2*Binomial(n-2, n-k-2): k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Mar 22 2018
  • Maple
    C := proc (n, k) if 0 <= k and k <= n then factorial(n)/(factorial(k)*factorial(n-k)) else 0 end if;
    end proc:
    for n from 0 to 10 do
      seq(C(n, n-k) - 2*C(n-1, n-k-1) + 2*C(n-2, n-k-2), k = 0..n);
    end do; # Peter Bala, Mar 20 2018
  • Mathematica
    Join[{1, -1}, Rest[T[0, 0]=1; T[n_, k_]:=Binomial[n, n - k] - 2 Binomial[n - 1, n - k - 1] + 2 Binomial[n - 2, n - k - 2]; Table[T[n, k], {n, 1, 15}, {k, 0, n}]//Flatten]] (* Vincenzo Librandi, Mar 22 2018 *)
  • Sage
    # uses[riordan_array from A256893]
    riordan_array((1-2*x+2*x^2)/(1-x), x/(1-x), 8) # Peter Luschny, Mar 21 2018
    

Formula

From Peter Bala, Mar 20 2018: (Start)
T(n,k) = C(n,k) - 2*C(n-1,n-k-1) + 2*C(n-2,n-k-2), where C(n,k) = n!/(k!*(n-k)!) for 0 <= k <= n, otherwise 0.
Exp(x) * the e.g.f. for row n = the e.g.f. for diagonal n. For example, for n = 3 we have exp(x)*(1 + x + x^2/2! + x^3/3!) = 1 + 2*x + 2*x^2/2! + 4*x^3/3! + 8*x^4/4! + 15*x^5/5! + .... The same property holds more generally for Riordan arrays of the form ( f(x), x/(1-x) ). (End)
Showing 1-2 of 2 results.