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.

A287215 Number T(n,k) of set partitions of [n] such that the maximal absolute difference between the least elements of consecutive blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 8, 5, 1, 1, 22, 21, 7, 1, 1, 65, 86, 39, 11, 1, 1, 209, 361, 209, 77, 19, 1, 1, 732, 1584, 1123, 493, 171, 35, 1, 1, 2780, 7315, 6153, 3124, 1293, 413, 67, 1, 1, 11377, 35635, 34723, 20019, 9320, 3709, 1059, 131, 1, 1, 49863, 183080, 202852, 130916, 66992, 30396, 11373, 2837, 259, 1
Offset: 0

Views

Author

Alois P. Heinz, May 21 2017

Keywords

Comments

The maximal absolute difference is assumed to be zero if there are fewer than two blocks.
T(n,k) is defined for all n,k >= 0. The triangle contains only the positive terms. T(n,k) = 0 if k>=n and k>0.

Examples

			T(4,0) = 1: 1234.
T(4,1) = 8: 134|2, 13|24, 14|23, 1|234, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
T(4,2) = 5: 124|3, 12|34, 12|3|4, 13|2|4, 1|23|4.
T(4,3) = 1: 123|4.
Triangle T(n,k) begins:
  1;
  1;
  1,   1;
  1,   3,    1;
  1,   8,    5,    1;
  1,  22,   21,    7,   1;
  1,  65,   86,   39,  11,   1;
  1, 209,  361,  209,  77,  19,  1;
  1, 732, 1584, 1123, 493, 171, 35, 1;
		

Crossrefs

Row sums give A000110.
T(2n,n) gives A322884.

Programs

  • Maple
    b:= proc(n, k, m, l) option remember; `if`(n<1, 1,
         `if`(l-n>k, 0, b(n-1, k, m+1, n))+m*b(n-1, k, m, l))
        end:
    A:= (n, k)-> b(n-1, min(k, n-1), 1, n):
    T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
  • Mathematica
    b[n_, k_, m_, l_] := b[n, k, m, l] = If[n < 1, 1, If[l - n > k, 0, b[n - 1, k, m + 1, n]] + m*b[n - 1, k, m, l]];
    A[n_, k_] := b[n - 1, Min[k, n - 1], 1, n];
    T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[T[n, k], {n, 0, 12}, {k, 0, Max[n - 1, 0]}] // Flatten (* Jean-François Alcover, May 19 2018, after Alois P. Heinz *)

Formula

T(n,k) = A287216(n,k) - A287216(n,k-1) for k>0, T(n,0) = 1.

A287213 Number T(n,k) of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 7, 5, 2, 1, 15, 18, 13, 5, 1, 31, 57, 61, 38, 15, 1, 63, 169, 248, 215, 129, 52, 1, 127, 482, 935, 1061, 836, 495, 203, 1, 255, 1341, 3368, 4835, 4789, 3573, 2108, 877, 1, 511, 3669, 11777, 20973, 25430, 22986, 16657, 9831, 4140
Offset: 0

Views

Author

Alois P. Heinz, May 21 2017

Keywords

Comments

The maximal absolute difference is assumed to be zero if there is no block with consecutive elements.
T(n,k) is defined for all n,k >= 0. The triangle contains only the positive terms. T(n,k) = 0 if k>=n and k>0.

Examples

			T(4,0) = 1: 1|2|3|4.
T(4,1) = 7: 1234, 123|4, 12|34, 12|3|4, 1|234, 1|23|4, 1|2|34.
T(4,2) = 5: 124|3, 134|2, 13|24, 13|2|4, 1|24|3.
T(4,3) = 2: 14|23, 14|2|3.
Triangle T(n,k) begins:
  1;
  1;
  1,   1;
  1,   3,   1;
  1,   7,   5,   2;
  1,  15,  18,  13,    5;
  1,  31,  57,  61,   38,  15;
  1,  63, 169, 248,  215, 129,  52;
  1, 127, 482, 935, 1061, 836, 495, 203;
		

Crossrefs

Row sums and T(n+2,n+1) give A000110.
T(2n,n) gives A294024.

