%I #34 Feb 08 2023 15:13:45
%S 1,1,2,4,12,35,129,567,2920,16110,103467,717608,5748214,47937957,
%T 441139750,4319093093,45963368076
%N Number of set partitions of [3n] into 3-element subsets {i, i+k, i+2k} with 1<=k<=n.
%C Differs from A331621 first at n=7.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%F a(n) <= A104429(n) <= A025035(n).
%e a(2) = 2: 123|456, 135|246.
%e a(3) = 4: 123|456|789, 123|468|579, 135|246|789, 147|258|369.
%p b:= proc(s, t) option remember; `if`(s={}, 1, (m-> add(
%p `if`({m-j, m-2*j} minus s={}, b(s minus {m, m-j, m-2*j},
%p t), 0), j=1..min(t, iquo(m-1, 2))))(max(s)))
%p end:
%p a:= proc(n) option remember; forget(b): b({$1..3*n}, n) end:
%p seq(a(n), n=0..12);
%t 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]]];
%t a[n_] := a[n] = b[Range[3n], n];
%t Table[Print[n, " ", a[n]]; a[n], {n, 0, 12}] (* _Jean-François Alcover_, May 10 2020, after Maple *)
%Y Cf. A014307 (the same for 2-element subsets), A025035, A059108, A104429 (where k is not restricted), A285527, A331621, A337520.
%Y Main diagonal of A360334.
%K nonn,more
%O 0,3
%A _Alois P. Heinz_, Apr 20 2020