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
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;
Columns k=0-10 give:
A000012,
A003101(n-1),
A322875,
A322876,
A322877,
A322878,
A322879,
A322880,
A322881,
A322882,
A322883.
-
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);
-
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 *)
A287214
Number A(n,k) of set partitions of [n] such that for each block all absolute differences between consecutive elements 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, 8, 1, 1, 1, 2, 5, 13, 16, 1, 1, 1, 2, 5, 15, 34, 32, 1, 1, 1, 2, 5, 15, 47, 89, 64, 1, 1, 1, 2, 5, 15, 52, 150, 233, 128, 1, 1, 1, 2, 5, 15, 52, 188, 481, 610, 256, 1, 1, 1, 2, 5, 15, 52, 203, 696, 1545, 1597, 512, 1
Offset: 0
A(4,0) = 1: 1|2|3|4.
A(4,1) = 8: 1234, 123|4, 12|34, 12|3|4, 1|234, 1|23|4, 1|2|34, 1|2|3|4.
A(4,2) = 13: 1234, 123|4, 124|3, 12|34, 12|3|4, 134|2, 13|24, 13|2|4, 1|234, 1|23|4, 1|24|3, 1|2|34, 1|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, ...
1, 2, 2, 2, 2, 2, 2, 2, ...
1, 4, 5, 5, 5, 5, 5, 5, ...
1, 8, 13, 15, 15, 15, 15, 15, ...
1, 16, 34, 47, 52, 52, 52, 52, ...
1, 32, 89, 150, 188, 203, 203, 203, ...
1, 64, 233, 481, 696, 825, 877, 877, ...
Columns k=0-10 give:
A000012,
A011782,
A001519,
A287275,
A287276,
A287277,
A287278,
A287279,
A287280,
A287281,
A287282.
-
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), []):
seq(seq(A(n, d-n), n=0..d), d=0..12);
-
b[0, , ] = 1; b[n_, k_, l_List] := 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], {}];
Table[A[n, d - n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)
A258109
Number of balanced parenthesis expressions of length 2n and depth 3.
Original entry on oeis.org
1, 5, 18, 57, 169, 482, 1341, 3669, 9922, 26609, 70929, 188226, 497845, 1313501, 3459042, 9096393, 23895673, 62721698, 164531565, 431397285, 1130708866, 2962826465, 7761964833, 20331456642, 53249182309, 139449644717, 365166860706, 956185155129, 2503657040137
Offset: 3
For n=4, the a(4) = 5 solutions are
/\ /\
/ \ \
LRLLLRRR /\/ \ \
................................
/\ |
/\/ \ / \
LLRLLRRR / \ \
................................
/\/\ |
/ \ |
LLLRLRRR / \ / \
................................
/\ |
/ \/\ / \
LLLRRLRR / \ /
................................
/\ /\
/ \ /
LLLRRRLR / \/\ /
- S. S. Skiena and M. A. Revilla, Programming Challenges: The Programming Contest Training Manual, Springer, 2006, page 140.
-
typedef long long unsigned Integer;
Integer a(int n)
{
int i;
Integer pow2 = 1, a[3] = {0};
for (i = 3; i <= n; ++i) {
a[ i%3 ] = pow2 + 3 * a[ (i-1)%3 ] - a[ (i-2)%3 ];
pow2 = pow2 * 2;
}
return a[ (i-1)%3 ];
}
-
I:=[1,5,18,57,169]; [n le 5 select I[n] else 5*Self(n-1) - 7*Self(n-2) + 2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Sep 26 2015
-
a:= proc(n) option remember; `if`(n<3, 0,
`if`(n=3, 1, 2^(n-3) +3*a(n-1) -a(n-2)))
end:
seq(a(n), n=3..30); # Alois P. Heinz, May 20 2015
-
Join[{1, 5}, LinearRecurrence[{5, -7, 2}, {18, 57, 169}, 30]] (* Vincenzo Librandi, Sep 26 2015 *)
-
Vec(-x^3/((2*x-1)*(x^2-3*x+1)) + O(x^100)) \\ Colin Barker, May 24 2015
-
a(n) = fibonacci(2*n-1) - 2^(n-1) \\ Gheorghe Coserea, Feb 04 2016
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
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;
...
-
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);
-
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 *)
A287640
Number T(n,k) of set partitions of [n], where k is minimal such that for all j in [n]: j is member of block b implies b = 1 or at least one of j-1, ..., j-k is member of a block >= b-1; triangle T(n,k), n >= 0, 0 <= k <= max(floor(n/2), n-2), read by rows.
Original entry on oeis.org
1, 1, 1, 1, 1, 4, 1, 13, 1, 1, 41, 9, 1, 1, 131, 59, 11, 1, 1, 428, 344, 88, 15, 1, 1, 1429, 1906, 634, 146, 23, 1, 1, 4861, 10345, 4389, 1231, 280, 39, 1, 1, 16795, 55901, 30006, 9835, 2763, 602, 71, 1, 1, 58785, 303661, 205420, 77178, 25014, 6967, 1408, 135, 1
Offset: 0
T(4,0) = 1: 1234.
T(4,1) = 13: 123|4, 124|3, 12|34, 12|3|4, 134|2, 13|24, 14|23, 1|234, 1|23|4, 14|2|3, 1|24|3, 1|2|34, 1|2|3|4.
T(4,2) = 1: 13|2|4.
T(5,2) = 9: 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.
T(6,3) = 11: 1245|3|6, 1346|2|5, 134|26|5, 134|2|56, 134|2|5|6, 145|23|6, 145|2|36, 145|2|3|6, 14|25|3|6, 15|24|3|6, 1|245|3|6.
T(6,4) = 1: 1345|2|6.
T(7,4) = 15: 12456|3|7, 13457|2|6, 1345|27|6, 1345|2|67, 1345|2|6|7, 1456|23|7, 1456|2|37, 1456|2|3|7, 145|26|3|7, 146|25|3|7, 14|256|3|7, 156|24|3|7, 15|246|3|7, 16|245|3|7, 1|2456|3|7.
Triangle T(n,k) begins:
1;
1;
1, 1;
1, 4;
1, 13, 1;
1, 41, 9, 1;
1, 131, 59, 11, 1;
1, 428, 344, 88, 15, 1;
1, 1429, 1906, 634, 146, 23, 1;
1, 4861, 10345, 4389, 1231, 280, 39, 1;
...
-
b:= proc(n, l) option remember; `if`(n=0 or l=[], 1, add(b(n-1,
[seq(max(l[i], j), i=2..nops(l)), j]), j=1..l[1]+1))
end:
T:= (n, k)-> `if`(k=0, 1, b(n, [0$k])-b(n, [0$k-1])):
seq(seq(T(n, k), k=0..max(n/2, n-2)), n=0..12);
-
b[n_, l_] := b[n, l] = If[n == 0 || l == {}, 1, Sum[b[n-1, Append[Table[ Max[l[[i]], j], {i, 2, Length[l]}], j]], {j, 1, l[[1]] + 1}]];
T[n_, k_] := If[k == 0, 1, b[n, Table[0, k]] - b[n, Table[0, k - 1]]];
Table[T[n, k], {n, 0, 12}, { k, 0, Max[n/2, n - 2]}] // Flatten (* Jean-François Alcover, May 22 2018, translated from Maple *)
A294052
Number of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals three.
Original entry on oeis.org
2, 13, 61, 248, 935, 3368, 11777, 40347, 136214, 454922, 1507000, 4961100, 16253188, 53045703, 172607505, 560317916, 1815445901, 5873136282, 18976870985, 61256217631, 197573796328, 636837047532, 2051636248268, 6606758265032, 21268025275930, 68445465415825
Offset: 4
-
LinearRecurrence[{7,-15,8,5,-5,1},{2,13,61,248,935,3368},30] (* Harvey P. Dale, Nov 22 2023 *)
A294053
Number of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals four.
Original entry on oeis.org
5, 38, 215, 1061, 4835, 20973, 88010, 360787, 1453978, 5784863, 22790024, 89092968, 346161413, 1338360327, 5153828402, 19781784669, 75723483993, 289218958150, 1102597884045, 4196961350447, 15954736073286, 60585891849501, 229855881578197, 871373727460242
Offset: 5
- Alois P. Heinz, Table of n, a(n) for n = 5..1000
- Index entries for linear recurrences with constant coefficients, signature (9,-26,23,0,20,-40,2,16,-1,0,-3,1)
-
Drop[CoefficientList[Series[(x^5-2x^4+x^3-3x^2+7x-5)x^5/((x-1)(x^3-x^2- 3x+1)(x^8-x^7-7x^5+7x^4+x^3+4x^2-5x+1)),{x,0,30}],x],5] (* or *) LinearRecurrence[{9,-26,23,0,20,-40,2,16,-1,0,-3,1},{5,38,215,1061,4835,20973,88010,360787,1453978,5784863,22790024,89092968},30] (* Harvey P. Dale, May 25 2022 *)
A294054
Number of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals five.
Original entry on oeis.org
15, 129, 836, 4789, 25430, 128360, 625905, 2976800, 13896153, 63950894, 291050996, 1312981604, 5881158250, 26191105884, 116085151862, 512487018089, 2255036961813, 9895020092839, 43316960894877, 189247864529166, 825397574526671, 3594688070523059, 15635607417594050
Offset: 6
- Alois P. Heinz, Table of n, a(n) for n = 6..1000
- Index entries for linear recurrences with constant coefficients, signature (11, -40, 49, -8, 14, 94, -354, 92, 41, 464, -113, -280, -39, -164, 217, 104, -48, -16, -32, 6, 5, 2, 1, -1)
A294055
Number of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals six.
Original entry on oeis.org
52, 495, 3573, 22986, 138140, 791355, 4378359, 23619010, 124985133, 651528571, 3356054226, 17122003113, 86672668175, 435922323548, 2180749707230, 10860449611842, 53881317215173, 266455227999826, 1314042578677412, 6464913802646613, 31741357154688581, 155566738708385012
Offset: 7
A294056
Number of set partitions of [n] such that the maximal absolute difference between consecutive elements within a block equals seven.
Original entry on oeis.org
203, 2108, 16657, 117897, 783922, 4993579, 30785899, 185088952, 1091673665, 6342173645, 36398304558, 206815079839, 1165446105293, 6522388312404, 36291251200978, 200938029161451, 1107900649341124, 6086624218751214, 33335270870796943, 182080367445331011, 992214076623396046
Offset: 8
Showing 1-10 of 14 results.
Comments