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.

A218579 Triangle read by rows: T(n,k) is the number of ascent sequences of length n with last zero at position k-1.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 5, 2, 3, 5, 15, 5, 8, 10, 15, 53, 15, 26, 32, 38, 53, 217, 53, 99, 122, 142, 164, 217, 1014, 217, 433, 537, 619, 704, 797, 1014, 5335, 1014, 2143, 2683, 3069, 3464, 3876, 4321, 5335, 31240, 5335, 11854, 15015, 17063, 19140, 21294, 23522, 25905, 31240
Offset: 1

Views

Author

Joerg Arndt, Nov 03 2012

Keywords

Comments

Row sums are A022493.
First column and the diagonal is A022493(n-1).

Examples

			Triangle starts:
[ 1]      1;
[ 2]      1,    1;
[ 3]      2,    1,     2;
[ 4]      5,    2,     3,     5;
[ 5]     15,    5,     8,    10,    15;
[ 6]     53,   15,    26,    32,    38,    53;
[ 7]    217,   53,    99,   122,   142,   164,   217;
[ 8]   1014,  217,   433,   537,   619,   704,   797,  1014;
[ 9]   5335, 1014,  2143,  2683,  3069,  3464,  3876,  4321,  5335;
[10]  31240, 5335, 11854, 15015, 17063, 19140, 21294, 23522, 25905, 31240;
...
		

Crossrefs

Cf. A022493 (number of ascent sequences).
Cf. A218580 (ascent sequences with first occurrence of the maximal value at position k-1), A218581 (ascent sequences with last occurrence of the maximal value at position k-1).
Cf. A137251 (ascent sequences with k ascents), A218577 (ascent sequences with maximal element k), A175579 (ascent sequences with k zeros).

Programs

  • Maple
    b:= proc(n, i, t, k) option remember; `if`(n=0, 1,
          add(b(n-1, j, t+`if`(j>i, 1, 0), max(-1, k-1)),
                 j=`if`(k>=0, 0, 1)..`if`(k=0, 0, t+1)))
        end:
    T:= (n, k)-> b(n-1, 0, 0, k-2):
    seq(seq(T(n,k), k=1..n), n=1..10);  # Alois P. Heinz, Nov 16 2012
  • Mathematica
    b[n_, i_, t_, k_] := b[n, i, t, k] = If[n == 0, 1, Sum[b[n-1, j, t + If[j>i, 1, 0], Max[-1, k-1]], {j, If[k >= 0, 0, 1], If[k == 0, 0, t+1]}]]; T[n_, k_] := b[n-1, 0, 0, k-2]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Feb 18 2015, after Alois P. Heinz *)