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

A114277 Sum of the lengths of the second ascents in all Dyck paths of semilength n+2.

Original entry on oeis.org

1, 5, 19, 67, 232, 804, 2806, 9878, 35072, 125512, 452388, 1641028, 5986993, 21954973, 80884423, 299233543, 1111219333, 4140813373, 15478839553, 58028869153, 218123355523, 821908275547, 3104046382351, 11747506651599
Offset: 0

Views

Author

Emeric Deutsch, Nov 20 2005

Keywords

Comments

Also number of Dyck paths of semilength n+4 having length of second ascent equal to three. Example: a(1)=5 because we have UD(UUU)DUDDD, UD(UUU)DDUDD, UD(UUU)DDDUD, UUD(UUU)DDDD and UUDD(UUU)DDD (second ascents shown between parentheses). Partial sums of A002057. Column 3 of A114276. a(n)=absolute value of A104496(n+3).
Also number of Dyck paths of semilength n+3 that do not start with a pyramid (a pyramid in a Dyck path is a factor of the form U^j D^j (j>0), starting at the x-axis; here U=(1,1) and D=(1,-1); this definition differs from the one in A091866). Equivalently, a(n)=A127156(n+3,0). Example: a(1)=5 because we have UUDUDDUD, UUDUDUDD, UUUDUDDD, UUDUUDDD and UUUDDUDD. - Emeric Deutsch, Feb 27 2007

Examples

			a(3)=5 because the total length of the second ascents in UD(U)DUD, UD(UU)DD, UUDD(U)D, UUD(U)DD and UUUDDD (shown between parentheses) is 5.
		

Crossrefs

Cf. A014137 (n=1), A014138 (n=2), A001453 (n=3), this sequence (n=4), A143955 (n=5), A323224 (array).

Programs

  • Maple
    a:=n->4*sum(binomial(2*j+3,j)/(j+4),j=0..n): seq(a(n),n=0..28);
  • Mathematica
    Table[4*Sum[Binomial[2j+3,j]/(j+4),{j,0,n}],{n,0,20}] (* Vaclav Kotesovec, Oct 19 2012 *)
  • Python
    from functools import cache
    @cache
    def B(n, k):
        if n <= 0 or k <= 0: return 0
        if n == k: return 1
        return B(n - 1, k) + B(n, k - 1)
    def A114277(n): return B(n + 5, n + 1)
    print([A114277(n) for n in range(24)]) # Peter Luschny, May 16 2022

Formula

