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-5 of 5 results.

A051601 Rows of triangle formed using Pascal's rule except we begin and end the n-th row with n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The number of spotlight tilings of an m X n rectangle missing the southeast corner. E.g., there are 2 spotlight tilings of a 2 X 2 square missing its southeast corner. - Bridget Tenner, Nov 10 2007
T(n,k) = A134636(n,k) - A051597(n,k). - Reinhard Zumkeller, Nov 23 2012
For a closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 18 2013
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 09 2013

Examples

			From _Roger L. Bagula_, Feb 17 2009: (Start)
Triangle begins:
   0;
   1,  1;
   2,  2,   2;
   3,  4,   4,   3;
   4,  7,   8,   7,    4;
   5, 11,  15,  15,   11,    5;
   6, 16,  26,  30,   26,   16,   6;
   7, 22,  42,  56,   56,   42,   22,    7;
   8, 29,  64,  98,  112,   98,   64,   29,   8;
   9, 37,  93, 162,  210,  210,  162,   93,   37,   9;
  10, 46, 130, 255,  372,  420,  372,  255,  130,  46,  10;
  11, 56, 176, 385,  627,  792,  792,  627,  385, 176,  56, 11;
  12, 67, 232, 561, 1012, 1419, 1584, 1419, 1012, 561, 232, 67, 12. ... (End)
		

Crossrefs

