%I #54 Feb 13 2023 02:55:06
%S 1,1,2,4,10,22,64,147,409,1092,3253,8661,28585,83190,274001,912373,
%T 3366384,13253582,61533277,290493694
%N Number of set partitions of [4n] into 4-element subsets {i, i+k, i+2k, i+3k} with 1<=k<=n.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Partition_of_a_set">Partition of a set</a>
%e a(4) = 10: {{1,2,3,4}, {5,6,7,8}, {9,10,11,12}, {13,14,15,16}},
%e {{1,3,5,7}, {2,4,6,8}, {9,10,11,12}, {13,14,15,16}},
%e {{1,2,3,4}, {5,7,9,11}, {6,8,10,12}, {13,14,15,16}},
%e {{1,4,7,10}, {2,5,8,11}, {3,6,9,12}, {13,14,15,16}},
%e {{1,2,3,4}, {5,6,7,8}, {9,11,13,15}, {10,12,14,16}},
%e {{1,3,5,7}, {2,4,6,8}, {9,11,13,15}, {10,12,14,16}},
%e {{2,4,6,8}, {1,5,9,13}, {3,7,11,15}, {10,12,14,16}},
%e {{1,2,3,4}, {5,8,11,14}, {6,9,12,15}, {7,10,13,16}},
%e {{1,3,5,7}, {2,6,10,14}, {9,11,13,15}, {4,8,12,16}},
%e {{1,5,9,13}, {2,6,10,14}, {3,7,11,15}, {4,8,12,16}}.
%p b:= proc(s, t) option remember; `if`(s={}, 1, (m-> add(
%p `if`({seq(m-h*j, h=1..3)} minus s={}, b(s minus {seq(m-h*j,
%p h=0..3)}, t), 0), j=1..min(t, iquo(m-1, 3))))(max(s)))
%p end:
%p a:= proc(n) option remember; forget(b): b({$1..4*n}, n) end:
%p seq(a(n), n=0..12);
%t b[s_, t_] := b[s, t] = If[s == {}, 1, Function[m, Sum[ If[Union@Table[m-h*j, {h, 1, 3}] ~Complement~ s == {}, b[s ~Complement~ Union@Table[m-h*j, {h, 0, 3}], t], 0], {j, 1, Min[t, Quotient[m-1, 3]]}]][Max[s]]];
%t a[n_] := a[n] = b[Range[4n], n];
%t Table[Print[n, " ", a[n]]; a[n], {n, 0, 12}] (* _Jean-François Alcover_, Feb 13 2023, after _Alois P. Heinz_ *)
%Y Cf. A000566, A014307, A104430, A334250.
%Y Main diagonal of A360333.
%K nonn,more
%O 0,3
%A _Alois P. Heinz_, Nov 18 2020