Programs

  • Maple
    b:= proc(n, k, l) option remember; `if`(n=0, 1, b(n-1, k, map(x->
          `if`(x-n>=k, [][], x), [l[], n]))+add(b(n-1, k, sort(map(x->
          `if`(x-n>=k, [][], x), subsop(j=n, l)))), j=1..nops(l)))
        end:
    A:= (n, k)-> b(n, min(k, n-1), []):
    T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
  • Mathematica
    b[0, , ] = 1; b[n_, k_, l_] := b[n, k, l] =b[n - 1, k, If[# - n >= k, Nothing, #]& /@ Append[l, n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]]], {j, 1, Length[l]}];
    A[n_, k_] := b[n, Min[k, n - 1], {}];
    T[n_, k_] :=  A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[Table[T[n, k], {k, 0, Max[n - 1, 0]}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

Formula

T(n,k) = A287214(n,k) - A287214(n,k-1) for k>0, T(n,0) = 1.

A287641 Number A(n,k) of set partitions of [n] such that j is member of block b only if b = 1 or at least one of j-1, ..., j-k is member of a block >= b-1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 5, 1, 1, 1, 2, 5, 14, 1, 1, 1, 2, 5, 15, 42, 1, 1, 1, 2, 5, 15, 51, 132, 1, 1, 1, 2, 5, 15, 52, 191, 429, 1, 1, 1, 2, 5, 15, 52, 202, 773, 1430, 1, 1, 1, 2, 5, 15, 52, 203, 861, 3336, 4862, 1, 1, 1, 2, 5, 15, 52, 203, 876, 3970, 15207, 16796, 1
Offset: 0

Views

Author

Alois P. Heinz, May 28 2017

Keywords

Examples

			A(5,0) = 1: 12345.
A(5,1) = 42 = 52 - 10 = A000110(5) - 10 counts all set partitions of [5] except: 124|3|5, 135|2|4, 13|25|4, 13|2|45, 13|2|4|5, 14|23|5, 14|2|35, 14|2|3|5, 1|24|3|5, 134|2|5.
A(5,2) = 51 = 52 - 1 = A000110(5) - 1 counts all set partitions of [5] except: 134|2|5.
Square array A(n,k) begins:
  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,   1,   1,   1,   1,   1,   1,   1, ...
  1,   2,   2,   2,   2,   2,   2,   2, ...
  1,   5,   5,   5,   5,   5,   5,   5, ...
  1,  14,  15,  15,  15,  15,  15,  15, ...
  1,  42,  51,  52,  52,  52,  52,  52, ...
  1, 132, 191, 202, 203, 203, 203, 203, ...
  1, 429, 773, 861, 876, 877, 877, 877, ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, 1, add(b(n-1,
          [seq(max(l[i], j), i=2..nops(l)), j]), j=1..l[1]+1))
        end:
    A:= (n, k)-> `if`(k=0, 1, b(n, [0$k])):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[0, ] = 1; b[n, l_List] := b[n, l] = Sum[b[n - 1, Append[ Table[ Max[ l[[i]], j], {i, 2, Length[l]}], j]], {j, 1, l[[1]] + 1}];
    A[n_, k_] := If[k == 0, 1, b[n, Table[0, k]]];
    Table[A[n, d - n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

Formula

A(n,k) = Sum_{j=0..k} A287640(n,j).

A287416 Number T(n,k) of set partitions of [n] such that the maximal value of all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks equals k; triangle T(n,k), n>=0, 0<=k<=max(n-1,0), read by rows.

Original entry on oeis.org

1, 1, 0, 2, 0, 3, 2, 0, 4, 8, 3, 0, 5, 22, 19, 6, 0, 6, 52, 81, 48, 16, 0, 7, 114, 289, 267, 147, 53, 0, 8, 240, 941, 1250, 968, 529, 204, 0, 9, 494, 2894, 5310, 5469, 3919, 2174, 878, 0, 10, 1004, 8601, 21256, 28083, 25326, 17593, 9961, 4141
Offset: 0

Views

Author

Alois P. Heinz, May 24 2017

Keywords

Comments

The maximal value is assumed to be zero if there are no consecutive blocks and no consecutive elements.
T(n,k) is defined for all n,k >= 0. The triangle contains only the terms for k <= max(n-1,0). T(n,k) = 0 if k>=n and k>0.

Examples

			T(4,1) = 4: 1234, 1|234, 1|2|34, 1|2|3|4.
T(4,2) = 8: 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 1|23|4, 1|24|3.
T(4,3) = 3: 123|4, 14|23, 14|2|3.
T(5,3) = 19: 1235|4, 123|45, 123|4|5, 125|34, 125|3|4, 134|25, 134|2|5, 13|24|5, 13|25|4, 145|23, 14|235, 14|23|5, 1|234|5, 145|2|3, 14|25|3, 14|2|35, 14|2|3|5, 1|25|34, 1|25|3|4.
Triangle T(n,k) begins:
  1;
  1;
  0, 2;
  0, 3,   2;
  0, 4,   8,   3;
  0, 5,  22,  19,    6;
  0, 6,  52,  81,   48,  16;
  0, 7, 114, 289,  267, 147,  53;
  0, 8, 240, 941, 1250, 968, 529, 204;
  ...
		

Crossrefs

Columns k=1-2 give: A001477 (for n>1), A005803 (for n>0).
Row sums give A000110.

Programs

  • Maple
    b:= proc(n, k, l, t) option remember; `if`(n<1, 1, `if`(t-n>k, 0,
           b(n-1, k, map(x-> `if`(x-n>=k, [][], x), [l[], n]), n)) +add(
           b(n-1, k, sort(map(x-> `if`(x-n>=k, [][], x), subsop(j=n, l))),
           `if`(t-n>k, infinity, t)), j=1..nops(l)))
        end:
    A:= (n, k)-> b(n, min(k, n-1), [], n):
    T:= (n, k)-> A(n, k)-`if`(k=0, 0, A(n, k-1)):
    seq(seq(T(n, k), k=0..max(n-1, 0)), n=0..12);
  • Mathematica
    b[n_, k_, l_, t_] := b[n, k, l, t] = If[n < 1, 1, If[t - n > k, 0, b[n - 1, k, If[# - n >= k, Nothing, #]& /@ Append[l, n], n]] + Sum[b[n - 1, k, Sort[If[# - n >= k, Nothing, #]& /@ ReplacePart[l, j -> n]], If[t - n > k, Infinity, t]], {j, 1, Length[l]}]];
    A[n_, k_] := b[n, Min[k, n - 1], {}, n];
    T[n_, k_] := A[n, k] - If[k == 0, 0, A[n, k - 1]];
    Table[T[n, k], {n, 0, 12}, { k, 0, Max[n - 1, 0]}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)

Formula

T(n,k) = A287417(n,k) - A287417(n,k-1) for k>0, T(n,0) = 1.
T(n+2,n+1) = 1 + A000110(n).
Showing 1-4 of 4 results.