Row sums give A000918(n+1).
Columns from 2 to 9, respectively: A000124; A000125, A055795, A027660, A055796, A055797, A055798, A055799 (except 1 for the last seven). [Bruno Berselli, Aug 02 2013]
Cf. A001477, A162551 (central terms).

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k->  Binomial(n, k+1) + Binomial(n, n-k+1) ))); # G. C. Greubel, Nov 12 2019
  • Haskell
    a051601 n k = a051601_tabl !! n !! k
    a051601_row n = a051601_tabl !! n
    a051601_tabl = iterate
                   (\row -> zipWith (+) ([1] ++ row) (row ++ [1])) [0]
    -- Reinhard Zumkeller, Nov 23 2012
    
  • Magma
    /* As triangle: */ [[Binomial(n,m+1)+Binomial(n,n-m+1): m in [0..n]]: n in [0..12]]; // Bruno Berselli, Aug 02 2013
    
  • Maple
    seq(seq(binomial(n,k+1) + binomial(n, n-k+1), k=0..n), n=0..12); # G. C. Greubel, Nov 12 2019
  • Mathematica
    T[n_, k_]:= T[n, k] = Binomial[n, k+1] + Binomial[n, n-k+1];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* Roger L. Bagula, Feb 17 2009; modified by G. C. Greubel, Nov 12 2019 *)
  • PARI
    T(n,k) = binomial(n, k+1) + binomial(n, n-k+1);
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Nov 12 2019
    
  • Sage
    [[binomial(n, k+1) + binomial(n, n-k+1) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 12 2019
    

Formula

T(m,n) = binomial(m+n,m) - 2*binomial(m+n-2,m-1), up to offset and transformation of array to triangular indices. - Bridget Tenner, Nov 10 2007
T(n,k) = binomial(n, k+1) + binomial(n, n-k+1). - Roger L. Bagula, Feb 17 2009
T(0,n) = T(n,0) = n, T(n,k) = T(n-1,k) + T(n-1,k-1), 0 < k < n.

A080852 Square array of 4D pyramidal numbers, read by antidiagonals.

Original entry on oeis.org

1, 1, 4, 1, 5, 10, 1, 6, 15, 20, 1, 7, 20, 35, 35, 1, 8, 25, 50, 70, 56, 1, 9, 30, 65, 105, 126, 84, 1, 10, 35, 80, 140, 196, 210, 120, 1, 11, 40, 95, 175, 266, 336, 330, 165, 1, 12, 45, 110, 210, 336, 462, 540, 495, 220, 1, 13, 50, 125, 245, 406, 588, 750, 825, 715, 286
Offset: 0

Views

Author

Paul Barry, Feb 21 2003

Keywords

Comments

The first row contains the tetrahedral numbers, which are really three-dimensional, but can be regarded as degenerate 4D pyramidal numbers. - N. J. A. Sloane, Aug 28 2015

Examples

			Array, n >= 0, k >= 0, begins
1 4 10 20  35  56 ...
1 5 15 35  70 126 ...
1 6 20 50 105 196 ...
1 7 25 65 140 266 ...
1 8 30 80 175 336 ...
		

Crossrefs

Cf. A057145, A080851, A180266, A055796 (antidiagonal sums).
See A257200 for another version of the array.

Programs

  • Derive
    vector(vector(poly_coeff(Taylor((1+kx)/(1-x)^5,x,11),x,n),n,0,11),k,-1,10)
    
  • Derive
    VECTOR(VECTOR(comb(k+3,3)+comb(k+3,4)n, k, 0, 11), n, 0, 11)
  • Maple
    A080852 := proc(n,k)
            binomial(k+4,4)+(n-1)*binomial(k+3,4) ;
    end proc:
    seq( seq(A080852(d-k,k),k=0..d),d=0..12) ; # R. J. Mathar, Oct 01 2021
  • Mathematica
    T[n_, k_] := Binomial[k+3, 3] + Binomial[k+3, 4]n;
    Table[T[n-k, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 05 2023 *)

Formula

T(n, k) = binomial(k + 4, 4) + (n-1)*binomial(k + 3, 4), corrected Oct 01 2021.
T(n, k) = T(n - 1, k) + C(k + 3, 4) = T(n - 1, k) + k(k + 1)(k + 2)(k + 3)/24.
G.f. for rows: (1 + nx)/(1 - x)^5, n >= -1.
T(n,k) = sum_{j=0..k} A080851(n,j). - R. J. Mathar, Jul 28 2016

A055794 Triangle T read by rows: T(i,0)=1 for i >= 0; T(i,i)=1 for i=0,1,2,3; T(i,i)=0 for i >= 4; T(i,j) = T(i-1,j) + T(i-2,j-1) for 1<=j<=i-1.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 28 2000

Keywords

Comments

T(i+j,j) is the number of strings (s(1),...,s(i+1)) of nonnegative integers s(k) such that 0<=s(k)-s(k-1)<=1 for k=2,3,...,i+1 and s(i+1)=j.
T(i+j,j) is the number of compositions of j consisting of i parts, all of in {0,1}.

Examples

			Triangle begins:
  1;
  1, 1;
  1, 2, 1;
  1, 3, 2, 1;
  1, 4, 4, 2, 0;
  1, 5, 7, 4, 1, 0;
  ...
T(7,4) counts the strings 3334, 3344, 3444, 2234, 2334, 2344, 1234.
T(7,4) counts the compositions 001, 010, 100, 011, 101, 110, 111.
		

Crossrefs

Row sums: A000204 (Lucas numbers).
Cf. subsequences T(2n+m,n): A000125 (m=0, cake numbers), A055795 (m=1), A027660 (m=2), A055796 (m=3), A055797 (m=4), A055798 (m=5), A055799 (m=6).

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return 1;
        elif k=n and n<4 then return 1;
        elif k=n then return 0;
        else return T(n-1,k) + T(n-2,k-1);
        fi; end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Jan 25 2020
  • Magma
    function T(n,k)
      if k eq 0 then return 1;
      elif k eq n and n lt 4 then return 1;
      elif k eq n then return 0;
      else return T(n-1,k) + T(n-2, k-1);
      end if; return T; end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jan 25 2020
    
  • Maple
    T:= proc(n, k) option remember;
          if k=0 then 1
        elif k=n and n<4 then 1
        elif k=n then 0
        else T(n-1, k) + T(n-2, k-1)
          fi; end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Jan 25 2020
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, 1, If[k==n && n<4, 1, If[k==n, 0, T[n-1, k] + T[n-2, k-1] ]]]; Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Jan 25 2020 *)
  • PARI
    T(n,k) = if(k==0, 1, if(k==n && n<4, 1, if(k==n, 0, T(n-1, k) + T(n-2, k-1) )));
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jan 25 2020
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0): return 1
        elif (k==n and n<4): return 1
        elif (k==n): return 0
        else: return T(n-1, k) + T(n-2, k-1)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Jan 25 2020
    

