A361866
Number of set partitions of {1..n} with block-means summing to an integer.
Original entry on oeis.org
1, 1, 1, 3, 8, 22, 75, 267, 1119, 4965, 22694, 117090, 670621, 3866503, 24113829, 161085223, 1120025702, 8121648620, 62083083115, 492273775141, 4074919882483
Offset: 0
The a(1) = 1 through a(4) = 8 set partitions:
{{1}} {{1}{2}} {{123}} {{1}{234}}
{{13}{2}} {{12}{34}}
{{1}{2}{3}} {{123}{4}}
{{13}{24}}
{{14}{23}}
{{1}{24}{3}}
{{13}{2}{4}}
{{1}{2}{3}{4}}
The set partition y = {{1,2},{3,4}} has block-means {3/2,7/2}, with sum 5, so y is counted under a(4).
For median instead of mean we have
A361911.
A308037 counts set partitions with integer mean block-size.
-
sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
Table[Length[Select[sps[Range[n]],IntegerQ[Total[Mean/@#]]&]],{n,6}]
A326493
Sum of multinomials M(n-k; p_1-1, ..., p_k-1), where p = (p_1, ..., p_k) ranges over all partitions of n into distinct parts (k is a partition length).
Original entry on oeis.org
1, 1, 1, 2, 2, 5, 9, 21, 38, 146, 322, 902, 3106, 8406, 35865, 123321, 393691, 1442688, 7310744, 23471306, 129918661, 500183094, 2400722981, 9592382321, 47764284769, 280267554944, 1247781159201, 7620923955225, 36278364107926, 189688942325418, 1124492015730891
Offset: 0
-
with(combinat):
a:= n-> add(multinomial(n-nops(p), map(x-> x-1, p)[], 0),
p=select(l-> nops(l)=nops({l[]}), partition(n))):
seq(a(n), n=0..30);
# second Maple program:
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2 b(n$3):
seq(a(n), n=0..31);
-
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n==0, p!, b[n, i-1, p] + b[n-i, Min[n-i, i-1], p-1]/(i-1)!]];
a[n_] := b[n, n, n];
a /@ Range[0, 31] (* Jean-François Alcover, Dec 09 2020, after Alois P. Heinz *)
A358912
Number of finite sequences of integer partitions with total sum n and all distinct lengths.
Original entry on oeis.org
1, 1, 2, 5, 11, 23, 49, 103, 214, 434, 874, 1738, 3443, 6765, 13193, 25512, 48957, 93267, 176595, 332550, 622957, 1161230, 2153710, 3974809, 7299707, 13343290, 24280924, 43999100, 79412942, 142792535, 255826836, 456735456, 812627069, 1440971069, 2546729830
Offset: 0
The a(1) = 1 through a(4) = 11 sequences:
(1) (2) (3) (4)
(11) (21) (22)
(111) (31)
(1)(11) (211)
(11)(1) (1111)
(11)(2)
(1)(21)
(2)(11)
(21)(1)
(1)(111)
(111)(1)
The case of set partitions is
A007837.
This is the case of
A055887 with all distinct lengths.
For distinct sums instead of lengths we have
A336342.
The case of twice-partitions is
A358830.
The version for constant instead of distinct lengths is
A358905.
A141199 counts sequences of partitions with weakly decreasing lengths.
Cf.
A000219,
A001970,
A038041,
A060642,
A218482,
A271619,
A319066,
A358831,
A358901,
A358906,
A358908.
-
ptnseq[n_]:=Join@@Table[Tuples[IntegerPartitions/@comp],{comp,Join@@Permutations/@IntegerPartitions[n]}];
Table[Length[Select[ptnseq[n],UnsameQ@@Length/@#&]],{n,0,10}]
-
P(n,y) = {1/prod(k=1, n, 1 - y*x^k + O(x*x^n))}
seq(n) = {my(g=P(n,y)); [subst(serlaplace(p), y, 1) | p<-Vec(prod(k=1, n, 1 + y*polcoef(g, k, y) + O(x*x^n)))]} \\ Andrew Howroyd, Dec 30 2022
A364406
Number of permutations of [n] such that the minimal element of each cycle is also its length.
Original entry on oeis.org
1, 1, 0, 1, 0, 0, 6, 6, 0, 0, 720, 2160, 9360, 19440, 30240, 3659040, 21772800, 228614400, 1632960000, 11125900800, 73025971200, 1708337433600, 15442053580800, 254260755302400, 3318429200486400, 46929444097536000, 546974781889536000, 7312714579602432000
Offset: 0
a(0) = 1: () the empty permutation.
a(1) = 1: (1).
a(3) = 1: (1)(23).
a(6) = 6: (1)(24)(356), (1)(24)(365), (1)(25)(346), (1)(25)(364),
(1)(26)(345), (1)(26)(354).
a(7) = 6: (1)(23)(4567), (1)(23)(4576), (1)(23)(4657), (1)(23)(4675),
(1)(23)(4756), (1)(23)(4765).
-
b:= proc(n, i) option remember; `if`(i*(i+1)/2n+1, 0, b(n-i, i-1)*binomial(n-i, i-1)*(i-1)!)))
end:
a:= n-> b(n$2):
seq(a(n), n=0..33);
-
b[n_, i_] := b[n, i] = If[i*(i + 1)/2 < n, 0, If[n == 0, 1, b[n, i - 1] + If[2*i > n + 1, 0, b[n - i, i - 1]*Binomial[n - i, i - 1]*(i - 1)!]]];
a[n_] := b[n, n];
Table[a[n], {n, 0, 33}] (* Jean-François Alcover, Dec 05 2023, after Alois P. Heinz *)
A182926
Row sums of absolute values of A182928.
Original entry on oeis.org
1, 2, 3, 10, 25, 161, 721, 5706, 40881, 385687, 3628801, 41268613, 479001601, 6324319717, 87212177053, 1317906346186, 20922789888001, 357099708702023, 6402373705728001, 121882752536893635, 2432928081076384321, 51140835669924352717
Offset: 1
a(6) = 1 + 10 + 30 + 120 = 161.
-
A182926 := proc(n) local d;
add(n!/(d*((n/d)!)^d),d = numtheory[divisors](n)) end:
seq(A182926(i), i = 1..22);
-
a[n_] := Sum[ Abs[ -n!/(d*(-(n/d)!)^d)], {d, Divisors[n]}]; Table[ a[n], {n, 1, 22}] (* Jean-François Alcover, Jul 29 2013 *)
Original entry on oeis.org
1, 0, 3, -8, 25, -99, 721, -5704, 40881, -340325, 3628801, -41245511, 479001601, -6129725315, 87212177053, -1317906346184, 20922789888001, -354320889234597, 6402373705728001, -121882630320799633, 2432928081076384321, -51041048673495232715
Offset: 1
a(6) = 1 - 10 + 30 - 120 = -99.
-
A182927 := proc(n) local d;
add(-n! / (d*(-(n/d)!)^d), d = numtheory[divisors](n)) end:
seq(A182927(i), i = 1..22);
-
a[n_] := Sum[ -n!/(d*(-(n/d)!)^d), {d, Divisors[n]}]; Table[a[n], {n, 1, 22}] // Flatten (* Jean-François Alcover, Jul 29 2013 *)
A334370
Expansion of e.g.f. Product_{k>=1} (1 + x^prime(k) / prime(k)!).
Original entry on oeis.org
1, 0, 1, 1, 0, 11, 0, 22, 56, 36, 2640, 1, 8712, 79, 72436, 360465, 48608, 49008961, 794376, 4232764, 7753140, 942565890, 18198334, 14799637777, 10577976, 366619314900, 2785137222400, 1475339135400, 1065920156634060, 3765722000041, 5869315258699050
Offset: 0
-
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0, b(n, i-1)+
(p-> `if`(p>n, 0, b(n-p, i-1)*binomial(n, p)))(ithprime(i))))
end:
a:= n-> b(n, numtheory[pi](n)):
seq(a(n), n=0..30); # Alois P. Heinz, Jul 18 2023
-
nmax = 30; CoefficientList[Series[Product[(1 + x^Prime[k]/Prime[k]!), {k, 1, nmax}], {x, 0, nmax}], x] Range[0, nmax]!
a[n_] := a[n] = If[n == 0, 1, (n - 1)! Sum[DivisorSum[k, -#/(-#!)^(k/#) &, PrimeQ[#] &] a[n - k]/(n - k)!, {k, 1, n}]]; Table[a[n], {n, 0, 30}]
-
my(N=40, x='x+O('x^N)); Vec(serlaplace(prod(k=1, N, 1+isprime(k)*x^k/k!))) \\ Seiichi Manyama, Feb 27 2022
A361911
Number of set partitions of {1..n} with block-medians summing to an integer.
Original entry on oeis.org
1, 1, 3, 10, 30, 107, 479, 2249, 11173, 60144, 351086, 2171087, 14138253, 97097101, 701820663, 5303701310, 41838047938, 343716647215, 2935346815495, 25999729551523, 238473713427285, 2261375071834708, 22141326012712122, 223519686318676559, 2323959300370456901
Offset: 1
The a(1) = 1 through a(4) = 10 set partitions:
{{1}} {{1}{2}} {{123}} {{1}{234}}
{{13}{2}} {{12}{34}}
{{1}{2}{3}} {{123}{4}}
{{124}{3}}
{{13}{24}}
{{134}{2}}
{{14}{23}}
{{1}{24}{3}}
{{13}{2}{4}}
{{1}{2}{3}{4}}
The set partition {{1,4},{2,3}} has medians {5/2,5/2}, with sum 5, so is counted under a(4).
For median instead of sum we have
A361864.
For mean instead of median we have
A361866.
A308037 counts set partitions with integer average block-size.
-
sps[{}]:={{}}; sps[set:{i_,_}] := Join@@Function[s,Prepend[#,s]& /@ sps[Complement[set,s]]] /@ Cases[Subsets[set],{i,_}];
Table[Length[Select[sps[Range[n]], IntegerQ[Total[Median/@#]]&]],{n,10}]
A032312
"EGJ" (unordered, element, labeled) transform of 2,2,2,2...
Original entry on oeis.org
1, 2, 4, 14, 48, 162, 826, 3558, 17296, 101714, 529014, 3218118, 21014010, 140974654, 888205714, 6529087674, 52806013456, 375280736754, 2994842092102, 23821110274230, 217847892367318, 1894959770821614, 16188955616322394, 142246084665611010, 1376483692715941594
Offset: 0
-
With[{nn=30},CoefficientList[Series[Product[(1+x^k/k!)^2,{k,nn}],{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Feb 07 2019 *)
-
seq(n)={Vec(serlaplace(prod(k=1, n, (1 + x^k/k! + O(x*x^n))^2)))} \\ Andrew Howroyd, Sep 11 2018
a(0)=1 prepended and terms a(22) and beyond from
Andrew Howroyd, Sep 11 2018
A114902
Number of compositions of {1,..,n} such that no two adjacent parts are of equal size (labeled Carlitz compositions).
Original entry on oeis.org
1, 1, 1, 7, 21, 81, 793, 4929, 33029, 388537, 3751311, 37585989, 523395777, 6814401361, 90789460427, 1486639926417, 24213653736389, 403184436319401, 7665459211898263, 149067938821523349, 2971265450045056871, 64800464138121854877, 1460876941168812354947
Offset: 0
-
b:= proc(n, i) option remember;
`if`(n=0, 1, add(`if`(i=j, 0, b(n-j,
`if`(j>n-j, 0, j)) *binomial(n, j)), j=1..n))
end:
a:= n-> b(n, 0):
seq(a(n), n=0..25); # Alois P. Heinz, Sep 04 2015
-
b[n_, i_] := b[n, i] = If[n==0, 1, Sum[If[i==j, 0, b[n-j, If[j>n-j, 0, j]]* Binomial[n, j]], {j, 1, n}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 20 2017, after Alois P. Heinz *)
Comments