A274547
Number of set partitions of [n] with alternating parity of elements.
Original entry on oeis.org
1, 1, 2, 4, 8, 18, 40, 101, 254, 723, 2064, 6586, 21143, 74752, 266078, 1029983, 4013425, 16843526, 71136112, 321150717, 1458636308, 7038678613, 34161890155, 175261038904, 904125989974, 4909033438008, 26795600521492, 153376337926066, 882391616100249
Offset: 0
a(5) = 18: 12345, 1234|5, 123|45, 123|4|5, 12|345, 12|34|5, 12|3|45, 12|3|4|5, 145|23, 1|2345, 1|234|5, 1|23|45, 1|23|4|5, 145|2|3, 1|2|345, 1|2|34|5, 1|2|3|45, 1|2|3|4|5.
a(6) = 40: 123456, 12345|6, 1234|56, 1234|5|6, 123|456, 123|45|6, 123|4|56, 123|4|5|6, 1256|34, 12|3456, 12|345|6, 12|34|56, 12|34|5|6, 1256|3|4, 12|3|456, 12|3|45|6, 12|3|4|56, 12|3|4|5|6, 145|236, 145|23|6, 1|23456, 1|2345|6, 1|234|56, 1|234|5|6, 1|23|456, 1|23|45|6, 1|23|4|56, 1|23|4|5|6, 145|2|36, 145|2|3|6, 1|256|34, 1|2|3456, 1|2|345|6, 1|2|34|56, 1|2|34|5|6, 1|256|3|4, 1|2|3|456, 1|2|3|45|6, 1|2|3|4|56, 1|2|3|4|5|6.
-
b:= proc(l, i, t) option remember; `if`(l=[], 1, add(`if`(l[j]=t,
b(subsop(j=[][], l), j, 1-t), 0), j=[1, $i..nops(l)]))
end:
a:= n-> b([seq(irem(i, 2), i=2..n)], 1, 0):
seq(a(n), n=0..25);
-
b[l_, i_, t_] := b[l, i, t] = If[l == {}, 1, Sum[If[l[[j]] == t, b[ReplacePart[l, j -> Sequence[]], j, 1-t], 0], {j, Prepend[Range[i, Length[l]], 1]}]]; a[n_] := b[Table[Mod[i, 2], {i, 2, n}], 1, 0]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 15 2017, translated from Maple *)
A124424
Triangle read by rows: T(n,k) is the number of partitions of the set {1,2,...,n}, having exactly k blocks consisting of entries of the same parity (0<=k<=n).
Original entry on oeis.org
1, 0, 1, 1, 0, 1, 1, 2, 1, 1, 3, 4, 5, 2, 1, 7, 14, 16, 10, 4, 1, 25, 48, 61, 42, 20, 6, 1, 79, 194, 250, 200, 106, 38, 9, 1, 339, 820, 1145, 958, 569, 230, 66, 12, 1, 1351, 3794, 5554, 5096, 3251, 1486, 486, 112, 16, 1, 6721, 18960, 29101, 28010, 19110, 9470, 3477, 930, 175, 20, 1
Offset: 0
T(4,2) = 5 because we have 13|24, 14|2|3, 1|2|34, 1|23|4 and 12|3|4.
Triangle starts:
1;
0, 1;
1, 0, 1;
1, 2, 1, 1;
3, 4, 5, 2, 1;
7, 14, 16, 10, 4, 1;
...
-
Q[0]:=1: for n from 1 to 11 do if n mod 2 = 1 then Q[n]:=expand(t*diff(Q[n-1],t)+x*diff(Q[n-1],s)+x*diff(Q[n-1],x)+t*Q[n-1]) else Q[n]:=expand(x*diff(Q[n-1],t)+s*diff(Q[n-1],s)+x*diff(Q[n-1],x)+s*Q[n-1]) fi od: for n from 0 to 11 do P[n]:=sort(subs({s=t,x=1},Q[n])) od: for n from 0 to 11 do seq(coeff(P[n],t,j),j=0..n) od; # yields sequence in triangular form
# second Maple program:
b:= proc(g, u) option remember;
add(Stirling2(g, k)*Stirling2(u, k)*k!, k=0..min(g, u))
end:
T:= proc(n, k) local g, u; g:= floor(n/2); u:= ceil(n/2);
add(add(add(binomial(g, i)*Stirling2(i, h)*binomial(u, j)*
Stirling2(j, k-h)*b(g-i, u-j), j=k-h..u), i=h..g), h=0..k)
end:
seq(seq(T(n,k), k=0..n), n=0..12); # Alois P. Heinz, Oct 24 2013
-
b[g_, u_] := b[g, u] = Sum[StirlingS2[g, k]*StirlingS2[u, k]*k!, {k, 0, Min[g, u]}] ; T[n_, k_] := Module[{g, u}, g = Floor[n/2]; u = Ceiling[n/2]; Sum[ Sum[ Sum[ Binomial[g, i]*StirlingS2[i, h]*Binomial[u, j]*StirlingS2[j, k-h]*b[g-i, u-j], {j, k-h, u}], {i, h, g}], {h, 0, k}]]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 12}] // Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)
A124526
Triangle, read by rows, where T(n,k) = A049020([n/2],k)*A049020([(n+1)/2],k).
Original entry on oeis.org
1, 1, 1, 1, 2, 3, 4, 9, 1, 10, 30, 6, 25, 100, 36, 1, 75, 370, 186, 10, 225, 1369, 961, 100, 1, 780, 5587, 4960, 750, 15, 2704, 22801, 25600, 5625, 225, 1, 10556, 101774, 136960, 39000, 2325, 21, 41209, 454276, 732736, 270400, 24025, 441, 1, 178031, 2199262, 4110512, 1849120, 217000, 6027, 28, 769129, 10647169, 23059204, 12645136, 1960000, 82369, 784, 1, 3630780, 55493841, 136074274, 87570056, 16787400, 944230, 13720, 36
Offset: 0
Triangle begins:
1;
1;
1, 1;
2, 3;
4, 9, 1;
10, 30, 6;
25, 100, 36, 1;
75, 370, 186, 10;
225, 1369, 961, 100, 1;
780, 5587, 4960, 750, 15;
2704, 22801, 25600, 5625, 225, 1;
10556, 101774, 136960, 39000, 2325, 21;
41209, 454276, 732736, 270400, 24025, 441, 1;
178031, 2199262, 4110512, 1849120, 217000, 6027, 28;
769129, 10647169, 23059204, 12645136, 1960000, 82369, 784, 1;
3630780, 55493841, 136074274, 87570056, 16787400, 944230, 13720, 36; ...
-
S[n_, k_] = Sum[StirlingS2[n, i] Binomial[i, k], {i, 0, n}];
T[n_, k_] := S[Floor[n/2], k] S[Floor[(n+1)/2], k];
Table[T[n, k], {n, 0, 15}, {k, 0, Floor[n/2]}] // Flatten (* Jean-François Alcover, Nov 02 2020 *)
-
{T(n,k) = (n\2)!*((n+1)\2)!*polcoeff(polcoeff(exp((1+y)*(exp(x+x*O(x^n))-1)),n\2),k) *polcoeff(polcoeff(exp((1+y)*(exp(x+x*O(x^n))-1)),(n+1)\2),k)}
for(n=0,15, for(k=0,n\2, print1(T(n,k),", "));print(""))
A152875
Number of permutations of {1,2,...,n} with all odd entries preceding all even entries or all even entries preceding all odd entries.
Original entry on oeis.org
1, 1, 2, 4, 8, 24, 72, 288, 1152, 5760, 28800, 172800, 1036800, 7257600, 50803200, 406425600, 3251404800, 29262643200, 263363788800, 2633637888000, 26336378880000, 289700167680000, 3186701844480000, 38240422133760000, 458885065605120000, 5965505852866560000
Offset: 0
a(4)=8 because we have 1324, 1342, 3124, 3142, 2413, 2431, 4213 and 4231.
-
a := proc (n) if `mod`(n, 2) = 0 then 2*factorial((1/2)*n)^2 else 2*factorial((1/2)*n-1/2)*factorial((1/2)*n+1/2) end if end proc: seq(a(n), n = 2 .. 25);
# second Maple program:
a:= n-> (h-> 2^signum(h)*h!*(n-h)!)(iquo(n, 2)):
seq(a(n), n=0..27); # Alois P. Heinz, May 23 2023
# third Maple program:
a:= proc(n) option remember; `if`(n<4, n*(n-1)/2+1,
n*(n-1)*a(n-2)/4 +a(n-1)/2)
end:
seq(a(n), n=0..27); # Alois P. Heinz, May 23 2023
-
a[n_] := Which[n<2, 1, EvenQ[n], 2(n/2)!^2, True, 2((n-1)/2)!*((n+1)/2)!];
Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Aug 16 2023 *)
A363454
Number of partitions of [n] such that the number of blocks containing only odd elements equals the number of blocks containing only even elements and no block contains both odd and even elements.
Original entry on oeis.org
1, 0, 1, 1, 2, 4, 11, 28, 87, 266, 952, 3381, 13513, 53915, 237113, 1046732, 5016728, 24186664, 125121009, 652084528, 3615047527, 20211789423, 119384499720, 711572380960, 4455637803543, 28162688795697, 186152008588691, 1242276416218540, 8636436319397292
Offset: 0
a(0) = 1: () the empty partition.
a(1) = 0.
a(2) = 1: 1|2.
a(3) = 1: 13|2.
a(4) = 2: 13|24, 1|2|3|4.
a(5) = 4: 135|24, 13|2|4|5, 15|2|3|4, 1|2|35|4.
a(6) = 11: 135|246, 13|24|5|6, 13|26|4|5, 13|2|46|5, 15|24|3|6, 1|24|35|6, 15|26|3|4, 15|2|3|46, 1|26|35|4, 1|2|35|46, 1|2|3|4|5|6.
a(7) = 28: 1357|246, 135|24|6|7, 137|24|5|6, 13|24|57|6, 135|26|4|7, 135|2|46|7, 137|26|4|5, 13|26|4|57, 137|2|46|5, 13|2|46|57, 13|2|4|5|6|7, 157|24|3|6, 15|24|37|6, 17|24|35|6, 1|24|357|6, 157|26|3|4, 15|26|37|4, 157|2|3|46, 15|2|37|46, 15|2|3|4|6|7, 17|26|35|4, 1|26|357|4, 17|2|35|46, 1|2|357|46, 1|2|35|4|6|7, 17|2|3|4|5|6, 1|2|37|4|5|6, 1|2|3|4|57|6.
Bisection gives
A047797 (even part).
-
a:= n-> (h-> add(Stirling2(h, k)*Stirling2(n-h, k), k=0..h))(iquo(n, 2)):
seq(a(n), n=0..40);
# second Maple program:
b:= proc(n, x, y) option remember; `if`(abs(x-y)>n, 0,
`if`(n=0, 1, `if`(x>0, b(n-1, y, x)*x, 0)+b(n-1, y, x+1)))
end:
a:= n-> b(n, 0$2):
seq(a(n), n=0..40);
A363511
Number of partitions of [n] having exactly one parity change within their blocks.
Original entry on oeis.org
0, 0, 1, 2, 6, 18, 61, 210, 778, 3008, 12219, 52268, 231726, 1083012, 5202199, 26307710, 135972580, 738339310, 4081523615, 23649300862, 139096468520, 855529383396, 5329630673249, 34643027568520, 227682351175868, 1558106351450416, 10766192988109009
Offset: 0
a(4) = 6: 124|3, 12|3|4, 134|2, 1|23|4, 14|2|3, 1|2|34.
-
b:= proc(n, x, y) option remember; convert(series(
`if`(n=0, 1, `if`(y=0, 0, expand(b(n-1, y-1, x+1)*y*z))
+b(n-1, y, x)*x + b(n-1, y, x+1)), z, 2), polynom)
end:
a:= n-> coeff(b(n, 0$2), z, 1):
seq(a(n), n=0..27);
A124426
Product of two successive Bell numbers.
Original entry on oeis.org
1, 2, 10, 75, 780, 10556, 178031, 3630780, 87548580, 2452523325, 78697155750, 2859220516290, 116482516809889, 5277304280371714, 264005848594606490, 14493602135008296115, 868435614538568029188, 56520205738693680322836
Offset: 0
-
[&*[ Bell(n+k): k in [0..1] ]: n in [0..30]]; // Vincenzo Librandi, Apr 09 2020
-
with(combinat): seq(bell(n)*bell(n+1),n=0..19);
-
Times@@@Partition[BellB[Range[0,20]],2,1] (* Harvey P. Dale, Oct 07 2018 *)
A363073
Number of set partitions of [n] such that each element is contained in a block whose block size parity coincides with the parity of the element.
Original entry on oeis.org
1, 1, 0, 0, 1, 2, 0, 0, 20, 48, 0, 0, 1147, 3968, 0, 0, 173203, 709488, 0, 0, 53555964, 246505600, 0, 0, 28368601065, 148963383616, 0, 0, 24044155851601, 141410718244864, 0, 0, 30934515698084780, 198914201874983936, 0, 0, 57215369885233295955, 398742900995358584320
Offset: 0
a(0) = 1: (), the empty partition.
a(1) = 1: 1.
a(4) = 1: 1|24|3.
a(5) = 2: 135|24, 1|24|3|5.
a(8) = 20: 135|2468|7, 135|24|68|7, 137|2468|5, 137|24|5|68, 135|26|48|7, 135|28|46|7, 137|26|48|5, 137|28|46|5, 157|2468|3, 157|24|3|68, 1|2468|357, 1|24|357|68, 1|2468|3|5|7, 1|24|3|5|68|7, 157|26|3|48, 157|28|3|46, 1|26|357|48, 1|28|357|46, 1|26|3|48|5|7, 1|28|3|46|5|7.
-
b:= proc(n, t) option remember; `if`(n=0, 1, add(
`if`((j+t)::even, b(n-j, t)*binomial(n-1, j-1), 0), j=1..n))
end:
a:= n-> (h-> b(n-h, 1)*b(h, 0))(iquo(n, 2)):
seq(a(n), n=0..40);
-
b[n_, t_] := b[n, t] = If[n == 0, 1, Sum[If[EvenQ[j + t], b[n - j, t]* Binomial[n - 1, j - 1], 0], {j, 1, n}]];
a[n_] := b[n - #, 1]*b[#, 0]&[Quotient[n, 2]];
Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Nov 18 2023, after Alois P. Heinz *)
Comments