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

A238121 Triangle read by rows: T(n,k) gives the number of ballot sequences of length n having exactly k descents, n>=0, 0<=k<=n.

Original entry on oeis.org

1, 1, 0, 2, 0, 0, 3, 1, 0, 0, 5, 5, 0, 0, 0, 7, 16, 3, 0, 0, 0, 11, 43, 21, 1, 0, 0, 0, 15, 99, 101, 17, 0, 0, 0, 0, 22, 215, 373, 145, 9, 0, 0, 0, 0, 30, 430, 1174, 836, 146, 4, 0, 0, 0, 0, 42, 834, 3337, 3846, 1324, 112, 1, 0, 0, 0, 0, 56, 1529, 8642, 15002, 8786, 1615, 66, 0, 0, 0, 0, 0, 77, 2765, 21148, 52132, 47013, 15403, 1582, 32, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 21 2014

Keywords

Comments

Also number of standard Young tableaux such that there are k pairs of cells (v,v+1) with v+1 lying in a row above v.
T(2n,n) gives A241804.
T(2n+1,n) gives A241805.
Row sums are A000085.
T(n*(n+1)/2,n*(n-1)/2) = 1.
A238122 is another version with zeros omitted.

Examples

			Triangle starts:
    1;
    1,    0;
    2,    0,     0;
    3,    1,     0,      0;
    5,    5,     0,      0,      0;
    7,   16,     3,      0,      0,      0;
   11,   43,    21,      1,      0,      0,     0;
   15,   99,   101,     17,      0,      0,     0,    0;
   22,  215,   373,    145,      9,      0,     0,    0,  0;
   30,  430,  1174,    836,    146,      4,     0,    0,  0, 0;
   42,  834,  3337,   3846,   1324,    112,     1,    0,  0, 0, 0;
   56, 1529,  8642,  15002,   8786,   1615,    66,    0,  0, 0, 0, 0;
   77, 2765, 21148,  52132,  47013,  15403,  1582,   32,  0, 0, 0, 0, 0;
  101, 4792, 48713, 164576, 214997, 112106, 21895, 1310, 14, 0, 0, 0, 0, 0;
  ...
The T(5,1) = 16 ballot sequences of length n=5 with k=1 descent are (dots for zeros):
01:  [ . . . 1 . ]
02:  [ . . 1 . . ]
03:  [ . . 1 . 1 ]
04:  [ . . 1 . 2 ]
05:  [ . . 1 1 . ]
06:  [ . . 1 2 . ]
07:  [ . . 1 2 1 ]
08:  [ . 1 . . . ]
09:  [ . 1 . . 1 ]
10:  [ . 1 . . 2 ]
11:  [ . 1 . 1 2 ]
12:  [ . 1 . 2 3 ]
13:  [ . 1 2 . . ]
14:  [ . 1 2 . 1 ]
15:  [ . 1 2 . 3 ]
16:  [ . 1 2 3 . ]
		

Programs

  • Maple
    b:= proc(n, v, l) option remember; `if`(n<1, 1, expand(
          add(`if`(i=1 or l[i-1]>l[i], `if`(i (p-> seq(coeff(p, x, i), i=0..n))(b(n-1, 1, [1])):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_, v_, l_] := b[n, v, l] = If[n<1, 1, Sum[If[i == 1 || l[[i-1]] > l[[i]], If[i l[[i]]+1]], 0], {i, 1, Length[l]}] + b[n-1, Length[l]+1, Append[l, 1]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, n}]][b[n-1, 1, {1}]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jan 06 2015, translated from Maple *)

A238122 Irregular triangle read by rows: T(n,k) gives the number of ballot sequences of length n having k descents, n>=0, 0<=k<=A083920(n-1).

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 5, 7, 16, 3, 11, 43, 21, 1, 15, 99, 101, 17, 22, 215, 373, 145, 9, 30, 430, 1174, 836, 146, 4, 42, 834, 3337, 3846, 1324, 112, 1, 56, 1529, 8642, 15002, 8786, 1615, 66, 77, 2765, 21148, 52132, 47013, 15403, 1582, 32, 101, 4792, 48713, 164576, 214997, 112106, 21895, 1310, 14
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 21 2014

Keywords

Comments

Same as A238121, with zeros omitted.
T(2n,n) gives A241804.
T(2n+1,n) gives A241805.
Row sums are A000085.
T(n*(n+1)/2,n*(n-1)/2) = 1.

Examples

			T(5,0) = 7: [1,1,1,1,1], [1,1,1,1,2], [1,1,1,2,2], [1,1,1,2,3], [1,1,2,2,3], [1,1,2,3,4], [1,2,3,4,5].
T(5,1) = 16: [1,1,1,2,1], [1,1,2,1,1], [1,1,2,1,2], [1,1,2,1,3], [1,1,2,2,1], [1,1,2,3,1], [1,1,2,3,2], [1,2,1,1,1], [1,2,1,1,2], [1,2,1,1,3], [1,2,1,2,3], [1,2,1,3,4], [1,2,3,1,1], [1,2,3,1,2], [1,2,3,1,4], [1,2,3,4,1].
T(5,2) = 3: [1,2,1,2,1], [1,2,1,3,1], [1,2,1,3,2].
Triangle starts:
00:   1;
01:   1;
02:   2;
03:   3,    1;
04:   5,    5;
05:   7,   16,      3;
06:  11,   43,     21,      1;
07:  15,   99,    101,     17;
08:  22,  215,    373,    145,      9;
09:  30,  430,   1174,    836,    146,      4;
10:  42,  834,   3337,   3846,   1324,    112,      1;
11:  56, 1529,   8642,  15002,   8786,   1615,     66;
12:  77, 2765,  21148,  52132,  47013,  15403,   1582,    32;
13: 101, 4792,  48713, 164576, 214997, 112106,  21895,  1310,  14;
14: 135, 8216, 108147, 484609, 874413, 672015, 215849, 26159, 932, 5;
...
		

Programs

  • Maple
    b:= proc(n, v, l) option remember; `if`(n<1, 1, expand(
          add(`if`(i=1 or l[i-1]>l[i], `if`(i(p->seq(coeff(p, x, i), i=0..degree(p)))(b(n-1, 1, [1])):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_, v_, l_List] := b[n, v, l] = If[n<1, 1, Expand[Sum[If[i == 1 || l[[i-1]] > l[[i]], If[i l[[i]]+1]], 0], {i, 1, Length[ l ]}] + b[n-1, Length[l]+1, Append[l, 1]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n-1, 1, {1}]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Maple *)
Showing 1-2 of 2 results.