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

A059284 Right edge of triangle in A059283.

Original entry on oeis.org

1, 1, 3, 11, 47, 219, 1081, 5557, 29439, 159611, 881405, 4940385, 28035205, 160751005, 929923395, 5420717819, 31809479855, 187757573787, 1114012352029, 6640357243537, 39746256802185, 238796968208537, 1439587364576015
Offset: 0

Views

Author

N. J. A. Sloane, Jan 24 2001

Keywords

Crossrefs

Programs

  • Mathematica
    T[0,0] = 1; T[n_,0] = 0; T[n_, k_] /; 0 <= k <= n := T[n, k] = T[n, k - 1] + T[n - 1, k - 1] + T[n - 1, k] + T[n - 2, k - 1]; T[, ] = 0; Table[T[n,n], {n,0,25}] (* G. C. Greubel, Jan 04 2016 *)

Formula

G.f.: -(-2+(-3*w^2-6*w+1)^(1/2))/(1+w)^2.

A224729 Central terms of the triangle in A059283.

Original entry on oeis.org

1, 2, 14, 138, 1522, 17740, 213642, 2628626, 32833226, 414697740, 5282720764, 67750624480, 873653602902, 11316723314858, 147143725788662, 1919360958676866, 25105597581410410, 329174706398378884, 4325098764217263996, 56934186664360843064
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 17 2013

Keywords

Comments

a(n) = A059283(2*n,n).

Programs

  • Haskell
    a224729 n = a059283 (2*n) n

A037027 Skew Fibonacci-Pascal triangle read by rows.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 3, 5, 3, 1, 5, 10, 9, 4, 1, 8, 20, 22, 14, 5, 1, 13, 38, 51, 40, 20, 6, 1, 21, 71, 111, 105, 65, 27, 7, 1, 34, 130, 233, 256, 190, 98, 35, 8, 1, 55, 235, 474, 594, 511, 315, 140, 44, 9, 1, 89, 420, 942, 1324, 1295, 924, 490, 192, 54, 10, 1, 144, 744, 1836
Offset: 0

Views

Author

Floor van Lamoen, Jan 01 1999

Keywords

Comments