a(n) = 4*Sum_{j=0..n} binomial(2*j+3, j)/(j+4).
G.f.: C^4/(1-z), where C=(1-sqrt(1-4*z))/(2*z) is the Catalan function.
a(n) = c(n+3) - (c(0) + c(1) + ... + c(n+2)), where c(k)=binomial(2k,k)/(k+1) is a Catalan number (A000108). - Emeric Deutsch, Feb 27 2007
D-finite with recurrence: n*(n+4)*a(n) = (5*n^2 + 14*n + 6)*a(n-1) - 2*(n+1)*(2*n+3)*a(n-2). - Vaclav Kotesovec, Oct 19 2012
a(n) ~ 2^(2*n+7)/(3*sqrt(Pi)*n^(3/2)). - Vaclav Kotesovec, Oct 19 2012
a(n) = exp((2*i*Pi)/3)-4*binomial(2*n+5,n+1)*hypergeom([1,3+n,n+7/2],[n+2,n+6],4)/ (n+5). - Peter Luschny, Feb 26 2017
a(n-1) = Sum_{i+j+k+lA000108 Catalan number. - Yuchun Ji, Jan 10 2019

Extensions

More terms from Emeric Deutsch, Feb 27 2007

A323224 A(n, k) = [x^k] C^n*x/(1 - x) where C = 2/(1 + sqrt(1 - 4*x)), square array read by ascending antidiagonals with n >= 0 and k >= 0.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 4, 1, 0, 1, 4, 8, 9, 1, 0, 1, 5, 13, 22, 23, 1, 0, 1, 6, 19, 41, 64, 65, 1, 0, 1, 7, 26, 67, 131, 196, 197, 1, 0, 1, 8, 34, 101, 232, 428, 625, 626, 1, 0, 1, 9, 43, 144, 376, 804, 1429, 2055, 2056, 1
Offset: 0

Views

Author

Peter Luschny, Jan 24 2019

Keywords

Comments

Equals A096465 when the leading column (k = 0) is removed. - Georg Fischer, Jul 26 2023

Examples

			The square array starts:
   [n\k]  0  1   2   3    4     5     6      7       8       9
    ---------------------------------------------------------------
    [0]   0, 1,  1,  1,   1,    1,    1,     1,      1,      1, ... A057427
    [1]   0, 1,  2,  4,   9,   23,   65,   197,    626,   2056, ... A014137
    [2]   0, 1,  3,  8,  22,   64,  196,   625,   2055,   6917, ... A014138
    [3]   0, 1,  4, 13,  41,  131,  428,  1429,   4861,  16795, ... A001453
    [4]   0, 1,  5, 19,  67,  232,  804,  2806,   9878,  35072, ... A114277
    [5]   0, 1,  6, 26, 101,  376, 1377,  5017,  18277,  66727, ... A143955
    [6]   0, 1,  7, 34, 144,  573, 2211,  8399,  31655, 118865, ...
    [7]   0, 1,  8, 43, 197,  834, 3382, 13378,  52138, 201364, ...
    [8]   0, 1,  9, 53, 261, 1171, 4979, 20483,  82499, 327656, ...
    [9]   0, 1, 10, 64, 337, 1597, 7105, 30361, 126292, 515659, ...
.
Triangle given by ascending antidiagonals:
    0;
    0, 1;
    0, 1, 1;
    0, 1, 2,  1;
    0, 1, 3,  4,   1;
    0, 1, 4,  8,   9,   1;
    0, 1, 5, 13,  22,  23,   1;
    0, 1, 6, 19,  41,  64,  65,   1;
    0, 1, 7, 26,  67, 131, 196, 197,   1;
    0, 1, 8, 34, 101, 232, 428, 625, 626, 1;
.
The difference table of a column successively gives the preceding columns, here starting with column 6.
col(6) = 1, 65, 196, 428, 804, 1377, 2211, 3382, 4979, 7105, ...
col(5) =    64, 131, 232, 376,  573,  834, 1171, 1597, 2126, ...
col(4) =         67, 101, 144,  197,  261,  337,  426,  529, ...
col(3) =              34,  43,   53,   64,   76,   89,  103, ...
col(2) =                    9,   10,   11,   12,   13,   14, ...
col(1) =                          1,    1,    1,    1,    1, ...
col(0) =                                0,    0,    0,    0, ...
.
Example for the sum formula: C(0) = 1, C(1) = 1, C(2) = 2 and C(3) = 5.
X(3, 4) = {{0,0,0}, {0,0,1}, {0,1,0}, {1,0,0}, {0,0,2}, {0,1,1}, {0,2,0}, {1,0,1},
{1,1,0}, {2,0,0}, {0,0,3}, {0,1,2}, {0,2,1}, {0,3,0}, {1,0,2}, {1,1,1}, {1,2,0},
{2,0,1}, {2,1,0}, {3,0,0}}. T(3,4) = 1+1+1+1+2+1+2+1+1+2+5+2+2+5+2+1+2+2+2+5 = 41.
		

Crossrefs

The coefficients of the polynomials generating the columns are in A323233.
Sums of antidiagonals and row 1 are A014137. Main diagonal is A242798.
Rows: A057427 (n=0), A014137 (n=1), A014138 (n=2), A001453 (n=3), A114277 (n=4), A143955 (n=5).
Columns: A000027 (k=2), A034856 (k=3), A323221 (k=4), A323220 (k=5).
Similar array based on central binomials is A323222.
Cf. A096465.

Programs

  • Maple
    Row := proc(n, len) local C, ogf, ser; C := (1-sqrt(1-4*x))/(2*x);
    ogf := C^n*x/(1-x); ser := series(ogf, x, (n+1)*len+1);
    seq(coeff(ser, x, j), j=0..len) end:
    for n from 0 to 9 do Row(n, 9) od;
    # Alternatively by recurrence:
    B := proc(n, k) option remember; if n <= 0 or k < 0 then 0
    elif n = k then 1 else B(n-1, k) + B(n, k-1) fi end:
    A := (n, k) -> B(n + k, k): seq(lprint(seq(A(n, k), k=0..9)), n=0..9);
  • Mathematica
    (* Illustrating the sum formula, not efficient. *) T[0, K_] := Boole[K != 0];
    T[N_, K_] := Module[{}, r[n_, k_] := FrobeniusSolve[ConstantArray[1, n], k];
    X[n_] := Flatten[Table[r[N, j], {j, 0, n - 1}], 1];
    Sum[Product[CatalanNumber[m[[i]]], {i, 1, N}], {m , X[K]}]];
    Trow[n_] := Table[T[n, k], {k, 0, 9}]; Table[Trow[n], {n, 0, 9}]

Formula

For n>0 and k>0 let X(n, k) denote the set of all tuples of length n with elements from {0, ..., k-1} with sum < k. Let C(m) denote the m-th Catalan number. Then: A(n, k) = Sum_{(j1,...,jn) in X(n, k)} C(j1)*C(j2)*...*C(jn).
A(n, k) = T(n + k, k) with T(n, k) = T(n-1, k) + T(n, k-1) with T(n, k) = 0 if n <= 0 or k < 0 and T(n, n) = 1.

A283054 Triangle read by rows: T(n,k) = T(n,k-1) + T(n-1,k), T(n,0)=1, T(n,n) = T(n,n-1) + 1.

Original entry on oeis.org

1, 1, 2, 1, 3, 4, 1, 4, 8, 9, 1, 5, 13, 22, 23, 1, 6, 19, 41, 64, 65, 1, 7, 26, 67, 131, 196, 197, 1, 8, 34, 101, 232, 428, 625, 626, 1, 9, 43, 144, 376, 804, 1429, 2055, 2056, 1, 10, 53, 197, 573, 1377, 2806, 4861, 6917, 6918, 1, 11, 64, 261, 834, 2211, 5017, 9878, 16795, 23713, 23714, 1, 12, 76, 337, 1171, 3382, 8399, 18277, 35072, 58785, 82499, 82500
Offset: 0

Views

Author

Ely Golden, Feb 27 2017

Keywords

Comments

The left diagonals form polynomial sequences. This is due to the observation that diagonal 0 D_0(x) = 1, and D_n(x) = D_n(x-1)+D_(n-1)(x+1), with D_n(-1) = 1 which is a recurrence that can be solved.
These polynomials begin 1, x+2, (x(x+7)+8)/2, (x(x(x+15)+62)+54)/6, (x(x(x(x+26)+227)+730)+552)/24, etc., the first 3 of which correspond to A000012(n), A000027(n+2), and A034856(n+2), respectively.
The rightmost diagonal appears to follow A014137(n). The second rightmost appears to follow A014138(n+1), the third appears to follow A001453(n+2), the fourth appears to follow A114277(n), and the fifth appears to follow A143955(n+3).
A closed-form formula for T(n,k) would be very desirable.

Examples

			First 7 rows:
  1;
  1,   2;
  1,   3,   4;
  1,   4,   8,   9;
  1,   5,  13,  22,  23;
  1,   6,  19,  41,  64,  65;
  1,   7,  26,  67, 131, 196, 197;
		

Programs

  • Mathematica
    T[0, 0] = 1; T[n_, k_] := T[n, k] = Which[k == 0, 1, k == n, T[n, n - 1] + 1, True, T[n, k - 1] + T[n - 1, k]]; Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Michael De Vlieger, Feb 27 2017 *)
  • PARI
    T(n,k)=if(k==0,return(1));if(k==n,return(T(n,n-1)+1));T(n,k-1)+T(n-1,k)
    for(n=0,10,for(k=0,n,print1(T(n,k),", "))) \\ Derek Orr, Feb 28 2017
  • SageMath
    def sideTriangleAt(a,b):
        if(b==0): return 1
        elif(b==a): return sideTriangleAt(a,b-1)+1
        else: return sideTriangleAt(a,b-1)+sideTriangleAt(a-1,b)
    def sideTriangle(size):
        li=[]
        for c in range(size):
            for d in range(c+1):
                if(d==0): li.append([1])
                elif(d==c): li[c].append(li[c][d-1]+1)
                else: li[c].append(li[c][d-1]+li[c-1][d])
        return li
    trig=sideTriangle(125)
    for c in range(len(trig)):
        print(str(trig[c])[1:-1].replace(",",""))
    

