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-10 of 12 results. Next

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.

A287216 Number A(n,k) of set partitions of [n] such that all absolute differences between least elements of consecutive blocks are <= k; 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, 4, 1, 1, 1, 2, 5, 9, 1, 1, 1, 2, 5, 14, 23, 1, 1, 1, 2, 5, 15, 44, 66, 1, 1, 1, 2, 5, 15, 51, 152, 210, 1, 1, 1, 2, 5, 15, 52, 191, 571, 733, 1, 1, 1, 2, 5, 15, 52, 202, 780, 2317, 2781, 1, 1, 1, 2, 5, 15, 52, 203, 857, 3440, 10096, 11378, 1
Offset: 0

Views

Author

Alois P. Heinz, May 21 2017

Keywords

Examples

			A(4,0) = 1: 1234.
A(4,1) = 9: 1234, 134|2, 13|24, 14|23, 1|234, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
A(4,2) = 14: 1234, 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 14|23, 1|234, 1|23|4, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
A(5,1) = 23: 12345, 1345|2, 134|25, 135|24, 13|245, 145|23, 14|235, 15|234, 1|2345, 145|2|3, 14|25|3, 14|2|35, 15|24|3, 1|245|3, 1|24|35, 15|2|34, 1|25|34, 1|2|345, 15|2|3|4, 1|25|3|4, 1|2|35|4, 1|2|3|45, 1|2|3|4|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,   4,   5,   5,   5,   5,   5,   5, ...
  1,   9,  14,  15,  15,  15,  15,  15, ...
  1,  23,  44,  51,  52,  52,  52,  52, ...
  1,  66, 152, 191, 202, 203, 203, 203, ...
  1, 210, 571, 780, 857, 876, 877, 877, ...
		

Crossrefs

Columns k=0-10 give: A000012, A026898(n-1) for n>0, A287252, A287253, A287254, A287255, A287256, A287257, A287258, A287259, A287260.
Main diagonal gives A000110.

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):
    seq(seq(A(n, d-n), n=0..d), d=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];
    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} A287215(n,j).

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).

A287417 Number A(n,k) of set partitions of [n] such that all absolute differences between least elements of consecutive blocks and between consecutive elements within the blocks are not larger than k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 2, 0, 1, 1, 2, 3, 0, 1, 1, 2, 5, 4, 0, 1, 1, 2, 5, 12, 5, 0, 1, 1, 2, 5, 15, 27, 6, 0, 1, 1, 2, 5, 15, 46, 58, 7, 0, 1, 1, 2, 5, 15, 52, 139, 121, 8, 0, 1, 1, 2, 5, 15, 52, 187, 410, 248, 9, 0, 1, 1, 2, 5, 15, 52, 203, 677, 1189, 503, 10, 0
Offset: 0

Views

Author

Alois P. Heinz, May 24 2017

Keywords

Examples

			A(5,3) = 46 = 52 - 6 = A000110(5) - 6 counts all set partitions of [5] except: 1234|5, 15|234, 15|23|4, 15|24|3, 15|2|34, 15|2|3|4.
Square array A(n,k) begins:
  1, 1,   1,   1,   1,   1,   1,   1, ...
  1, 1,   1,   1,   1,   1,   1,   1, ...
  0, 2,   2,   2,   2,   2,   2,   2, ...
  0, 3,   5,   5,   5,   5,   5,   5, ...
  0, 4,  12,  15,  15,  15,  15,  15, ...
  0, 5,  27,  46,  52,  52,  52,  52, ...
  0, 6,  58, 139, 187, 203, 203, 203, ...
  0, 7, 121, 410, 677, 824, 877, 877, ...
		

Crossrefs

Main diagonal gives 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):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • 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];
    Table[A[n, d - n], {d, 0, 14}, { n, 0, d}] // Flatten (* Jean-François Alcover, May 24 2018, translated from Maple *)

Formula

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

A287275 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= three.

Original entry on oeis.org

1, 1, 2, 5, 15, 47, 150, 481, 1545, 4965, 15958, 51293, 164871, 529947, 1703418, 5475329, 17599457, 56570281, 181834970, 584475733, 1878691887, 6038716423, 19410365422, 62391120801, 200545011401, 644615789581, 2072001259342, 6660074556205, 21407609138375
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Examples

			a(5) = 47 = 52 - 5 = A000110(5) - 5 counts all set partitions of [5] except: 15|234, 15|23|4, 15|24|3, 15|2|34, 15|2|3|4.
		

Crossrefs

Column k=3 of A287214.
Cf. A000110.

Formula

G.f.: -(x^3-3*x+1)/((x-1)*(x^3-x^2-3*x+1)).
a(n) = A287214(n,3).
a(n) = A000110(n) for n <= 4.

A287276 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= four.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 188, 696, 2606, 9800, 36931, 139303, 525658, 1983925, 7488281, 28265353, 106692425, 402731694, 1520195297, 5738304135, 21660476556, 81762200416, 308629323572, 1164989004846, 4397506361848, 16599351862867, 62657893108843, 236515956134402
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Examples

			a(6) = 188 = 203 - 15 = A000110(6) - 15 counts all set partitions of [6] except: 16|2345, 16|234|5, 16|235|4, 16|23|45, 16|23|4|5, 16|245|3, 16|24|35, 16|24|3|5, 16|25|34, 16|2|345, 16|2|34|5, 16|25|3|4, 16|2|35|4, 16|2|3|45, 16|2|3|4|5.
		

