A275313 Number of set partitions of [n] where adjacent blocks differ in size.
1, 1, 1, 4, 7, 23, 100, 333, 1443, 6910, 36035, 186958, 1095251, 6620976, 42151463, 290483173, 2030271491, 15044953241, 116044969497, 930056879535, 7749440529803, 66931578540965, 597728811956244, 5511695171795434, 52578231393128128, 515775207055816041
Offset: 0
Keywords
Examples
a(3) = 4: 123, 12|3, 13|2, 1|23. a(4) = 7: 1234, 123|4, 124|3, 134|2, 1|234, 1|23|4, 1|24|3. a(5) = 23: 12345, 1234|5, 1235|4, 123|45, 1245|3, 124|35, 125|34, 12|345, 12|3|45, 1345|2, 134|25, 135|24, 13|245, 13|2|45, 145|23, 14|235, 15|234, 1|2345, 1|234|5, 1|235|4, 14|2|35, 1|245|3, 15|2|34.
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..580
- Wikipedia, Partition of a set
Programs
-
Maple
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-1, j-1)), j=1..n)) end: a:= n-> b(n, 0): seq(a(n), n=0..35);
-
Mathematica
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-1, j-1]], {j, 1, n}]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 35}] (* Jean-François Alcover, Dec 18 2016, after Alois P. Heinz *)
Comments