T(n,k) is the number of lattice paths from (0,0) to (n,k) using steps (0,1), (1,0), (2,0). - Joerg Arndt, Jun 30 2011
T(n,k) is the number of lattice paths of length n, starting from the origin and ending at (n,k), using horizontal steps H=(1,0), up steps U=(1,1) and down steps D=(1,-1), never containing UUU, DD, HD. For instance, for n=4 and k=2, we have the paths; HHUU, HUHU, HUUH, UHHU, UHUH, UUHH, UUDU, UDUU, UUUD. - Emanuele Munarini, Mar 15 2011
Row sums form Pell numbers A000129, T(n,0) forms Fibonacci numbers A000045, T(n,1) forms A001629. T(n+k,n-k) is polynomial sequence of degree k.
T(n,k) gives a convolved Fibonacci sequence (A001629, A001872, etc.).
As a Riordan array, this is (1/(1-x-x^2),x/(1-x-x^2)). An interesting factorization is (1/(1-x^2),x/(1-x^2))*(1/(1-x),x/(1-x)) [abs(A049310) times A007318]. Diagonal sums are the Jacobsthal numbers A001045(n+1). - Paul Barry, Jul 28 2005
T(n,k) = T'(n+1,k+1), T' given by [0, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938. - Philippe Deléham, Nov 19 2005
Equals A049310 * A007318 as infinite lower triangular matrices. - Gary W. Adamson, Oct 28 2007
This triangle may also be obtained from the coefficients of the Morgan-Voyce polynomials defined by: Mv(x, n) = (x + 1)*Mv(x, n - 1) + Mv(x, n - 2). - Roger L. Bagula, Apr 09 2008
Row sums are A000129. - Roger L. Bagula, Apr 09 2008
Absolute value of coefficients of the characteristic polynomial of tridiagonal matrices with 1's along the main diagonal, and i's along the superdiagonal and the subdiagonal (where i=sqrt(-1), see Mathematica program). - John M. Campbell, Aug 23 2011
A037027 is jointly generated with A122075 as an array of coefficients of polynomials v(n,x): initially, u(1,x)=v(1,x)=1; for n>1, u(n,x)=u(n-1,x)+(x+1)*v(n-1)x and v(n,x)=u(n-1,x)+x*v(n-1,x). See the Mathematica section at A122075. - Clark Kimberling, Mar 05 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
Row n, for n>=0, shows the coefficients of the polynomial u(n) = c(0) + c(1)*x + ... + c(n)*x^n which is the denominator of the n-th convergent of the continued fraction [x+1, x+1, x+1, ...]; see A230000. - Clark Kimberling, Nov 13 2013
T(n,k) is the number of ternary words of length n having k letters 2 and avoiding a runs of odd length for the letter 0. - Milan Janjic, Jan 14 2017
Let T(m, n, k) be an m-bonacci Pascal's triangle, where T(m, n, 0) gives the values of F(m, n), the n-th m-bonacci number, and T(m, n, k) gives the values for the k-th convolution of F(m, n). Then the classic Pascal triangle is T(1, n, k) and this sequence is T(2, n, k). T(m, n, k) is the number of compositions of n using only the positive integers 1, 1' and 2 through m, with the part 1' used exactly k times. G.f. for k-th column of T(m, n, k): x/(1 - x - x^2 - ... - x^m)^k. The row sum for T(m, n, k) is the number of compositions of n using only the positive integers 1, 1' and 2 through m. G.f. for row sum of T(m, n, k): 1/(1 - 2x - x^2 - ... - x^m). - Gregory L. Simay, Jul 24 2021

Examples

			Ratio of row polynomials R(3)/R(2) = (3 + 5*x + 3*x^2 + x^3)/(2 + 2*x + x^2) = [1+x; 1+x, 1+x].
Triangle begins:
                                 1;
                              1,    1;
                           2,    2,    1;
                        3,    5,    3,    1;
                     5,   10,    9,    4,    1;
                  8,   20,   22,   14,    5,    1;
              13,   38,   51,   40,   20,    6,    1;
           21,   71,  111,  105,   65,   27,    7,    1;
        34,  130,  233,  256,  190,   98,   35,    8,    1;
     55,  235,  474,  594,  511,  315,  140,   44,    9,    1;
  89,  420,  942, 1324, 1295,  924,  490,  192,   54,   10,    1;
		

Crossrefs

A038112(n) = T(2n, n). A038137 is reflected version. Maximal row entries: A038149.
Diagonal differences are in A055830. Vertical sums are in A091186.
Some other Fibonacci-Pascal triangles: A027926, A036355, A074829, A105809, A109906, A111006, A114197, A162741, A228074.

Programs

  • Haskell
    a037027 n k = a037027_tabl !! n !! k
    a037027_row n = a037027_tabl !! n
    a037027_tabl = [1] : [1,1] : f [1] [1,1] where
       f xs ys = ys' : f ys ys' where
         ys' = zipWith3 (\u v w -> u + v + w) (ys ++ [0]) (xs ++ [0,0]) ([0] ++ ys)
    -- Reinhard Zumkeller, Jul 07 2012
  • Maple
    T := (n,k) -> `if`(n=0,1,binomial(n,k)*hypergeom([(k-n)/2, (k-n+1)/2], [-n], -4)): seq(seq(simplify(T(n,k)), k=0..n), n=0..10); # Peter Luschny, Apr 25 2016
    # Uses function PMatrix from A357368. Adds a row above and a column to the left.
    PMatrix(10, n -> combinat:-fibonacci(n)); # Peter Luschny, Oct 07 2022
  • Mathematica
    Mv[x, -1] = 0; Mv[x, 0] = 1; Mv[x, 1] = 1 + x; Mv[x_, n_] := Mv[x, n] = ExpandAll[(x + 1)*Mv[x, n - 1] + Mv[x, n - 2]]; Table[ CoefficientList[ Mv[x, n], x], {n, 0, 10}] // Flatten (* Roger L. Bagula, Apr 09 2008 *)
    Abs[Flatten[Table[CoefficientList[CharacteristicPolynomial[Array[KroneckerDelta[#1,#2]+KroneckerDelta[#1,#2+1]*I+KroneckerDelta[#1,#2-1]*I&,{n,n}],x],x],{n,1,20}]]] (* John M. Campbell, Aug 23 2011 *)
    T[n_, k_] := Binomial[n, k] Hypergeometric2F1[(k-n)/2, (k-n+1)/2, -n, -4];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 16 2019, after Peter Luschny *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, if( n==0 && k==0, 1, T(n-1, k) + T(n-1, k-1) + T(n-2, k)))}; /* Michael Somos, Sep 29 2003 */
    
  • PARI
    T(n,k)=if(nPaul D. Hanna, Feb 27 2004
    

Formula

T(n, m) = T'(n-1, m) + T'(n-2, m) + T'(n-1, m-1), where T'(n, m) = T(n, m) for n >= 0 and 0< = m <= n and T'(n, m) = 0 otherwise.
G.f.: 1/(1 - y - y*z - y^2).
G.f. for k-th column: x/(1-x-x^2)^k.
T(n, m) = Sum_{k=0..n-m} binomial(m+k, m)*binomial(k, n-k-m), n >= m >= 0, otherwise 0. - Wolfdieter Lang, Jun 17 2002
T(n, m) = ((n-m+1)*T(n, m-1) + 2*(n+m)*T(n-1, m-1))/(5*m), n >= m >= 1; T(n, 0)= A000045(n+1); T(n, m)= 0 if n < m. - Wolfdieter Lang, Apr 12 2000
Chebyshev coefficient triangle (abs(A049310)) times Pascal's triangle (A007318) as product of lower triangular matrices. T(n, k) = Sum_{j=0..n} binomial((n+j)/2, j)*(1+(-1)^(n+j))*binomial(j, k)/2. - Paul Barry, Dec 22 2004
Let R(n) = n-th row polynomial in x, with R(0)=1, then R(n+1)/R(n) equals the continued fraction [1+x;1+x, ...(1+x) occurring (n+1) times ..., 1+x] for n >= 0. - Paul D. Hanna, Feb 27 2004
T(n,k) = Sum_{j=0..n} binomial(n-j,j)*binomial(n-2*j,k); in Egorychev notation, T(n,k) = res_w(1-w-w^2)^(-k-1)*w^(-n+k+1). - Paul Barry, Sep 13 2006
Sum_{k=0..n} T(n,k)*x^k = A000045(n+1), A000129(n+1), A006190(n+1), A001076(n+1), A052918(n), A005668(n+1), A054413(n), A041025(n), A099371(n+1), A041041(n), A049666(n+1), A041061(n), A140455(n+1), A041085(n), A154597(n+1), A041113(n) for x = 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 respectively. - Philippe Deléham, Nov 29 2009
T((m+1)*n+r-1, m*n+r-1)*r/(m*n+r) = Sum_{k=1..n} k/n*T((m+1)*n-k-1, m*n-1)*(r+k,r), n >= m > 1.
T(n-1,m-1) = (m/n)*Sum_{k=1..n-m+1} k*A000045(k)*T(n-k-1,m-2), n >= m > 1. - Vladimir Kruchinin, Mar 17 2011
T(n,k) = binomial(n,k)*hypergeom([(k-n)/2, (k-n+1)/2], [-n], -4) for n >= 1. - Peter Luschny, Apr 25 2016

Extensions

Examples from Paul D. Hanna, Feb 27 2004

A122542 Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, 2, -1, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938.

Original entry on oeis.org

1, 0, 1, 0, 2, 1, 0, 2, 4, 1, 0, 2, 8, 6, 1, 0, 2, 12, 18, 8, 1, 0, 2, 16, 38, 32, 10, 1, 0, 2, 20, 66, 88, 50, 12, 1, 0, 2, 24, 102, 192, 170, 72, 14, 1, 0, 2, 28, 146, 360, 450, 292, 98, 16, 1, 0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1
Offset: 0

Views

Author

Philippe Deléham, Sep 19 2006, May 28 2007

Keywords

Comments

Riordan array (1, x*(1+x)/(1-x)). Rising and falling diagonals are the tribonacci numbers A000213, A001590.

Examples

			Triangle begins:
  1;
  0, 1;
  0, 2,  1;
  0, 2,  4,   1;
  0, 2,  8,   6,   1;
  0, 2, 12,  18,   8,    1;
  0, 2, 16,  38,  32,   10,   1;
  0, 2, 20,  66,  88,   50,  12,   1;
  0, 2, 24, 102, 192,  170,  72,  14,   1;
  0, 2, 28, 146, 360,  450, 292,  98,  16,  1;
  0, 2, 32, 198, 608, 1002, 912, 462, 128, 18, 1;
		

Crossrefs

Other versions: A035607, A113413, A119800, A266213.
Sums include: A000007, A001333 (row), A001590 (diagonal), A007483, A057077 (signed row), A078016 (signed diagonal), A086901, A091928, A104934, A122558, A122690.

Programs

  • Haskell
    a122542 n k = a122542_tabl !! n !! k
    a122542_row n = a122542_tabl !! n
    a122542_tabl = map fst $ iterate
       (\(us, vs) -> (vs, zipWith (+) ([0] ++ us ++ [0]) $
                          zipWith (+) ([0] ++ vs) (vs ++ [0]))) ([1], [0, 1])
    -- Reinhard Zumkeller, Jul 20 2013, Apr 17 2013
    
  • Magma
    function T(n, k) // T = A122542
      if k eq 0 then return 0^n;
      elif k eq n then return 1;
      else return T(n-1,k) + T(n-1,k-1) + T(n-2,k-1);
      end if;
    end function;
    [T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Oct 27 2024
  • Mathematica
    CoefficientList[#, y]& /@ CoefficientList[(1-x)/(1 - (1+y)x - y x^2) + O[x]^11, x] // Flatten (* Jean-François Alcover, Sep 09 2018 *)
    (* Second program *)
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, 0, T[n-1,k-1] +T[n-1,k] +T[n-2,k- 1] ]]; (* T = A122542 *)
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Oct 27 2024 *)
  • Sage
    def A122542_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return prec(n-1,k-1)+2*sum(prec(n-i,k-1) for i in (2..n-k+1))
        return [prec(n, k) for k in (0..n)]
    for n in (0..10): print(A122542_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

Sum_{k=0..n} x^k*T(n,k) = A000007(n), A001333(n), A104934(n), A122558(n), A122690(n), A091928(n) for x = 0, 1, 2, 3, 4, 5. - Philippe Deléham, Jan 25 2012
Sum_{k=0..n} 3^(n-k)*T(n,k) = A086901(n).
Sum_{k=0..n} 2^(n-k)*T(n,k) = A007483(n-1), n >= 1. - Philippe Deléham, Oct 08 2006
T(2*n, n) = A123164(n).
T(n, k) = T(n-1,k) + T(n-1,k-1) + T(n-2,k-1), n > 1. - Philippe Deléham, Jan 25 2012
G.f.: (1-x)/(1-(1+y)*x-y*x^2). - Philippe Deléham, Mar 02 2012
From G. C. Greubel, Oct 27 2024: (Start)
Sum_{k=0..n} (-1)^k*T(n, k) = A057077(n).
Sum_{k=0..floor(n/2)} T(n-k, k) = A001590(n+1).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = A078016(n). (End)

A155161 A Fibonacci convolution triangle: Riordan array (1, x/(1 - x - x^2)). Triangle T(n,k), 0 <= k <= n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 2, 1, 0, 3, 5, 3, 1, 0, 5, 10, 9, 4, 1, 0, 8, 20, 22, 14, 5, 1, 0, 13, 38, 51, 40, 20, 6, 1, 0, 21, 71, 111, 105, 65, 27, 7, 1, 0, 34, 130, 233, 256, 190, 98, 35, 8, 1, 0, 55, 235, 474, 594, 511, 315, 140, 44, 9, 1, 0, 89, 420, 942, 1324, 1295, 924, 490, 192, 54, 10, 1
Offset: 0

Views

Author

Philippe Deléham, Jan 21 2009

Keywords

Examples

			Triangle begins:
[0] 1;
[1] 0,  1;
[2] 0,  1,   1;
[3] 0,  2,   2,   1;
[4] 0,  3,   5,   3,   1;
[5] 0,  5,  10,   9,   4,   1;
[6] 0,  8,  20,  22,  14,   5,  1;
[7] 0, 13,  38,  51,  40,  20,  6,  1;
[8] 0, 21,  71, 111, 105,  65, 27,  7, 1;
[9] 0, 34, 130, 233, 256, 190, 98, 35, 8, 1.
		

Crossrefs

Row sums are in A215928.
Central terms: T(2*n,n) = A213684(n) for n > 0.

Programs

  • Haskell
    a155161 n k = a155161_tabl !! n !! k
    a155161_row n = a155161_tabl !! n
    a155161_tabl = [1] : [0,1] : f [0] [0,1] where
       f us vs = ws : f vs ws where
         ws = zipWith (+) (us ++ [0,0]) $ zipWith (+) ([0] ++ vs) (vs ++ [0])
    -- Reinhard Zumkeller, Apr 17 2013
  • Maple
    T := (n, k) -> binomial(n-1, k-1)*hypergeom([-(n-k)/2, -(n-k-1)/2], [1-n], -4):
    seq(seq(simplify(T(n, k)), k = 0..n), n = 0..11); # Peter Luschny, May 23 2021
    # Uses function PMatrix from A357368.
    PMatrix(10, n -> combinat:-fibonacci(n)); # Peter Luschny, Oct 07 2022
  • Mathematica
    CoefficientList[#, y]& /@ CoefficientList[(1-x-x^2)/(1-x-x^2-x*y)+O[x]^12, x] // Flatten (* Jean-François Alcover, Mar 01 2019 *)
    (* Generates the triangle without the leading '1' (rows are rearranged). *)
    (* Function RiordanSquare defined in A321620. *)
    RiordanSquare[x/(1 - x - x^2), 11] // Flatten  (* Peter Luschny, Feb 27 2021 *)
  • Maxima
    M(n,k):=pochhammer(n,k)/k!;
    create_list(sum(M(k,i)*binomial(i,n-i-k),i,0,n-k),n,0,8,k,0,n); /* Emanuele Munarini, Mar 15 2011 */
    

Formula

T(n, k) given by [0,1,1,-1,0,0,0,...] DELTA [1,0,0,0,...] where DELTA is the operator defined in A084938.
a(n,k) = Sum_{i=0..n-k} M(k,i)*binomial(i,n-i-k), where M(n,k) = n(n+1)(n+2)...(n+k-1)/k!. - Emanuele Munarini, Mar 15 2011
Recurrence: a(n+2,k+1) = a(n+1,k+1) + a(n+1,k) + a(n,k+1). - Emanuele Munarini, Mar 15 2011
G.f.: (1-x-x^2)/(1-x-x^2-x*y). - Philippe Deléham, Feb 08 2012
Sum_{k=0..n} T(n,k)*x^k = A000007(n), A000129(n) (n > 0), A052991(n), A155179(n), A155181(n), A155195(n), A155196(n), A155197(n), A155198(n), A155199(n) for x = 0,1,2,3,4,5,6,7,8,9 respectively. - Philippe Deléham, Feb 08 2012
T(n, k) = binomial(n-1, k-1)*hypergeom([-(n-k)/2, -(n-k-1)/2], [1-n], -4). - Peter Luschny, May 23 2021

A059576 Summatory Pascal triangle T(n,k) (0 <= k <= n) read by rows. Top entry is 1. Each entry is the sum of the parallelogram above it.

Original entry on oeis.org

1, 1, 1, 2, 3, 2, 4, 8, 8, 4, 8, 20, 26, 20, 8, 16, 48, 76, 76, 48, 16, 32, 112, 208, 252, 208, 112, 32, 64, 256, 544, 768, 768, 544, 256, 64, 128, 576, 1376, 2208, 2568, 2208, 1376, 576, 128, 256, 1280, 3392, 6080, 8016, 8016, 6080, 3392, 1280, 256
Offset: 0

Views

Author

Floor van Lamoen, Jan 23 2001

Keywords

Comments

We may also relabel the entries as U(0,0), U(1,0), U(0,1), U(2,0), U(1,1), U(0,2), U(3,0), ... [That is, T(n,k) = U(n-k, k) for 0 <= k <= n and U(m,s) = T(m+s, s) for m,s >= 0.]
From Petros Hadjicostas, Jul 16 2020: (Start)
We explain the parallelogram definition of T(n,k).
T(0,0) *
|\
| \
| * T(k,k)
T(n-k,0) * |
\ |
\|
* T(n,k)
The definition implies that T(n,k) is the sum of all T(i,j) such that (i,j) has integer coordinates over the set
{(i,j): a(1,0) + b(1,1), 0 <= a <= n-k, 0 <= b <= k} - {(n,k)}.
The parallelogram can sometimes be degenerate; e.g., when k = 0 or n = k. (End)
T(n,k) is the number of 2-compositions of n having sum of the entries of the first row equal to k (0 <= k <= n). A 2-composition of n is a nonnegative matrix with two rows, such that each column has at least one nonzero entry and whose entries sum up to n. - Emeric Deutsch, Oct 12 2010
From Michel Marcus and Petros Hadjicostas, Jul 16 2020: (Start)
Robeva and Sun (2020) let A(m,n) = U(m-1, n-1) be the number of subdivisions of a 2-row grid with m points on the top and n points at the bottom (and such that the lower left point is the origin).
The authors proved that A(m,n) = 2*(A(m,n-1) + A(m-1,n) - A(m-1,n-1)) for m, n >= 2 (with (m,n) <> (2,2)), which is equivalent to a similar recurrence for U(n,k) given in the Formula section below. (They did not explicitly specify the value of A(1,1) = U(0,0) because they did not care about the number of subdivisions of a degenerate polygon with only one side.)
They also proved that, for (m,n) <> (1,1), A(m,n) = (2^(m-2)/(n-1)!) * Q_n(m) =
= (2^(m-2)/(n-1)!) * Sum_{k=1..n} A336244(n,k) * m^(n-k), where Q_n(m) is a polynomial in m of degree n-1. (End)
With the square array notation of Petros Hadjicostas, Jul 16 2020 below, U(i,j) is the number of lattice paths from (0,0) to (i,j) whose steps move north or east or have positive slope. For example, representing a path by its successive lattice points rather than its steps, U(1,2) = 8 counts {(0,0),(1,2)}, {(0,0),(0,1),(1,2)}, {(0,0),(0,2),(1,2)}, {(0,0),(1,0),(1,2)}, {(0,0),(1,1),(1,2)}, {(0,0),(0,1),(0,2),(1,2)}, {(0,0),(0,1),(1,1),(1,2)}, {(0,0),(1,0),(1,1),(1,2)}. If north (vertical) steps are excluded, the resulting paths are counted by A049600. - David Callan, Nov 25 2021

Examples

			Triangle T(n,k) (with rows n >= 0 and columns k = 0..n) begins
[0]   1;
[1]   1,   1;
[2]   2,   3,   2;
[3]   4,   8,   8,   4;
[4]   8,  20,  26,  20,   8;
[5]  16,  48,  76,  76,  48,  16;
[6]  32, 112, 208, 252, 208, 112, 32;
  ...
T(5,2) = 76 is the sum of the elements above it in the parallelogram bordered by T(0,0), T(5-2,0) = T(3,0), T(2,2) and T(5,2). We of course exclude T(5,2) from the summation. Thus
T(5,2) = Sum_{a=0..5-2, b=0..2, (a,b) <> (5-2,2)} T(a(1,0) + b(1,1)) =
= (1 + 1 + 2) + (1 + 3 + 8) + (2 + 8 + 26) + (4 + 20) = 76. [Edited by _Petros Hadjicostas_, Jul 16 2020]
From _Petros Hadjicostas_, Jul 16 2020: (Start)
Square array U(n,k) (with rows n >= 0 and columns k >= 0) begins
   1,   1,   2,    4,    8, ...
   1,   3,   8,   20,   48, ...
   2,   8,  26,   76,  208, ...
   4,  20,  76,  252,  768, ...
   8,  48, 208,  768, 2568, ...
  16, 112, 544, 2208, 8016, ...
  ...
Consider the following 2-row grid with n = 3 points at the top and k = 2 points at the bottom:
   A  B  C
   *--*--*
   |    /
   |   /
   *--*
   D  E
The sets of the dividing internal lines of the A(3,2) = U(3-1, 2-1) = 8 subdivisions of the above 2-row grid are as follows: { }, {DC}, {DB}, {EB}, {EA}, {DB, DC}, {DB, EB}, and {EA, EB}. See Robeva and Sun (2020).
These are the 2-compositions of n = 3 with sum of first row entries equal to k = 1:
[1; 2], [0,1; 2,0], [0,1; 1,1], [1,0; 0,2], [1,0; 1,1], [0,0,1; 1,1,0], [0,1,0; 1,0,1], and [1,0,0; 0,1,1]. We have T(3,2) = 8 such matrices. See _Emeric Deutsch_'s contribution above. See also Section 2 in Castiglione et al. (2007). (End)
		

Crossrefs

Programs

  • Haskell
    a059576 n k = a059576_tabl !! n !! k
    a059576_row n = a059576_tabl !! n
    a059576_tabl = [1] : map fst (iterate f ([1,1], [2,3,2])) where
       f (us, vs) = (vs, map (* 2) ws) where
         ws = zipWith (-) (zipWith (+) ([0] ++ vs) (vs ++ [0]))
                          ([0] ++ us ++ [0])
    -- Reinhard Zumkeller, Dec 03 2012
    
  • Magma
    A011782:= func< n | n eq 0 select 1 else 2^(n-1) >;
    function T(n,k) // T = A059576
      if k eq 0 or k eq n then return A011782(n);
      else return 2*T(n-1, k-1) + 2*T(n-1, k) - (2 - 0^(n-2))*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, Sep 02 2022
    
  • Maple
    A059576 := proc(n,k) local b,t1; t1 := min(n+k-2,n,k); add( (-1)^b * 2^(n+k-b-2) * (n+k-b-2)! * (1/(b! * (n-b)! * (k-b)!)) * (-2 * n-2 * k+2 * k^2+b^2-3 * k * b+2 * n^2+5 * n * k-3 * n * b), b=0..t1); end;
    T := proc (n, k) if k <= n then add((-1)^j*2^(n-j-1)*binomial(k, j)*binomial(n-j, k), j = 0 .. min(k, n-k)) fi end proc: 1; for n to 10 do seq(T(n, k), k = 0 .. n) end do; # yields sequence in triangular form # Emeric Deutsch, Oct 12 2010
    T := (n, k) -> `if`(n=0, 1, 2^(n-1)*binomial(n, k)*hypergeom([-k, k - n], [-n], 1/2)): seq(seq(simplify(T(n, k)), k=0..n), n=0..10); # Peter Luschny, Nov 26 2021
  • Mathematica
    T[0, 0] = 1; T[n_, k_] := 2^(n-k-1)*n!*Hypergeometric2F1[ -k, -k, -n, -1 ] / (k!*(n-k)!); Flatten[ Table[ T[n, k], {n, 0, 9}, {k, 0, n}]] (* Jean-François Alcover, Feb 01 2012, after Robert Israel *)
  • SageMath
    def T(n,k): # T = A059576
        if (k==0 or k==n): return 1 if (n==0) else 2^(n-1) # A011782
        else: return 2*T(n-1, k-1) + 2*T(n-1, k) - (2 - 0^(n-2))*T(n-2, k-1)
    flatten([[T(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Sep 02 2022

Formula

T(n, n-1) = A001792(n-1).
T(2*n, n) = A052141(n).
Sum_{k=0..n} T(n, k) = A003480(n).
G.f.: U(z, w) = Sum_{n >= 0, k >= 0} U(n, k)*z^n*w^k = Sum{n >= 0, k >= 0} T(n, k)*z^(n-k)*w^k = (1-z)*(1-w)/(1 - 2*w - 2*z + 2*z*w).
Maple code gives another explicit formula for U(n, k).
From Jon Stadler (jstadler(AT)capital.edu), Apr 30 2003: (Start)
U(n,k) is the number of ways of writing the vector (n,k) as an ordered sum of vectors, equivalently, the number of paths from (0,0) to (n,k) in which steps may be taken from (i,j) to (p,q) provided (p,q) is to the right or above (i,j).
2*U(n,k) = Sum_{i <= n, j <= k} U(i,j).
U(n,k) = 2*U(n-1,k) + Sum_{i < k} U(n,i).
U(n,k) = Sum_{j=0..n+k} C(n,j-k+1)*C(k,j-n+1)*2^j. (End)
T(n, k) = 2*(T(n-1, k-1) + T(n-1, k)) - (2 - 0^(n-2))*T(n-2, k-1) for n > 1 and 1 < k < n; T(n, 0) = T(n, n) = 2*T(n-1, 0) for n > 0; and T(0, 0) = 1. - Reinhard Zumkeller, Dec 03 2004
From Emeric Deutsch, Oct 12 2010: (Start)
Sum_{k=0..n} k*T(n,k) = A181292(n).
T(n,k) = Sum_{j=0..min(k, n-k)} (-1)^j*2^(n-j-1)*binomial(k, j)*binomial(n-j, k) for (n,k) != (0,0).
G.f.: G(t,z) = (1-z)*(1-t*z)/(1 - 2*z - 2*t*z + 2*t*z^2). (End)
U(n,k) = 0 if k < 0; else U(k,n) if k > n; else 1 if n <= 1; else 3 if n = 2 and k = 1; else 2*U(n,k-1) + 2*U(n-1,k) - 2*U(n-1,k-1). - David W. Wilson; corrected in the case k > n by Robert Israel, Jun 15 2011 [Corrected by Petros Hadjicostas, Jul 16 2020]
U(n,k) = binomial(n,k) * 2^(n-1) * hypergeom([-k,-k], [n+1-k], 2) if n >= k >= 0 with (n,k) <> (0,0). - Robert Israel, Jun 15 2011 [Corrected by Petros Hadjicostas, Jul 16 2020]
U(n,k) = Sum_{0 <= i+j <= n+k-1} (-1)^j*C(i+j+1, j)*C(n+i, n)*C(k+i, k). - Masato Maruoka, Dec 10 2019
T(n, k) = 2^(n - 1)*binomial(n, k)*hypergeom([-k, k - n], [-n], 1/2) = A059474(n, k)/2 for n >= 1. - Peter Luschny, Nov 26 2021
From G. C. Greubel, Sep 02 2022: (Start)
T(n, n-k) = T(n, k).
T(n, 0) = T(n, n) = A011782(n).
T(n, n-2) = 2*A049611(n-1), n >= 2.
T(n, n-3) = 4*A049612(n-2), n >= 3.
T(n, n-4) = 8*A055589(n-3), n >= 4.
T(n, n-5) = 16*A055852(n-4), n >= 5.
T(n, n-6) = 32*A055853(n-5), n >= 6.
Sum_{k=0..floor(n/2)} T(n, k) = A181306(n). (End)

A224791 Triangle T(n,k) read by rows: left edge is 0, 1, 2, ... (cf. A001477); otherwise each entry is sum of entry to left and entries immediately above it to left and right, with 1 for the missing right term at right edge.

Original entry on oeis.org

0, 1, 2, 2, 5, 8, 3, 10, 23, 32, 4, 17, 50, 105, 138, 5, 26, 93, 248, 491, 630, 6, 37, 156, 497, 1236, 2357, 2988, 7, 50, 243, 896, 2629, 6222, 11567, 14556, 8, 65, 358, 1497, 5022, 13873, 31662, 57785, 72342, 9, 82, 505, 2360, 8879, 27774, 73309, 162756
Offset: 0

Views

Author

Reinhard Zumkeller, Apr 18 2013

Keywords

Examples

			Triangle begins:
  0;
  1,  2;
  2,  5,  8;
  3, 10, 23,  32;
  4, 17, 50, 105, 138;
		

Crossrefs

Programs

  • Haskell
    a224791 n k = a224791_tabl !! n !! k
    a224791_row n = a224791_tabl !! n
    a224791_tabl = iterate
       (\row -> scanl1 (+) $ zipWith (+) ([1] ++ row) (row ++ [1])) [0]
    
  • Maple
    T:= proc(n, k) option remember;
          if k=0 then n
        elif k=n then T(n,n-1) + T(n-1,n-1) + 1
        else T(n,k-1) + T(n-1,k-1) + T(n-1, k)
          fi
        end:
    seq(seq(T(n, k), k=0..n), n=0..12); # G. C. Greubel, Nov 12 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, n, If[k==n , T[n, n-1] + T[n-1, n-1] + 1, T[n, k-1] + T[n-1, k-1] + T[n-1, k]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 12 2019 *)
  • PARI
    T(n,k) = if(k==0, n, if(k==n, T(n,n-1) + T(n-1,n-1) + 1, T(n,k-1) + T(n-1,k-1) + T(n-1, k) )); \\ G. C. Greubel, Nov 12 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==0): return n
        elif (k==n): return T(n,n-1) + T(n-1,n-1) + 1
        else: return T(n,k-1) + T(n-1,k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 12 2019

Formula

T(n,0) = n, T(n+1,k) = T(n+1,k-1) + T(n,k-1) + T(n,k) (0 < k <= n) and T(n+1,n+1) = T(n+1,n) + T(n,n) + 1.
Showing 1-7 of 7 results.