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.

A288108 Number T(n,k) of Dyck paths of semilength n such that each level has exactly k peaks or no peaks; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 3, 1, 1, 0, 5, 2, 1, 1, 0, 13, 5, 3, 1, 1, 0, 31, 15, 4, 4, 1, 1, 0, 71, 27, 10, 7, 5, 1, 1, 0, 181, 76, 36, 11, 11, 6, 1, 1, 0, 447, 196, 83, 22, 19, 16, 7, 1, 1, 0, 1111, 548, 225, 81, 32, 31, 22, 8, 1, 1, 0, 2799, 1388, 573, 235, 60, 56, 48, 29, 9, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 05 2017

Keywords

Comments

T(n,k) is defined for all n,k >= 0. The triangle contains only the terms for k<=n. T(0,k) = 1 and T(n,k) = 0 if k > n > 0.

Examples

			. T(5,2) = 5:                                        /\/\
.                                       /\  /\      /    \
.      /\/\      /\/\      /\/\        /  \/  \    /      \
. /\/\/    \  /\/    \/\  /    \/\/\  /        \  /        \ .
.
. T(5,3) = 3:
.                                       /\/\/\
.              /\  /\/\    /\/\  /\    /      \
.             /  \/    \  /    \/  \  /        \ .
.
Triangle T(n,k) begins:
  1;
  0,   1;
  0,   1,  1;
  0,   3,  1,  1;
  0,   5,  2,  1,  1;
  0,  13,  5,  3,  1,  1;
  0,  31, 15,  4,  4,  1, 1;
  0,  71, 27, 10,  7,  5, 1, 1;
  0, 181, 76, 36, 11, 11, 6, 1, 1;
		

Crossrefs

Row sums give A288109.
T(2n,n) gives A156043.

Programs

  • Maple
    b:= proc(n, k, j) option remember; `if`(n=j, 1, add(
          b(n-j, k, i)*(binomial(j-1, i-1)+binomial(i, k)
           *binomial(j-1, i-1-k)), i=1..min(j+k, n-j)))
        end:
    T:= (n, k)-> b(n, k$2):
    seq(seq(T(n, k), k=0..n), n=0..14);
  • Mathematica
    b[n_, k_, j_] := b[n, k, j] = If[n == j, 1, Sum[b[n - j, k, i]*(Binomial[j - 1, i - 1] + Binomial[i, k]*Binomial[j - 1, i - 1 - k]), {i, 1, Min[j + k, n - j]}]];
    T[n_, k_] := b[n, k, k];
    Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)

A287846 Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has exactly one peak.

Original entry on oeis.org

1, 1, 0, 2, 0, 4, 6, 8, 24, 52, 96, 212, 504, 1072, 2352, 5288, 11928, 26800, 60336, 136304, 308928, 701248, 1593120, 3622016, 8245008, 18787360, 42836928, 97724384, 223052784, 509338816, 1163512032, 2658731648, 6077117376, 13893874624, 31771515648
Offset: 0

Views

Author

Alois P. Heinz, Jun 01 2017

Keywords

Comments

All terms with n > 1 are even.

Examples

			. a(1) = 1:    /\  .
.
. a(3) = 2:     /\       /\
.            /\/  \     /  \/\  .
.
. a(5) = 4:
.                /\       /\         /\       /\
.             /\/  \     /  \/\   /\/  \     /  \/\
.          /\/      \ /\/      \ /      \/\ /      \/\ .
		

Crossrefs

Programs

  • Maple
    b:= proc(n, j) option remember; `if`(n=j or n=0, 1, add(
           b(n-j, i)*binomial(j-1, i-2)*i, i=1..min(j+2, n-j)))
        end:
    a:= n-> b(n, 1):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, j_] := b[n, j] = If[n == j || n == 0, 1, Sum[b[n - j, i]*Binomial[j - 1, i - 2]*i, {i, 1, Min[j + 2, n - j]}]];
    a[n_] := b[n, 1];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, May 23 2018, translated from Maple *)

A287845 Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has exactly two peaks.

Original entry on oeis.org

1, 0, 1, 0, 0, 3, 6, 0, 9, 54, 138, 207, 360, 1368, 4545, 11304, 25182, 61605, 173916, 498798, 1347417, 3497328, 9147060, 24630669, 67414590, 184065966, 498495303, 1345622436, 3642036804, 9900361107, 26982011250, 73570082760, 200540053395, 546660151722
Offset: 0

Views

Author

Alois P. Heinz, Jun 01 2017

Keywords

Examples

			. a(2) = 1:   /\/\  .
.
. a(5) = 3:
.
.               /\/\     /\/\     /\/\
.          /\/\/    \ /\/    \/\ /    \/\/\ .
		

Crossrefs

Programs

  • Maple
    b:= proc(n, j) option remember;
          `if`(n=j or n=0, 1, add(b(n-j, i)*i*(i-1)/2
           *binomial(j-1, i-3), i=3..min(j+2, n-j)))
        end:
    a:= n-> b(n, 2):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, j_] := b[n, j] = If[n == j || n == 0, 1, Sum[b[n - j, i]*i*(i - 1)/2* Binomial[j - 1, i - 3], {i, 3, Min[j + 2, n - j]}]];
    a[n_] := b[n, 2];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, May 25 2018, translated from Maple *)

A287963 Number of Dyck paths of semilength n such that each positive level up to the highest nonempty level has one or two peaks.

Original entry on oeis.org

1, 1, 1, 2, 5, 10, 28, 71, 194, 532, 1495, 4256, 12176, 35251, 102664, 300260, 881909, 2599948, 7688164, 22788527, 67676144, 201308938, 599676445, 1788564038, 5339905904, 15956230705, 47713265536, 142763240666, 427390085963, 1280058256294, 3835332884686
Offset: 0

Views

Author

Alois P. Heinz, Jun 03 2017

Keywords

Examples

			. a(3) = 2:     /\      /\
.            /\/  \    /  \/\  .
.
. a(4) = 5:      /\      /\        /\/\    /\        /\/\
.           /\/\/  \  /\/  \/\  /\/    \  /  \/\/\  /    \/\ .
		

Crossrefs

Programs

  • Maple
    b:= proc(n, j) option remember; `if`(n=j, 1, add(
           b(n-j, i)*i*(binomial(j-1, i-2) +(i-1)/2*
           binomial(j-1, i-3)), i=2..min(j+3, n-j)))
        end:
    a:= n-> `if`(n=0, 1, b(n, 1)+b(n, 2)):
    seq(a(n), n=0..35);
  • Mathematica
    b[n_, j_] := b[n, j] = If[n == j, 1, Sum[b[n - j, i]*i*(Binomial[j - 1, i - 2] + (i - 1)/2*Binomial[j - 1, i - 3]), {i, 2, Min[j + 3, n - j]}]];
    a[n_] := If[n == 0, 1, b[n, 1] + b[n, 2]];
    Table[a[n], {n, 0, 35}] (* Jean-François Alcover, May 29 2018, from Maple *)
Showing 1-4 of 4 results.