Crossrefs

Column k=4 of A287214.
Cf. A000110.

Programs

  • Mathematica
    LinearRecurrence[{5,-4,-1,-7,7,0,1,-1},{1,1,2,5,15,52,188,696},30] (* Harvey P. Dale, Jan 02 2021 *)

Formula

G.f.: -(x^7+x^5-6*x^4-x^2+4*x-1)/(x^8-x^7-7*x^5+7*x^4+x^3+4*x^2-5*x+1).
a(n) = A287214(n,4).
a(n) = A000110(n) for n <= 5.

A287277 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= five.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 825, 3442, 14589, 62361, 267663, 1151563, 4960725, 21384434, 92216247, 397743421, 1715713298, 7401353547, 31929410019, 137745628418, 594249218505, 2563666285385, 11060009097685, 47714467256725, 205847216392033, 888055467635514
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=5 of A287214.
Cf. A000110.

Programs

  • Mathematica
    CoefficientList[Series[-(x^15+x^14-x^13-12x^11-10x^10+17x^9+5x^8+20x^7+19x^6-31x^5- 4x^4- 3x^3-2x^2+5x-1)/((x^6+x^5-x^4-3x^2-x+1)(x^10-x^9-x^7-9x^6+10x^5+9x^4-7x^3+ 4x^2- 5x+1)),{x,0,30}],x] (* or *) LinearRecurrence[{6,-6,-4,-3,-28,54,16,-16,6,-30,-4,13,0,2,0,-1},{1,1,2,5,15,52,203,825,3442,14589,62361,267663,1151563,4960725,21384434,92216247},30] (* Harvey P. Dale, Jan 05 2024 *)

Formula

G.f.: -(x^15 +x^14 -x^13 -12*x^11 -10*x^10 +17*x^9 +5*x^8 +20*x^7 +19*x^6 -31*x^5 -4*x^4 -3*x^3 -2*x^2 +5*x-1) / ((x^6 +x^5 -x^4 -3*x^2 -x+1) * (x^10 -x^9 -x^7 -9*x^6 +10*x^5 +9*x^4 -7*x^3 +4*x^2 -5*x+1)).
a(n) = A287214(n,5).
a(n) = A000110(n) for n <= 6.

A287278 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= six.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 877, 3937, 18162, 85347, 405803, 1942918, 9339084, 45003444, 217201380, 1049271992, 5071767524, 24523356660, 118602078194, 573667951966, 2774998925735, 13424115897227, 64941326312858, 314169695256551, 1519889795069445, 7352969270282127
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=6 of A287214.
Cf. A000110.

Formula

G.f.: -(x^31 +2*x^30 +3*x^29 +4*x^28 +6*x^27 -24*x^26 -46*x^25 -60*x^24 -81*x^23 -129*x^22 +156*x^21 +265*x^20 +224*x^19 +350*x^18 +617*x^17 -425*x^16 -531*x^15 -161*x^14 -567*x^13 -806*x^12 +462*x^11 +401*x^10 +85*x^9 +198*x^8 +227*x^7 -185*x^6 -35*x^5 -4*x^4 -5*x^3 -4*x^2 +6*x-1) / (x^32 +x^31 +x^30 +x^29 +x^28 -32*x^27 -24*x^26 -15*x^25 -23*x^24 -23*x^23 +329*x^22 +141*x^21 -20*x^20 +164*x^19 +101*x^18 -1243*x^17 -175*x^16 +277*x^15 -495*x^14 +8*x^13 +1536*x^12 +17*x^11 -235*x^10 +121*x^9 -115*x^8 -447*x^7 +152*x^6 +32*x^5 +x^4 +5*x^3 +9*x^2 -7*x+1).
a(n) = A287214(n,6).
a(n) = A000110(n) for n <= 7.

A287279 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= seven.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 877, 4140, 20270, 102004, 523700, 2726840, 14332663, 75789343, 402290332, 2140945657, 11413941169, 60921661218, 325417158033, 1739114057259, 9297387238139, 49715367098205, 265879355474309, 1422070344597675, 7606514013820659
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=7 of A287214.
Cf. A000110.

Formula

G.f.: see link above.
a(n) = A287214(n,7).
a(n) = A000110(n) for n <= 8.

A287280 Number of set partitions of [n] such that for each block all absolute differences between consecutive elements are <= eight.

Original entry on oeis.org

1, 1, 2, 5, 15, 52, 203, 877, 4140, 21147, 111835, 607726, 3372147, 19006265, 108345829, 622553137, 3596571484, 20854506433, 121247283115, 706276123051, 4119684344466, 24052768332415, 140525287140277, 821384370939660, 4802655803213444, 28087804863005024
Offset: 0

Views

Author

Alois P. Heinz, May 22 2017

Keywords

Crossrefs

Column k=8 of A287214.
Cf. A000110.

Formula

G.f.: see link above.
a(n) = A287214(n,8).
a(n) = A000110(n) for n <= 9.
Showing 1-10 of 12 results. Next