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-3 of 3 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.

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

A275490 Square array of 5D pyramidal numbers, read by antidiagonals.

Original entry on oeis.org

1, 1, 5, 1, 6, 15, 1, 7, 21, 35, 1, 8, 27, 56, 70, 1, 9, 33, 77, 126, 126, 1, 10, 39, 98, 182, 252, 210, 1, 11, 45, 119, 238, 378, 462, 330, 1, 12, 51, 140, 294, 504, 714, 792, 495, 1, 13, 57, 161, 350, 630, 966, 1254, 1287, 715, 1, 14, 63, 182, 406, 756, 1218, 1716, 2079, 2002, 1001
Offset: 2

Views

Author

R. J. Mathar, Jul 30 2016

Keywords

Comments

Let F(r,n,d) = binomial(r+d-2,d-1)* ((r-1)*(n-2)+d) /d be the d-dimensional pyramidal numbers. Then A(n,k) = F(k,n,5).
Sum of the n-th antidiagonal is binomial(n+4,7) + binomial(n+4,5) = A055797(n-1). - Mathew Englander, Oct 27 2020

Examples

			The array starts in rows n>=2 and columns k>=1 as
   1    5   15   35   70  126  210  330  495   715  1001  1365  1820
   1    6   21   56  126  252  462  792 1287  2002  3003  4368  6188
   1    7   27   77  182  378  714 1254 2079  3289  5005  7371 10556
   1    8   33   98  238  504  966 1716 2871  4576  7007 10374 14924
   1    9   39  119  294  630 1218 2178 3663  5863  9009 13377 19292
   1   10   45  140  350  756 1470 2640 4455  7150 11011 16380 23660
   1   11   51  161  406  882 1722 3102 5247  8437 13013 19383 28028
   1   12   57  182  462 1008 1974 3564 6039  9724 15015 22386 32396
   1   13   63  203  518 1134 2226 4026 6831 11011 17017 25389 36764
		

Crossrefs

Cf. Row sums of A080852 (4D), A080851 (3D), A057145 (2D), A077028 (1D).
Cf. A055797.

Programs

  • Mathematica
    Table[Binomial[k + 3, 4] + (# - 2)*Binomial[k + 3, 5] &[m - k + 1], {m, 2, 12}, {k, m - 1}] // Flatten (* Michael De Vlieger, Nov 05 2020 *)

Formula

A(n+2,k) = Sum_{j=0..k-1} A080852(n,j).
A(n,k) = binomial(k+3,4) + (n-2)*binomial(k+3,5). - Mathew Englander, Oct 27 2020
Showing 1-3 of 3 results.