A334250 Number of set partitions of [3n] into 3-element subsets {i, i+k, i+2k} with 1<=k<=n.
1, 1, 2, 4, 12, 35, 129, 567, 2920, 16110, 103467, 717608, 5748214, 47937957, 441139750, 4319093093, 45963368076, 510202534002, 6150655137844, 76789781005325, 1028853084775725, 14294680087131380
Offset: 0
Examples
a(2) = 2: 123|456, 135|246. a(3) = 4: 123|456|789, 123|468|579, 135|246|789, 147|258|369.
Links
- Wikipedia, Partition of a set
Crossrefs
Programs
-
Maple
b:= proc(s, t) option remember; `if`(s={}, 1, (m-> add( `if`({m-j, m-2*j} minus s={}, b(s minus {m, m-j, m-2*j}, t), 0), j=1..min(t, iquo(m-1, 2))))(max(s))) end: a:= proc(n) option remember; forget(b): b({$1..3*n}, n) end: seq(a(n), n=0..12);
-
Mathematica
b[s_List, t_] := b[s, t] = If[s == {}, 1, Function[m, Sum[If[{m - j, m - 2j} ~Complement~ s == {}, b[s ~Complement~ {m, m - j, m - 2j}, t], 0], {j, 1, Min[t, Quotient[m - 1, 2]]}]][Max[s]]]; a[n_] := a[n] = b[Range[3n], n]; Table[Print[n, " ", a[n]]; a[n], {n, 0, 12}] (* Jean-François Alcover, May 10 2020, after Maple *)
Extensions
a(17)-a(21) from Martin Fuller, Jul 19 2025
Comments