A373744 Triangle read by rows: the almost-Riordan array ( 1/(1-x) | 2/((1-x)*(1+sqrt(1-4*x))), (1-2*x-sqrt(1-4*x))/(2*x) ).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 9, 13, 6, 1, 1, 23, 41, 26, 8, 1, 1, 65, 131, 101, 43, 10, 1, 1, 197, 428, 376, 197, 64, 12, 1, 1, 626, 1429, 1377, 834, 337, 89, 14, 1, 1, 2056, 4861, 5017, 3382, 1597, 529, 118, 16, 1, 1, 6918, 16795, 18277, 13378, 7105, 2773, 781, 151, 18, 1
Offset: 0

Views

Author

Stefano Spezia, Jun 16 2024

Keywords

Examples

			The triangle begins as:
  1;
  1,   1;
  1,   2,   1;
  1,   4,   4,   1;
  1,   9,  13,   6,   1;
  1,  23,  41,  26,   8,  1;
  1,  65, 131, 101,  43, 10,  1;
  1, 197, 428, 376, 197, 64, 12, 1;
  ...
		

Crossrefs

Cf. A000012 (k=0 and n=k), A001453 (k=2), A004275 (subdiagonal), A014137, A091823, A143955 (k=3).

Programs

  • Mathematica
    T[n_, 0]:=1; T[n_, k_]:=SeriesCoefficient[2/((1-x)(1+Sqrt[1-4x]))((1-2x-Sqrt[1-4x])/(2x))^(k-1), {x, 0, n-1}]; Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten

Formula

T(n,1) = A014137(n-1).
T(n,n-2) = A091823(n-1) for n > 2.
Showing 1-4 of 4 results.