Extensions

Typo in definition corrected by Georg Fischer, Dec 03 2021

A124725 Triangle read by rows: T(n,k) = binomial(n,k) + binomial(n,k+2) (0 <= k <= n).

Original entry on oeis.org

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

Views

Author

Gary W. Adamson and Roger L. Bagula, Nov 05 2006

Keywords

Comments

Binomial transform of the infinite tridiagonal matrix with main diagonal, (1,1,1,...), subdiagonal, (0,0,0,...) and subsubdiagonal, (1,1,1,...). Sum of entries in row n = 2^(n+1) - n - 1 = A000325(n+1).
Riordan array ((1-2x+2x^2)/(1-x)^3, x/(1-x)). - Paul Barry, Apr 08 2011

Examples

			Row 3 = (4, 4, 3, 1), then row 4 = (7, 8, 7, 4, 1).
First few rows of the triangle are
   1;
   1,  1;
   2,  2,  1;
   4,  4,  3,  1;
   7,  8,  7,  4,  1;
  11, 15, 15, 11,  5,  1;
  16, 26, 30, 26, 16,  6,  1;
  ...
From _Paul Barry_, Apr 08 2011: (Start)
Production matrix begins
   1, 1;
   1, 1, 1;
   0, 0, 1, 1;
  -1, 0, 0, 1, 1;
   0, 0, 0, 0, 1, 1;
   1, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 1, 1;
  -1, 0, 0, 0, 0, 0, 0, 1, 1;
   0, 0, 0, 0, 0, 0, 0, 0, 1, 1;
   1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1;
(End)
		

Crossrefs

Programs

  • Maple
    T:=(n,k)->binomial(n,k)+binomial(n,k+2): for n from 0 to 12 do seq(T(n,k),k=0..n) od; # yields sequence in triangular form
  • Mathematica
    Flatten[Table[Binomial[n,k]+Binomial[n,k+2],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Jun 12 2015 *)

Formula

T(n,k) = 3*T(n-1,k) + T(n-1,k-1) - 3*T(n-2,k) - 2*T(n-2,k-1) + T(n-3,k) + T(n-3,k-1), T(0,0) = T(1,0) = T(1,1) = T(2,2) = 1, T(2,0) = T(2,1) = 2, T(n,k) = 0 if k < 0 or if k > n. - Philippe Deléham, Feb 12 2014

Extensions

Edited by N. J. A. Sloane, Nov 29 2006

A125230 Triangle T(n,k) (0<=k<=n) read by rows in which column k contains the binomial transform of the sequence of k 0's, (k+1) 1's, followed by 0's.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 6, 4, 1, 1, 10, 11, 5, 1, 1, 15, 25, 16, 6, 1, 1, 21, 50, 42, 22, 7, 1, 1, 28, 91, 98, 64, 29, 8, 1, 1, 36, 154, 210, 163, 93, 37, 9, 1, 1, 45, 246, 420, 381, 256, 130, 46, 10, 1, 1, 55, 375, 792, 837, 638, 386, 176, 56, 11, 1, 1, 66, 550, 1419, 1749, 1485, 1024
Offset: 0

Views

Author

Gary W. Adamson, Nov 24 2006

Keywords

Comments

A125231 is another triangle with the same row sums A045623: (1, 2, 5, 12, 28, 64, 144, 320...).

Examples

			T(5,2) = C(5,2) + C(5,3) + C(5,4) = 10 + 10 + 5 = 25.
First few rows of the triangle are:
1
1 1
1 3 1
1 6 4 1
1 10 11 5 1
1 15 25 16 6 1
		

Crossrefs

Cf. A007318, A125231. Columns k=0-3 give: A000012, A000217, A006522(n+1), A055796(n-3). Row sums give: A045623.

Programs

  • Maple
    T:= (n, k)-> add (binomial (n, j), j=k..min(2*k, n)): seq (seq (T(n, k), k=0..n), n=0..12);

Formula

T(n,k) = Sum_{j=k..min(2*k,n)} C(n,j).

Extensions

Edited with more terms and Maple program by Alois P. Heinz, Oct 16 2009
Showing 1-5 of 5 results.